Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
removed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit committed Dec 17, 2018
2 parents fda49eb + 1651319 commit 4205d21
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildscript {
apply plugin: 'com.github.triplet.play'

// Load keystore
def keystorePropertiesFile = rootProject.file("C:\\Users\\Captain Jack\\AndroidStudioProjects\\keys\\keystore.properties")
def keystorePropertiesFile = rootProject.file("/Users/amit/studioprojects/keys/keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class TrackInfoActivity: AppCompatActivity() , TrackInfo.Callback{
trackInfo.similarTracks
?.track
?.map { TracksAdapter.TrackItem(it.name
, "Match ${it.match*100}%"
, "${it.artist.name} | Match ${String.format("%.2f", it.match*100)}%"
, it.image.last().text
, it.url) } ?: listOf())
recyclerSimilarTracks.layoutManager = LinearLayoutManager(this)
Expand All @@ -179,10 +179,16 @@ class TrackInfoActivity: AppCompatActivity() , TrackInfo.Callback{

}

fun launchLyricsView(){
fun launchLyricsView(trackTitle: String, trackArtist: String){
val intent = Intent(this, ActivityLyricView::class.java)
intent.putExtra("track_title", trackItem.title)
intent.putExtra("artist", trackItem.artist)
intent.putExtra("track_title", trackTitle)
if(trackArtist.isEmpty()){
//clicked on album traklist item
intent.putExtra("artist", trackItem.artist)
}else{
//clicked on one of track from similar tracklist
intent.putExtra("artist", trackArtist)
}
startActivity(intent)
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left)
}
Expand Down Expand Up @@ -244,7 +250,14 @@ class TrackInfoActivity: AppCompatActivity() , TrackInfo.Callback{
override fun onClick(p0: View?) {

when(p0?.id){
R.id.trackInfo, R.id.playCount, R.id.imageView -> (context as TrackInfoActivity).launchLyricsView()
R.id.trackInfo, R.id.playCount, R.id.imageView -> {
//below code is ugly, but it works. Will refactor later
if(secondaryText.text.contains("Duration"))
(context as TrackInfoActivity).launchLyricsView(tracks[adapterPosition].trackTitle, "")
else
(context as TrackInfoActivity).launchLyricsView(tracks[adapterPosition].trackTitle
, tracks[adapterPosition].secondaryText.substring(0,tracks[adapterPosition].secondaryText.indexOf('|')))
}
R.id.more -> (context as TrackInfoActivity).openUrl(Uri.parse(tracks[adapterPosition].clickUrl))
}

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,9 @@
<item>#43abc9</item>
</string-array>

<string name="whats_new"><![CDATA[ \u0020 * Improved controls in Now Playing screen \n
* Bug fixes from last update
<string name="whats_new"><![CDATA[ \u0020 * One click to get track info from Now Playing screen. \n
* Add lyrics manually if AB Music is unable to find them. \n
* Couple of new color themes.
]]></string>

<!-- Request notification access-->
Expand Down
1 change: 0 additions & 1 deletion app/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Sun Dec 16 16:46:20 IST 2018
VERSION_NUMBER=189
VERSION_BUILD=376
VERSION_PATCH=0

0 comments on commit 4205d21

Please sign in to comment.