From 1496148a385004f40914d89e790ff2e75cdb8760 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 17 Jan 2018 21:03:08 -0800 Subject: [PATCH] Promoted "playlists" button to main activity, and also added an explicit "play queue" button above. --- .../remote/ui/home/activity/MainActivity.kt | 16 +++++++++------- .../app/src/main/res/layout/activity_main.xml | 17 +++++++++++++++-- .../app/src/main/res/menu/main_menu.xml | 7 +------ .../app/src/main/res/values/strings.xml | 3 ++- .../app/src/main/res/values/styles.xml | 14 ++++++++++++++ 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/home/activity/MainActivity.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/home/activity/MainActivity.kt index f65d48a6f..ab6bc211a 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/home/activity/MainActivity.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/home/activity/MainActivity.kt @@ -114,7 +114,6 @@ class MainActivity : BaseActivity() { val connected = data.wss.state === WebSocketService.State.Connected val streaming = isStreamingSelected - menu.findItem(R.id.action_playlists).isEnabled = connected menu.findItem(R.id.action_genres).isEnabled = connected menu.findItem(R.id.action_remote_manage).isEnabled = connected @@ -142,12 +141,6 @@ class MainActivity : BaseActivity() { return true } - R.id.action_playlists -> { - startActivity(CategoryBrowseActivity.getStartIntent( - this, Messages.Category.PLAYLISTS, NavigationType.Tracks)) - return true - } - R.id.action_offline_tracks -> { onOfflineTracksSelected() return true @@ -309,6 +302,15 @@ class MainActivity : BaseActivity() { startActivity(AlbumBrowseActivity.getStartIntent(this@MainActivity)) } + findViewById(R.id.button_albums).setOnClickListener { _: View -> + startActivity(AlbumBrowseActivity.getStartIntent(this@MainActivity)) + } + + findViewById(R.id.button_playlists).setOnClickListener { + startActivity(CategoryBrowseActivity.getStartIntent( + this, Messages.Category.PLAYLISTS, NavigationType.Tracks)) + } + findViewById(R.id.button_play_queue).setOnClickListener { _ -> navigateToPlayQueue() } findViewById(R.id.metadata_container).setOnClickListener { _ -> diff --git a/src/musikdroid/app/src/main/res/layout/activity_main.xml b/src/musikdroid/app/src/main/res/layout/activity_main.xml index 09c7c5e75..253848def 100644 --- a/src/musikdroid/app/src/main/res/layout/activity_main.xml +++ b/src/musikdroid/app/src/main/res/layout/activity_main.xml @@ -22,6 +22,19 @@ android:layout_height="wrap_content" android:orientation="vertical"> + + + + @@ -74,11 +87,11 @@ + android:text="@string/button_playlists"/> diff --git a/src/musikdroid/app/src/main/res/menu/main_menu.xml b/src/musikdroid/app/src/main/res/menu/main_menu.xml index 880289ac6..0129af9ea 100644 --- a/src/musikdroid/app/src/main/res/menu/main_menu.xml +++ b/src/musikdroid/app/src/main/res/menu/main_menu.xml @@ -8,12 +8,7 @@ app:showAsAction="always" android:title="@string/menu_remote_toggle" android:icon="@drawable/ic_toolbar_remote" /> - - - + seek > change connection songs + playlists albums artists - queue + play queue vol + vol - shuffle diff --git a/src/musikdroid/app/src/main/res/values/styles.xml b/src/musikdroid/app/src/main/res/values/styles.xml index 7bc103e62..63efe6d56 100644 --- a/src/musikdroid/app/src/main/res/values/styles.xml +++ b/src/musikdroid/app/src/main/res/values/styles.xml @@ -14,6 +14,20 @@ @color/theme_foreground @drawable/category_button true + 1 + end + + +