WIP theme

This commit is contained in:
h4h13 2019-12-01 20:57:01 +05:30
parent bb72a16b84
commit 9f1e6cb98e
87 changed files with 1694 additions and 1697 deletions

View file

@ -4,10 +4,12 @@ import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.MenuItem
import android.view.View
import androidx.core.app.ShareCompat import androidx.core.app.ShareCompat
import androidx.recyclerview.widget.* import androidx.recyclerview.widget.DefaultItemAnimator
import code.name.monkey.appthemehelper.util.* import androidx.recyclerview.widget.LinearLayoutManager
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.Constants.APP_INSTAGRAM_LINK import code.name.monkey.retromusic.Constants.APP_INSTAGRAM_LINK
import code.name.monkey.retromusic.Constants.APP_TELEGRAM_LINK import code.name.monkey.retromusic.Constants.APP_TELEGRAM_LINK
import code.name.monkey.retromusic.Constants.APP_TWITTER_LINK import code.name.monkey.retromusic.Constants.APP_TWITTER_LINK
@ -20,9 +22,12 @@ import code.name.monkey.retromusic.Constants.TRANSLATE
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.adapter.ContributorAdapter import code.name.monkey.retromusic.adapter.ContributorAdapter
import code.name.monkey.retromusic.extensions.surfaceColor
import code.name.monkey.retromusic.model.Contributor import code.name.monkey.retromusic.model.Contributor
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.NavigationUtil
import com.afollestad.materialdialogs.* import code.name.monkey.retromusic.util.PreferenceUtil
import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems import com.afollestad.materialdialogs.list.listItems
import com.google.gson.Gson import com.google.gson.Gson
@ -62,11 +67,11 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener {
setNavigationBarColorPrimary() setNavigationBarColorPrimary()
setLightNavigationBar(true) setLightNavigationBar(true)
loadContributors() loadContributors()
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
toolbar.apply { toolbar.apply {
setTitleTextColor(ATHUtil.resolveColor(this@AboutActivity, R.attr.colorOnPrimary)) setBackgroundColor(surfaceColor(context))
setBackgroundColor(ATHUtil.resolveColor(this@AboutActivity, R.attr.colorPrimary))
setNavigationOnClickListener { onBackPressed() } setNavigationOnClickListener { onBackPressed() }
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar)
} }

View file

@ -2,7 +2,6 @@ package code.name.monkey.retromusic.activities
import android.app.ActivityOptions import android.app.ActivityOptions
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
@ -15,7 +14,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.App import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
@ -44,6 +43,7 @@ import com.afollestad.materialcab.MaterialCab
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_album.* import kotlinx.android.synthetic.main.activity_album.*
import kotlinx.android.synthetic.main.activity_album_content.* import kotlinx.android.synthetic.main.activity_album_content.*
import kotlinx.android.synthetic.main.status_bar.*
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
import android.util.Pair as UtilPair import android.util.Pair as UtilPair
@ -80,11 +80,10 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
setDrawUnderStatusBar() setDrawUnderStatusBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
toggleBottomNavigationView(true) toggleBottomNavigationView(true)
setStatusbarColor(Color.TRANSPARENT) setStatusbarColorAuto()
setNavigationbarColorAuto() setNavigationbarColorAuto()
setTaskDescriptionColorAuto() setTaskDescriptionColorAuto()
setLightNavigationBar(true) setLightNavigationBar(true)
setLightStatusbar(ColorUtil.isColorLight(ATHUtil.resolveColor(this, R.attr.colorPrimary)))
ActivityCompat.postponeEnterTransition(this) ActivityCompat.postponeEnterTransition(this)
@ -191,18 +190,20 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
val themeColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color val themeColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color
else ThemeStore.accentColor(this) else ThemeStore.accentColor(this)
songTitle.setTextColor(ThemeStore.accentColor(this)) songTitle.setTextColor(themeColor)
moreTitle.setTextColor(ThemeStore.accentColor(this)) moreTitle.setTextColor(themeColor)
val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor) val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
color color
else else
ATHUtil.resolveColor(this, R.attr.cardBackgroundColor) ATHUtil.resolveColor(this, R.attr.colorControlNormal)
//MaterialUtil.setTint(button = shuffleAction, color = buttonColor) MaterialUtil.setTint(button = shuffleAction, color = buttonColor)
//MaterialUtil.setTint(button = playAction, color = buttonColor) MaterialUtil.setTint(button = playAction, color = buttonColor)
toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) val toolbarColor = ATHUtil.resolveColor(this, R.attr.colorSurface)
status_bar.setBackgroundColor(toolbarColor)
toolbar.setBackgroundColor(toolbarColor)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
supportActionBar?.title = null supportActionBar?.title = null
} }

View file

@ -2,7 +2,6 @@ package code.name.monkey.retromusic.activities
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.text.Html import android.text.Html
@ -17,7 +16,6 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialUtil import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.App import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
@ -39,6 +37,7 @@ import com.afollestad.materialcab.MaterialCab
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_artist_content.* import kotlinx.android.synthetic.main.activity_artist_content.*
import kotlinx.android.synthetic.main.activity_artist_details.* import kotlinx.android.synthetic.main.activity_artist_details.*
import kotlinx.android.synthetic.main.status_bar.*
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
@ -74,11 +73,10 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
setDrawUnderStatusBar() setDrawUnderStatusBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
toggleBottomNavigationView(true) toggleBottomNavigationView(true)
setStatusbarColor(Color.TRANSPARENT) setStatusbarColorAuto()
setNavigationbarColorAuto() setNavigationbarColorAuto()
setTaskDescriptionColorAuto() setTaskDescriptionColorAuto()
setLightNavigationBar(true) setLightNavigationBar(true)
setLightStatusbar(ColorUtil.isColorLight(ATHUtil.resolveColor(this, R.attr.colorPrimary)))
ActivityCompat.postponeEnterTransition(this) ActivityCompat.postponeEnterTransition(this)
@ -240,7 +238,10 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
MaterialUtil.setTint(button = shuffleAction, color = buttonColor) MaterialUtil.setTint(button = shuffleAction, color = buttonColor)
MaterialUtil.setTint(button = playAction, color = buttonColor) MaterialUtil.setTint(button = playAction, color = buttonColor)
toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary))
val toolbarColor = ATHUtil.resolveColor(this, R.attr.colorSurface)
status_bar.setBackgroundColor(toolbarColor)
toolbar.setBackgroundColor(toolbarColor)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
supportActionBar?.title = null supportActionBar?.title = null
} }

View file

@ -1,19 +1,25 @@
package code.name.monkey.retromusic.activities package code.name.monkey.retromusic.activities
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.Menu
import androidx.recyclerview.widget.* import android.view.MenuItem
import code.name.monkey.appthemehelper.util.* import android.view.View
import code.name.monkey.retromusic.* import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
import code.name.monkey.retromusic.adapter.song.ShuffleButtonSongAdapter import code.name.monkey.retromusic.adapter.song.ShuffleButtonSongAdapter
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.helper.menu.GenreMenuHelper import code.name.monkey.retromusic.helper.menu.GenreMenuHelper
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.Genre
import code.name.monkey.retromusic.mvp.presenter.* import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.mvp.presenter.GenreDetailsPresenter
import code.name.monkey.retromusic.mvp.presenter.GenreDetailsView
import code.name.monkey.retromusic.util.RetroColorUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import com.afollestad.materialcab.MaterialCab import com.afollestad.materialcab.MaterialCab
import kotlinx.android.synthetic.main.activity_playlist_detail.* import kotlinx.android.synthetic.main.activity_playlist_detail.*
@ -26,127 +32,123 @@ import javax.inject.Inject
class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), CabHolder, GenreDetailsView { class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), CabHolder, GenreDetailsView {
@Inject @Inject
lateinit var genreDetailsPresenter: GenreDetailsPresenter lateinit var genreDetailsPresenter: GenreDetailsPresenter
private lateinit var genre: Genre private lateinit var genre: Genre
private lateinit var songAdapter: ShuffleButtonSongAdapter private lateinit var songAdapter: ShuffleButtonSongAdapter
private var cab: MaterialCab? = null private var cab: MaterialCab? = null
private fun checkIsEmpty() { private fun checkIsEmpty() {
empty?.visibility = if (songAdapter.itemCount == 0) View.VISIBLE else View.GONE empty?.visibility = if (songAdapter.itemCount == 0) View.VISIBLE else View.GONE
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setDrawUnderStatusBar() setDrawUnderStatusBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setStatusbarColorAuto()
setNavigationbarColorAuto()
setTaskDescriptionColorAuto()
setLightNavigationBar(true)
toggleBottomNavigationView(true)
setStatusbarColor(Color.TRANSPARENT) if (intent.extras != null) {
setNavigationbarColorAuto() genre = intent?.extras?.getParcelable(EXTRA_GENRE_ID)!!
setTaskDescriptionColorAuto() } else {
setLightNavigationBar(true) finish()
setLightStatusbar(ColorUtil.isColorLight(ATHUtil.resolveColor(this, R.attr.colorPrimary))) }
toggleBottomNavigationView(true)
if (intent.extras != null) { setUpToolBar()
genre = intent?.extras?.getParcelable(EXTRA_GENRE_ID)!! setupRecyclerView()
} else {
finish()
}
setUpToolBar() App.musicComponent.inject(this)
setupRecyclerView() genreDetailsPresenter.attachView(this)
App.musicComponent.inject(this) }
genreDetailsPresenter.attachView(this)
} private fun setUpToolBar() {
applyToolbar(toolbar)
title = genre.name
}
private fun setUpToolBar() { override fun onResume() {
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary) super.onResume()
appBarLayout.setBackgroundColor(primaryColor) genreDetailsPresenter.loadGenreSongs(genre.id)
applyToolbar(toolbar) }
title = genre.name
}
override fun onResume() { override fun onDestroy() {
super.onResume() super.onDestroy()
genreDetailsPresenter.loadGenreSongs(genre.id) genreDetailsPresenter.detachView()
} }
override fun onDestroy() { override fun createContentView(): View {
super.onDestroy() return wrapSlidingMusicPanel(R.layout.activity_playlist_detail)
genreDetailsPresenter.detachView() }
}
override fun createContentView(): View { override fun showEmptyView() {
return wrapSlidingMusicPanel(R.layout.activity_playlist_detail)
}
override fun showEmptyView() { }
} override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_genre_detail, menu)
return super.onCreateOptionsMenu(menu)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
menuInflater.inflate(R.menu.menu_genre_detail, menu) if (item.itemId == android.R.id.home) {
return super.onCreateOptionsMenu(menu) onBackPressed()
} }
return GenreMenuHelper.handleMenuClick(this, genre, item)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean { private fun setupRecyclerView() {
if (item.itemId == android.R.id.home) { ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
onBackPressed() songAdapter = ShuffleButtonSongAdapter(this, ArrayList(), R.layout.item_list, false, this)
} recyclerView.apply {
return GenreMenuHelper.handleMenuClick(this, genre, item) itemAnimator = DefaultItemAnimator()
} layoutManager = LinearLayoutManager(this@GenreDetailsActivity)
adapter = songAdapter
}
songAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onChanged() {
super.onChanged()
checkIsEmpty()
}
})
}
private fun setupRecyclerView() { override fun songs(songs: ArrayList<Song>) {
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView) songAdapter.swapDataSet(songs)
songAdapter = ShuffleButtonSongAdapter(this, ArrayList(), R.layout.item_list, false, this) }
recyclerView.apply {
itemAnimator = DefaultItemAnimator()
layoutManager = LinearLayoutManager(this@GenreDetailsActivity)
adapter = songAdapter
}
songAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onChanged() {
super.onChanged()
checkIsEmpty()
}
})
}
override fun songs(songs: ArrayList<Song>) { override fun openCab(menuRes: Int, callback: MaterialCab.Callback): MaterialCab {
songAdapter.swapDataSet(songs) if (cab != null && cab!!.isActive) cab!!.finish()
} cab = MaterialCab(this, R.id.cab_stub).setMenu(menuRes)
.setCloseDrawableRes(R.drawable.ic_close_white_24dp).setBackgroundColor(
RetroColorUtil.shiftBackgroundColorForLightText(
ATHUtil.resolveColor(
this,
R.attr.colorPrimary
)
)
).start(callback)
return cab!!
}
override fun openCab(menuRes: Int, callback: MaterialCab.Callback): MaterialCab { override fun onBackPressed() {
if (cab != null && cab!!.isActive) cab!!.finish() if (cab != null && cab!!.isActive) cab!!.finish()
cab = MaterialCab(this, R.id.cab_stub).setMenu(menuRes) else {
.setCloseDrawableRes(R.drawable.ic_close_white_24dp).setBackgroundColor( recyclerView!!.stopScroll()
RetroColorUtil.shiftBackgroundColorForLightText( super.onBackPressed()
ATHUtil.resolveColor( }
this, }
R.attr.colorPrimary
)
)
).start(callback)
return cab!!
}
override fun onBackPressed() { override fun onMediaStoreChanged() {
if (cab != null && cab!!.isActive) cab!!.finish() super.onMediaStoreChanged()
else { genreDetailsPresenter.loadGenreSongs(genre.id)
recyclerView!!.stopScroll() }
super.onBackPressed()
}
}
override fun onMediaStoreChanged() { companion object {
super.onMediaStoreChanged() const val EXTRA_GENRE_ID = "extra_genre_id"
genreDetailsPresenter.loadGenreSongs(genre.id) }
}
companion object {
const val EXTRA_GENRE_ID = "extra_genre_id"
}
} }

View file

