From c53c4a8b50200b057f504ac2d06e834e15d62c97 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 9 Oct 2020 15:02:47 +0200 Subject: [PATCH] launch QueueActivity on clicking at the Next Track bar --- app/src/main/AndroidManifest.xml | 4 ++++ .../musicplayer/activities/QueueActivity.kt | 18 ++++++++++++++++++ .../musicplayer/activities/TrackActivity.kt | 4 ++++ app/src/main/res/layout/activity_queue.xml | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/QueueActivity.kt create mode 100644 app/src/main/res/layout/activity_queue.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ad12265d..f916350a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -119,6 +119,10 @@ android:theme="@style/TranslucentTheme" android:parentActivityName=".activities.MainActivity" /> + + diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/QueueActivity.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/QueueActivity.kt new file mode 100644 index 00000000..a7ad8f93 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/QueueActivity.kt @@ -0,0 +1,18 @@ +package com.simplemobiletools.musicplayer.activities + +import android.os.Bundle +import android.view.Menu +import com.simplemobiletools.musicplayer.R + +class QueueActivity : SimpleActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_queue) + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + updateMenuItemColors(menu) + return super.onCreateOptionsMenu(menu) + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/TrackActivity.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/TrackActivity.kt index 6d6f90cd..63df57c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/TrackActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/TrackActivity.kt @@ -19,6 +19,7 @@ import com.bumptech.glide.request.RequestOptions import com.google.gson.Gson import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.mydebug import com.simplemobiletools.musicplayer.R import com.simplemobiletools.musicplayer.extensions.config import com.simplemobiletools.musicplayer.extensions.sendIntent @@ -61,6 +62,9 @@ class TrackActivity : SimpleActivity() { } next_track_holder.background = ColorDrawable(config.backgroundColor) + next_track_holder.setOnClickListener { + startActivity(Intent(applicationContext, QueueActivity::class.java)) + } } override fun onResume() { diff --git a/app/src/main/res/layout/activity_queue.xml b/app/src/main/res/layout/activity_queue.xml new file mode 100644 index 00000000..3ecbc8ba --- /dev/null +++ b/app/src/main/res/layout/activity_queue.xml @@ -0,0 +1,7 @@ + + + +