mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-29 03:32:42 +00:00
Promoted "playlists" button to main activity, and also added an explicit
"play queue" button above.
This commit is contained in:
parent
3729aff107
commit
1496148a38
@ -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<View>(R.id.button_albums).setOnClickListener { _: View ->
|
||||
startActivity(AlbumBrowseActivity.getStartIntent(this@MainActivity))
|
||||
}
|
||||
|
||||
findViewById<View>(R.id.button_playlists).setOnClickListener {
|
||||
startActivity(CategoryBrowseActivity.getStartIntent(
|
||||
this, Messages.Category.PLAYLISTS, NavigationType.Tracks))
|
||||
}
|
||||
|
||||
findViewById<View>(R.id.button_play_queue).setOnClickListener { _ -> navigateToPlayQueue() }
|
||||
|
||||
findViewById<View>(R.id.metadata_container).setOnClickListener { _ ->
|
||||
|
@ -22,6 +22,19 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v4.widget.Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="2dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/QueueButton"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/button_play_queue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/button_play_queue"/>
|
||||
|
||||
<android.support.v4.widget.Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="2dp" />
|
||||
@ -74,11 +87,11 @@
|
||||
<TextView
|
||||
style="@style/BrowseButton"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/button_play_queue"
|
||||
android:id="@+id/button_playlists"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/button_play_queue"/>
|
||||
android:text="@string/button_playlists"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -8,12 +8,7 @@
|
||||
app:showAsAction="always"
|
||||
android:title="@string/menu_remote_toggle"
|
||||
android:icon="@drawable/ic_toolbar_remote" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_playlists"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_playlists"/>
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/action_genres"
|
||||
app:showAsAction="never"
|
||||
|
@ -21,9 +21,10 @@
|
||||
<string name="button_seek_forward">seek ></string>
|
||||
<string name="button_change_connection">change connection</string>
|
||||
<string name="button_tracks">songs</string>
|
||||
<string name="button_playlists">playlists</string>
|
||||
<string name="button_albums">albums</string>
|
||||
<string name="button_artists">artists</string>
|
||||
<string name="button_play_queue">queue</string>
|
||||
<string name="button_play_queue">play queue</string>
|
||||
<string name="button_vol_up">vol +</string>
|
||||
<string name="button_vol_down">vol -</string>
|
||||
<string name="button_shuffle">shuffle</string>
|
||||
|
@ -14,6 +14,20 @@
|
||||
<item name="android:textColor">@color/theme_foreground</item>
|
||||
<item name="android:background">@drawable/category_button</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
</style>
|
||||
|
||||
<style name="QueueButton">
|
||||
<item name="android:layout_margin">0dp</item>
|
||||
<item name="android:paddingLeft">12dp</item>
|
||||
<item name="android:paddingRight">12dp</item>
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textColor">@color/theme_foreground</item>
|
||||
<item name="android:background">@drawable/playback_button</item>
|
||||
<item name="android:clickable">true</item>
|
||||
</style>
|
||||
|
||||
<style name="DisconnectedButton">
|
||||
|
Loading…
x
Reference in New Issue
Block a user