@ -65,7 +65,7 @@ public class LicenseActivity extends AbsBaseActivity {
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
ToolbarContentTintHelper.colorBackButton(toolbar); ToolbarContentTintHelper.colorBackButton(toolbar);
toolbar.setBackgroundColor(INSTANCE.resolveColor(this, R.attr.colorPrimary)); toolbar.setBackgroundColor(INSTANCE.resolveColor(this, R.attr.colorSurface));
WebView webView = findViewById(R.id.license); WebView webView = findViewById(R.id.license);
try { try {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
@ -78,7 +78,7 @@ public class LicenseActivity extends AbsBaseActivity {
// Inject color values for WebView body background and links // Inject color values for WebView body background and links
final boolean isDark = INSTANCE.isWindowBackgroundDark(this); final boolean isDark = INSTANCE.isWindowBackgroundDark(this);
final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, R.attr.colorPrimary, Color.parseColor(isDark ? "#424242" : "#ffffff"))); final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, android.R.attr.windowBackground, Color.parseColor(isDark ? "#424242" : "#ffffff")));
final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000"));
final String changeLog = buf.toString() final String changeLog = buf.toString()
.replace("{style-placeholder}", .replace("{style-placeholder}",

View file

@ -2,28 +2,44 @@ package code.name.monkey.retromusic.activities
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.os.* import android.os.AsyncTask
import android.text.* import android.os.Build
import android.os.Bundle
import android.text.InputType
import android.text.TextUtils
import android.view.* import android.view.*
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.* import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.retromusic.* import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity
import code.name.monkey.retromusic.activities.tageditor.WriteTagsAsyncTask import code.name.monkey.retromusic.activities.tageditor.WriteTagsAsyncTask
import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment
import code.name.monkey.retromusic.helper.* import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.lyrics.* import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.lyrics.LrcHelper
import code.name.monkey.retromusic.lyrics.LrcView
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.model.lyrics.Lyrics import code.name.monkey.retromusic.model.lyrics.Lyrics
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.LyricUtil
import com.afollestad.materialdialogs.* import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil
import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.input.* import com.afollestad.materialdialogs.input.getInputLayout
import com.afollestad.materialdialogs.input.input
import kotlinx.android.synthetic.main.activity_lyrics.* import kotlinx.android.synthetic.main.activity_lyrics.*
import kotlinx.android.synthetic.main.fragment_lyrics.* import kotlinx.android.synthetic.main.fragment_lyrics.*
import kotlinx.android.synthetic.main.fragment_synced.* import kotlinx.android.synthetic.main.fragment_synced.*
@ -33,393 +49,373 @@ import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPager.OnPageChangeListener { class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) { override fun onPageScrollStateChanged(state: Int) {
when (state) { when (state) {
ViewPager.SCROLL_STATE_IDLE -> fab.show() ViewPager.SCROLL_STATE_IDLE -> fab.show()
ViewPager.SCROLL_STATE_DRAGGING, ViewPager.SCROLL_STATE_SETTLING -> fab.hide() ViewPager.SCROLL_STATE_DRAGGING, ViewPager.SCROLL_STATE_SETTLING -> fab.hide()
} }
} }
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
} }
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
PreferenceUtil.getInstance(this).lyricsOptions = position PreferenceUtil.getInstance(this).lyricsOptions = position
if (position == 0) fab.text = getString(R.string.synced_lyrics) if (position == 0) fab.text = getString(R.string.synced_lyrics)
else if (position == 1) fab.text = getString(R.string.lyrics) else if (position == 1) fab.text = getString(R.string.lyrics)
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (viewPager.currentItem) { when (viewPager.currentItem) {
0 -> showSyncedLyrics() 0 -> showSyncedLyrics()
1 -> showLyricsSaveDialog() 1 -> showLyricsSaveDialog()
} }
} }
private lateinit var song: Song private lateinit var song: Song
private var lyricsString: String? = null private var lyricsString: String? = null
private val googleSearchLrcUrl: String private val googleSearchLrcUrl: String
get() { get() {
var baseUrl = "http://www.google.com/search?" var baseUrl = "http://www.google.com/search?"
var query = song.title + "+" + song.artistName var query = song.title + "+" + song.artistName
query = "q=" + query.replace(" ", "+") + " .lrc" query = "q=" + query.replace(" ", "+") + " .lrc"
baseUrl += query baseUrl += query
return baseUrl return baseUrl
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_lyrics) setContentView(R.layout.activity_lyrics)
setStatusbarColorAuto()
setTaskDescriptionColorAuto()
setNavigationBarColorPrimary()
setStatusbarColorAuto() applyToolbar(toolbar)
setTaskDescriptionColorAuto() fab.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
setNavigationBarColorPrimary() ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.accentColor(this))))
.apply {
fab.setTextColor(this)
fab.iconTint = this
}
setupWakelock()
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary) viewPager.apply {
appBarLayout.setBackgroundColor(primaryColor) adapter = PagerAdapter(supportFragmentManager)
toolbar.apply { currentItem = PreferenceUtil.getInstance(this@LyricsActivity).lyricsOptions
setBackgroundColor(primaryColor) addOnPageChangeListener(this@LyricsActivity)
navigationIcon = TintHelper.createTintedDrawable( }
ContextCompat.getDrawable(
this@LyricsActivity, R.drawable.ic_keyboard_backspace_black_24dp
), ThemeStore.textColorSecondary(this@LyricsActivity)
)
setSupportActionBar(toolbar)
}
tabs.apply {
setupWithViewPager(viewPager)
setSelectedTabIndicator(
TintHelper.createTintedDrawable(
ContextCompat.getDrawable(
this@LyricsActivity, R.drawable.tab_indicator
), ThemeStore.accentColor(this@LyricsActivity)
)
)
setTabTextColors(
ThemeStore.textColorSecondary(this@LyricsActivity),
ThemeStore.accentColor(this@LyricsActivity)
)
setSelectedTabIndicatorColor(ThemeStore.accentColor(context))
}
fab.setOnClickListener(this)
}
fab.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this)) override fun onPlayingMetaChanged() {
ColorStateList.valueOf( super.onPlayingMetaChanged()
MaterialValueHelper.getPrimaryTextColor( song = MusicPlayerRemote.currentSong
this, ColorUtil.isColorLight( toolbar.title = song.title
ThemeStore.accentColor( toolbar.subtitle = song.artistName
this }
)
)
)
).apply {
fab.setTextColor(this)
fab.iconTint = this
}
setupWakelock()
viewPager.apply { override fun onServiceConnected() {
adapter = PagerAdapter(supportFragmentManager) super.onServiceConnected()
currentItem = PreferenceUtil.getInstance(this@LyricsActivity).lyricsOptions song = MusicPlayerRemote.currentSong
addOnPageChangeListener(this@LyricsActivity) toolbar.title = song.title
} toolbar.subtitle = song.artistName
}
tabs.apply { private fun setupWakelock() {
setupWithViewPager(viewPager) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
setSelectedTabIndicator( }
TintHelper.createTintedDrawable(
ContextCompat.getDrawable(
this@LyricsActivity, R.drawable.tab_indicator
), ThemeStore.accentColor(this@LyricsActivity)
)
)
setTabTextColors(
ThemeStore.textColorSecondary(this@LyricsActivity),
ThemeStore.accentColor(this@LyricsActivity)
)
setSelectedTabIndicatorColor(ThemeStore.accentColor(context))
}
fab.setOnClickListener(this)
}
override fun onPlayingMetaChanged() { override fun onOptionsItemSelected(item: MenuItem): Boolean {
super.onPlayingMetaChanged() if (item.itemId == android.R.id.home) {
song = MusicPlayerRemote.currentSong onBackPressed()
toolbar.title = song.title }
toolbar.subtitle = song.artistName return super.onOptionsItemSelected(item)
} }
override fun onServiceConnected() { private fun showSyncedLyrics() {
super.onServiceConnected() var content = ""
song = MusicPlayerRemote.currentSong try {
toolbar.title = song.title content = LyricUtil.getStringFromFile(song.data, song.artistName)
toolbar.subtitle = song.artistName } catch (e: Exception) {
} try {
content = LyricUtil.getStringFromFile(song.title, song.artistName)
} catch (e2: Exception) {
private fun setupWakelock() { }
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) e.printStackTrace()
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean { val materialDialog = MaterialDialog(
if (item.itemId == android.R.id.home) { this, BottomSheet(LayoutMode.WRAP_CONTENT)
onBackPressed() ).show {
} title(R.string.add_time_framed_lryics)
return super.onOptionsItemSelected(item) negativeButton(R.string.action_search) {
} RetroUtil.openUrl(
this@LyricsActivity, googleSearchLrcUrl
)
}
input(
hint = getString(R.string.paste_lyrics_here),
prefill = content,
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
) { _, input ->
LyricUtil.writeLrcToLoc(song.data, song.artistName, input.toString())
}
positiveButton(android.R.string.ok) {
updateSong()
}
}
MaterialUtil.setTint(materialDialog.getInputLayout(), false)
}
private fun showSyncedLyrics() { private fun updateSong() {
var content = "" val page = supportFragmentManager.findFragmentByTag("android:switcher:" + R.id.viewPager + ":" + viewPager.currentItem)
try { if (viewPager.currentItem == 0 && page != null) {
content = LyricUtil.getStringFromFile(song.data, song.artistName) (page as BaseLyricsFragment).upDateSong()
} catch (e: Exception) { }
try { }
content = LyricUtil.getStringFromFile(song.title, song.artistName)
} catch (e2: Exception) {
} private fun showLyricsSaveDialog() {
e.printStackTrace() val content: String = if (lyricsString == null) {
} ""
} else {
lyricsString!!
}
val materialDialog = MaterialDialog( val materialDialog = MaterialDialog(
this, BottomSheet(LayoutMode.WRAP_CONTENT) this, BottomSheet(LayoutMode.WRAP_CONTENT)
).show { ).show {
title(R.string.add_time_framed_lryics) title(R.string.add_lyrics)
negativeButton(R.string.action_search) { negativeButton(R.string.action_search) {
RetroUtil.openUrl( RetroUtil.openUrl(
this@LyricsActivity, googleSearchLrcUrl this@LyricsActivity, getGoogleSearchUrl()
) )
} }
input( input(
hint = getString(R.string.paste_lyrics_here), hint = getString(R.string.paste_lyrics_here),
prefill = content, prefill = content,
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
) { _, input -> ) { _, input ->
LyricUtil.writeLrcToLoc(song.data, song.artistName, input.toString()) val fieldKeyValueMap = EnumMap<FieldKey, String>(FieldKey::class.java)
} fieldKeyValueMap[FieldKey.LYRICS] = input.toString()
positiveButton(android.R.string.ok) { WriteTagsAsyncTask(this@LyricsActivity).execute(
updateSong() WriteTagsAsyncTask.LoadingInfo(
} getSongPaths(song), fieldKeyValueMap, null
} )
MaterialUtil.setTint(materialDialog.getInputLayout(), false) )
} }
positiveButton(android.R.string.ok) {
updateSong()
}
}
MaterialUtil.setTint(materialDialog.getInputLayout(), false)
}
private fun updateSong() { private fun getSongPaths(song: Song): ArrayList<String> {
val page = supportFragmentManager.findFragmentByTag("android:switcher:" + R.id.viewPager + ":" + viewPager.currentItem) val paths = ArrayList<String>(1)
if (viewPager.currentItem == 0 && page != null) { paths.add(song.data)
(page as BaseLyricsFragment).upDateSong() return paths
} }
}
private fun showLyricsSaveDialog() { private fun getGoogleSearchUrl(): String {
val content: String = if (lyricsString == null) { var baseUrl = "http://www.google.com/search?"
"" var query = song.title + "+" + song.artistName
} else { query = "q=" + query.replace(" ", "+") + " lyrics"
lyricsString!! baseUrl += query
} return baseUrl
}
val materialDialog = MaterialDialog( class PagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(
this, BottomSheet(LayoutMode.WRAP_CONTENT) fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
).show { ) {
title(R.string.add_lyrics) class Tabs(
negativeButton(R.string.action_search) { @StringRes val title: Int, val fragment: Fragment
RetroUtil.openUrl( )
this@LyricsActivity, getGoogleSearchUrl()
)
}
input(
hint = getString(R.string.paste_lyrics_here),
prefill = content,
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
) { _, input ->
val fieldKeyValueMap = EnumMap<FieldKey, String>(FieldKey::class.java)
fieldKeyValueMap[FieldKey.LYRICS] = input.toString()
WriteTagsAsyncTask(this@LyricsActivity).execute(
WriteTagsAsyncTask.LoadingInfo(
getSongPaths(song), fieldKeyValueMap, null
)
)
}
positiveButton(android.R.string.ok) {
updateSong()
}
}
MaterialUtil.setTint(materialDialog.getInputLayout(), false)
}
private fun getSongPaths(song: Song): ArrayList<String> { private var tabs = ArrayList<Tabs>()
val paths = ArrayList<String>(1)
paths.add(song.data)
return paths
}
private fun getGoogleSearchUrl(): String { init {
var baseUrl = "http://www.google.com/search?" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
var query = song.title + "+" + song.artistName tabs.add(Tabs(R.string.synced_lyrics, SyncedLyricsFragment()))
query = "q=" + query.replace(" ", "+") + " lyrics" }
baseUrl += query tabs.add(Tabs(R.string.normal_lyrics, OfflineLyricsFragment()))
return baseUrl }
}
class PagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter( override fun getItem(position: Int): Fragment {
fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT return tabs[position].fragment
) { }
class Tabs(
@StringRes val title: Int, val fragment: Fragment
)
private var tabs = ArrayList<Tabs>() override fun getPageTitle(position: Int): CharSequence? {
return App.getContext().getString(tabs[position].title)
}
init { override fun getCount(): Int {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { return tabs.size
tabs.add(Tabs(R.string.synced_lyrics, SyncedLyricsFragment())) }
}
tabs.add(Tabs(R.string.normal_lyrics, OfflineLyricsFragment()))
}
override fun getItem(position: Int): Fragment { }
return tabs[position].fragment
}
override fun getPageTitle(position: Int): CharSequence? { abstract class BaseLyricsFragment : AbsMusicServiceFragment() {
return App.getContext().getString(tabs[position].title) abstract fun upDateSong()
}
override fun getCount(): Int { override fun onPlayingMetaChanged() {
return tabs.size super.onPlayingMetaChanged()
} upDateSong()
}
} override fun onServiceConnected() {
super.onServiceConnected()
upDateSong()
}
abstract class BaseLyricsFragment : AbsMusicServiceFragment() { }
abstract fun upDateSong()
override fun onPlayingMetaChanged() { class OfflineLyricsFragment : BaseLyricsFragment() {
super.onPlayingMetaChanged() override fun upDateSong() {
upDateSong() loadSongLyrics()
} }
override fun onServiceConnected() { private var updateLyricsAsyncTask: AsyncTask<*, *, *>? = null
super.onServiceConnected() private var lyrics: Lyrics? = null
upDateSong()
}
} @SuppressLint("StaticFieldLeak")
private fun loadSongLyrics() {
if (updateLyricsAsyncTask != null) {
updateLyricsAsyncTask!!.cancel(false)
}
val song = MusicPlayerRemote.currentSong
updateLyricsAsyncTask = object : AsyncTask<Void?, Void?, Lyrics?>() {
override fun doInBackground(vararg params: Void?): Lyrics? {
val data = MusicUtil.getLyrics(song)
return if (TextUtils.isEmpty(data)) {
null
} else Lyrics.parse(song, data!!)
}
class OfflineLyricsFragment : BaseLyricsFragment() { override fun onPreExecute() {
override fun upDateSong() { super.onPreExecute()
loadSongLyrics() lyrics = null
} }
private var updateLyricsAsyncTask: AsyncTask<*, *, *>? = null override fun onPostExecute(l: Lyrics?) {
private var lyrics: Lyrics? = null lyrics = l
offlineLyrics?.visibility = View.VISIBLE
if (l == null) {
offlineLyrics?.setText(R.string.no_lyrics_found)
return
}
(activity as LyricsActivity).lyricsString = l.text
offlineLyrics?.text = l.text
}
@SuppressLint("StaticFieldLeak") override fun onCancelled(s: Lyrics?) {
private fun loadSongLyrics() { onPostExecute(null)
if (updateLyricsAsyncTask != null) { }
updateLyricsAsyncTask!!.cancel(false) }.execute()
} }
val song = MusicPlayerRemote.currentSong
updateLyricsAsyncTask = object : AsyncTask<Void?, Void?, Lyrics?>() {
override fun doInBackground(vararg params: Void?): Lyrics? {
val data = MusicUtil.getLyrics(song)
return if (TextUtils.isEmpty(data)) {
null
} else Lyrics.parse(song, data!!)
}
override fun onPreExecute() { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onPreExecute() super.onActivityCreated(savedInstanceState)
lyrics = null loadSongLyrics()
} }
override fun onPostExecute(l: Lyrics?) { override fun onDestroyView() {
lyrics = l super.onDestroyView()
offlineLyrics?.visibility = View.VISIBLE if (updateLyricsAsyncTask != null && !updateLyricsAsyncTask!!.isCancelled) {
if (l == null) { updateLyricsAsyncTask?.cancel(true)
offlineLyrics?.setText(R.string.no_lyrics_found) }
return }
}
(activity as LyricsActivity).lyricsString = l.text
offlineLyrics?.text = l.text
}
override fun onCancelled(s: Lyrics?) { override fun onCreateView(
onPostExecute(null) inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
} ): View? {
}.execute() return inflater.inflate(R.layout.fragment_lyrics, container, false)
} }
}
override fun onActivityCreated(savedInstanceState: Bundle?) { class SyncedLyricsFragment : BaseLyricsFragment(), MusicProgressViewUpdateHelper.Callback {
super.onActivityCreated(savedInstanceState) override fun upDateSong() {
loadSongLyrics() loadLRCLyrics()
} }
override fun onDestroyView() { private lateinit var updateHelper: MusicProgressViewUpdateHelper
super.onDestroyView() override fun onCreateView(
if (updateLyricsAsyncTask != null && !updateLyricsAsyncTask!!.isCancelled) { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
updateLyricsAsyncTask?.cancel(true) ): View? {
} return inflater.inflate(R.layout.fragment_synced, container, false)
} }
override fun onCreateView( override fun onCreate(savedInstanceState: Bundle?) {
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? super.onCreate(savedInstanceState)
): View? { updateHelper = MusicProgressViewUpdateHelper(this, 500, 1000)
return inflater.inflate(R.layout.fragment_lyrics, container, false) }
}
}
class SyncedLyricsFragment : BaseLyricsFragment(), MusicProgressViewUpdateHelper.Callback { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
override fun upDateSong() { super.onViewCreated(view, savedInstanceState)
loadLRCLyrics() setupLyricsView()
} }
private lateinit var updateHelper: MusicProgressViewUpdateHelper private fun setupLyricsView() {
override fun onCreateView( lyricsView.apply {
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? val context = activity!!
): View? { setCurrentPlayLineColor(ThemeStore.accentColor(context))
return inflater.inflate(R.layout.fragment_synced, container, false) setIndicatorTextColor(ThemeStore.accentColor(context))
} setCurrentIndicateLineTextColor(ThemeStore.textColorPrimary(context))
setNoLrcTextColor(ThemeStore.textColorPrimary(context))
setOnPlayIndicatorLineListener(object : LrcView.OnPlayIndicatorLineListener {
override fun onPlay(time: Long, content: String) {
MusicPlayerRemote.seekTo(time.toInt())
}
})
}
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onResume() {
super.onCreate(savedInstanceState) super.onResume()
updateHelper = MusicProgressViewUpdateHelper(this, 500, 1000) updateHelper.start()
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onPause() {
super.onViewCreated(view, savedInstanceState) super.onPause()
setupLyricsView() updateHelper.stop()
} }
private fun setupLyricsView() { override fun onUpdateProgressViews(progress: Int, total: Int) {
lyricsView.apply { lyricsView.updateTime(progress.toLong())
val context = activity!! }
setCurrentPlayLineColor(ThemeStore.accentColor(context))
setIndicatorTextColor(ThemeStore.accentColor(context))
setCurrentIndicateLineTextColor(ThemeStore.textColorPrimary(context))
setNoLrcTextColor(ThemeStore.textColorPrimary(context))
setOnPlayIndicatorLineListener(object : LrcView.OnPlayIndicatorLineListener {
override fun onPlay(time: Long, content: String) {
MusicPlayerRemote.seekTo(time.toInt())
}
})
}
}
override fun onResume() { private fun loadLRCLyrics() {
super.onResume() val song = MusicPlayerRemote.currentSong
updateHelper.start() if (LyricUtil.isLrcFile2Exist(song.data, song.artistName)) {
} showLyricsLocal(LyricUtil.getLocalLyricFile(song.data, song.artistName))
} else {
if (LyricUtil.isLrcFileExist(song.title, song.artistName)) {
showLyricsLocal(LyricUtil.getLocalLyricFile(song.title, song.artistName))
}
}
}
override fun onPause() { private fun showLyricsLocal(file: File?) {
super.onPause() if (file != null) {
updateHelper.stop() lyricsView.setLrcData(LrcHelper.parseLrcFromFile(file))
} }
}
override fun onUpdateProgressViews(progress: Int, total: Int) { }
lyricsView.updateTime(progress.toLong())
}
private fun loadLRCLyrics() {
val song = MusicPlayerRemote.currentSong
if (LyricUtil.isLrcFile2Exist(song.data, song.artistName)) {
showLyricsLocal(LyricUtil.getLocalLyricFile(song.data, song.artistName))
} else {
if (LyricUtil.isLrcFileExist(song.title, song.artistName)) {
showLyricsLocal(LyricUtil.getLocalLyricFile(song.title, song.artistName))
}
}
}
private fun showLyricsLocal(file: File?) {
if (file != null) {
lyricsView.setLrcData(LrcHelper.parseLrcFromFile(file))
}
}
}
} }

View file

@ -3,15 +3,17 @@ package code.name.monkey.retromusic.activities
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.os.Bundle import android.os.Bundle
import android.view.MenuItem import android.view.MenuItem
import androidx.recyclerview.widget.* import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity
import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager
@ -20,169 +22,161 @@ import kotlinx.android.synthetic.main.activity_playing_queue.*
open class PlayingQueueActivity : AbsMusicServiceActivity() { open class PlayingQueueActivity : AbsMusicServiceActivity() {
private var wrappedAdapter: RecyclerView.Adapter<*>? = null private var wrappedAdapter: RecyclerView.Adapter<*>? = null
private var recyclerViewDragDropManager: RecyclerViewDragDropManager? = null private var recyclerViewDragDropManager: RecyclerViewDragDropManager? = null
private var playingQueueAdapter: PlayingQueueAdapter? = null private var playingQueueAdapter: PlayingQueueAdapter? = null
private lateinit var linearLayoutManager: LinearLayoutManager private lateinit var linearLayoutManager: LinearLayoutManager
private fun getUpNextAndQueueTime(): String { private fun getUpNextAndQueueTime(): String {
val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position) val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position)
return MusicUtil.buildInfoString(resources.getString(R.string.up_next), MusicUtil.getReadableDurationString(duration))
}
return MusicUtil.buildInfoString( override fun onCreate(savedInstanceState: Bundle?) {
resources.getString(R.string.up_next), MusicUtil.getReadableDurationString(duration) super.onCreate(savedInstanceState)
) setContentView(R.layout.activity_playing_queue)
} setStatusbarColorAuto()
setNavigationBarColorPrimary()
setTaskDescriptionColorAuto()
setLightNavigationBar(true)
override fun onCreate( setupToolbar()
savedInstanceState: Bundle? setUpRecyclerView()
) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_playing_queue)
setStatusbarColorAuto() clearQueue.setOnClickListener {
setNavigationBarColorPrimary() MusicPlayerRemote.clearQueue()
setTaskDescriptionColorAuto() }
setLightNavigationBar(true) checkForPadding()
}
setupToolbar() override fun onOptionsItemSelected(item: MenuItem): Boolean {
setUpRecyclerView() return when (item.itemId) {
android.R.id.home -> {
onBackPressed()
true
}
else -> super.onOptionsItemSelected(item)
}
}
clearQueue.setOnClickListener { private fun setUpRecyclerView() {
MusicPlayerRemote.clearQueue() recyclerViewDragDropManager = RecyclerViewDragDropManager()
} val animator = RefactoredDefaultItemAnimator()
checkForPadding()
}
override fun onOptionsItemSelected(item: MenuItem): Boolean { playingQueueAdapter = PlayingQueueAdapter(
return when (item.itemId) { this,
android.R.id.home -> { MusicPlayerRemote.playingQueue,
onBackPressed() MusicPlayerRemote.position,
true R.layout.item_queue
} )
else -> super.onOptionsItemSelected(item) wrappedAdapter = recyclerViewDragDropManager?.createWrappedAdapter(playingQueueAdapter!!)
}
}
private fun setUpRecyclerView() { linearLayoutManager = LinearLayoutManager(this)
recyclerViewDragDropManager = RecyclerViewDragDropManager()
val animator = RefactoredDefaultItemAnimator()
playingQueueAdapter = PlayingQueueAdapter( recyclerView.apply {
this, layoutManager = linearLayoutManager
MusicPlayerRemote.playingQueue, adapter = wrappedAdapter
MusicPlayerRemote.position, itemAnimator = animator
R.layout.item_queue recyclerViewDragDropManager?.attachRecyclerView(this)
) }
wrappedAdapter = recyclerViewDragDropManager?.createWrappedAdapter(playingQueueAdapter!!)
linearLayoutManager = LinearLayoutManager(this) linearLayoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0)
recyclerView.apply { recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
layoutManager = linearLayoutManager override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
adapter = wrappedAdapter super.onScrolled(recyclerView, dx, dy)
itemAnimator = animator if (dy > 0) {
recyclerViewDragDropManager?.attachRecyclerView(this) clearQueue.shrink()
} } else if (dy < 0) {
clearQueue.extend()
}
}
})
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
}
linearLayoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0) private fun checkForPadding() {
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { }
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy > 0) {
clearQueue.shrink()
} else if (dy < 0) {
clearQueue.extend()
}
}
})
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
}
private fun checkForPadding() { override fun onQueueChanged() {
if (MusicPlayerRemote.playingQueue.isEmpty()) {
finish()
return
}
checkForPadding()
updateQueue()
updateCurrentSong()
}
} override fun onMediaStoreChanged() {
updateQueue()
updateCurrentSong()
}
override fun onQueueChanged() { private fun updateCurrentSong() {
if (MusicPlayerRemote.playingQueue.isEmpty()) { playerQueueSubHeader.text = getUpNextAndQueueTime()
finish() }
return
}
checkForPadding()
updateQueue()
updateCurrentSong()
}
override fun onMediaStoreChanged() { override fun onPlayingMetaChanged() {
updateQueue() updateQueuePosition()
updateCurrentSong() }
}
private fun updateCurrentSong() { private fun updateQueuePosition() {
playerQueueSubHeader.text = getUpNextAndQueueTime() playingQueueAdapter?.setCurrent(MusicPlayerRemote.position)
} resetToCurrentPosition()
playerQueueSubHeader.text = getUpNextAndQueueTime()
}
override fun onPlayingMetaChanged() { private fun updateQueue() {
updateQueuePosition() playingQueueAdapter?.swapDataSet(MusicPlayerRemote.playingQueue, MusicPlayerRemote.position)
} resetToCurrentPosition()
}
private fun updateQueuePosition() { private fun resetToCurrentPosition() {
playingQueueAdapter?.setCurrent(MusicPlayerRemote.position) recyclerView.stopScroll()
resetToCurrentPosition() linearLayoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0)
playerQueueSubHeader.text = getUpNextAndQueueTime() }
}
private fun updateQueue() { override fun onPause() {
playingQueueAdapter?.swapDataSet(MusicPlayerRemote.playingQueue, MusicPlayerRemote.position) if (recyclerViewDragDropManager != null) {
resetToCurrentPosition() recyclerViewDragDropManager!!.cancelDrag()
} }
super.onPause()
}
private fun resetToCurrentPosition() { override fun onDestroy() {
recyclerView.stopScroll() if (recyclerViewDragDropManager != null) {
linearLayoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0) recyclerViewDragDropManager!!.release()
} recyclerViewDragDropManager = null
}
override fun onPause() { if (wrappedAdapter != null) {
if (recyclerViewDragDropManager != null) { WrapperAdapterUtils.releaseAll(wrappedAdapter)
recyclerViewDragDropManager!!.cancelDrag() wrappedAdapter = null
} }
super.onPause() playingQueueAdapter = null
} super.onDestroy()
}
override fun onDestroy() { private fun setupToolbar() {
if (recyclerViewDragDropManager != null) { playerQueueSubHeader.text = getUpNextAndQueueTime()
recyclerViewDragDropManager!!.release() playerQueueSubHeader.setTextColor(ThemeStore.accentColor(this))
recyclerViewDragDropManager = null
}
if (wrappedAdapter != null) { applyToolbar(toolbar)
WrapperAdapterUtils.releaseAll(wrappedAdapter) clearQueue.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
wrappedAdapter = null ColorStateList.valueOf(
} MaterialValueHelper.getPrimaryTextColor(
playingQueueAdapter = null this,
super.onDestroy() ColorUtil.isColorLight(
} ThemeStore.accentColor(
this
private fun setupToolbar() { )
playerQueueSubHeader.text = getUpNextAndQueueTime() )
playerQueueSubHeader.setTextColor(ThemeStore.accentColor(this)) )
).apply {
applyToolbar(toolbar) clearQueue.setTextColor(this)
appBarLayout.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) clearQueue.iconTint = this
}
clearQueue.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this)) }
ColorStateList.valueOf(
MaterialValueHelper.getPrimaryTextColor(
this,
ColorUtil.isColorLight(
ThemeStore.accentColor(
this
)
)
)
).apply {
clearQueue.setTextColor(this)
clearQueue.iconTint = this
}
}
} }

View file

