From 362b7c4b39e70d44e3ddf64cdacb9ed9f8071dd5 Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Mon, 21 Mar 2022 10:39:32 +0100 Subject: [PATCH 01/92] GameManager: basic Game Manager to set songs and score --- .../java/ch/sdp/vibester/games/GameManager.kt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/src/main/java/ch/sdp/vibester/games/GameManager.kt diff --git a/app/src/main/java/ch/sdp/vibester/games/GameManager.kt b/app/src/main/java/ch/sdp/vibester/games/GameManager.kt new file mode 100644 index 000000000..d0929ede0 --- /dev/null +++ b/app/src/main/java/ch/sdp/vibester/games/GameManager.kt @@ -0,0 +1,50 @@ +package ch.sdp.vibester.games + +import ch.sdp.vibester.api.ItunesMusicApi +import ch.sdp.vibester.api.LastfmHelper +import ch.sdp.vibester.model.Song +import ch.sdp.vibester.model.SongList +import okhttp3.OkHttpClient +import java.io.Serializable + +class GameManager constructor(method: String, tag: String): Serializable{ + private var score = 0; + private var currentSong = 0; + private val gameSize = 10; + private var gameSongList: List = mutableListOf() + + init { + gameSongList = LastfmHelper.getRandomSongList(method, tag); + } + + fun increaseScore(){ + score++; + } + + fun getScore():Int { + return score + } + + fun getSongList():List{ + return gameSongList + } + + fun nextSong(): Song{ + if(currentSong < gameSongList.size){ + val songName = gameSongList.get(currentSong) + val songDetails = Song.singleSong(ItunesMusicApi.querySong(songName, OkHttpClient(), 1).get()) + currentSong++; + return songDetails + + } + + else{ + finish() + } + return songDetails + } + + fun finish(){ + } + +} \ No newline at end of file From 05817743162d763e19f3e98d65f9fae9c0ce2851 Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Mon, 21 Mar 2022 10:39:42 +0100 Subject: [PATCH 02/92] GenreTemporary: testing --- .../main/java/ch/sdp/vibester/GenreTemporary.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/GenreTemporary.kt b/app/src/main/java/ch/sdp/vibester/GenreTemporary.kt index 557201100..6140a4c34 100644 --- a/app/src/main/java/ch/sdp/vibester/GenreTemporary.kt +++ b/app/src/main/java/ch/sdp/vibester/GenreTemporary.kt @@ -1,11 +1,15 @@ package ch.sdp.vibester +import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.View import android.widget.ArrayAdapter import android.widget.ListView import ch.sdp.vibester.api.LastfmHelper +import ch.sdp.vibester.games.GameManager +import ch.sdp.vibester.games.TypingGame +import ch.sdp.vibester.model.Song /** * Activity to show the list of songs for a chosen tag @@ -25,10 +29,14 @@ class GenreTemporary : AppCompatActivity() { * @param tag: tag name if method BY_TAG is chosen */ fun performQuery(method: String, tag: String=""){ - val listSongs = findViewById(R.id.songsListView) - val songList = LastfmHelper.getRandomSongList(method, tag) - val arr = ArrayAdapter(this, android.R.layout.simple_list_item_1 , songList) - listSongs.adapter = arr + val gameManager = GameManager(method, tag) + + val newIntent = Intent(this, TypingGame::class.java) + newIntent.putExtra("song", gameManager.nextSong()) + newIntent.putExtra("isPlaying", true) + newIntent.putExtra("hasWon", true) + newIntent.putExtra("gameManager", gameManager) + startActivity(newIntent) } fun getKpopSongList(view: View) { From 21ee32c135152d2d2b1a961b6d233cb136b9f5ea Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Mon, 21 Mar 2022 10:39:59 +0100 Subject: [PATCH 03/92] TypingGame: modify for GameManager needs --- .../java/ch/sdp/vibester/games/TypingGame.kt | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/games/TypingGame.kt b/app/src/main/java/ch/sdp/vibester/games/TypingGame.kt index 36f69a031..cf8c8ca13 100644 --- a/app/src/main/java/ch/sdp/vibester/games/TypingGame.kt +++ b/app/src/main/java/ch/sdp/vibester/games/TypingGame.kt @@ -26,21 +26,22 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.launch import okhttp3.OkHttpClient +import java.io.Serializable import java.util.concurrent.CompletableFuture /** * Class that represent a game */ class TypingGame : AppCompatActivity() { - + private lateinit var gameManager:GameManager companion object{ /** * Print Toast message to announce the user if he wons or not */ - private fun hasWon(ctx: Context, hasWon: Boolean, itwas: Song){ + private fun hasWon(ctx: Context, score:Int, hasWon: Boolean, itwas: Song){ if(hasWon){ - Toast.makeText(ctx,"Well Done!",Toast.LENGTH_SHORT).show() + Toast.makeText(ctx,score.toString()+" Well Done!",Toast.LENGTH_SHORT).show() }else{ Toast.makeText(ctx,"Sadly you're wrong, it was: "+itwas.getTrackName()+" by "+itwas.getArtistName(),Toast.LENGTH_SHORT).show() } @@ -49,15 +50,19 @@ class TypingGame : AppCompatActivity() { /** * Generate a change of intent at the end of the game */ - fun intentGen(ctx: Context, choosenSong: Song?, playedSong: Song):Intent{ - val newIntent = Intent(ctx, TypingGame::class.java) - newIntent.putExtra("song", playedSong) - newIntent.putExtra("isPlaying", false) + fun intentGen(ctx: Context, choosenSong: Song?, playedSong: Song, gameManager: GameManager):Intent{ + if(choosenSong != null && choosenSong.getTrackName() == playedSong.getTrackName() && choosenSong.getArtistName() == playedSong.getArtistName()){ - newIntent.putExtra("hasWon", true) + gameManager.increaseScore() + hasWon(ctx, gameManager.getScore(),true,playedSong) }else{ - newIntent.putExtra("hasWon", false) + hasWon(ctx, gameManager.getScore(),false, playedSong) } + + val newIntent = Intent(ctx, TypingGame::class.java) + newIntent.putExtra("song", gameManager.nextSong()) + newIntent.putExtra("isPlaying", false) + newIntent.putExtra("gameManager", gameManager) newIntent.setFlags(FLAG_ACTIVITY_NEW_TASK) return newIntent } @@ -65,7 +70,7 @@ class TypingGame : AppCompatActivity() { /** * Create the frame layout and its logic of the suggestion when user is typing */ - fun guess(song: Song, guessLayout: LinearLayout, ctx: Context, playedSong: Song, player: CompletableFuture?): FrameLayout{ + fun guess(song: Song, guessLayout: LinearLayout, ctx: Context, playedSong: Song, player: CompletableFuture?, gameManager: GameManager): FrameLayout{ val frameLay = FrameLayout(ctx) frameLay.background = borderGen() @@ -91,7 +96,7 @@ class TypingGame : AppCompatActivity() { if (playerMedia != null) { playerMedia.stop() } - startActivity(ctx, intentGen(ctx, song, playedSong), null) + startActivity(ctx, intentGen(ctx, song, playedSong, gameManager), null) } guessLayout.addView(generateSpace(75,75, ctx)) @@ -171,14 +176,15 @@ class TypingGame : AppCompatActivity() { val getIntent = intent.extras if(getIntent != null){ val playableSong: Song = getIntent.get("song") as Song - val isPlaying: Boolean = getIntent.get("isPlaying") as Boolean - val hasWon: Boolean = getIntent.get("hasWon") as Boolean - - if(!isPlaying){ - //Is the activity showing the result - hasWon(this, hasWon, playableSong) - inputTxt.setKeyListener(null) - }else{ +// val isPlaying: Boolean = getIntent.get("isPlaying") as Boolean +// val hasWon: Boolean = getIntent.get("hasWon") as Boolean + gameManager = getIntent.getSerializable("gameManager") as GameManager + +// if(!isPlaying){ +// //Is the activity showing the result +// hasWon(this, hasWon, playableSong) +// inputTxt.setKeyListener(null) +// }else{ //Is the activity playing music mediaPlayer = AudioPlayer.playAudio(playableSong.getPreviewUrl()) val h = Handler() @@ -190,14 +196,14 @@ class TypingGame : AppCompatActivity() { }else if (myBar.progress==0){ if(mysong != null){ if(mediaPlayer.get().isPlaying){ - startActivity(intentGen(ctx, null, playableSong)) + startActivity(intentGen(ctx, null, playableSong, gameManager)) finish() } } } } }) - } + mysong = playableSong } @@ -213,9 +219,9 @@ class TypingGame : AppCompatActivity() { val list = Song.listSong(task.await()) for(x: Song in list){ if (mysong != null) { - guess(x, findViewById(R.id.displayGuess), this@TypingGame, mysong, mediaPlayer) + guess(x, findViewById(R.id.displayGuess), this@TypingGame, mysong, mediaPlayer, gameManager) }else{ - guess(x, findViewById(R.id.displayGuess), this@TypingGame, x, mediaPlayer) + guess(x, findViewById(R.id.displayGuess), this@TypingGame, x, mediaPlayer, gameManager) } } } From 6e6c1c6d06aea1a7dc65c2ef3116a646374c7dd8 Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:03:05 +0100 Subject: [PATCH 04/92] LastfmApi.kt: add extra fields for uri --- app/src/main/java/ch/sdp/vibester/api/LastfmApi.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/ch/sdp/vibester/api/LastfmApi.kt b/app/src/main/java/ch/sdp/vibester/api/LastfmApi.kt index 23f061a7f..fbdefd447 100644 --- a/app/src/main/java/ch/sdp/vibester/api/LastfmApi.kt +++ b/app/src/main/java/ch/sdp/vibester/api/LastfmApi.kt @@ -29,6 +29,8 @@ class LastfmApi private constructor(){ .appendQueryParameter("format",params.format) .appendQueryParameter("page", params.page) .appendQueryParameter("tag", params.tag) + .appendQueryParameter("limit", params.limit) + .appendQueryParameter("artist", params.artist) .build() val uri = builtUri.toString() From cb5a0d3f729016a1695f29d5459858dfc404485a Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:03:45 +0100 Subject: [PATCH 05/92] acctivity_end_basic_game.xml: add basic end screen with game score --- .../main/res/layout/activity_end_basic_game.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/src/main/res/layout/activity_end_basic_game.xml diff --git a/app/src/main/res/layout/activity_end_basic_game.xml b/app/src/main/res/layout/activity_end_basic_game.xml new file mode 100644 index 000000000..ab6b28122 --- /dev/null +++ b/app/src/main/res/layout/activity_end_basic_game.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file From 0b0900d01c0e2236bf59903ad34a17f9e08a4d3a Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:04:07 +0100 Subject: [PATCH 06/92] AndroidManifest.xml: adding basic end screen for game --- app/src/main/AndroidManifest.xml | 123 ++++++++++++++++--------------- 1 file changed, 63 insertions(+), 60 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ef56e934d..10fb23da8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,61 +1,64 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ec495d36d7799c9104d661fdcb8f494ccad0b10e Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:04:36 +0100 Subject: [PATCH 07/92] EndBasicGameActivity.kt: activity to show end of the game --- .../ch/sdp/vibester/EndBasicGameActivity.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/src/main/java/ch/sdp/vibester/EndBasicGameActivity.kt diff --git a/app/src/main/java/ch/sdp/vibester/EndBasicGameActivity.kt b/app/src/main/java/ch/sdp/vibester/EndBasicGameActivity.kt new file mode 100644 index 000000000..5caa63e5f --- /dev/null +++ b/app/src/main/java/ch/sdp/vibester/EndBasicGameActivity.kt @@ -0,0 +1,18 @@ +package ch.sdp.vibester + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.TextView + +class EndBasicGameActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_end_basic_game) + + var bundle = intent.extras + var txtView = findViewById(R.id.score) + if (bundle != null) { + txtView.text = bundle.getString("score") + } + } +} \ No newline at end of file From e29a32a7cacb7793bbf50b93be2342f7563eeaff Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:04:56 +0100 Subject: [PATCH 08/92] LastfmUri.kt: adding extra filed for artisit, set some defaults --- app/src/main/java/ch/sdp/vibester/api/LastfmUri.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ch/sdp/vibester/api/LastfmUri.kt b/app/src/main/java/ch/sdp/vibester/api/LastfmUri.kt index 7d25e6703..17c2157dc 100644 --- a/app/src/main/java/ch/sdp/vibester/api/LastfmUri.kt +++ b/app/src/main/java/ch/sdp/vibester/api/LastfmUri.kt @@ -4,5 +4,7 @@ data class LastfmUri ( val method:String="", val format:String="json", val tag: String = "", - val page: String = "" + val page: String = "1", + var limit: String = "100", + val artist: String = "" ) \ No newline at end of file From b5db280d9750d2dfe81e0c46d5742708879c5d0b Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:05:19 +0100 Subject: [PATCH 09/92] Lastfmhelper.kt: remove helper to combine lists for current version --- .../java/ch/sdp/vibester/api/LastfmHelper.kt | 103 +++++++++--------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/api/LastfmHelper.kt b/app/src/main/java/ch/sdp/vibester/api/LastfmHelper.kt index 2ffc6563f..e8690ec98 100644 --- a/app/src/main/java/ch/sdp/vibester/api/LastfmHelper.kt +++ b/app/src/main/java/ch/sdp/vibester/api/LastfmHelper.kt @@ -1,51 +1,52 @@ -package ch.sdp.vibester.api - -import ch.sdp.vibester.model.SongList -import okhttp3.OkHttpClient - -/** - * Object to combine the song lists from two Lastfm queries. - * Two queries helps to achieve better randomization of the songs. - * Final song list for a game is created from the songs fetched from Page 1 and - * Page Random. - * - * The limit to choose page for the second query is 200 due to Lastfm bug. - * (songs do not appear on page 201 and higher) - */ -class LastfmHelper { - - companion object{ - private var pageLimitQueryTwo = 200; - private val GAME_SIZE = 10; - - /** - * Function that performs queries to two pages within given tag - * @param method: method to retrieve songs BY_TAG or BY_CHART - * @param tag: tag to retrieve songs. If method BY_CHART is used, tag is empty. - * @return list of songs in a format ("$songName $artistName") - */ - fun getRandomSongList(method: String, tag:String = ""): List { - val firstQuery = SongList(LastfmApi.querySongList(OkHttpClient(), - LastfmUri(method = method, tag = tag)).get()) - val firstSongList = firstQuery.getSongList() - val pagesQueryOne = firstQuery.getTotalPages().toInt() - - if(pagesQueryOne < pageLimitQueryTwo){ - pageLimitQueryTwo = pagesQueryOne - } - - val pageQueryTwo =(2..pageLimitQueryTwo).random() - val secondQuery = SongList(LastfmApi.querySongList(OkHttpClient(), - LastfmUri(method = method, tag = tag, page = pageQueryTwo.toString())).get()) - val secondSongList = secondQuery.getSongList() - - val mergedLists = merge(firstSongList, secondSongList) - var finalList = mergedLists.asSequence().shuffled().take(GAME_SIZE).toList() - return finalList - } - - fun merge(first: List, second: List): List { - return first + second - } - } -} \ No newline at end of file +//package ch.sdp.vibester.api +// +//import ch.sdp.vibester.model.SongList +//import okhttp3.OkHttpClient +// +///** +// * Object to combine the song lists from two Lastfm queries. +// * Two queries helps to achieve better randomization of the songs. +// * Final song list for a game is created from the songs fetched from Page 1 and +// * Page Random. +// * +// * The limit to choose page for the second query is 200 due to Lastfm bug. +// * (songs do not appear on page 201 and higher) +// */ +//class LastfmHelper { +// +// companion object{ +// private var pageLimitQueryTwo = 200; +// private val GAME_SIZE = 30; +// +// /** +// * Function that performs queries to two pages within given tag +// * @param method: method to retrieve songs BY_TAG or BY_CHART +// * @param tag: tag to retrieve songs. If method BY_CHART is used, tag is empty. +// * @return list of songs in a format ("$songName $artistName") +// */ +// fun getRandomSongList(jsonMeta: String): List { +//// uri.limit = "100" +//// val res = LastfmApi.querySongList(OkHttpClient(),uri).get(); +// val firstQuery = SongList(jsonMeta) +// val firstSongList = firstQuery.getSongList() +// val pagesQueryOne = firstQuery.getTotalPages().toInt() +// +//// if(pagesQueryOne < pageLimitQueryTwo){ +//// pageLimitQueryTwo = pagesQueryOne +//// } +// +//// val pageQueryTwo =(2..pageLimitQueryTwo).random() +//// val secondQuery = SongList(LastfmApi.querySongList(OkHttpClient(), +//// LastfmUri(method = method, tag = tag, page = pageQueryTwo.toString())).get()) +//// val secondSongList = secondQuery.getSongList() +//// +//// val mergedLists = merge(firstSongList, secondSongList) +// var finalList = firstSongList.asSequence().shuffled().take(GAME_SIZE).toList() +// return finalList +// } +// +// fun merge(first: List, second: List): List { +// return first + second +// } +// } +//} \ No newline at end of file From 59b50f26e99703e66a794b526ae858cdab097d2a Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:06:14 +0100 Subject: [PATCH 10/92] SongList.kt: add function to shuffle the list of songList --- app/src/main/java/ch/sdp/vibester/model/SongList.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/ch/sdp/vibester/model/SongList.kt b/app/src/main/java/ch/sdp/vibester/model/SongList.kt index 8e900771d..3b99105ba 100644 --- a/app/src/main/java/ch/sdp/vibester/model/SongList.kt +++ b/app/src/main/java/ch/sdp/vibester/model/SongList.kt @@ -61,6 +61,14 @@ class SongList(jsonMeta: String) { return songList } + /** + * Getter that return shuffled songs list + * @return MutableList of type "$artistName $songName" + */ + fun getShuffledSongList(): MutableList { + return songList.asSequence().shuffled().toMutableList() + } + /** * Getter that return page number from the query * @return String page From ccf8851c538e65beb51c8ebc6800ec371d3546ea Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:09:47 +0100 Subject: [PATCH 11/92] SongList.kt: separate json field for methods, small fixes --- .../main/java/ch/sdp/vibester/model/SongList.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/model/SongList.kt b/app/src/main/java/ch/sdp/vibester/model/SongList.kt index 3b99105ba..086f54a61 100644 --- a/app/src/main/java/ch/sdp/vibester/model/SongList.kt +++ b/app/src/main/java/ch/sdp/vibester/model/SongList.kt @@ -1,5 +1,6 @@ package ch.sdp.vibester.model +//import ch.sdp.vibester.api.LastfmHelper import org.json.JSONArray import org.json.JSONObject import java.lang.IllegalArgumentException @@ -9,8 +10,11 @@ import java.lang.IllegalArgumentException * Mainly, it creates a list of songs in the form ["$songName $artistName"] * @param jsonMeta: Lastfm fetched data */ -class SongList(jsonMeta: String) { - +class SongList(jsonMeta: String, method: String) { + private val BY_TAG = "tag.gettoptracks" + private val BY_CHART = "chart.gettoptracks" + private val BY_ARTIST = "artist.gettoptracks" + private var GAME_SIZE = 100 private var songList = mutableListOf() private var page = "" private var songsPerPage = "" @@ -20,7 +24,11 @@ class SongList(jsonMeta: String) { init { try { val jsonObj = JSONObject(jsonMeta) - var jsonRes = jsonObj.getJSONObject("tracks") + var tracksField = "tracks" + if(method==BY_ARTIST){ + tracksField="toptracks" + } + var jsonRes = jsonObj.getJSONObject(tracksField) var nonFilteredSongs = jsonRes.getJSONArray("track") filterSongs(nonFilteredSongs) @@ -45,7 +53,7 @@ class SongList(jsonMeta: String) { var i = 0 while(i < songsLength) { var songObj = nonFilteredSongs.getJSONObject(i) - val songName = songObj.getString("name") + val songName = songObj.getString("name").lowercase() val artistDetails = songObj.getJSONObject("artist") val artistName = artistDetails.getString("name") songList.add("$songName $artistName") From e747c033366ba21fecaf13dd5383df0138317f6c Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Tue, 22 Mar 2022 21:11:22 +0100 Subject: [PATCH 12/92] SongList.kt: small fixes and todo --- app/src/main/java/ch/sdp/vibester/model/SongList.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/model/SongList.kt b/app/src/main/java/ch/sdp/vibester/model/SongList.kt index 086f54a61..99a70344e 100644 --- a/app/src/main/java/ch/sdp/vibester/model/SongList.kt +++ b/app/src/main/java/ch/sdp/vibester/model/SongList.kt @@ -28,11 +28,11 @@ class SongList(jsonMeta: String, method: String) { if(method==BY_ARTIST){ tracksField="toptracks" } - var jsonRes = jsonObj.getJSONObject(tracksField) - var nonFilteredSongs = jsonRes.getJSONArray("track") + val jsonRes = jsonObj.getJSONObject(tracksField) + val nonFilteredSongs = jsonRes.getJSONArray("track") filterSongs(nonFilteredSongs) - var attributes = jsonRes.getJSONObject("@attr") + val attributes = jsonRes.getJSONObject("@attr") page = attributes.getString("page") songsPerPage = attributes.getString("perPage") totalPages = attributes.getString("totalPages") @@ -52,10 +52,11 @@ class SongList(jsonMeta: String, method: String) { val songsLength = nonFilteredSongs.length() var i = 0 while(i < songsLength) { - var songObj = nonFilteredSongs.getJSONObject(i) + val songObj = nonFilteredSongs.getJSONObject(i) val songName = songObj.getString("name").lowercase() val artistDetails = songObj.getJSONObject("artist") - val artistName = artistDetails.getString("name") + val artistName = artistDetails.getString("name").lowercase() + // TODO: filter the songs that are remixes or were sang by others. songList.add("$songName $artistName") ++i } From 45305205641f0b631058a626665cc71dc77ea0ea Mon Sep 17 00:00:00 2001 From: Kamila Babayeva Date: Wed, 23 Mar 2022 17:41:56 +0100 Subject: [PATCH 13/92] activity_genre_temporary.xml: add buttons for genre --- .../res/layout/activity_genre_temporary.xml | 82 +++++++++++++------ 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/app/src/main/res/layout/activity_genre_temporary.xml b/app/src/main/res/layout/activity_genre_temporary.xml index 161b5dcaa..80dc12615 100644 --- a/app/src/main/res/layout/activity_genre_temporary.xml +++ b/app/src/main/res/layout/activity_genre_temporary.xml @@ -6,50 +6,82 @@ android:layout_height="match_parent" tools:context=".GenreTemporary"> +