@ -1,20 +1,29 @@
package code.name.monkey.retromusic.activities package code.name.monkey.retromusic.activities
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.Menu
import androidx.recyclerview.widget.* import android.view.MenuItem
import code.name.monkey.appthemehelper.util.* import android.view.View
import code.name.monkey.retromusic.* import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
import code.name.monkey.retromusic.adapter.song.* import code.name.monkey.retromusic.adapter.song.OrderablePlaylistSongAdapter
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.adapter.song.PlaylistSongAdapter
import code.name.monkey.retromusic.adapter.song.SongAdapter
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.loaders.PlaylistLoader import code.name.monkey.retromusic.loaders.PlaylistLoader
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.AbsCustomPlaylist
import code.name.monkey.retromusic.mvp.presenter.* import code.name.monkey.retromusic.model.Playlist
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.mvp.presenter.PlaylistSongsPresenter
import code.name.monkey.retromusic.mvp.presenter.PlaylistSongsView
import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.PlaylistsUtil
import code.name.monkey.retromusic.util.RetroColorUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import com.afollestad.materialcab.MaterialCab import com.afollestad.materialcab.MaterialCab
import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator
@ -25,217 +34,202 @@ import javax.inject.Inject
class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsView { class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsView {
@Inject @Inject
lateinit var playlistSongsPresenter: PlaylistSongsPresenter lateinit var playlistSongsPresenter: PlaylistSongsPresenter
private lateinit var playlist: Playlist private lateinit var playlist: Playlist
private var cab: MaterialCab? = null private var cab: MaterialCab? = null
private lateinit var adapter: SongAdapter private lateinit var adapter: SongAdapter
private var wrappedAdapter: RecyclerView.Adapter<*>? = null private var wrappedAdapter: RecyclerView.Adapter<*>? = null
private var recyclerViewDragDropManager: RecyclerViewDragDropManager? = null private var recyclerViewDragDropManager: RecyclerViewDragDropManager? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setDrawUnderStatusBar() setDrawUnderStatusBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
App.musicComponent.inject(this) setStatusbarColorAuto()
setNavigationbarColorAuto()
setTaskDescriptionColorAuto()
setLightNavigationBar(true)
toggleBottomNavigationView(true)
playlistSongsPresenter.attachView(this) App.musicComponent.inject(this)
playlistSongsPresenter.attachView(this)
setStatusbarColor(Color.TRANSPARENT) if (intent.extras != null) {
setNavigationbarColorAuto() playlist = intent.extras!!.getParcelable(EXTRA_PLAYLIST)!!
setTaskDescriptionColorAuto() } else {
setLightNavigationBar(true) finish()
setLightStatusbar(ColorUtil.isColorLight(ATHUtil.resolveColor(this, R.attr.colorPrimary))) }
toggleBottomNavigationView(true) setUpToolBar()
setUpRecyclerView()
}
if (intent.extras != null) { override fun createContentView(): View {
playlist = intent.extras!!.getParcelable(EXTRA_PLAYLIST)!! return wrapSlidingMusicPanel(R.layout.activity_playlist_detail)
} else { }
finish()
}
setUpToolBar() private fun setUpRecyclerView() {
setUpRecyclerView() ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
} recyclerView.layoutManager = LinearLayoutManager(this)
if (playlist is AbsCustomPlaylist) {
adapter = PlaylistSongAdapter(this, ArrayList(), R.layout.item_list, false, this)
recyclerView.adapter = adapter
} else {
recyclerViewDragDropManager = RecyclerViewDragDropManager()
val animator = RefactoredDefaultItemAnimator()
adapter = OrderablePlaylistSongAdapter(this,
ArrayList(),
R.layout.item_list,
false,
this,
object : OrderablePlaylistSongAdapter.OnMoveItemListener {
override fun onMoveItem(fromPosition: Int, toPosition: Int) {
if (PlaylistsUtil.moveItem(this@PlaylistDetailActivity, playlist.id, fromPosition, toPosition)) {
val song = adapter.dataSet.removeAt(fromPosition)
adapter.dataSet.add(toPosition, song)
adapter.notifyItemMoved(fromPosition, toPosition)
}
}
})
wrappedAdapter = recyclerViewDragDropManager!!.createWrappedAdapter(adapter)
override fun createContentView(): View { recyclerView.adapter = wrappedAdapter
return wrapSlidingMusicPanel(R.layout.activity_playlist_detail) recyclerView.itemAnimator = animator
}
private fun setUpRecyclerView() { recyclerViewDragDropManager?.attachRecyclerView(recyclerView)
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView) }
recyclerView.layoutManager = LinearLayoutManager(this) adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
if (playlist is AbsCustomPlaylist) { override fun onChanged() {
adapter = PlaylistSongAdapter(this, ArrayList(), R.layout.item_list, false, this) super.onChanged()
recyclerView.adapter = adapter checkIsEmpty()
} else { }
recyclerViewDragDropManager = RecyclerViewDragDropManager() })
val animator = RefactoredDefaultItemAnimator() }
adapter = OrderablePlaylistSongAdapter(this,
ArrayList(),
R.layout.item_list,
false,
this,
object : OrderablePlaylistSongAdapter.OnMoveItemListener {
override fun onMoveItem(
fromPosition: Int,
toPosition: Int
) {
if (PlaylistsUtil.moveItem(
this@PlaylistDetailActivity,
playlist.id,
fromPosition,
toPosition
)) {
val song = adapter.dataSet.removeAt(
fromPosition
)
adapter.dataSet.add(toPosition, song)
adapter.notifyItemMoved(
fromPosition,
toPosition
)
}
}
})
wrappedAdapter = recyclerViewDragDropManager!!.createWrappedAdapter(adapter)
recyclerView.adapter = wrappedAdapter override fun onResume() {
recyclerView.itemAnimator = animator super.onResume()
playlistSongsPresenter.loadPlaylistSongs(playlist)
}
recyclerViewDragDropManager?.attachRecyclerView(recyclerView) private fun setUpToolBar() {
} toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorSurface))
adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { setSupportActionBar(toolbar)
override fun onChanged() { title = playlist.name
super.onChanged() }
checkIsEmpty()
}
})
}
override fun onResume() { override fun onCreateOptionsMenu(menu: Menu): Boolean {
super.onResume() menuInflater.inflate(
playlistSongsPresenter.loadPlaylistSongs(playlist) if (playlist is AbsCustomPlaylist) R.menu.menu_smart_playlist_detail
} else R.menu.menu_playlist_detail, menu
)
return super.onCreateOptionsMenu(menu)
}
private fun setUpToolBar() { override fun onOptionsItemSelected(item: MenuItem): Boolean {
applyToolbar(toolbar) when (item.itemId) {
title = playlist.name android.R.id.home -> {
} onBackPressed()
return true
}
}
return PlaylistMenuHelper.handleMenuClick(this, playlist, item)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun openCab(menuRes: Int, callback: MaterialCab.Callback): MaterialCab {
menuInflater.inflate( if (cab != null && cab!!.isActive) {
if (playlist is AbsCustomPlaylist) R.menu.menu_smart_playlist_detail cab!!.finish()
else R.menu.menu_playlist_detail, menu }
) cab = MaterialCab(this, R.id.cab_stub).setMenu(menuRes)
return super.onCreateOptionsMenu(menu) .setCloseDrawableRes(R.drawable.ic_close_white_24dp).setBackgroundColor(
} RetroColorUtil.shiftBackgroundColorForLightText(
ATHUtil.resolveColor(
this,
R.attr.colorPrimary
)
)
).start(callback)
return cab!!
}
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onBackPressed() {
when (item.itemId) { if (cab != null && cab!!.isActive) {
android.R.id.home -> { cab!!.finish()
onBackPressed() } else {
return true recyclerView!!.stopScroll()
} super.onBackPressed()
} }
return PlaylistMenuHelper.handleMenuClick(this, playlist, item) }
}
override fun openCab(menuRes: Int, callback: MaterialCab.Callback): MaterialCab { override fun onMediaStoreChanged() {
if (cab != null && cab!!.isActive) { super.onMediaStoreChanged()
cab!!.finish() if (playlist !is AbsCustomPlaylist) {
} // Playlist deleted
cab = MaterialCab(this, R.id.cab_stub).setMenu(menuRes) if (!PlaylistsUtil.doesPlaylistExist(this, playlist.id)) {
.setCloseDrawableRes(R.drawable.ic_close_white_24dp).setBackgroundColor( finish()
RetroColorUtil.shiftBackgroundColorForLightText( return
ATHUtil.resolveColor( }
this, // Playlist renamed
R.attr.colorPrimary val playlistName = PlaylistsUtil.getNameForPlaylist(this, playlist.id.toLong())
) if (playlistName != playlist.name) {
) playlist = PlaylistLoader.getPlaylist(this, playlist.id)
).start(callback) setToolbarTitle(playlist.name)
return cab!! }
} }
playlistSongsPresenter.loadPlaylistSongs(playlist)
}
override fun onBackPressed() { private fun setToolbarTitle(title: String) {
if (cab != null && cab!!.isActive) { supportActionBar!!.title = title
cab!!.finish() }
} else {
recyclerView!!.stopScroll()
super.onBackPressed()
}
}
override fun onMediaStoreChanged() { private fun checkForPadding() {
super.onMediaStoreChanged() val height = DensityUtil.dip2px(this, 52f)
if (playlist !is AbsCustomPlaylist) { recyclerView.setPadding(0, 0, 0, (height))
// Playlist deleted }
if (!PlaylistsUtil.doesPlaylistExist(this, playlist.id)) {
finish()
return
}
// Playlist renamed
val playlistName = PlaylistsUtil.getNameForPlaylist(this, playlist.id.toLong())
if (playlistName != playlist.name) {
playlist = PlaylistLoader.getPlaylist(this, playlist.id)
setToolbarTitle(playlist.name)
}
}
playlistSongsPresenter.loadPlaylistSongs(playlist)
}
private fun setToolbarTitle(title: String) { private fun checkIsEmpty() {
supportActionBar!!.title = title checkForPadding()
} empty.visibility = if (adapter.itemCount == 0) View.VISIBLE else View.GONE
emptyText.visibility = if (adapter.itemCount == 0) View.VISIBLE else View.GONE
}
private fun checkForPadding() { public override fun onPause() {
val height = DensityUtil.dip2px(this, 52f) if (recyclerViewDragDropManager != null) {
recyclerView.setPadding(0, 0, 0, (height)) recyclerViewDragDropManager!!.cancelDrag()
} }
super.onPause()
}
private fun checkIsEmpty() { override fun onDestroy() {
checkForPadding() if (recyclerViewDragDropManager != null) {
empty.visibility = if (adapter.itemCount == 0) View.VISIBLE else View.GONE recyclerViewDragDropManager!!.release()
emptyText.visibility = if (adapter.itemCount == 0) View.VISIBLE else View.GONE recyclerViewDragDropManager = null
} }
public override fun onPause() { if (recyclerView != null) {
if (recyclerViewDragDropManager != null) { recyclerView!!.itemAnimator = null
recyclerViewDragDropManager!!.cancelDrag() recyclerView!!.adapter = null
} }
super.onPause()
}
override fun onDestroy() { if (wrappedAdapter != null) {
if (recyclerViewDragDropManager != null) { WrapperAdapterUtils.releaseAll(wrappedAdapter)
recyclerViewDragDropManager!!.release() wrappedAdapter = null
recyclerViewDragDropManager = null }
} super.onDestroy()
playlistSongsPresenter.detachView()
}
if (recyclerView != null) { override fun showEmptyView() {
recyclerView!!.itemAnimator = null empty.visibility = View.VISIBLE
recyclerView!!.adapter = null emptyText.visibility = View.VISIBLE
} }
if (wrappedAdapter != null) { override fun songs(songs: ArrayList<Song>) {
WrapperAdapterUtils.releaseAll(wrappedAdapter) adapter.swapDataSet(songs)
wrappedAdapter = null }
}
super.onDestroy()
playlistSongsPresenter.detachView()
}
override fun showEmptyView() { companion object {
empty.visibility = View.VISIBLE var EXTRA_PLAYLIST = "extra_playlist"
emptyText.visibility = View.VISIBLE }
}
override fun songs(songs: ArrayList<Song>) {
adapter.swapDataSet(songs)
}
companion object {
var EXTRA_PLAYLIST = "extra_playlist"
}
} }

View file

@ -1,16 +1,19 @@
package code.name.monkey.retromusic.activities package code.name.monkey.retromusic.activities
import android.content.Intent import android.content.Intent
import android.os.* import android.os.AsyncTask
import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.MenuItem import android.view.MenuItem
import android.widget.Toast import android.widget.Toast
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.* import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.BuildConfig import code.name.monkey.retromusic.BuildConfig
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.extensions.applyToolbar
import com.anjlab.android.iab.v3.* import com.anjlab.android.iab.v3.BillingProcessor
import com.anjlab.android.iab.v3.TransactionDetails
import kotlinx.android.synthetic.main.activity_pro_version.* import kotlinx.android.synthetic.main.activity_pro_version.*
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
@ -23,16 +26,11 @@ class PurchaseActivity : AbsBaseActivity(), BillingProcessor.IBillingHandler {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_pro_version) setContentView(R.layout.activity_pro_version)
setDrawUnderStatusBar() setDrawUnderStatusBar()
setStatusbarColorAuto() setStatusbarColorAuto()
setNavigationBarColorPrimary() setNavigationBarColorPrimary()
setTaskDescriptionColorAuto() setTaskDescriptionColorAuto()
setLightNavigationBar(true) setLightNavigationBar(true)
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary)
toolbar.setBackgroundColor(primaryColor)
appBarLayout.setBackgroundColor(primaryColor)
applyToolbar(toolbar) applyToolbar(toolbar)
restoreButton.isEnabled = false restoreButton.isEnabled = false

View file

@ -18,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.transition.TransitionManager import androidx.transition.TransitionManager
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.App import code.name.monkey.retromusic.App
@ -125,7 +124,6 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, TextWatch
private fun setUpToolBar() { private fun setUpToolBar() {
title = null title = null
appBarLayout.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary))
} }
private fun search(query: String) { private fun search(query: String) {

View file

@ -5,7 +5,8 @@ import android.view.MenuItem
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.transition.TransitionManager import androidx.transition.TransitionManager
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.fragments.settings.MainSettingsFragment import code.name.monkey.retromusic.fragments.settings.MainSettingsFragment
@ -25,8 +26,7 @@ class SettingsActivity : AbsBaseActivity() {
setupToolbar() setupToolbar()
if (savedInstanceState == null) { if (savedInstanceState == null) {
fragmentManager.beginTransaction().replace(R.id.contentFrame, MainSettingsFragment()) fragmentManager.beginTransaction().replace(R.id.contentFrame, MainSettingsFragment()).commit()
.commit()
} }
} }
@ -34,13 +34,10 @@ class SettingsActivity : AbsBaseActivity() {
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
setTitle(R.string.action_settings) setTitle(R.string.action_settings)
toolbar.apply { toolbar.apply {
setTitleTextColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorOnPrimary)) setBackgroundColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorSurface))
setBackgroundColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorPrimary))
setNavigationOnClickListener { onBackPressed() } setNavigationOnClickListener { onBackPressed() }
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar)
} }
appBarLayout.setBackgroundColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorPrimary))
} }
fun setupFragment(fragment: Fragment, @StringRes titleName: Int) { fun setupFragment(fragment: Fragment, @StringRes titleName: Int) {

View file

@ -2,20 +2,30 @@ package code.name.monkey.retromusic.activities
import android.content.Intent import android.content.Intent
import android.graphics.Paint import android.graphics.Paint
import android.os.* import android.os.AsyncTask
import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.* import android.view.LayoutInflater
import android.widget.* import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
import androidx.recyclerview.widget.* import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.retromusic.* import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.BuildConfig import code.name.monkey.retromusic.BuildConfig
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.extensions.applyToolbar
import com.anjlab.android.iab.v3.* import com.anjlab.android.iab.v3.BillingProcessor
import com.anjlab.android.iab.v3.SkuDetails
import com.anjlab.android.iab.v3.TransactionDetails
import kotlinx.android.synthetic.main.activity_donation.* import kotlinx.android.synthetic.main.activity_donation.*
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
import java.util.* import java.util.*
@ -61,8 +71,6 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH
} }
private fun setupToolbar() { private fun setupToolbar() {
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary)
appBarLayout.setBackgroundColor(primaryColor)
applyToolbar(toolbar) applyToolbar(toolbar)
} }

View file

@ -1,7 +1,10 @@
package code.name.monkey.retromusic.activities package code.name.monkey.retromusic.activities
import android.app.Activity import android.app.Activity
import android.content.* import android.content.ContentUris
import android.content.Context
import android.content.ContextWrapper
import android.content.Intent
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.Bitmap import android.graphics.Bitmap
import android.net.Uri import android.net.Uri
@ -13,298 +16,266 @@ import android.text.TextUtils
import android.view.MenuItem import android.view.MenuItem
import android.widget.Toast import android.widget.Toast
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.retromusic.* import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.Constants.USER_BANNER import code.name.monkey.retromusic.Constants.USER_BANNER
import code.name.monkey.retromusic.Constants.USER_PROFILE import code.name.monkey.retromusic.Constants.USER_PROFILE
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.extensions.applyToolbar import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.Compressor
import code.name.monkey.retromusic.util.ImageUtil.getResizedBitmap import code.name.monkey.retromusic.util.ImageUtil.getResizedBitmap
import com.afollestad.materialdialogs.* import code.name.monkey.retromusic.util.PreferenceUtil
import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems import com.afollestad.materialdialogs.list.listItems
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_user_info.* import kotlinx.android.synthetic.main.activity_user_info.*
import java.io.* import java.io.File
import java.io.FileOutputStream
import java.io.IOException
class UserInfoActivity : AbsBaseActivity() { class UserInfoActivity : AbsBaseActivity() {
private var disposable = CompositeDisposable() private var disposable = CompositeDisposable()
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_user_info) setContentView(R.layout.activity_user_info)
setStatusbarColorAuto() setStatusbarColorAuto()
setNavigationBarColorPrimary() setNavigationBarColorPrimary()
setTaskDescriptionColorAuto() setTaskDescriptionColorAuto()
setLightNavigationBar(true) setLightNavigationBar(true)
setupToolbar() applyToolbar(toolbar)
MaterialUtil.setTint(nameContainer, false) MaterialUtil.setTint(nameContainer, false)
name.setText(PreferenceUtil.getInstance(this).userName) name.setText(PreferenceUtil.getInstance(this).userName)
if (PreferenceUtil.getInstance(this).profileImage.isNotEmpty()) { if (PreferenceUtil.getInstance(this).profileImage.isNotEmpty()) {
loadImageFromStorage(PreferenceUtil.getInstance(this).profileImage) loadImageFromStorage(PreferenceUtil.getInstance(this).profileImage)
} }
if (PreferenceUtil.getInstance(this).bannerImage.isNotEmpty()) { if (PreferenceUtil.getInstance(this).bannerImage.isNotEmpty()) {
loadBannerFromStorage(PreferenceUtil.getInstance(this).bannerImage) loadBannerFromStorage(PreferenceUtil.getInstance(this).bannerImage)
} }
userImage.setOnClickListener { userImage.setOnClickListener {
MaterialDialog(this, BottomSheet(LayoutMode.WRAP_CONTENT)).show { MaterialDialog(this, BottomSheet(LayoutMode.WRAP_CONTENT)).show {
title(text = getString(R.string.set_photo)) cornerRadius(PreferenceUtil.getInstance(this@UserInfoActivity).dialogCorner)
listItems( title(text = getString(R.string.set_photo))
items = listOf( listItems(items = listOf(getString(R.string.new_profile_photo), getString(R.string.remove_profile_photo))) { _, position, _ ->
getString(R.string.new_profile_photo), when (position) {
getString(R.string.remove_profile_photo) 0 -> pickNewPhoto()
) 1 -> PreferenceUtil.getInstance(this@UserInfoActivity).saveProfileImage("")
) { _, position, _ -> }
when (position) { }
0 -> pickNewPhoto() }
1 -> PreferenceUtil.getInstance(this@UserInfoActivity).saveProfileImage("") }
} bannerSelect.setOnClickListener {
} MaterialDialog(this, BottomSheet(LayoutMode.WRAP_CONTENT)).show {
} cornerRadius(PreferenceUtil.getInstance(this@UserInfoActivity).dialogCorner)
} title(R.string.select_banner_photo)
bannerSelect.setOnClickListener { listItems(items = listOf(getString(R.string.new_banner_photo), getString(R.string.remove_banner_photo)))
showBannerOptions() { _, position, _ ->
} when (position) {
next.setOnClickListener { 0 -> selectBannerImage()
val nameString = name.text.toString().trim { it <= ' ' } 1 -> PreferenceUtil.getInstance(this@UserInfoActivity).setBannerImagePath("")
if (TextUtils.isEmpty(nameString)) { }
Toast.makeText(this, "Umm name is empty", Toast.LENGTH_SHORT).show() }
return@setOnClickListener }
} }
/*val bioString = bio.text.toString().trim() { it <= ' ' } next.setOnClickListener {
if (TextUtils.isEmpty(bioString)) { val nameString = name.text.toString().trim { it <= ' ' }
Toast.makeText(this, "Umm bio is empty", Toast.LENGTH_SHORT).show() if (TextUtils.isEmpty(nameString)) {
return@setOnClickListener Toast.makeText(this, "Umm name is empty", Toast.LENGTH_SHORT).show()
return@setOnClickListener
}
PreferenceUtil.getInstance(this).userName = nameString
setResult(Activity.RESULT_OK)
finish()
}
next.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.accentColor(this))))
.apply {
next.setTextColor(this)
next.iconTint = this
}
}
}*/ override fun onOptionsItemSelected(item: MenuItem): Boolean {
PreferenceUtil.getInstance(this).userName = nameString if (item.itemId == android.R.id.home) {
//PreferenceUtil.getInstance().userBio = bioString onBackPressed()
setResult(Activity.RESULT_OK) }
finish() return super.onOptionsItemSelected(item)
} }
next.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
ColorStateList.valueOf(
MaterialValueHelper.getPrimaryTextColor(
this,
ColorUtil.isColorLight(
ThemeStore.accentColor(
this
)
)
)
).apply {
next.setTextColor(this)
next.iconTint = this
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean { private fun selectBannerImage() {
if (item.itemId == android.R.id.home) { val pickImageIntent = Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI)
onBackPressed() pickImageIntent.type = "image/*"
} //pickImageIntent.putExtra("crop", "true")
return super.onOptionsItemSelected(item) pickImageIntent.putExtra("outputX", 1290)
} pickImageIntent.putExtra("outputY", 720)
pickImageIntent.putExtra("aspectX", 16)
pickImageIntent.putExtra("aspectY", 9)
pickImageIntent.putExtra("scale", true)
//intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(
Intent.createChooser(pickImageIntent, "Select Picture"),
PICK_BANNER_REQUEST
)
}
private fun setupToolbar() { private fun pickNewPhoto() {
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary) val pickImageIntent = Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI)
applyToolbar(toolbar) pickImageIntent.type = "image/*"
appBarLayout.setBackgroundColor(primaryColor) pickImageIntent.putExtra("crop", "true")
} pickImageIntent.putExtra("outputX", 512)
pickImageIntent.putExtra("outputY", 512)
pickImageIntent.putExtra("aspectX", 1)
pickImageIntent.putExtra("aspectY", 1)
pickImageIntent.putExtra("scale", true)
startActivityForResult(
Intent.createChooser(pickImageIntent, "Select Picture"),
PICK_IMAGE_REQUEST
)
}
private fun showBannerOptions() { public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
MaterialDialog(this, BottomSheet(LayoutMode.WRAP_CONTENT)).show { super.onActivityResult(requestCode, resultCode, data)
title(R.string.select_banner_photo) if (resultCode == Activity.RESULT_OK && data != null) {
listItems( when (requestCode) {
items = listOf( PICK_IMAGE_REQUEST -> {
getString(R.string.new_banner_photo), try {
getString(R.string.remove_banner_photo) data.data?.let {
) val bitmap = getResizedBitmap(
) { _, position, _ -> getBitmap(contentResolver, it),
when (position) { PROFILE_ICON_SIZE
0 -> selectBannerImage() )
1 -> PreferenceUtil.getInstance(this@UserInfoActivity).setBannerImagePath("") val profileImagePath = saveToInternalStorage(bitmap, USER_PROFILE)
} PreferenceUtil.getInstance(this).saveProfileImage(profileImagePath)
} loadImageFromStorage(profileImagePath)
} }
}
private fun selectBannerImage() { } catch (e: IOException) {
e.printStackTrace()
}
}
PICK_BANNER_REQUEST -> {
try {
data.data?.let {
val bitmap = getBitmap(contentResolver, it)
val profileImagePath = saveToInternalStorage(bitmap, USER_BANNER)
PreferenceUtil.getInstance(this).setBannerImagePath(profileImagePath)
loadBannerFromStorage(profileImagePath)
}
} catch (e: IOException) {
e.printStackTrace()
}
}
}
}
}
if (TextUtils.isEmpty(PreferenceUtil.getInstance(this).bannerImage)) { private fun getImagePathFromUri(aUri: Uri?): String? {
val pickImageIntent = Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI) var imagePath: String? = null
pickImageIntent.type = "image/*" if (aUri == null) {
//pickImageIntent.putExtra("crop", "true") return imagePath
pickImageIntent.putExtra("outputX", 1290) }
pickImageIntent.putExtra("outputY", 720) if (DocumentsContract.isDocumentUri(App.getContext(), aUri)) {
pickImageIntent.putExtra("aspectX", 16) val documentId = DocumentsContract.getDocumentId(aUri)
pickImageIntent.putExtra("aspectY", 9) if ("com.android.providers.media.documents" == aUri.authority) {
pickImageIntent.putExtra("scale", true) val id = documentId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[1]
//intent.setAction(Intent.ACTION_GET_CONTENT); val selection = Media._ID + "=" + id
startActivityForResult( imagePath = getImagePath(Media.EXTERNAL_CONTENT_URI, selection)
Intent.createChooser(pickImageIntent, "Select Picture"), } else if ("com.android.providers.downloads.documents" == aUri.authority) {
PICK_BANNER_REQUEST val contentUri = ContentUris.withAppendedId(
) Uri.parse("content://downloads/public_downloads"),
} else { java.lang.Long.valueOf(documentId)
PreferenceUtil.getInstance(this).setBannerImagePath("") )
bannerImage.setImageResource(android.R.color.transparent) imagePath = getImagePath(contentUri, null)
} }
} } else if ("content".equals(aUri.scheme!!, ignoreCase = true)) {
imagePath = getImagePath(aUri, null)
} else if ("file".equals(aUri.scheme!!, ignoreCase = true)) {
imagePath = aUri.path
}
return imagePath
}
private fun pickNewPhoto() { private fun getImagePath(aUri: Uri, aSelection: String?): String? {
val pickImageIntent = Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI) var path: String? = null
pickImageIntent.type = "image/*" val cursor = App.getContext().contentResolver.query(aUri, null, aSelection, null, null)
pickImageIntent.putExtra("crop", "true") if (cursor != null) {
pickImageIntent.putExtra("outputX", 512) if (cursor.moveToFirst()) {
pickImageIntent.putExtra("outputY", 512) path = cursor.getString(cursor.getColumnIndex(Media.DATA))
pickImageIntent.putExtra("aspectX", 1) }
pickImageIntent.putExtra("aspectY", 1) cursor.close()
pickImageIntent.putExtra("scale", true) }
startActivityForResult( return path
Intent.createChooser(pickImageIntent, "Select Picture"), }
PICK_IMAGE_REQUEST
)
}
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { private fun loadBannerFromStorage(profileImagePath: String) {
super.onActivityResult(requestCode, resultCode, data) disposable.add(
if (resultCode == Activity.RESULT_OK && data != null) { Compressor(this).setQuality(100).setCompressFormat(Bitmap.CompressFormat.WEBP).compressToBitmapAsFlowable(
when (requestCode) { File(profileImagePath, USER_BANNER)
PICK_IMAGE_REQUEST -> { ).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(
try { { bitmap -> bannerImage.setImageBitmap(bitmap) },
data.data?.let { { t -> println() })
val bitmap = getResizedBitmap( )
getBitmap(contentResolver, it), }
PROFILE_ICON_SIZE
)
val profileImagePath = saveToInternalStorage(bitmap, USER_PROFILE)
PreferenceUtil.getInstance(this).saveProfileImage(profileImagePath)
loadImageFromStorage(profileImagePath)
}
} catch (e: IOException) { private fun loadImageFromStorage(path: String) {
e.printStackTrace() disposable.add(
} Compressor(this).setMaxHeight(300).setMaxWidth(300).setQuality(75).setCompressFormat(
} Bitmap.CompressFormat.WEBP
PICK_BANNER_REQUEST -> { ).compressToBitmapAsFlowable(
try { File(
data.data?.let { path,
val bitmap = getBitmap(contentResolver, it) USER_PROFILE
val profileImagePath = saveToInternalStorage(bitmap, USER_BANNER) )
PreferenceUtil.getInstance(this).setBannerImagePath(profileImagePath) ).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(
loadBannerFromStorage(profileImagePath) { bitmap -> userImage!!.setImageBitmap(bitmap) },
} { t -> println() })
} catch (e: IOException) { )
e.printStackTrace() }
}
}
}
}
}
private fun getImagePathFromUri(aUri: Uri?): String? { private fun saveToInternalStorage(bitmapImage: Bitmap, userBanner: String): String {
var imagePath: String? = null val cw = ContextWrapper(this)
if (aUri == null) { val directory = cw.getDir("imageDir", Context.MODE_PRIVATE)
return imagePath val myPath = File(directory, userBanner)
} var fos: FileOutputStream? = null
if (DocumentsContract.isDocumentUri(App.getContext(), aUri)) { try {
val documentId = DocumentsContract.getDocumentId(aUri) fos = FileOutputStream(myPath)
if ("com.android.providers.media.documents" == aUri.authority) { // Use the compress method on the BitMap object to write image to the OutputStream
val id = documentId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[1] bitmapImage.compress(Bitmap.CompressFormat.WEBP, 100, fos)
val selection = Media._ID + "=" + id } catch (e: Exception) {
imagePath = getImagePath(Media.EXTERNAL_CONTENT_URI, selection) e.printStackTrace()
} else if ("com.android.providers.downloads.documents" == aUri.authority) { } finally {
val contentUri = ContentUris.withAppendedId( try {
Uri.parse("content://downloads/public_downloads"), fos?.close()
java.lang.Long.valueOf(documentId) } catch (e: IOException) {
) e.printStackTrace()
imagePath = getImagePath(contentUri, null) }
} }
} else if ("content".equals(aUri.scheme!!, ignoreCase = true)) { return directory.absolutePath
imagePath = getImagePath(aUri, null) }
} else if ("file".equals(aUri.scheme!!, ignoreCase = true)) {
imagePath = aUri.path
}
return imagePath
}
private fun getImagePath(aUri: Uri, aSelection: String?): String? { companion object {
var path: String? = null
val cursor = App.getContext().contentResolver.query(aUri, null, aSelection, null, null)
if (cursor != null) {
if (cursor.moveToFirst()) {
path = cursor.getString(cursor.getColumnIndex(Media.DATA))
}
cursor.close()
}
return path
}
private fun loadBannerFromStorage(profileImagePath: String) { private const val PICK_IMAGE_REQUEST = 9002
disposable.add( private const val PICK_BANNER_REQUEST = 9004
Compressor(this).setQuality(100).setCompressFormat(Bitmap.CompressFormat.WEBP).compressToBitmapAsFlowable( private const val PROFILE_ICON_SIZE = 400
File(profileImagePath, USER_BANNER) }
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(
{ bitmap -> bannerImage.setImageBitmap(bitmap) },
{ t -> println() })
)
}
private fun loadImageFromStorage(path: String) {
disposable.add(
Compressor(this).setMaxHeight(300).setMaxWidth(300).setQuality(75).setCompressFormat(
Bitmap.CompressFormat.WEBP
).compressToBitmapAsFlowable(
File(
path,
USER_PROFILE
)
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(
{ bitmap -> userImage!!.setImageBitmap(bitmap) },
{ t -> println() })
)
}
private fun saveToInternalStorage(bitmapImage: Bitmap, userBanner: String): String {
val cw = ContextWrapper(this)
val directory = cw.getDir("imageDir", Context.MODE_PRIVATE)
val myPath = File(directory, userBanner)
var fos: FileOutputStream? = null
try {
fos = FileOutputStream(myPath)
// Use the compress method on the BitMap object to write image to the OutputStream
bitmapImage.compress(Bitmap.CompressFormat.WEBP, 100, fos)
} catch (e: Exception) {
e.printStackTrace()
} finally {
try {
fos?.close()
} catch (e: IOException) {
e.printStackTrace()
}
}
return directory.absolutePath
}
companion object {
private const val PICK_IMAGE_REQUEST = 9002
private const val PICK_BANNER_REQUEST = 9004
private const val PROFILE_ICON_SIZE = 400
}
} }
fun Activity.pickImage(requestCode: Int) { fun Activity.pickImage(requestCode: Int) {
Intent(Intent.ACTION_GET_CONTENT).apply { Intent(Intent.ACTION_GET_CONTENT).apply {
addCategory(Intent.CATEGORY_OPENABLE) addCategory(Intent.CATEGORY_OPENABLE)
type = "image/*" type = "image/*"
startActivityForResult(this, requestCode) startActivityForResult(this, requestCode)
} }
} }

View file

@ -60,7 +60,7 @@ public class WhatsNewActivity extends AbsBaseActivity {
toolbar = findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
appBarLayout = findViewById(R.id.appBarLayout); appBarLayout = findViewById(R.id.appBarLayout);
int primaryColor = INSTANCE.resolveColor(this, R.attr.colorPrimary); int primaryColor = INSTANCE.resolveColor(this, R.attr.colorSurface);
toolbar.setBackgroundColor(primaryColor); toolbar.setBackgroundColor(primaryColor);
appBarLayout.setBackgroundColor(primaryColor); appBarLayout.setBackgroundColor(primaryColor);
//setSupportActionBar(toolbar); //setSupportActionBar(toolbar);
@ -79,11 +79,10 @@ public class WhatsNewActivity extends AbsBaseActivity {
// Inject color values for WebView body background and links // Inject color values for WebView body background and links
final boolean isDark = INSTANCE.isWindowBackgroundDark(this); final boolean isDark = INSTANCE.isWindowBackgroundDark(this);
final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, R.attr.colorPrimary, Color.parseColor(isDark ? "#424242" : "#ffffff"))); final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, android.R.attr.windowBackground, Color.parseColor(isDark ? "#424242" : "#ffffff")));
final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000"));
final String changeLog = buf.toString() final String changeLog = buf.toString()
.replace("{style-placeholder}", .replace("{style-placeholder}", String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor))
String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor))
.replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this))) .replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this)))
.replace("{link-color-active}", colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); .replace("{link-color-active}", colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this))));

View file

@ -1,7 +1,6 @@
package code.name.monkey.retromusic.activities.base package code.name.monkey.retromusic.activities.base
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.graphics.Color import android.graphics.Color
import android.graphics.Rect import android.graphics.Rect
import android.os.Bundle import android.os.Bundle
@ -35,6 +34,7 @@ import code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment
import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment
import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.model.CategoryInfo
import code.name.monkey.retromusic.util.DensityUtil import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.BottomNavigationBarTinted import code.name.monkey.retromusic.views.BottomNavigationBarTinted
@ -114,13 +114,11 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList) bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList)
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case if (navigationBarColorAnimator != null) navigationBarColorAnimator?.cancel() // just in case
} }
protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View { protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View {
@SuppressLint("InflateParams") val slidingMusicPanelLayout = layoutInflater.inflate( val slidingMusicPanelLayout = layoutInflater.inflate(R.layout.sliding_music_panel_layout, null)
R.layout.sliding_music_panel_layout, null
)
val contentContainer = slidingMusicPanelLayout.findViewById<ViewGroup>(R.id.mainContentFrame) val contentContainer = slidingMusicPanelLayout.findViewById<ViewGroup>(R.id.mainContentFrame)
layoutInflater.inflate(resId, contentContainer) layoutInflater.inflate(resId, contentContainer)
return slidingMusicPanelLayout return slidingMusicPanelLayout
@ -143,7 +141,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE
bottomNavigationView.translationY = progress * 500 bottomNavigationView.translationY = progress * 500
bottomNavigationView.alpha = alpha //bottomNavigationView.alpha = alpha
} }
open fun onPanelCollapsed() { open fun onPanelCollapsed() {
@ -296,13 +294,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
super.setLightNavigationBar(isColorLight) super.setLightNavigationBar(isColorLight)
super.setLightStatusbar(isColorLight) super.setLightStatusbar(isColorLight)
} else { } else {
super.setLightStatusbar( super.setLightStatusbar(ColorUtil.isColorLight(ATHUtil.resolveColor(this, android.R.attr.windowBackground)))
ColorUtil.isColorLight(
ATHUtil.resolveColor(
this, R.attr.colorPrimary
)
)
)
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
} }
} }
@ -339,15 +331,16 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
private fun updateTabs() { private fun updateTabs() {
bottomNavigationView.menu.clear() bottomNavigationView.menu.clear()
val currentTabs = PreferenceUtil.getInstance(this).libraryCategoryInfos val currentTabs: List<CategoryInfo> = PreferenceUtil.getInstance(this).libraryCategoryInfos
for (tab in currentTabs) { for (tab in currentTabs) {
if (tab.visible) { if (tab.visible) {
val menu = tab.category val menu = tab.category
bottomNavigationView.menu.add( bottomNavigationView.menu.add(0, menu.id, 0, menu.stringRes).setIcon(menu.icon)
0, menu.id, 0, menu.stringRes
).setIcon(menu.icon)
} }
} }
if (currentTabs.size <= 1) {
toggleBottomNavigationView(true)
}
} }
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean { override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {

View file

@ -91,11 +91,7 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
if (statusBar != null) { if (statusBar != null) {
when { when {
VersionUtils.hasMarshmallow() -> window.statusBarColor = color VersionUtils.hasMarshmallow() -> window.statusBarColor = color
VersionUtils.hasLollipop() -> statusBar.setBackgroundColor( VersionUtils.hasLollipop() -> statusBar.setBackgroundColor(ColorUtil.darkenColor(color))
ColorUtil.darkenColor(
color
)
)
else -> statusBar.setBackgroundColor(color) else -> statusBar.setBackgroundColor(color)
} }
} else { } else {
@ -104,12 +100,13 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
else -> window.statusBarColor = ColorUtil.darkenColor(color) else -> window.statusBarColor = ColorUtil.darkenColor(color)
} }
} }
setLightStatusbarAuto(color) setLightStatusbarAuto(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} }
fun setStatusbarColorAuto() { fun setStatusbarColorAuto() {
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat // we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
//setStatusbarColor(ATHUtil.resolveColor(this, android.R.attr.windowBackground)) //setStatusbarColor(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
setLightStatusbarAuto(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} }
open fun setTaskDescriptionColor(@ColorInt color: Int) { open fun setTaskDescriptionColor(@ColorInt color: Int) {
@ -117,7 +114,7 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
} }
fun setTaskDescriptionColorAuto() { fun setTaskDescriptionColorAuto() {
setTaskDescriptionColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) setTaskDescriptionColor(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} }
open fun setNavigationbarColor(color: Int) { open fun setNavigationbarColor(color: Int) {
@ -129,11 +126,11 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
} }
open fun setNavigationBarColorPrimary() { open fun setNavigationBarColorPrimary() {
ATH.setNavigationbarColor(this, ATHUtil.resolveColor(this, R.attr.colorPrimary)) ATH.setNavigationbarColor(this, ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} }
fun setNavigationbarColorAuto() { fun setNavigationbarColorAuto() {
setNavigationbarColor(ATHUtil.resolveColor(this, R.attr.colorSecondary)) setNavigationbarColor(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} }
open fun setLightStatusbar(enabled: Boolean) { open fun setLightStatusbar(enabled: Boolean) {

View file

@ -1,21 +1,32 @@
package code.name.monkey.retromusic.activities.bugreport package code.name.monkey.retromusic.activities.bugreport
import android.app.* import android.app.Activity
import android.content.* import android.app.Dialog
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.MenuItem import android.view.MenuItem
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.Toast import android.widget.Toast
import androidx.annotation.* import androidx.annotation.StringDef
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsThemeActivity import code.name.monkey.retromusic.activities.base.AbsThemeActivity
import code.name.monkey.retromusic.activities.bugreport.model.* import code.name.monkey.retromusic.activities.bugreport.model.DeviceInfo
import code.name.monkey.retromusic.activities.bugreport.model.github.* import code.name.monkey.retromusic.activities.bugreport.model.Report
import code.name.monkey.retromusic.activities.bugreport.model.github.ExtraInfo
import code.name.monkey.retromusic.activities.bugreport.model.github.GithubLogin
import code.name.monkey.retromusic.activities.bugreport.model.github.GithubTarget
import code.name.monkey.retromusic.misc.DialogAsyncTask import code.name.monkey.retromusic.misc.DialogAsyncTask
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.callbacks.onCancel import com.afollestad.materialdialogs.callbacks.onCancel
@ -25,7 +36,8 @@ import kotlinx.android.synthetic.main.activity_bug_report.*
import kotlinx.android.synthetic.main.bug_report_card_device_info.* import kotlinx.android.synthetic.main.bug_report_card_device_info.*
import kotlinx.android.synthetic.main.bug_report_card_report.* import kotlinx.android.synthetic.main.bug_report_card_report.*
import org.eclipse.egit.github.core.Issue import org.eclipse.egit.github.core.Issue
import org.eclipse.egit.github.core.client.* import org.eclipse.egit.github.core.client.GitHubClient
import org.eclipse.egit.github.core.client.RequestException
import org.eclipse.egit.github.core.service.IssueService import org.eclipse.egit.github.core.service.IssueService
import java.io.IOException import java.io.IOException
@ -52,7 +64,6 @@ open class BugReportActivity : AbsThemeActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_bug_report) setContentView(R.layout.activity_bug_report)
setStatusbarColorAuto() setStatusbarColorAuto()
setNavigationbarColorAuto() setNavigationbarColorAuto()
setTaskDescriptionColorAuto() setTaskDescriptionColorAuto()
@ -67,7 +78,7 @@ open class BugReportActivity : AbsThemeActivity() {
private fun initViews() { private fun initViews() {
val accentColor = ThemeStore.accentColor(this) val accentColor = ThemeStore.accentColor(this)
val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary) val primaryColor = ATHUtil.resolveColor(this, R.attr.colorSurface)
toolbar.setBackgroundColor(primaryColor) toolbar.setBackgroundColor(primaryColor)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar)

View file

@ -48,44 +48,23 @@ class HomeAdapter(
when (getItemViewType(position)) { when (getItemViewType(position)) {
RECENT_ALBUMS -> { RECENT_ALBUMS -> {
val viewHolder = holder as AlbumViewHolder val viewHolder = holder as AlbumViewHolder
viewHolder.bindView( viewHolder.bindView(list[position].arrayList.toAlbums(), R.string.recent_albums)
list[position].arrayList.toAlbums(),
R.string.recent_albums,
R.string.recent_added_albums
)
} }
TOP_ALBUMS -> { TOP_ALBUMS -> {
val viewHolder = holder as AlbumViewHolder val viewHolder = holder as AlbumViewHolder
viewHolder.bindView( viewHolder.bindView(list[position].arrayList.toAlbums(), R.string.top_albums)
list[position].arrayList.toAlbums(),
R.string.top_albums,
R.string.most_played_albums
)
} }
RECENT_ARTISTS -> { RECENT_ARTISTS -> {
val viewHolder = holder as ArtistViewHolder val viewHolder = holder as ArtistViewHolder
viewHolder.bindView( viewHolder.bindView(list[position].arrayList.toArtists(), R.string.recent_artists)
list[position].arrayList.toArtists(),
R.string.recent_artists,
R.string.recent_added_artists
)
} }
TOP_ARTISTS -> { TOP_ARTISTS -> {
val viewHolder = holder as ArtistViewHolder val viewHolder = holder as ArtistViewHolder
viewHolder.bindView(list[position].arrayList.toArtists(), R.string.top_artists)
viewHolder.bindView(
list[position].arrayList.toArtists(),
R.string.top_artists,
R.string.most_played_artists
)
} }
PLAYLISTS -> { PLAYLISTS -> {
val viewHolder = holder as PlaylistViewHolder val viewHolder = holder as PlaylistViewHolder
viewHolder.bindView( viewHolder.bindView(list[position].arrayList.toPlaylist(), R.string.favorites)
list[position].arrayList.toPlaylist(),
R.string.favorites,
R.string.favorites_songs
)
} }
} }
} }
@ -114,7 +93,7 @@ class HomeAdapter(
} }
private inner class AlbumViewHolder(view: View) : AbsHomeViewItem(view) { private inner class AlbumViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(list: ArrayList<Album>, titleRes: Int, subtitleRes: Int) { fun bindView(list: ArrayList<Album>, titleRes: Int) {
if (list.isNotEmpty()) { if (list.isNotEmpty()) {
recyclerView.apply { recyclerView.apply {
show() show()
@ -126,7 +105,7 @@ class HomeAdapter(
} }
inner class ArtistViewHolder(view: View) : AbsHomeViewItem(view) { inner class ArtistViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(list: ArrayList<Artist>, titleRes: Int, subtitleRes: Int) { fun bindView(list: ArrayList<Artist>, titleRes: Int) {
if (list.isNotEmpty()) { if (list.isNotEmpty()) {
recyclerView.apply { recyclerView.apply {
show() show()
@ -148,7 +127,7 @@ class HomeAdapter(
} }
private inner class PlaylistViewHolder(view: View) : AbsHomeViewItem(view) { private inner class PlaylistViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(arrayList: ArrayList<Playlist>, titleRes: Int, subtitleRes: Int) { fun bindView(arrayList: ArrayList<Playlist>, titleRes: Int) {
if (arrayList.isNotEmpty()) { if (arrayList.isNotEmpty()) {
val songs = PlaylistSongsLoader.getPlaylistSongList(activity, arrayList[0]) val songs = PlaylistSongsLoader.getPlaylistSongList(activity, arrayList[0])
if (songs.isNotEmpty()) { if (songs.isNotEmpty()) {

View file

@ -93,7 +93,7 @@ public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements Vie
playSongs = itemView.findViewById(R.id.playSongs); playSongs = itemView.findViewById(R.id.playSongs);
if (imageContainerCard != null) { if (imageContainerCard != null) {
imageContainerCard.setCardBackgroundColor(ATHUtil.INSTANCE.resolveColor(itemView.getContext(), R.attr.colorPrimary)); imageContainerCard.setCardBackgroundColor(ATHUtil.INSTANCE.resolveColor(itemView.getContext(), R.attr.colorSurface));
} }
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this); itemView.setOnLongClickListener(this);

View file

@ -1,222 +1,216 @@
package code.name.monkey.retromusic.adapter.playlist package code.name.monkey.retromusic.adapter.playlist
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.* import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.adapter.base.* import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
import code.name.monkey.retromusic.dialogs.* import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
import code.name.monkey.retromusic.helper.menu.* import code.name.monkey.retromusic.dialogs.ClearSmartPlaylistDialog
import code.name.monkey.retromusic.dialogs.DeletePlaylistDialog
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader import code.name.monkey.retromusic.loaders.PlaylistSongsLoader
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.AbsCustomPlaylist
import code.name.monkey.retromusic.model.smartplaylist.* import code.name.monkey.retromusic.model.Playlist
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.NavigationUtil
import java.util.* import java.util.*
class PlaylistAdapter( class PlaylistAdapter(
private val activity: AppCompatActivity, private val activity: AppCompatActivity,
var dataSet: ArrayList<Playlist>, var dataSet: ArrayList<Playlist>,
private var itemLayoutRes: Int, private var itemLayoutRes: Int,
cabHolder: CabHolder? cabHolder: CabHolder?
) : AbsMultiSelectAdapter<PlaylistAdapter.ViewHolder, Playlist>( ) : AbsMultiSelectAdapter<PlaylistAdapter.ViewHolder, Playlist>(
activity, activity,
cabHolder, cabHolder,
R.menu.menu_playlists_selection R.menu.menu_playlists_selection
) { ) {
var songs = ArrayList<Song>() var songs = ArrayList<Song>()
init { init {
setHasStableIds(true) setHasStableIds(true)
} }
fun swapDataSet(dataSet: ArrayList<Playlist>) { fun swapDataSet(dataSet: ArrayList<Playlist>) {
this.dataSet = dataSet this.dataSet = dataSet
notifyDataSetChanged() notifyDataSetChanged()
} }
override fun getItemId(position: Int): Long { override fun getItemId(position: Int): Long {
return dataSet[position].id.toLong() return dataSet[position].id.toLong()
} }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false) val view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false)
return createViewHolder(view) return createViewHolder(view)
} }
protected fun createViewHolder(view: View): ViewHolder { protected fun createViewHolder(view: View): ViewHolder {
return ViewHolder(view) return ViewHolder(view)
} }
protected fun getPlaylistTitle(playlist: Playlist): String { protected fun getPlaylistTitle(playlist: Playlist): String {
return playlist.name return playlist.name
} }
protected fun getPlaylistText(playlist: Playlist): String { protected fun getPlaylistText(playlist: Playlist): String {
return MusicUtil.getPlaylistInfoString(activity, getSongs(playlist)) return MusicUtil.getPlaylistInfoString(activity, getSongs(playlist))
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val playlist = dataSet[position] val playlist = dataSet[position]
holder.itemView.isActivated = isChecked(playlist) holder.itemView.isActivated = isChecked(playlist)
holder.title?.text = getPlaylistTitle(playlist) holder.title?.text = getPlaylistTitle(playlist)
holder.text?.text = getPlaylistText(playlist) holder.text?.text = getPlaylistText(playlist)
holder.image?.setImageDrawable(getIconRes(playlist)) holder.image?.setImageDrawable(getIconRes(playlist))
} }
private fun getIconRes(playlist: Playlist): Drawable { private fun getIconRes(playlist: Playlist): Drawable {
if (playlist is AbsSmartPlaylist) { return if (MusicUtil.isFavoritePlaylist(activity, playlist))
return TintHelper.createTintedDrawable( TintHelper.createTintedDrawable(activity, R.drawable.ic_favorite_white_24dp, ThemeStore.accentColor(activity))!!
activity, else TintHelper.createTintedDrawable(activity, R.drawable.ic_playlist_play_white_24dp, ATHUtil.resolveColor(activity, R.attr.colorControlNormal))!!
playlist.iconRes, }
ATHUtil.resolveColor(activity, R.attr.iconColor)
)!!
}
return if (MusicUtil.isFavoritePlaylist(
activity,
playlist
)) TintHelper.createTintedDrawable(
activity,
R.drawable.ic_favorite_white_24dp,
ThemeStore.accentColor(activity)
)!!
else TintHelper.createTintedDrawable(
activity,
R.drawable.ic_playlist_play_white_24dp,
ATHUtil.resolveColor(activity, R.attr.iconColor)
)!!
}
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int): Int {
return if (dataSet[position] is AbsSmartPlaylist) SMART_PLAYLIST else DEFAULT_PLAYLIST return if (dataSet[position] is AbsSmartPlaylist) SMART_PLAYLIST else DEFAULT_PLAYLIST
} }
override fun getItemCount(): Int { override fun getItemCount(): Int {
return dataSet.size return dataSet.size
} }
override fun getIdentifier(position: Int): Playlist? { override fun getIdentifier(position: Int): Playlist? {
return dataSet[position] return dataSet[position]
} }
override fun getName(playlist: Playlist): String { override fun getName(playlist: Playlist): String {
return playlist.name return playlist.name
} }
override fun onMultipleItemAction(menuItem: MenuItem, selection: ArrayList<Playlist>) { override fun onMultipleItemAction(menuItem: MenuItem, selection: ArrayList<Playlist>) {
when (menuItem.itemId) { when (menuItem.itemId) {
R.id.action_delete_playlist -> { R.id.action_delete_playlist -> {
var i = 0 var i = 0
while (i < selection.size) { while (i < selection.size) {
val playlist = selection[i] val playlist = selection[i]
if (playlist is AbsSmartPlaylist) { if (playlist is AbsSmartPlaylist) {
ClearSmartPlaylistDialog.create(playlist).show( ClearSmartPlaylistDialog.create(playlist).show(
activity.supportFragmentManager, "CLEAR_PLAYLIST_" + playlist.name activity.supportFragmentManager, "CLEAR_PLAYLIST_" + playlist.name
) )
selection.remove(playlist) selection.remove(playlist)
i-- i--
} }
i++ i++
} }
if (selection.size > 0) { if (selection.size > 0) {
DeletePlaylistDialog.create(selection) DeletePlaylistDialog.create(selection)
.show(activity.supportFragmentManager, "DELETE_PLAYLIST") .show(activity.supportFragmentManager, "DELETE_PLAYLIST")
} }
} }
else -> SongsMenuHelper.handleMenuClick( else -> SongsMenuHelper.handleMenuClick(
activity, activity,
getSongList(selection), getSongList(selection),
menuItem.itemId menuItem.itemId
) )
} }
} }
private fun getSongList(playlists: List<Playlist>): ArrayList<Song> { private fun getSongList(playlists: List<Playlist>): ArrayList<Song> {
val songs = ArrayList<Song>() val songs = ArrayList<Song>()
for (playlist in playlists) { for (playlist in playlists) {
if (playlist is AbsCustomPlaylist) { if (playlist is AbsCustomPlaylist) {
songs.addAll(playlist.getSongs(activity)) songs.addAll(playlist.getSongs(activity))
} else { } else {
songs.addAll(PlaylistSongsLoader.getPlaylistSongList(activity, playlist.id)) songs.addAll(PlaylistSongsLoader.getPlaylistSongList(activity, playlist.id))
} }
} }
return songs return songs
} }
private fun getSongs(playlist: Playlist): ArrayList<Song> { private fun getSongs(playlist: Playlist): ArrayList<Song> {
val songs = ArrayList<Song>() val songs = ArrayList<Song>()
if (playlist is AbsSmartPlaylist) { if (playlist is AbsSmartPlaylist) {
songs.addAll(playlist.getSongs(activity)) songs.addAll(playlist.getSongs(activity))
} else { } else {
songs.addAll(PlaylistSongsLoader.getPlaylistSongList(activity, playlist.id)) songs.addAll(PlaylistSongsLoader.getPlaylistSongList(activity, playlist.id))
} }
return songs return songs
} }
inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) { inner class ViewHolder(itemView: View) : MediaEntryViewHolder(itemView) {
init { init {
image?.apply { image?.apply {
val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding) val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding)
setPadding(iconPadding, iconPadding, iconPadding, iconPadding) setPadding(iconPadding, iconPadding, iconPadding, iconPadding)
//setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN) //setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN)
} }
menu?.setOnClickListener { view -> menu?.setOnClickListener { view ->
val playlist = dataSet[adapterPosition] val playlist = dataSet[adapterPosition]
val popupMenu = PopupMenu(activity, view) val popupMenu = PopupMenu(activity, view)
popupMenu.inflate( popupMenu.inflate(
if (itemViewType == SMART_PLAYLIST) R.menu.menu_item_smart_playlist if (itemViewType == SMART_PLAYLIST) R.menu.menu_item_smart_playlist
else R.menu.menu_item_playlist else R.menu.menu_item_playlist
) )
if (playlist is LastAddedPlaylist) { if (playlist is LastAddedPlaylist) {
popupMenu.menu.findItem(R.id.action_clear_playlist).isVisible = false popupMenu.menu.findItem(R.id.action_clear_playlist).isVisible = false
} }
popupMenu.setOnMenuItemClickListener { item -> popupMenu.setOnMenuItemClickListener { item ->
if (item.itemId == R.id.action_clear_playlist) { if (item.itemId == R.id.action_clear_playlist) {
if (playlist is AbsSmartPlaylist) { if (playlist is AbsSmartPlaylist) {
ClearSmartPlaylistDialog.create(playlist).show( ClearSmartPlaylistDialog.create(playlist).show(
activity.supportFragmentManager, activity.supportFragmentManager,
"CLEAR_SMART_PLAYLIST_" + playlist.name "CLEAR_SMART_PLAYLIST_" + playlist.name
) )
return@setOnMenuItemClickListener true return@setOnMenuItemClickListener true
} }
} }
PlaylistMenuHelper.handleMenuClick( PlaylistMenuHelper.handleMenuClick(
activity, dataSet[adapterPosition], item activity, dataSet[adapterPosition], item
) )
} }
popupMenu.show() popupMenu.show()
} }
imageTextContainer?.apply { imageTextContainer?.apply {
cardElevation = 0f cardElevation = 0f
setCardBackgroundColor(ATHUtil.resolveColor(activity, R.attr.colorPrimary)) setCardBackgroundColor(ATHUtil.resolveColor(activity, R.attr.colorSurface))
} }
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (isInQuickSelectMode) { if (isInQuickSelectMode) {
toggleChecked(adapterPosition) toggleChecked(adapterPosition)
} else { } else {
val playlist = dataSet[adapterPosition] val playlist = dataSet[adapterPosition]
NavigationUtil.goToPlaylistNew(activity, playlist) NavigationUtil.goToPlaylistNew(activity, playlist)
} }
} }
override fun onLongClick(v: View?): Boolean { override fun onLongClick(v: View?): Boolean {
toggleChecked(adapterPosition) toggleChecked(adapterPosition)
return true return true
} }
} }
companion object { companion object {
val TAG: String = PlaylistAdapter::class.java.simpleName val TAG: String = PlaylistAdapter::class.java.simpleName
private const val SMART_PLAYLIST = 0 private const val SMART_PLAYLIST = 0
private const val DEFAULT_PLAYLIST = 1 private const val DEFAULT_PLAYLIST = 1
} }
} }

View file

@ -1,18 +1,14 @@
package code.name.monkey.retromusic.adapter.song package code.name.monkey.retromusic.adapter.song
import android.app.ActivityOptions import android.app.ActivityOptions
import android.content.res.ColorStateList
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.RetroColorUtil
import com.google.android.material.button.MaterialButton import com.google.android.material.button.MaterialButton
import java.util.* import java.util.*
@ -33,30 +29,18 @@ open class PlaylistSongAdapter(
} }
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) { override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
if (holder.itemViewType == OFFSET_ITEM) { if (holder.itemViewType == OFFSET_ITEM) {
val buttonColor = RetroColorUtil.toolbarColor(activity)
val textColor = MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(buttonColor))
val viewHolder = holder as ViewHolder val viewHolder = holder as ViewHolder
viewHolder.playAction?.let { viewHolder.playAction?.let {
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
it.setTextColor(textColor)
it.iconTint = ColorStateList.valueOf(textColor)
it.setOnClickListener { it.setOnClickListener {
MusicPlayerRemote.openQueue(dataSet, 0, true) MusicPlayerRemote.openQueue(dataSet, 0, true)
} }
} }
viewHolder.shuffleAction?.let { viewHolder.shuffleAction?.let {
it.backgroundTintList = ColorStateList.valueOf(buttonColor)
it.setTextColor(textColor)
it.iconTint = ColorStateList.valueOf(textColor)
it.setOnClickListener { it.setOnClickListener {
MusicPlayerRemote.openAndShuffleQueue(dataSet, true) MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
} }
} }
} else { } else {
super.onBindViewHolder(holder, position - 1) super.onBindViewHolder(holder, position - 1)
} }

View file

@ -14,6 +14,7 @@
package code.name.monkey.retromusic.extensions package code.name.monkey.retromusic.extensions
import android.content.res.ColorStateList
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
@ -25,7 +26,7 @@ fun AppCompatActivity.applyToolbar(toolbar: Toolbar) {
setNavigationOnClickListener { onBackPressed() } setNavigationOnClickListener { onBackPressed() }
setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar)
setBackgroundColor(ATHUtil.resolveColor(this@applyToolbar, R.attr.colorPrimary)) backgroundTintList = ColorStateList.valueOf(ATHUtil.resolveColor(this@applyToolbar, R.attr.colorSurface))
} }
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
} }

View file

@ -14,8 +14,16 @@
package code.name.monkey.retromusic.extensions package code.name.monkey.retromusic.extensions
import android.content.Context
import android.graphics.Color
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.retromusic.R
fun Int.ripAlpha(): Int { fun Int.ripAlpha(): Int {
return ColorUtil.stripAlpha(this) return ColorUtil.stripAlpha(this)
}
fun Any.surfaceColor(context: Context): Int {
return ATHUtil.resolveColor(context, R.attr.colorSurface, Color.WHITE)
} }

View file

@ -2,6 +2,7 @@ package code.name.monkey.retromusic.fragments.mainactivity;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityOptions; import android.app.ActivityOptions;
import android.content.res.ColorStateList;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -140,7 +141,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
private void setupToolbar() { private void setupToolbar() {
toolbar.setBackgroundColor(RetroColorUtil.toolbarColor(getMainActivity())); toolbar.setBackgroundTintList(ColorStateList.valueOf(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorSurface)));
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
toolbar.setOnClickListener(v -> { toolbar.setOnClickListener(v -> {
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(getMainActivity(), toolbarContainer, getString(R.string.transition_toolbar)); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(getMainActivity(), toolbarContainer, getString(R.string.transition_toolbar));

View file

@ -72,15 +72,13 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setStatusBarColorAuto(view)
toolbar = view.findViewById(R.id.toolbar) toolbar = view.findViewById(R.id.toolbar)
bannerImage?.setOnClickListener { bannerImage?.setOnClickListener {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, userImage, getString(R.string.transition_user_image)) val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, userImage, getString(R.string.transition_user_image))
NavigationUtil.goToUserInfo(requireActivity(), options) NavigationUtil.goToUserInfo(requireActivity(), options)
} }
if (!PreferenceUtil.getInstance(requireContext()).isHomeBanner)
setStatusBarColorAuto(view)
lastAdded.setOnClickListener { lastAdded.setOnClickListener {
NavigationUtil.goToPlaylistNew(requireActivity(), LastAddedPlaylist(requireActivity())) NavigationUtil.goToPlaylistNew(requireActivity(), LastAddedPlaylist(requireActivity()))
@ -127,7 +125,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private fun setupToolbar() { private fun setupToolbar() {
toolbar.apply { toolbar.apply {
setBackgroundColor(toolbarColor()) setBackgroundColor(RetroColorUtil.toolbarColor(mainActivity))
setNavigationIcon(R.drawable.ic_menu_white_24dp) setNavigationIcon(R.drawable.ic_menu_white_24dp)
setOnClickListener { setOnClickListener {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, toolbarContainer, getString(R.string.transition_toolbar)) val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, toolbarContainer, getString(R.string.transition_toolbar))

View file

@ -63,7 +63,7 @@ abstract class AbsSettingsFragment : ATEPreferenceFragmentCompat() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setDivider(ColorDrawable(Color.TRANSPARENT)) setDivider(ColorDrawable(Color.TRANSPARENT))
listView.setBackgroundColor(ATHUtil.resolveColor(requireContext(), R.attr.colorPrimary)) listView.setBackgroundColor(ATHUtil.resolveColor(requireContext(), R.attr.colorSurface))
listView.overScrollMode = View.OVER_SCROLL_NEVER listView.overScrollMode = View.OVER_SCROLL_NEVER
listView.setPadding(0, 0, 0, 0) listView.setPadding(0, 0, 0, 0)
listView.setPaddingRelative(0, 0, 0, 0) listView.setPaddingRelative(0, 0, 0, 0)

View file

@ -63,7 +63,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
aboutSettings.setOnClickListener(this) aboutSettings.setOnClickListener(this)
buyProContainer.apply { buyProContainer.apply {
if (!App.isProVersion()) show() else hide() if (App.isProVersion()) show() else hide()
setOnClickListener { setOnClickListener {
NavigationUtil.goToProVersion(requireContext()) NavigationUtil.goToProVersion(requireContext())
} }

View file

@ -30,8 +30,6 @@ class OtherSettingsFragment : AbsSettingsFragment() {
} }
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_blacklist)
addPreferencesFromResource(R.xml.pref_playlists)
addPreferencesFromResource(R.xml.pref_advanced) addPreferencesFromResource(R.xml.pref_advanced)
} }

View file

@ -36,7 +36,6 @@ class PersonalizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnS
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_ui) addPreferencesFromResource(R.xml.pref_ui)
addPreferencesFromResource(R.xml.pref_lockscreen)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View file

@ -20,7 +20,6 @@ import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.HomeSection
class Home(val priority: Int, class Home(val priority: Int,
@StringRes val title: Int, @StringRes val title: Int,
@StringRes val subTitle: Int,
val arrayList: ArrayList<*>, val arrayList: ArrayList<*>,
@HomeSection @HomeSection
val homeSection: Int, val homeSection: Int,

View file

@ -144,7 +144,6 @@ class RepositoryImpl(private val context: Context) : Repository {
} else { } else {
Success(Home(0, Success(Home(0,
R.string.recent_artists, R.string.recent_artists,
R.string.recent_added_artists,
artists, artists,
HomeAdapter.RECENT_ARTISTS, HomeAdapter.RECENT_ARTISTS,
R.drawable.ic_artist_white_24dp)) R.drawable.ic_artist_white_24dp))
@ -162,7 +161,6 @@ class RepositoryImpl(private val context: Context) : Repository {
} else { } else {
Success(Home(1, Success(Home(1,
R.string.recent_albums, R.string.recent_albums,
R.string.recent_added_albums,
albums, albums,
HomeAdapter.RECENT_ALBUMS, HomeAdapter.RECENT_ALBUMS,
R.drawable.ic_album_white_24dp R.drawable.ic_album_white_24dp
@ -181,7 +179,6 @@ class RepositoryImpl(private val context: Context) : Repository {
} else { } else {
Success(Home(3, Success(Home(3,
R.string.top_albums, R.string.top_albums,
R.string.most_played_albums,
albums, albums,
HomeAdapter.TOP_ALBUMS, HomeAdapter.TOP_ALBUMS,
R.drawable.ic_album_white_24dp R.drawable.ic_album_white_24dp
@ -201,7 +198,6 @@ class RepositoryImpl(private val context: Context) : Repository {
} else { } else {
Success(Home(2, Success(Home(2,
R.string.top_artists, R.string.top_artists,
R.string.most_played_artists,
artists, artists,
HomeAdapter.TOP_ARTISTS, HomeAdapter.TOP_ARTISTS,
R.drawable.ic_artist_white_24dp R.drawable.ic_artist_white_24dp
@ -220,7 +216,6 @@ class RepositoryImpl(private val context: Context) : Repository {
} else { } else {
Success(Home(4, Success(Home(4,
R.string.favorites, R.string.favorites,
R.string.favorites_songs,
playlists, playlists,
HomeAdapter.PLAYLISTS, HomeAdapter.PLAYLISTS,
R.drawable.ic_favorite_white_24dp R.drawable.ic_favorite_white_24dp

View file

@ -38,12 +38,13 @@ public class RetroColorUtil {
float[] hsv = new float[3]; float[] hsv = new float[3];
Color.colorToHSV(color, hsv); Color.colorToHSV(color, hsv);
hsv[1] = ( hsv[1] / 1 * ratio ) + ( 0.2f * (1.0f - ratio) ); hsv[1] = (hsv[1] / 1 * ratio) + (0.2f * (1.0f - ratio));
return Color.HSVToColor(hsv); return Color.HSVToColor(hsv);
} }
public static int toolbarColor(@NonNull Context context) { public static int toolbarColor(@NonNull Context context) {
return ATHUtil.INSTANCE.resolveColor(context, R.attr.colorSurface); return ATHUtil.INSTANCE.resolveColor(context, R.attr.colorButtonNormal);
} }
@Nullable @Nullable

View file

@ -38,12 +38,14 @@ class BottomNavigationBarTinted @JvmOverloads constructor(
labelVisibilityMode = PreferenceUtil.getInstance(context).tabTitleMode labelVisibilityMode = PreferenceUtil.getInstance(context).tabTitleMode
selectedItemId = PreferenceUtil.getInstance(context).lastPage selectedItemId = PreferenceUtil.getInstance(context).lastPage
val iconColor = ATHUtil.resolveColor(context, R.attr.iconColor) val iconColor = ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
val accentColor = ThemeStore.accentColor(context) val accentColor = ThemeStore.accentColor(context)
NavigationViewUtil.setItemIconColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor) NavigationViewUtil.setItemIconColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor)
NavigationViewUtil.setItemTextColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor) NavigationViewUtil.setItemTextColors(this, ColorUtil.withAlpha(iconColor, 0.5f), accentColor)
itemBackground = RippleDrawable(RippleUtils.convertToRippleDrawableColor(ColorStateList.valueOf(ThemeStore.accentColor(context).addAlpha())), ContextCompat.getDrawable(context, R.drawable.bottom_navigation_item_background), null) itemBackground = RippleDrawable(RippleUtils.convertToRippleDrawableColor(ColorStateList.valueOf(ThemeStore.accentColor(context).addAlpha())), ContextCompat.getDrawable(context, R.drawable.bottom_navigation_item_background), null)
setOnApplyWindowInsetsListener(null) setOnApplyWindowInsetsListener(null)
//itemRippleColor = ColorStateList.valueOf(accentColor)
backgroundTintList = ColorStateList.valueOf(ATHUtil.resolveColor(context, android.R.attr.windowBackground))
} }
} }

View file

@ -53,7 +53,7 @@ class ColorIconsImageView : AppCompatImageView {
if (ATHUtil.isWindowBackgroundDark(context) && PreferenceUtil.getInstance(context).desaturatedColor()) { if (ATHUtil.isWindowBackgroundDark(context) && PreferenceUtil.getInstance(context).desaturatedColor()) {
val desaturatedColor = RetroColorUtil.desaturateColor(color, 0.4f) val desaturatedColor = RetroColorUtil.desaturateColor(color, 0.4f)
backgroundTintList = ColorStateList.valueOf(desaturatedColor) backgroundTintList = ColorStateList.valueOf(desaturatedColor)
imageTintList = ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.colorPrimary)) imageTintList = ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.colorSurface))
} else { } else {
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f)) backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f)) imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/md_black_1000" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<solid android:color="?attr/cardBackgroundColor" />
</shape>

View file

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="?attr/colorSurface" /> <solid android:color="?android:attr/windowBackground" />
</shape> </shape>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#000000" />
<corners android:radius="15dp" />
</shape>
</item>
<item android:drawable="@drawable/bottom_navigation_item_background" />
</ripple>

View file

@ -27,7 +27,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="?colorPrimary" /> <solid android:color="?attr/colorControlHighlight" />
</shape> </shape>
</item> </item>
</ripple> </ripple>

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">

View file

@ -60,7 +60,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@drawable/shadow_up_full_theme" android:background="@drawable/shadow_up_full_theme"
android:backgroundTint="?colorPrimary" /> android:backgroundTint="?android:attr/windowBackground" />
</FrameLayout> </FrameLayout>
@ -89,7 +89,6 @@
app:cardBackgroundColor="@android:color/transparent" app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardElevation="6dp" app:cardElevation="6dp"
app:cardUseCompatPadding="true"
app:layout_collapseMode="pin" app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"> app:layout_scrollFlags="scroll|enterAlways">
@ -116,16 +115,14 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal" android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:elevation="@dimen/card_elevation"
app:behavior_overlapTop="72dp" app:behavior_overlapTop="72dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardBackgroundColor="?colorPrimary" app:cardCornerRadius="16dp"
app:cardElevation="8dp" app:cardElevation="8dp">
app:shapeAppearanceOverlay="@style/TopCornerCardView">
<include layout="@layout/home_content" /> <include layout="@layout/home_content" />
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View file

@ -36,8 +36,9 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
app:liftOnScroll="true"> android:elevation="0dp"
app:elevation="0dp">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/toolbarContainer" android:id="@+id/toolbarContainer"

View file

@ -60,7 +60,7 @@
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"
android:layout_marginStart="128dp" android:layout_marginStart="128dp"
android:layout_marginEnd="128dp" android:layout_marginEnd="128dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment" android:background="?attr/colorSurface"
android:fillViewport="true" android:fillViewport="true"
android:overScrollMode="never" android:overScrollMode="never"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -35,9 +35,9 @@
app:layout_collapseMode="parallax" /> app:layout_collapseMode="parallax" />
<FrameLayout <FrameLayout
app:layout_collapseMode="pin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
app:layout_collapseMode="pin">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -67,6 +67,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:background="?attr/colorSurface"
app:cardElevation="8dp" app:cardElevation="8dp"
app:shapeAppearanceOverlay="@style/TopCornerCardView"> app:shapeAppearanceOverlay="@style/TopCornerCardView">
@ -75,7 +76,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -27,6 +27,9 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout

View file

@ -37,8 +37,9 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
app:liftOnScroll="true"> android:elevation="0dp"
app:elevation="0dp">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/toolbarContainer" android:id="@+id/toolbarContainer"

View file

@ -2,9 +2,9 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:transitionName="@string/transition_album_art"> android:transitionName="@string/transition_album_art">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
@ -60,6 +60,7 @@
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"
android:layout_marginStart="96dp" android:layout_marginStart="96dp"
android:layout_marginEnd="96dp" android:layout_marginEnd="96dp"
android:background="?attr/colorSurface"
android:fillViewport="true" android:fillViewport="true"
android:overScrollMode="never" android:overScrollMode="never"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -68,6 +68,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:background="?attr/colorSurface"
app:cardElevation="8dp" app:cardElevation="8dp"
app:shapeAppearanceOverlay="@style/TopCornerCardView"> app:shapeAppearanceOverlay="@style/TopCornerCardView">

View file

@ -9,6 +9,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp" android:elevation="0dp"
app:elevation="0dp"> app:elevation="0dp">
@ -64,8 +65,8 @@
android:layout_gravity="center" android:layout_gravity="center"
android:background="?roundSelector" android:background="?roundSelector"
android:padding="16dp" android:padding="16dp"
app:tint="@color/md_white_1000" app:srcCompat="@drawable/ic_add_photo_white_24dp"
app:srcCompat="@drawable/ic_add_photo_white_24dp" /> app:tint="@color/md_white_1000" />
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -21,13 +21,14 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="?colorPrimary">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:liftOnScroll="true"> android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -38,8 +38,9 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
app:liftOnScroll="true"> android:elevation="0dp"
app:elevation="0dp">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/toolbarContainer" android:id="@+id/toolbarContainer"

View file

@ -5,7 +5,7 @@
android:id="@+id/miniPlayerContent" android:id="@+id/miniPlayerContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="?colorSecondary" android:background="?android:attr/background"
android:clickable="true" android:clickable="true"
android:focusable="false" android:focusable="false"
android:transitionName="@string/transition_mini_player" android:transitionName="@string/transition_mini_player"

View file

@ -8,54 +8,16 @@
android:paddingBottom="12dp"> android:paddingBottom="12dp">
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/userImage"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:civ_border="false"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ellipsize="end"
android:text="@string/welcome"
android:textColor="?colorOnBackground"
app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toTopOf="@+id/userImage" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/titleWelcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:padding="0dp"
android:textAppearance="@style/TextViewHeadline5"
android:textColor="?colorOnPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/userImage"
app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:text="@string/app_name" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/history" android:id="@+id/history"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintEnd_toStartOf="@+id/lastAdded" app:layout_constraintEnd_toStartOf="@+id/lastAdded"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleWelcome"> app:layout_constraintTop_toTopOf="parent">
<code.name.monkey.retromusic.views.ColorIconsImageView <code.name.monkey.retromusic.views.ColorIconsImageView
android:id="@+id/v1" android:id="@+id/v1"
@ -80,7 +42,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v1" app:layout_constraintTop_toBottomOf="@+id/v1"
tools:text="Hemanth savarala kumar dai" /> tools:text="@tools:sample/lorem" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -117,7 +79,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v2" app:layout_constraintTop_toBottomOf="@+id/v2"
tools:text="Hemanth savarala" /> tools:text="@tools:sample/lorem" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -154,7 +116,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v3" app:layout_constraintTop_toBottomOf="@+id/v3"
tools:text="Hemanth savarala" /> tools:text="@tools:sample/lorem" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -191,7 +153,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v4" app:layout_constraintTop_toBottomOf="@+id/v4"
tools:text="Hemanth savarala" /> tools:text="@tools:sample/lorem" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -16,7 +16,8 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="?attr/colorSurface">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
@ -49,16 +50,18 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareCardView <code.name.monkey.retromusic.views.WidthFitSquareCardView
android:id="@+id/albumCoverContainer" android:id="@+id/albumCoverContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:transitionName="@string/transition_album_art" android:transitionName="@string/transition_album_art"
app:cardCornerRadius="24dp" app:cardCornerRadius="24dp"
app:cardElevation="8dp" app:cardElevation="8dp"
app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">

View file

@ -16,7 +16,8 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="?attr/colorSurface">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"

View file

@ -27,42 +27,36 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<FrameLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_weight="1"> android:clipToPadding="false"
android:orientation="vertical">
<LinearLayout <include
layout="@layout/bug_report_card_report"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipToPadding="false" android:layout_marginBottom="8dp" />
android:orientation="vertical">
<include <include
layout="@layout/bug_report_card_report" layout="@layout/bug_report_card_device_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_marginBottom="8dp" />
<include <Space
layout="@layout/bug_report_card_device_info" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="56dp"
android:layout_height="wrap_content" /> android:layout_margin="16dp" />
<Space </LinearLayout>
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_margin="16dp" />
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/sendFab"
style="@style/Fab"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:srcCompat="@drawable/ic_send_white_24dp" />
</FrameLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/sendFab"
style="@style/Fab"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:srcCompat="@drawable/ic_send_white_24dp" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -9,7 +9,10 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -19,7 +22,7 @@
app:contentInsetStart="0dp" app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp" app:contentInsetStartWithNavigation="0dp"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption" app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption"
app:titleMargin="0dp" app:titleMargin="0dp"
app:titleMarginStart="0dp" app:titleMarginStart="0dp"

View file

@ -10,6 +10,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
@ -20,9 +21,11 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:background="?attr/colorPrimary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp"
app:liftOnScroll="true"> app:liftOnScroll="true">
<FrameLayout <FrameLayout
@ -33,7 +36,6 @@
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/Toolbar" style="@style/Toolbar"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp" app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" /> app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />
@ -49,6 +51,7 @@
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipToPadding="false" android:clipToPadding="false"
android:scrollbars="none" android:scrollbars="none"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" /> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />

View file

@ -25,6 +25,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp" android:elevation="0dp"
app:elevation="0dp"> app:elevation="0dp">

View file

@ -5,13 +5,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:background="?attr/colorSurface"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:liftOnScroll="true"> app:liftOnScroll="true">
@ -77,9 +78,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?roundSelector" android:background="?roundSelector"
android:padding="12dp" android:padding="12dp"
android:visibility="gone"
app:srcCompat="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
app:tint="?colorOnSurface" app:tint="?colorOnSurface"
android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>

View file

@ -10,6 +10,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar

View file

@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
@ -33,7 +32,7 @@
android:padding="16dp" android:padding="16dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
tools:text="@string/donate_summary" /> tools:text="@tools:sample/lorem/random" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View file

@ -34,22 +34,6 @@
app:statusBarScrim="@color/md_black_1000" app:statusBarScrim="@color/md_black_1000"
app:titleEnabled="false"> app:titleEnabled="false">
<FrameLayout
android:id="@+id/imageContainer"
android:layout_width="match_parent"
android:layout_height="228dp"
app:layout_collapseMode="parallax">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/bannerImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
tools:background="@color/md_red_400"
tools:ignore="ContentDescription"
tools:srcCompat="@tools:sample/backgrounds/scenic[9]" />
</FrameLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -66,33 +50,6 @@
</FrameLayout> </FrameLayout>
<com.google.android.material.card.MaterialCardView
android:id="@+id/toolbarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginTop="@dimen/toolbar_margin_vertical"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:layout_marginBottom="@dimen/toolbar_margin_vertical"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:layout_scrollFlags="scroll|enterAlways"
app:shapeAppearance="@style/ToolbarCornerCardView">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="?colorSurface"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="?toolbarPopupTheme"
app:title="@string/search_hint"
app:titleMarginStart="0dp"
app:titleTextAppearance="@style/ToolbarTextAppearanceSearch"
tools:ignore="UnusedAttribute" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@ -100,17 +57,112 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:behavior_overlapTop="24dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<com.google.android.material.card.MaterialCardView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardBackgroundColor="?colorPrimary" android:orientation="vertical">
app:cardElevation="8dp"
app:shapeAppearanceOverlay="@style/TopCornerCardView"> <com.google.android.material.card.MaterialCardView
android:id="@+id/imageContainer"
android:layout_width="match_parent"
android:layout_height="228dp"
app:cardCornerRadius="24dp"
app:cardUseCompatPadding="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/bannerImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
tools:ignore="ContentDescription"
tools:srcCompat="@tools:sample/backgrounds/scenic[9]" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/toolbarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginTop="8dp"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
app:cardBackgroundColor="@android:color/transparent"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_scrollFlags="scroll|enterAlways"
app:shapeAppearance="@style/ToolbarCornerCardView">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="?attr/colorSurface"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="?toolbarPopupTheme"
app:title="@string/search_hint"
app:titleMarginStart="0dp"
app:titleTextAppearance="@style/ToolbarTextAppearanceSearch"
tools:ignore="UnusedAttribute" />
</com.google.android.material.card.MaterialCardView>
<View
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="@drawable/shadow_up"
app:layout_constraintBottom_toBottomOf="parent" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/userImage"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="8dp"
app:civ_border="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ellipsize="end"
android:text="@string/welcome"
android:textColor="@color/md_white_1000"
app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toTopOf="@+id/userImage" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/titleWelcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:padding="0dp"
android:textAppearance="@style/TextViewHeadline5"
android:textColor="@color/md_white_1000"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/userImage"
app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:text="@string/app_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<include layout="@layout/home_content" /> <include layout="@layout/home_content" />
</com.google.android.material.card.MaterialCardView> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -16,7 +16,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="?colorPrimary"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -35,7 +34,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView

View file

@ -7,7 +7,6 @@
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:textColor="?colorOnSecondary"
android:id="@+id/offlineLyrics" android:id="@+id/offlineLyrics"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -18,5 +17,6 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="128dp" android:paddingBottom="128dp"
android:text="@string/no_lyrics_found" android:text="@string/no_lyrics_found"
android:textAppearance="@style/TextViewBody1" /> android:textAppearance="@style/TextViewBody1"
android:textColor="?android:attr/textColorPrimary" />
</ScrollView> </ScrollView>

View file

@ -49,7 +49,6 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/retro_music_pro" android:text="@string/retro_music_pro"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?colorOnPrimary"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/diamondIcon" /> app:layout_constraintTop_toBottomOf="@id/diamondIcon" />
@ -83,6 +82,7 @@
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="?colorAccent" android:textColor="?colorAccent"
android:textStyle="bold" android:textStyle="bold"
app:backgroundTint="?attr/colorSurface"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -122,7 +122,6 @@
android:singleLine="true" android:singleLine="true"
android:text="@string/general_settings_title" android:text="@string/general_settings_title"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?colorOnPrimary"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
~ Copyright (c) 2019 Hemanth Savarala. ~ Copyright (c) 2019 Hemanth Savarala.
~ ~
~ Licensed under the GNU General Public License v3 ~ Licensed under the GNU General Public License v3
@ -20,6 +17,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
@ -53,16 +51,17 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_margin="24dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"> tools:visibility="visible">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
app:tint="?colorOnSecondary"
android:layout_width="96dp" android:layout_width="96dp"
android:layout_height="96dp" android:layout_height="96dp"
app:srcCompat="@drawable/ic_play_arrow_white_64dp" /> app:srcCompat="@drawable/ic_play_arrow_white_64dp"
app:tint="?colorOnSecondary" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/emptyText" android:id="@+id/emptyText"

View file

@ -33,7 +33,7 @@
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?attr/colorOnPrimary" android:textColor="?android:attr/textColorPrimary"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="My top tracks" /> tools:text="My top tracks" />
</LinearLayout> </LinearLayout>

View file

@ -28,6 +28,6 @@
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:paddingTop="12dp" android:paddingTop="12dp"
android:textColor="?attr/colorOnPrimary" android:textColor="?android:attr/textColorPrimary"
tools:text="Name" /> tools:text="Name" />
</LinearLayout> </LinearLayout>

View file

@ -41,6 +41,6 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/folders" android:text="@string/folders"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?attr/colorOnPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>

View file

@ -42,9 +42,7 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingTop="6dp" android:paddingTop="6dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnBackground"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="My top tracks" /> tools:text="My top tracks" />

View file

@ -51,10 +51,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="?attr/colorSurface"
android:elevation="0dp" android:elevation="0dp"
android:visibility="gone" android:visibility="gone"
app:itemBackground="@drawable/bottom_navigation_item_background" app:backgroundTint="?android:attr/windowBackground"
app:itemHorizontalTranslationEnabled="false" app:itemHorizontalTranslationEnabled="false"
app:itemIconTint="@drawable/bottom_navigation_item_colors" app:itemIconTint="@drawable/bottom_navigation_item_colors"
app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearanceActive" app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearanceActive"

View file

@ -158,7 +158,6 @@
<string name="error">Hiba</string> <string name="error">Hiba</string>
<string name="faq">GYIK</string> <string name="faq">GYIK</string>
<string name="favorites">Kedvencek</string> <string name="favorites">Kedvencek</string>
<string name="favorites_songs">Te vagy a legkedvencebb dal</string>
<string name="finish_last_song">Fejezze be az utolsó dalt</string> <string name="finish_last_song">Fejezze be az utolsó dalt</string>
<string name="fit">Fit</string> <string name="fit">Fit</string>
<string name="flat">Lapos</string> <string name="flat">Lapos</string>
@ -216,8 +215,6 @@
<string name="material">Materiál</string> <string name="material">Materiál</string>
<string name="md_error_label">Hiba</string> <string name="md_error_label">Hiba</string>
<string name="md_storage_perm_error">Engedély hiba</string> <string name="md_storage_perm_error">Engedély hiba</string>
<string name="most_played_albums">A legtöbb játszott albumok</string>
<string name="most_played_artists">A legtöbb játszott művész</string>
<string name="my_name">Név</string> <string name="my_name">Név</string>
<string name="my_top_tracks">Legjobb számok</string> <string name="my_top_tracks">Legjobb számok</string>
<string name="never">Soha</string> <string name="never">Soha</string>
@ -361,8 +358,6 @@
<string name="queue">Sorban áll</string> <string name="queue">Sorban áll</string>
<string name="rate_app">Értékeld az alkalmazást</string> <string name="rate_app">Értékeld az alkalmazást</string>
<string name="rate_on_google_play_summary">Szereted ezt az app-ot a Google Play áruházban, hogy jobb élményt nyújtsunk</string> <string name="rate_on_google_play_summary">Szereted ezt az app-ot a Google Play áruházban, hogy jobb élményt nyújtsunk</string>
<string name="recent_added_albums">Nemrégiben hozzáadott albumok</string>
<string name="recent_added_artists">Nemrégiben hozzáadott művészek</string>
<string name="recent_albums">Legutóbbi albumok</string> <string name="recent_albums">Legutóbbi albumok</string>
<string name="recent_artists">Legújabb előadók</string> <string name="recent_artists">Legújabb előadók</string>
<string name="remove_action">Eltávolítás</string> <string name="remove_action">Eltávolítás</string>

View file

@ -272,8 +272,6 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="favorites">Preferiti</string> <string name="favorites">Preferiti</string>
<string name="favorites_songs">I tuoi brani preferiti</string>
<string name="finish_last_song">Termina ultimo brano</string> <string name="finish_last_song">Termina ultimo brano</string>
<string name="fit">Adatta</string> <string name="fit">Adatta</string>
@ -376,9 +374,6 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="md_storage_perm_error">Errore di autorizzazione</string> <string name="md_storage_perm_error">Errore di autorizzazione</string>
<string name="most_played_albums">Album più ascoltati</string>
<string name="most_played_artists">Artisti più ascoltati</string>
<string name="my_name">Nome</string> <string name="my_name">Nome</string>
<string name="my_top_tracks">I più riprodotti</string> <string name="my_top_tracks">I più riprodotti</string>
@ -584,9 +579,6 @@ https://play.google.com/store/apps/details?id=%s</string>
<string name="rate_on_google_play_summary">Adori quest\'app? Facci sapere sul Play Store come possiamo renderla ancora migliore</string> <string name="rate_on_google_play_summary">Adori quest\'app? Facci sapere sul Play Store come possiamo renderla ancora migliore</string>
<string name="recent_added_albums">Album aggiunti di recente</string>
<string name="recent_added_artists">Artisti aggiunti di recente</string>
<string name="recent_albums">Album recenti</string> <string name="recent_albums">Album recenti</string>
<string name="recent_artists">Artisti recenti</string> <string name="recent_artists">Artisti recenti</string>

View file

@ -158,7 +158,6 @@
<string name="error">Hata</string> <string name="error">Hata</string>
<string name="faq">SSS</string> <string name="faq">SSS</string>
<string name="favorites">Gözdeler</string> <string name="favorites">Gözdeler</string>
<string name="favorites_songs">Favori Şarkıların</string>
<string name="finish_last_song">Son şarkıyı bitir</string> <string name="finish_last_song">Son şarkıyı bitir</string>
<string name="fit">Fit</string> <string name="fit">Fit</string>
<string name="flat">Düz</string> <string name="flat">Düz</string>
@ -216,8 +215,6 @@
<string name="material">Materyal</string> <string name="material">Materyal</string>
<string name="md_error_label">Hata</string> <string name="md_error_label">Hata</string>
<string name="md_storage_perm_error">İzin hatası</string> <string name="md_storage_perm_error">İzin hatası</string>
<string name="most_played_albums">En çok çalınan albümler</string>
<string name="most_played_artists">En çok çalınan sanatçılar</string>
<string name="my_name">İsim</string> <string name="my_name">İsim</string>
<string name="my_top_tracks">Sık oynatılanlar</string> <string name="my_top_tracks">Sık oynatılanlar</string>
<string name="never">Asla</string> <string name="never">Asla</string>
@ -361,8 +358,6 @@
<string name="queue">Kuyruk</string> <string name="queue">Kuyruk</string>
<string name="rate_app">Uygulamayı Değerlendir</string> <string name="rate_app">Uygulamayı Değerlendir</string>
<string name="rate_on_google_play_summary">Bu uygulamayı sevdin mi? Daha iyi bir gelişim için lütfen Google Play\'de nasıl daha iyi yapabileceğimizi bildir.</string> <string name="rate_on_google_play_summary">Bu uygulamayı sevdin mi? Daha iyi bir gelişim için lütfen Google Play\'de nasıl daha iyi yapabileceğimizi bildir.</string>
<string name="recent_added_albums">Son eklenen albümler</string>
<string name="recent_added_artists">Son eklenen sanatçılar</string>
<string name="recent_albums">Son albümler</string> <string name="recent_albums">Son albümler</string>
<string name="recent_artists">Son sanatçılar</string> <string name="recent_artists">Son sanatçılar</string>
<string name="remove_action">Kaldır</string> <string name="remove_action">Kaldır</string>

View file

@ -158,7 +158,6 @@
<string name="error">錯誤</string> <string name="error">錯誤</string>
<string name="faq">常見問題</string> <string name="faq">常見問題</string>
<string name="favorites">我的最愛</string> <string name="favorites">我的最愛</string>
<string name="favorites_songs">你最喜愛的歌曲</string>
<string name="finish_last_song">最後一首已經結束播放</string> <string name="finish_last_song">最後一首已經結束播放</string>
<string name="fit">Fit</string> <string name="fit">Fit</string>
<string name="flat">平面</string> <string name="flat">平面</string>
@ -216,8 +215,6 @@
<string name="material">物質</string> <string name="material">物質</string>
<string name="md_error_label">錯誤</string> <string name="md_error_label">錯誤</string>
<string name="md_storage_perm_error">權限錯誤</string> <string name="md_storage_perm_error">權限錯誤</string>
<string name="most_played_albums">最常播放的專輯</string>
<string name="most_played_artists">最常播放的歌手</string>
<string name="my_name">名字</string> <string name="my_name">名字</string>
<string name="my_top_tracks">最常播放</string> <string name="my_top_tracks">最常播放</string>
<string name="never">永不</string> <string name="never">永不</string>
@ -361,8 +358,6 @@
<string name="queue">播放列表</string> <string name="queue">播放列表</string>
<string name="rate_app">為這個App評分</string> <string name="rate_app">為這個App評分</string>
<string name="rate_on_google_play_summary">喜歡這個App嗎?請讓我們知道如何提供更好的體驗</string> <string name="rate_on_google_play_summary">喜歡這個App嗎?請讓我們知道如何提供更好的體驗</string>
<string name="recent_added_albums">最近新增的專輯</string>
<string name="recent_added_artists">最近新增的歌手</string>
<string name="recent_albums">近期專輯</string> <string name="recent_albums">近期專輯</string>
<string name="recent_artists">近期歌手</string> <string name="recent_artists">近期歌手</string>
<string name="remove_action">移除</string> <string name="remove_action">移除</string>

View file

@ -6,73 +6,105 @@
<string name="accent_color_desc">The theme accent color, defaults to purple</string> <string name="accent_color_desc">The theme accent color, defaults to purple</string>
<string name="action_about">About</string> <string name="action_about">About</string>
<string name="action_add_to_favorites">Add to favorites</string> <string name="action_add_to_favorites">Add to favorites</string>
<string name="action_add_to_playing_queue">Add to playing queue</string> <string name="action_add_to_playing_queue">Add to playing queue</string>
<string name="action_add_to_playlist">Add to playlist</string> <string name="action_add_to_playlist">Add to playlist</string>
<string name="action_clear_playing_queue">Clear playing queue</string> <string name="action_clear_playing_queue">Clear playing queue</string>
<string name="action_clear_playlist">Clear playlist</string> <string name="action_clear_playlist">Clear playlist</string>
<string name="action_cycle_repeat">Cycle repeat mode</string> <string name="action_cycle_repeat">Cycle repeat mode</string>
<string name="action_delete">Delete</string> <string name="action_delete">Delete</string>
<string name="action_delete_from_device">Delete from device</string> <string name="action_delete_from_device">Delete from device</string>
<string name="action_details">Details</string> <string name="action_details">Details</string>
<string name="action_go_to_album">Go to album</string> <string name="action_go_to_album">Go to album</string>
<string name="action_go_to_artist">Go to artist</string> <string name="action_go_to_artist">Go to artist</string>
<string name="action_go_to_genre">Go to genre</string> <string name="action_go_to_genre">Go to genre</string>
<string name="action_go_to_start_directory">Go to start directory</string> <string name="action_go_to_start_directory">Go to start directory</string>
<string name="action_grant">Grant</string> <string name="action_grant">Grant</string>
<string name="action_grid_size">Grid size</string> <string name="action_grid_size">Grid size</string>
<string name="action_grid_size_land">Grid size (land)</string> <string name="action_grid_size_land">Grid size (land)</string>
<string name="action_new_playlist">New playlist</string> <string name="action_new_playlist">New playlist</string>
<string name="action_next">Next</string> <string name="action_next">Next</string>
<string name="action_play">Play</string> <string name="action_play">Play</string>
<string name="action_play_all">Play all</string> <string name="action_play_all">Play all</string>
<string name="action_play_next">Play next</string> <string name="action_play_next">Play next</string>
<string name="action_play_pause">Play/Pause</string> <string name="action_play_pause">Play/Pause</string>
<string name="action_previous">Previous</string> <string name="action_previous">Previous</string>
<string name="action_remove_from_favorites">Remove from favorites</string> <string name="action_remove_from_favorites">Remove from favorites</string>
<string name="action_remove_from_playing_queue">Remove from playing queue</string> <string name="action_remove_from_playing_queue">Remove from playing queue</string>
<string name="action_remove_from_playlist">Remove from playlist</string> <string name="action_remove_from_playlist">Remove from playlist</string>
<string name="action_rename">Rename</string> <string name="action_rename">Rename</string>
<string name="action_save_playing_queue">Save playing queue</string> <string name="action_save_playing_queue">Save playing queue</string>
<string name="action_scan">Scan</string> <string name="action_scan">Scan</string>
<string name="action_search">Search</string> <string name="action_search">Search</string>
<string name="action_set">Start</string> <string name="action_set">Start</string>
<string name="action_set_as_ringtone">Set as ringtone</string> <string name="action_set_as_ringtone">Set as ringtone</string>
<string name="action_set_as_start_directory">Set as start directory</string> <string name="action_set_as_start_directory">Set as start directory</string>
<string name="action_settings">"Settings"</string> <string name="action_settings">"Settings"</string>
<string name="action_share">Share</string> <string name="action_share">Share</string>
<string name="action_shuffle_all">Shuffle all</string> <string name="action_shuffle_all">Shuffle all</string>
<string name="action_shuffle_playlist">Shuffle playlist</string> <string name="action_shuffle_playlist">Shuffle playlist</string>
<string name="action_sleep_timer">Sleep timer</string> <string name="action_sleep_timer">Sleep timer</string>
<string name="action_sort_order">Sort order</string> <string name="action_sort_order">Sort order</string>
<string name="action_tag_editor">Tag editor</string> <string name="action_tag_editor">Tag editor</string>
<string name="action_toggle_favorite">Toggle favorite</string> <string name="action_toggle_favorite">Toggle favorite</string>
<string name="action_toggle_shuffle">Toggle shuffle mode</string> <string name="action_toggle_shuffle">Toggle shuffle mode</string>
<string name="adaptive">Adaptive</string> <string name="adaptive">Adaptive</string>
<string name="add_action">Add</string> <string name="add_action">Add</string>
<string name="add_lyrics">Add lyrics</string> <string name="add_lyrics">Add lyrics</string>
<string name="add_photo">Add \nphoto</string> <string name="add_photo">Add \nphoto</string>
<string name="add_playlist_title">"Add to playlist"</string> <string name="add_playlist_title">"Add to playlist"</string>
<string name="add_time_framed_lryics">Add time frame lyrics</string> <string name="add_time_framed_lryics">Add time frame lyrics</string>
<string name="added_title_to_playing_queue">"Added 1 title to the playing queue."</string> <string name="added_title_to_playing_queue">"Added 1 title to the playing queue."</string>
<string name="added_x_titles_to_playing_queue">Added %1$d titles to the playing queue.</string> <string name="added_x_titles_to_playing_queue">Added %1$d titles to the playing queue.</string>
<string name="album">Album</string> <string name="album">Album</string>
<string name="album_artist">Album artist</string> <string name="album_artist">Album artist</string>
<string name="album_or_artist_empty">The title or artist is empty.</string> <string name="album_or_artist_empty">The title or artist is empty.</string>
<string name="albums">Albums</string> <string name="albums">Albums</string>
<string name="always">Always</string> <string name="always">Always</string>
<string name="app_share">Hey check out this cool music player at: https://play.google.com/store/apps/details?id=%s</string> <string name="app_share">Hey check out this cool music player at: https://play.google.com/store/apps/details?id=%s</string>
<string name="app_shortcut_shuffle_all_short">Shuffle</string> <string name="app_shortcut_shuffle_all_short">Shuffle</string>
<string name="app_shortcut_top_tracks_short">Top Tracks</string> <string name="app_shortcut_top_tracks_short">Top Tracks</string>
<string name="app_widget_big_name">Retro music - Big</string> <string name="app_widget_big_name">Retro music - Big</string>
<string name="app_widget_card_name">Retro music - Card</string> <string name="app_widget_card_name">Retro music - Card</string>
<string name="app_widget_classic_name">Retro music - Classic</string> <string name="app_widget_classic_name">Retro music - Classic</string>
@ -84,6 +116,7 @@
<string name="artists">Artists</string> <string name="artists">Artists</string>
<string name="audio_focus_denied">Audio focus denied.</string> <string name="audio_focus_denied">Audio focus denied.</string>
<string name="audio_settings_summary">Change the sound settings and adjust the equalizer controls</string> <string name="audio_settings_summary">Change the sound settings and adjust the equalizer controls</string>
<string name="auto">Auto</string> <string name="auto">Auto</string>
@ -101,6 +134,7 @@
<string name="blacklist">Blacklist</string> <string name="blacklist">Blacklist</string>
<string name="blur">Blur</string> <string name="blur">Blur</string>
<string name="blur_card">Blur Card</string> <string name="blur_card">Blur Card</string>
<string name="bug_report_failed">Unable to send report</string> <string name="bug_report_failed">Unable to send report</string>
@ -123,11 +157,15 @@
<string name="cancel_current_timer">Cancel</string> <string name="cancel_current_timer">Cancel</string>
<string name="card">Card</string> <string name="card">Card</string>
<string name="card_circular_style">Circular</string> <string name="card_circular_style">Circular</string>
<string name="card_color_style">Colored Card</string> <string name="card_color_style">Colored Card</string>
<string name="card_style">Card</string> <string name="card_style">Card</string>
<string name="carousal">Carousel</string> <string name="carousal">Carousel</string>
<string name="carousal_effect_on_now_playing_screen">Carousel effect on the now playing screen</string> <string name="carousal_effect_on_now_playing_screen">Carousel effect on the now playing screen</string>
<string name="cascading">Cascading</string> <string name="cascading">Cascading</string>
@ -135,6 +173,7 @@
<string name="cast">Cast</string> <string name="cast">Cast</string>
<string name="changelog">Changelog</string> <string name="changelog">Changelog</string>
<string name="changelog_summary">Changelog maintained on the Telegram channel</string> <string name="changelog_summary">Changelog maintained on the Telegram channel</string>
<string name="circular">Circular</string> <string name="circular">Circular</string>
@ -142,15 +181,20 @@
<string name="classic">Classic</string> <string name="classic">Classic</string>
<string name="clear_action">Clear</string> <string name="clear_action">Clear</string>
<string name="clear_app_data">Clear app data</string> <string name="clear_app_data">Clear app data</string>
<string name="clear_blacklist">Clear blacklist</string> <string name="clear_blacklist">Clear blacklist</string>
<string name="clear_playing_queue">Clear queue</string> <string name="clear_playing_queue">Clear queue</string>
<string name="clear_playlist_title">Clear playlist</string> <string name="clear_playlist_title">Clear playlist</string>
<string name="clear_playlist_x"><![CDATA[Clear the playlist <b>%1$s</b>? This can\u2019t be undone!]]></string> <string name="clear_playlist_x"><![CDATA[Clear the playlist <b>%1$s</b>? This can\u2019t be undone!]]></string>
<string name="close_notification">Close</string> <string name="close_notification">Close</string>
<string name="color">Color</string> <string name="color">Color</string>
<string name="color_theme_name">Color</string> <string name="color_theme_name">Color</string>
<string name="colors">Colors</string> <string name="colors">Colors</string>
@ -178,13 +222,16 @@
<string name="delete_playlist_title">Delete playlist</string> <string name="delete_playlist_title">Delete playlist</string>
<string name="delete_playlist_x"><![CDATA[Delete the playlist <b>%1$s</b>?]]></string> <string name="delete_playlist_x"><![CDATA[Delete the playlist <b>%1$s</b>?]]></string>
<string name="delete_playlists_title">Delete playlists</string> <string name="delete_playlists_title">Delete playlists</string>
<string name="delete_song_title">Delete song</string> <string name="delete_song_title">Delete song</string>
<string name="delete_song_x"><![CDATA[Delete the song <b>%1$s</b>?]]></string> <string name="delete_song_x"><![CDATA[Delete the song <b>%1$s</b>?]]></string>
<string name="delete_songs_title">Delete songs</string> <string name="delete_songs_title">Delete songs</string>
<string name="delete_x_playlists"><![CDATA[Delete <b>%1$d</b> playlists?]]></string> <string name="delete_x_playlists"><![CDATA[Delete <b>%1$d</b> playlists?]]></string>
<string name="delete_x_songs"><![CDATA[Delete <b>%1$d</b> songs?]]></string> <string name="delete_x_songs"><![CDATA[Delete <b>%1$d</b> songs?]]></string>
<string name="deleted_x_songs">Deleted %1$d songs.</string> <string name="deleted_x_songs">Deleted %1$d songs.</string>
<string name="deleting_songs">Deleting songs</string> <string name="deleting_songs">Deleting songs</string>
@ -196,12 +243,14 @@
<string name="device_info">Device info</string> <string name="device_info">Device info</string>
<string name="dialog_message_set_ringtone">Allow Retro Music to modify audio settings</string> <string name="dialog_message_set_ringtone">Allow Retro Music to modify audio settings</string>
<string name="dialog_title_set_ringtone">Set ringtone</string> <string name="dialog_title_set_ringtone">Set ringtone</string>
<string name="do_you_want_to_clear_the_blacklist">Do you want to clear the blacklist?</string> <string name="do_you_want_to_clear_the_blacklist">Do you want to clear the blacklist?</string>
<string name="do_you_want_to_remove_from_the_blacklist"><![CDATA[Do you want to remove <b>%1$s</b> from the blacklist?]]></string> <string name="do_you_want_to_remove_from_the_blacklist"><![CDATA[Do you want to remove <b>%1$s</b> from the blacklist?]]></string>
<string name="donate">Donate</string> <string name="donate">Donate</string>
<string name="donate_summary">If you think I deserve to get paid for my work, you can leave some money here</string> <string name="donate_summary">If you think I deserve to get paid for my work, you can leave some money here</string>
<string name="donation_header">Buy me a:</string> <string name="donation_header">Buy me a:</string>
@ -209,6 +258,7 @@
<string name="download_from_last_fm">Download from Last.fm</string> <string name="download_from_last_fm">Download from Last.fm</string>
<string name="edit">Edit</string> <string name="edit">Edit</string>
<string name="edit_cover">Edit cover</string> <string name="edit_cover">Edit cover</string>
<string name="empty">Empty</string> <string name="empty">Empty</string>
@ -220,7 +270,6 @@
<string name="faq">FAQ</string> <string name="faq">FAQ</string>
<string name="favorites">Favorites</string> <string name="favorites">Favorites</string>
<string name="favorites_songs">You\'re most favorites songs</string>
<string name="finish_last_song">Finish last song</string> <string name="finish_last_song">Finish last song</string>
@ -235,6 +284,7 @@
<string name="for_you">For you</string> <string name="for_you">For you</string>
<string name="full">Full</string> <string name="full">Full</string>
<string name="full_card">Full card</string> <string name="full_card">Full card</string>
<string name="general_settings_summary">Change the theme and colors of the app</string> <string name="general_settings_summary">Change the theme and colors of the app</string>
@ -256,6 +306,7 @@
<string name="grid_size_6">6</string> <string name="grid_size_6">6</string>
<string name="grid_size_7">7</string> <string name="grid_size_7">7</string>
<string name="grid_size_8">8</string> <string name="grid_size_8">8</string>
<string name="grid_style_label"><![CDATA[Grids & Style]]></string> <string name="grid_style_label"><![CDATA[Grids & Style]]></string>
<string name="hinge">Hinge</string> <string name="hinge">Hinge</string>
@ -267,7 +318,9 @@
<string name="horizontal_flip">Horizontal flip</string> <string name="horizontal_flip">Horizontal flip</string>
<string name="image">Image</string> <string name="image">Image</string>
<string name="image_gradient">Gradient image</string> <string name="image_gradient">Gradient image</string>
<string name="image_settings_summary">Change artist image download settings</string> <string name="image_settings_summary">Change artist image download settings</string>
<string name="inserted_x_songs_into_playlist_x">Inserted %1$d songs into the playlist %2$s.</string> <string name="inserted_x_songs_into_playlist_x">Inserted %1$d songs into the playlist %2$s.</string>
@ -278,21 +331,28 @@
<string name="keyboard">Keyboard</string> <string name="keyboard">Keyboard</string>
<string name="label_bit_rate">Bitrate</string> <string name="label_bit_rate">Bitrate</string>
<string name="label_file_format">Format</string> <string name="label_file_format">Format</string>
<string name="label_file_name">File name</string> <string name="label_file_name">File name</string>
<string name="label_file_path">File path</string> <string name="label_file_path">File path</string>
<string name="label_file_size">Size</string> <string name="label_file_size">Size</string>
<string name="label_more_from">More from %s</string>
<string name="label_sampling_rate">Sampling rate</string> <string name="label_sampling_rate">Sampling rate</string>
<string name="label_track_length">Length</string> <string name="label_track_length">Length</string>
<string name="labeled">Labeled</string> <string name="labeled">Labeled</string>
<string name="last_added">Last added</string> <string name="last_added">Last added</string>
<string name="last_song">Last song</string> <string name="last_song">Last song</string>
<string name="lets_play_something">Let\'s play some music</string> <string name="lets_play_something">Let\'s play some music</string>
<string name="library">Library</string> <string name="library">Library</string>
<string name="library_categories">Library categories</string> <string name="library_categories">Library categories</string>
<string name="licenses">Licenses</string> <string name="licenses">Licenses</string>
@ -312,36 +372,49 @@
<string name="material">Material</string> <string name="material">Material</string>
<string name="md_error_label">Error</string> <string name="md_error_label">Error</string>
<string name="md_storage_perm_error">Permission error</string> <string name="md_storage_perm_error">Permission error</string>
<string name="most_played_albums">Most played albums</string>
<string name="most_played_artists">Most played artists</string>
<string name="my_name">Name</string> <string name="my_name">Name</string>
<string name="my_top_tracks">Most played</string> <string name="my_top_tracks">Most played</string>
<string name="never">Never</string> <string name="never">Never</string>
<string name="new_banner_photo">New banner photo</string> <string name="new_banner_photo">New banner photo</string>
<string name="new_playlist_title">New playlist</string> <string name="new_playlist_title">New playlist</string>
<string name="new_profile_photo">New profile photo</string> <string name="new_profile_photo">New profile photo</string>
<string name="new_start_directory">%s is the new start directory.</string> <string name="new_start_directory">%s is the new start directory.</string>
<string name="next_song">Next Song</string> <string name="next_song">Next Song</string>
<string name="no_albums">You have no albums</string> <string name="no_albums">You have no albums</string>
<string name="no_artists">You have no artists</string> <string name="no_artists">You have no artists</string>
<string name="no_audio_ID">"Play a song first, then try again."</string> <string name="no_audio_ID">"Play a song first, then try again."</string>
<string name="no_equalizer">No equalizer found</string> <string name="no_equalizer">No equalizer found</string>
<string name="no_genres">You have no genres</string> <string name="no_genres">You have no genres</string>
<string name="no_lyrics_found">No lyrics found</string> <string name="no_lyrics_found">No lyrics found</string>
<string name="no_playlists">You have no playlists</string> <string name="no_playlists">You have no playlists</string>
<string name="no_purchase_found">No purchase found.</string> <string name="no_purchase_found">No purchase found.</string>
<string name="no_results">No results</string> <string name="no_results">No results</string>
<string name="no_songs">You have no songs</string> <string name="no_songs">You have no songs</string>
<string name="normal">Normal</string> <string name="normal">Normal</string>
<string name="normal_lyrics">Normal lyrics</string> <string name="normal_lyrics">Normal lyrics</string>
<string name="normal_style">Normal</string> <string name="normal_style">Normal</string>
<string name="not_listed_in_media_store"><![CDATA[<b>%s</b> is not listed in the media store.]]></string> <string name="not_listed_in_media_store"><![CDATA[<b>%s</b> is not listed in the media store.]]></string>
@ -349,6 +422,7 @@
<string name="nothing_to_scan">Nothing to scan.</string> <string name="nothing_to_scan">Nothing to scan.</string>
<string name="notification">Notification</string> <string name="notification">Notification</string>
<string name="notification_settings_summary">Customize the notification style</string> <string name="notification_settings_summary">Customize the notification style</string>
<string name="now_playing">Now playing</string> <string name="now_playing">Now playing</string>
@ -375,9 +449,11 @@
<string name="permissions_denied">Permissions denied.</string> <string name="permissions_denied">Permissions denied.</string>
<string name="personalize">Personalize</string> <string name="personalize">Personalize</string>
<string name="personalize_settings_summary">Customize your now playing and UI controls</string> <string name="personalize_settings_summary">Customize your now playing and UI controls</string>
<string name="pick_from_local_storage">Pick from local storage</string> <string name="pick_from_local_storage">Pick from local storage</string>
<string name="pick_image_intent_text">Pick image</string> <string name="pick_image_intent_text">Pick image</string>
<string name="pinterest_page">Pinterest</string> <string name="pinterest_page">Pinterest</string>
@ -389,16 +465,24 @@
<string name="playing_notification_name">Playing notification</string> <string name="playing_notification_name">Playing notification</string>
<string name="playlist_empty_text">Empty playlist</string> <string name="playlist_empty_text">Empty playlist</string>
<string name="playlist_is_empty">Playlist is empty</string> <string name="playlist_is_empty">Playlist is empty</string>
<string name="playlist_name_empty">Playlist name</string> <string name="playlist_name_empty">Playlist name</string>
<string name="playlists">Playlists</string> <string name="playlists">Playlists</string>
<string name="pref_album_detail_style">Album detail style</string> <string name="pref_album_detail_style">Album detail style</string>
<string name="pref_blur_amount_summary">Amount of blur applied for blur themes, lower is faster</string> <string name="pref_blur_amount_summary">Amount of blur applied for blur themes, lower is faster</string>
<string name="pref_blur_amount_title">Blur amount</string> <string name="pref_blur_amount_title">Blur amount</string>
<string name="pref_dialog_corner_summary">Adjust the bottom sheet dialog corners</string>
<string name="pref_dialog_corner_title">Dialog corner</string> <string name="pref_dialog_corner_title">Dialog corner</string>
<string name="pref_filter_song_summary">Filter songs by length</string>
<string name="pref_filter_song_title">Filter song duration</string> <string name="pref_filter_song_title">Filter song duration</string>
<string name="pref_header_album">Album style</string> <string name="pref_header_album">Album style</string>
<string name="pref_header_audio">Audio</string> <string name="pref_header_audio">Audio</string>
<string name="pref_header_controls">Controls</string> <string name="pref_header_controls">Controls</string>
@ -407,14 +491,17 @@
<string name="pref_header_library">Library</string> <string name="pref_header_library">Library</string>
<string name="pref_header_lockscreen">Lockscreen</string> <string name="pref_header_lockscreen">Lockscreen</string>
<string name="pref_header_playlists">Playlists</string> <string name="pref_header_playlists">Playlists</string>
<string name="pref_keep_pause_on_zero_volume_summary">Pauses the song when the volume decreases to zero and starts playing back when the volume level rises. Also works outside the app</string> <string name="pref_keep_pause_on_zero_volume_summary">Pauses the song when the volume decreases to zero and starts playing back when the volume level rises. Also works outside the app</string>
<string name="pref_keep_pause_on_zero_volume_title">Pause on zero</string> <string name="pref_keep_pause_on_zero_volume_title">Pause on zero</string>
<string name="pref_keep_screen_on_summary">Keep in mind that enabling this feature may affect battery life</string> <string name="pref_keep_screen_on_summary">Keep in mind that enabling this feature may affect battery life</string>
<string name="pref_keep_screen_on_title">Keep the screen on</string> <string name="pref_keep_screen_on_title">Keep the screen on</string>
<string name="pref_now_playing_screen_summary">Click to open with or slide to without transparent navigation of now playing screen</string> <string name="pref_now_playing_screen_summary">Click to open with or slide to without transparent navigation of now playing screen</string>
<string name="pref_now_playing_screen_title">Click or Slide</string> <string name="pref_now_playing_screen_title">Click or Slide</string>
<string name="pref_snow_fall_title">Snow fall effect</string> <string name="pref_snow_fall_title">Snow fall effect</string>
<string name="pref_summary_album_art_on_lockscreen">Use the currently playing song album cover as the lockscreen wallpaper</string> <string name="pref_summary_album_art_on_lockscreen">Use the currently playing song album cover as the lockscreen wallpaper</string>
<string name="pref_summary_audio_ducking">Lower the volume when a system sound is played or a notification is received</string> <string name="pref_summary_audio_ducking">Lower the volume when a system sound is played or a notification is received</string>
<string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string> <string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string>
@ -441,6 +528,7 @@
<string name="pref_summary_toggle_headset">Start playing immediately after headphones are connected</string> <string name="pref_summary_toggle_headset">Start playing immediately after headphones are connected</string>
<string name="pref_summary_toggle_shuffle">Shuffle mode will turn off when playing a new list of songs</string> <string name="pref_summary_toggle_shuffle">Shuffle mode will turn off when playing a new list of songs</string>
<string name="pref_summary_toggle_volume">If enough space is available, show volume controls in the now playing screen</string> <string name="pref_summary_toggle_volume">If enough space is available, show volume controls in the now playing screen</string>
<string name="pref_title_album_art_on_lockscreen">Show album cover</string> <string name="pref_title_album_art_on_lockscreen">Show album cover</string>
<string name="pref_title_album_cover_style">Album cover theme</string> <string name="pref_title_album_cover_style">Album cover theme</string>
<string name="pref_title_album_cover_transform">Album cover skip</string> <string name="pref_title_album_cover_transform">Album cover skip</string>
@ -487,34 +575,44 @@
<string name="profile">Profile</string> <string name="profile">Profile</string>
<string name="purchase">Purchase</string> <string name="purchase">Purchase</string>
<string name="purchase_summary">*Think before buying, don\'t ask for refund.</string> <string name="purchase_summary">*Think before buying, don\'t ask for refund.</string>
<string name="queue">Queue</string> <string name="queue">Queue</string>
<string name="rate_app">Rate the app</string> <string name="rate_app">Rate the app</string>
<string name="rate_on_google_play_summary">Love this app? Let us know in the Google Play Store how we can make it even better</string> <string name="rate_on_google_play_summary">Love this app? Let us know in the Google Play Store how we can make it even better</string>
<string name="recent_added_albums">Recently added albums</string>
<string name="recent_added_artists">Recently added artists</string>
<string name="recent_albums">Recent albums</string> <string name="recent_albums">Recent albums</string>
<string name="recent_artists">Recent artists</string> <string name="recent_artists">Recent artists</string>
<string name="remove_action">Remove</string> <string name="remove_action">Remove</string>
<string name="remove_banner_photo">Remove banner photo</string> <string name="remove_banner_photo">Remove banner photo</string>
<string name="remove_cover">Remove cover</string> <string name="remove_cover">Remove cover</string>
<string name="remove_from_blacklist">Remove from blacklist</string> <string name="remove_from_blacklist">Remove from blacklist</string>
<string name="remove_profile_photo">Remove profile photo</string> <string name="remove_profile_photo">Remove profile photo</string>
<string name="remove_song_from_playlist_title">Remove song from playlist</string> <string name="remove_song_from_playlist_title">Remove song from playlist</string>
<string name="remove_song_x_from_playlist"><![CDATA[Remove the song <b>%1$s</b> from the playlist?]]></string> <string name="remove_song_x_from_playlist"><![CDATA[Remove the song <b>%1$s</b> from the playlist?]]></string>
<string name="remove_songs_from_playlist_title">Remove songs from playlist</string> <string name="remove_songs_from_playlist_title">Remove songs from playlist</string>
<string name="remove_x_songs_from_playlist"><![CDATA[Remove <b>%1$d</b> songs from the playlist?]]></string> <string name="remove_x_songs_from_playlist"><![CDATA[Remove <b>%1$d</b> songs from the playlist?]]></string>
<string name="rename_playlist_title">Rename playlist</string> <string name="rename_playlist_title">Rename playlist</string>
<string name="report_an_issue">Report an issue</string> <string name="report_an_issue">Report an issue</string>
<string name="report_bug">Report bug</string> <string name="report_bug">Report bug</string>
<string name="reset_action">Reset</string> <string name="reset_action">Reset</string>
<string name="reset_artist_image">Reset artist image</string> <string name="reset_artist_image">Reset artist image</string>
<string name="restore">Restore</string> <string name="restore">Restore</string>
@ -525,11 +623,14 @@
<string name="restoring_purchase">Restoring purchase…</string> <string name="restoring_purchase">Restoring purchase…</string>
<string name="retro_equalizer">Retro Music Equalizer</string> <string name="retro_equalizer">Retro Music Equalizer</string>
<string name="retro_music_pro">Retro Music Pro</string> <string name="retro_music_pro">Retro Music Pro</string>
<string name="saf_delete_failed">File delete failed: %s</string> <string name="saf_delete_failed">File delete failed: %s</string>
<!-- SAF --> <!-- SAF -->
<string name="saf_error_uri">Can\'t get SAF URI</string> <string name="saf_error_uri">Can\'t get SAF URI</string>
<string name="saf_guide_slide1_description">Open navigation drawer</string> <string name="saf_guide_slide1_description">Open navigation drawer</string>
<string name="saf_guide_slide1_description_before_o">Enable \'Show SD card\' in overflow menu</string> <string name="saf_guide_slide1_description_before_o">Enable \'Show SD card\' in overflow menu</string>
<!-- SAF guide --> <!-- SAF guide -->
@ -538,12 +639,15 @@
<string name="saf_guide_slide2_title">Select your SD card in navigation drawer</string> <string name="saf_guide_slide2_title">Select your SD card in navigation drawer</string>
<string name="saf_guide_slide3_description">Do not open any sub-folders</string> <string name="saf_guide_slide3_description">Do not open any sub-folders</string>
<string name="saf_guide_slide3_title">Tap \'select\' button at the bottom of the screen</string> <string name="saf_guide_slide3_title">Tap \'select\' button at the bottom of the screen</string>
<string name="saf_write_failed">File write failed: %s</string> <string name="saf_write_failed">File write failed: %s</string>
<string name="save">Save</string> <string name="save">Save</string>
<!-- SAF --> <!-- SAF -->
<!-- SAF guide --> <!-- SAF guide -->
<string name="save_playlist_title">Save as file</string> <string name="save_playlist_title">Save as file</string>
<string name="save_playlists_title">Save as files</string> <string name="save_playlists_title">Save as files</string>
<string name="saved_playlist_to">Saved playlist to %s.</string> <string name="saved_playlist_to">Saved playlist to %s.</string>
@ -557,6 +661,7 @@
<string name="search_hint">Search your library…</string> <string name="search_hint">Search your library…</string>
<string name="select_all">Select all</string> <string name="select_all">Select all</string>
<string name="select_banner_photo">Select banner photo</string> <string name="select_banner_photo">Select banner photo</string>
<string name="selected">Selected</string> <string name="selected">Selected</string>
@ -564,7 +669,9 @@
<string name="send_crash_log">Send crash log</string> <string name="send_crash_log">Send crash log</string>
<string name="set">Set</string> <string name="set">Set</string>
<string name="set_artist_image">Set artist image</string> <string name="set_artist_image">Set artist image</string>
<string name="set_photo">Set a profile photo</string> <string name="set_photo">Set a profile photo</string>
<string name="share_app">Share app</string> <string name="share_app">Share app</string>
@ -583,6 +690,7 @@
<string name="social">Social</string> <string name="social">Social</string>
<string name="song">Song</string> <string name="song">Song</string>
<string name="song_duration">Song duration</string> <string name="song_duration">Song duration</string>
<string name="songs">Songs</string> <string name="songs">Songs</string>
@ -597,6 +705,7 @@
<string name="sort_order_z_a">Descending</string> <string name="sort_order_z_a">Descending</string>
<string name="speech_not_supported">Sorry! Your device doesn\'t support speech input</string> <string name="speech_not_supported">Sorry! Your device doesn\'t support speech input</string>
<string name="speech_prompt">Search your library</string> <string name="speech_prompt">Search your library</string>
<string name="stack">Stack</string> <string name="stack">Stack</string>
@ -624,29 +733,37 @@
<string name="the_audio_file">The audio file</string> <string name="the_audio_file">The audio file</string>
<string name="this_month">This month</string> <string name="this_month">This month</string>
<string name="this_week">This week</string> <string name="this_week">This week</string>
<string name="this_year">This year</string> <string name="this_year">This year</string>
<string name="tiny">Tiny</string> <string name="tiny">Tiny</string>
<string name="title">Title</string> <string name="title">Title</string>
<string name="title_dashboard">Dashboard</string> <string name="title_dashboard">Dashboard</string>
<string name="title_good_afternoon">Good afternoon</string> <string name="title_good_afternoon">Good afternoon</string>
<string name="title_good_day">Good day</string> <string name="title_good_day">Good day</string>
<string name="title_good_evening">Good evening</string> <string name="title_good_evening">Good evening</string>
<string name="title_good_morning">Good morning</string> <string name="title_good_morning">Good morning</string>
<string name="title_good_night">Good night</string> <string name="title_good_night">Good night</string>
<string name="title_user_info">What\'s Your Name</string> <string name="title_user_info">What\'s Your Name</string>
<string name="today">Today</string> <string name="today">Today</string>
<string name="top_albums">Top albums</string> <string name="top_albums">Top albums</string>
<string name="top_artists">Top artists</string> <string name="top_artists">Top artists</string>
<string name="track_hint">"Track (2 for track 2 or 3004 for CD3 track 4)"</string> <string name="track_hint">"Track (2 for track 2 or 3004 for CD3 track 4)"</string>
<string name="track_list">Track number</string> <string name="track_list">Track number</string>
<string name="translate">Translate</string> <string name="translate">Translate</string>
<string name="translate_community">Help us translate the app to your language</string> <string name="translate_community">Help us translate the app to your language</string>
<string name="twitter_page">Twitter</string> <string name="twitter_page">Twitter</string>
@ -679,19 +796,20 @@
<string name="whats_new">What\'s New</string> <string name="whats_new">What\'s New</string>
<string name="window">Window</string> <string name="window">Window</string>
<string name="window_corner_edges">Rounded corners</string> <string name="window_corner_edges">Rounded corners</string>
<string name="x_has_been_set_as_ringtone">Set %1$s as your ringtone.</string> <string name="x_has_been_set_as_ringtone">Set %1$s as your ringtone.</string>
<string name="x_selected">%1$d selected</string> <string name="x_selected">%1$d selected</string>
<string name="year">Year</string> <string name="year">Year</string>
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string> <string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string> <string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string> <string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
<string name="pref_header_advanced">Advanced</string>
<string name="label_more_from">More from %s</string> <string name="pref_header_blacklist">Blacklist</string>
<string name="pref_dialog_corner_summary" >Adjust the bottom sheet dialog corners</string>
<string name="pref_filter_song_summary">Filter songs by length</string>
</resources> </resources>

View file

@ -48,6 +48,7 @@
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:textSize">20sp</item> <item name="android:textSize">20sp</item>
<item name="android:letterSpacing">0.0125</item> <item name="android:letterSpacing">0.0125</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style> </style>
<style name="BigTitleTextAppearanceToolbar"> <style name="BigTitleTextAppearanceToolbar">

View file

@ -20,6 +20,7 @@
<item name="roundSelector">@drawable/round_selector</item> <item name="roundSelector">@drawable/round_selector</item>
<item name="rectSelector">@drawable/rect_selector</item> <item name="rectSelector">@drawable/rect_selector</item>
<item name="rectSelectorStrong">@drawable/rect_selector_strong</item> <item name="rectSelectorStrong">@drawable/rect_selector_strong</item>
</style> </style>
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar"> <style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">

View file

@ -3,15 +3,45 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory <code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title" android:layout="@layout/preference_category_title"
android:title="Advanced"> android:title="@string/pref_header_blacklist">
<code.name.monkey.retromusic.preferences.BlacklistPreference
android:key="blacklist"
android:layout="@layout/list_item_view"
android:summary="@string/pref_summary_blacklist"
android:title="@string/pref_title_blacklist"
app:enableCopying="true"
app:icon="@drawable/ic_music_note_off_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_playlists">
<code.name.monkey.retromusic.preferences.MaterialListPreference
android:defaultValue="this_month"
android:entries="@array/pref_playlists_last_added_interval_titles"
android:entryValues="@array/pref_playlists_last_added_interval_values"
android:key="last_added_interval"
android:layout="@layout/list_item_view"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_last_added_interval"
app:enableCopying="true"
app:icon="@drawable/ic_playlist_add_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_advanced">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference <code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference
android:defaultValue="30" android:defaultValue="30"
android:key="filter_song" android:key="filter_song"
android:layout="@layout/list_item_view_seekbar" android:layout="@layout/list_item_view_seekbar"
android:max="60" android:max="60"
android:title="@string/pref_filter_song_title"
android:summary="@string/pref_filter_song_summary" android:summary="@string/pref_filter_song_summary"
android:title="@string/pref_filter_song_title"
app:enableCopying="true" app:enableCopying="true"
app:icon="@drawable/ic_filter_song_white_24dp" app:icon="@drawable/ic_filter_song_white_24dp"
app:showSeekBarValue="true" /> app:showSeekBarValue="true" />

View file

@ -1,16 +0,0 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="Blacklist">
<code.name.monkey.retromusic.preferences.BlacklistPreference
android:key="blacklist"
android:layout="@layout/list_item_view"
android:summary="@string/pref_summary_blacklist"
android:title="@string/pref_title_blacklist"
app:enableCopying="true"
app:icon="@drawable/ic_music_note_off_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
</androidx.preference.PreferenceScreen>

View file

@ -1,22 +0,0 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_playlists">
<code.name.monkey.retromusic.preferences.MaterialListPreference
android:defaultValue="this_month"
android:entries="@array/pref_playlists_last_added_interval_titles"
android:entryValues="@array/pref_playlists_last_added_interval_values"
android:key="last_added_interval"
android:layout="@layout/list_item_view"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_last_added_interval"
app:enableCopying="true"
app:icon="@drawable/ic_playlist_add_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
</androidx.preference.PreferenceScreen>

View file

@ -1,6 +1,6 @@
package code.name.monkey.appthemehelper.common; package code.name.monkey.appthemehelper.common;
import android.graphics.drawable.ColorDrawable; import android.graphics.Color;
import android.view.Menu; import android.view.Menu;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -15,13 +15,11 @@ import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
public class ATHToolbarActivity extends ATHActivity { public class ATHToolbarActivity extends ATHActivity {
private Toolbar toolbar; private Toolbar toolbar;
public static int getToolbarBackgroundColor(Toolbar toolbar) { public static int getToolbarBackgroundColor(@Nullable Toolbar toolbar) {
if (toolbar != null) { if (toolbar != null) {
if (toolbar.getBackground() instanceof ColorDrawable) { return ATHUtil.INSTANCE.resolveColor(toolbar.getContext(), R.attr.colorSurface);
return ((ColorDrawable) toolbar.getBackground()).getColor();
}
} }
return 0; return Color.BLACK;
} }
@Override @Override