From b9412c6ef61621a4127d41ea50a69eba76f51e7c Mon Sep 17 00:00:00 2001 From: h4h13 Date: Sat, 23 Feb 2019 23:09:02 +0530 Subject: [PATCH] Fix volume color, text style etc --- app/build.gradle | 6 +- app/src/main/assets/retro-changelog.html | 2 +- .../name/monkey/retromusic/model/Home.java | 14 +- .../retromusic/mvp/presenter/HomePresenter.kt | 14 +- .../ui/activities/EqualizerActivity.kt | 8 + .../ui/activities/LyricsActivity.kt | 6 +- .../activities/SupportDevelopmentActivity.kt | 2 +- .../base/AbsSlidingMusicPanelActivity.kt | 319 +++++++++++++- .../tageditor/AbsTagEditorActivity.kt | 15 +- .../retromusic/ui/adapter/HomeAdapter.kt | 29 +- .../ui/adapter/album/AlbumAdapter.kt | 2 +- .../ui/adapter/song/PlayingQueueAdapter.kt | 6 +- .../ui/fragments/MiniPlayerFragment.kt | 4 +- .../ui/fragments/NowPlayingScreen.kt | 2 +- .../retromusic/ui/fragments/VolumeFragment.kt | 30 +- .../base/AbsPlayerControlsFragment.kt | 6 +- .../ui/fragments/base/AbsPlayerFragment.kt | 21 +- .../mainactivity/folders/FoldersFragment.java | 12 +- .../AdaptivePlaybackControlsFragment.kt | 10 +- .../blur/BlurPlaybackControlsFragment.kt | 8 +- .../card/CardPlaybackControlsFragment.kt | 21 +- .../CardBlurPlaybackControlsFragment.kt | 17 +- .../player/classic/ClassicPlayerFragment.kt | 415 ++++++++++++++++++ .../ClassicPlayerPlaybackControlsFragment.kt | 235 ++++++++++ .../color/ColorPlaybackControlsFragment.kt | 2 +- .../player/fit/FitPlaybackControlsFragment.kt | 15 +- .../flat/FlatPlaybackControlsFragment.kt | 26 +- .../full/FullPlaybackControlsFragment.kt | 10 +- .../LockScreenPlayerControlsFragment.kt | 2 +- .../material/MaterialControlsFragment.kt | 30 +- .../fragments/player/normal/PlayerFragment.kt | 21 +- .../normal/PlayerPlaybackControlsFragment.kt | 37 +- .../plain/PlainPlaybackControlsFragment.kt | 13 +- .../simple/SimplePlaybackControlsFragment.kt | 12 +- .../monkey/retromusic/util/MusicUtil.java | 40 +- .../name/monkey/retromusic/util/ViewUtil.kt | 30 +- .../retromusic/views/ColorIconsImageView.kt | 2 +- .../res/drawable/abs_history_playlist.xml | 6 - .../res/drawable/abs_last_added_playlist.xml | 6 - app/src/main/res/drawable/abs_shuffle.xml | 5 - .../res/drawable/abs_top_tracks_playlist.xml | 6 - app/src/main/res/drawable/bg_card_line.xml | 1 - .../main/res/drawable/bg_circular_corners.xml | 5 - .../res/drawable/ic_disc_full_black_24dp.xml | 12 +- .../res/drawable/ic_person_white_24dp.xml | 10 + .../main/res/layout-land/activity_album.xml | 9 +- .../layout-land/activity_album_tag_editor.xml | 8 +- .../layout-land/activity_artist_details.xml | 5 +- .../layout-land/fragment_classic_player.xml | 131 ++++++ .../main/res/layout-v21/fragment_player.xml | 81 ++++ .../layout_notification_expanded.xml | 11 +- .../res/layout-xlarge-land/activity_album.xml | 7 +- .../activity_artist_details.xml | 5 +- .../main/res/layout-xlarge/abs_playlists.xml | 52 ++- .../main/res/layout-xlarge/activity_album.xml | 11 +- .../layout-xlarge/activity_artist_details.xml | 5 +- app/src/main/res/layout/abs_playlists.xml | 40 +- app/src/main/res/layout/activity_album.xml | 7 +- .../res/layout/activity_album_tag_editor.xml | 11 +- .../res/layout/activity_artist_details.xml | 7 +- app/src/main/res/layout/activity_donation.xml | 5 +- .../layout/activity_lock_screen_old_style.xml | 3 +- .../res/layout/activity_song_tag_editor.xml | 11 +- .../res/layout/dialog_promotional_offer.xml | 3 +- ...ent_card_blur_player_playback_controls.xml | 2 +- .../res/layout/fragment_classic_player.xml | 152 +++++++ ...gment_classic_player_playback_controls.xml | 136 ++++++ ...fragment_flat_player_playback_controls.xml | 2 +- .../layout/fragment_hmm_controls_fragment.xml | 6 +- .../main/res/layout/fragment_main_options.xml | 3 +- .../fragment_player_playback_controls.xml | 3 +- .../layout/layout_notification_expanded.xml | 23 +- app/src/main/res/layout/media_button.xml | 4 +- .../layout/metal_section_recycler_view.xml | 23 +- app/src/main/res/layout/progress_bar.xml | 18 + .../main/res/layout/section_item_collage.xml | 23 +- .../main/res/layout/section_recycler_view.xml | 23 +- app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/styles.xml | 2 +- .../layout/two_lines_list_preference_row.xml | 3 +- build.gradle | 2 +- 81 files changed, 2028 insertions(+), 305 deletions(-) create mode 100644 app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerFragment.kt create mode 100644 app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt delete mode 100644 app/src/main/res/drawable/abs_history_playlist.xml delete mode 100644 app/src/main/res/drawable/abs_last_added_playlist.xml delete mode 100644 app/src/main/res/drawable/abs_shuffle.xml delete mode 100644 app/src/main/res/drawable/abs_top_tracks_playlist.xml delete mode 100644 app/src/main/res/drawable/bg_card_line.xml delete mode 100644 app/src/main/res/drawable/bg_circular_corners.xml create mode 100644 app/src/main/res/drawable/ic_person_white_24dp.xml create mode 100644 app/src/main/res/layout-land/fragment_classic_player.xml create mode 100644 app/src/main/res/layout-v21/fragment_player.xml create mode 100644 app/src/main/res/layout/fragment_classic_player.xml create mode 100644 app/src/main/res/layout/fragment_classic_player_playback_controls.xml create mode 100644 app/src/main/res/layout/progress_bar.xml diff --git a/app/build.gradle b/app/build.gradle index 16af02b0..8ef28fde 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,8 +32,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 289 - versionName '3.1.00' + versionCode 291 + versionName '3.1.100' multiDexEnabled true @@ -159,7 +159,7 @@ dependencies { implementation 'com.r0adkll:slidableactivity:2.0.6' /*Backend all*/ implementation project(':appthemehelper') - implementation 'com.github.hannesa2:AndroidSlidingUpPanel:3.5.0' + implementation 'com.github.kabouzeid:AndroidSlidingUpPanel:3.3.0-kmod3' implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3' implementation 'org.nanohttpd:nanohttpd:2.3.1' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 0ecd5017..1372c023 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

v3.1.00

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file +

v3.1.100

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/model/Home.java b/app/src/main/java/code/name/monkey/retromusic/model/Home.java index 6e217343..746c0e74 100644 --- a/app/src/main/java/code/name/monkey/retromusic/model/Home.java +++ b/app/src/main/java/code/name/monkey/retromusic/model/Home.java @@ -1,9 +1,9 @@ package code.name.monkey.retromusic.model; -import androidx.annotation.StringRes; - import java.util.ArrayList; +import androidx.annotation.DrawableRes; +import androidx.annotation.StringRes; import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.HomeSection; public class Home { @@ -13,14 +13,17 @@ public class Home { int subtitle; @HomeSection int homeSection; + @DrawableRes + int icon; ArrayList arrayList; - public Home(int title, int subtitle, ArrayList arrayList, @HomeSection int homeSection) { + public Home(int title, int subtitle, ArrayList arrayList, @HomeSection int homeSection, @DrawableRes int icon) { this.title = title; this.subtitle = subtitle; this.arrayList = arrayList; this.homeSection = homeSection; + this.icon = icon; } @HomeSection @@ -41,4 +44,9 @@ public class Home { public ArrayList getArrayList() { return arrayList; } + + @DrawableRes + public int getIcon() { + return icon; + } } diff --git a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt index a1db74be..f7ded2a2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt @@ -33,13 +33,13 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home topArtists: ArrayList, genres: ArrayList, favoritePlaylist: ArrayList -> val homes: ArrayList = ArrayList() - if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS)) - if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS)) - if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS)) - if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS)) - if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS)) - if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS)) - if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES)) + if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS, R.drawable.ic_audiotrack_black_24dp)) + if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS, R.drawable.ic_artist_white_24dp)) + if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS, R.drawable.ic_album_white_24dp)) + if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS, R.drawable.ic_artist_white_24dp)) + if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS, R.drawable.ic_album_white_24dp)) + if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS, R.drawable.ic_favorite_white_24dp)) + if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES, R.drawable.ic_guitar_acoustic_white_24dp)) homes }).subscribe({ homes -> if (homes.isNotEmpty()) { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/EqualizerActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/EqualizerActivity.kt index f72b17b4..da3c8bdd 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/EqualizerActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/EqualizerActivity.kt @@ -10,9 +10,12 @@ import android.widget.ArrayAdapter import android.widget.SeekBar import android.widget.TextView import code.name.monkey.appthemehelper.ThemeStore +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.helper.EqualizerHelper import code.name.monkey.retromusic.ui.activities.base.AbsMusicServiceActivity +import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.activity_equalizer.* /** @@ -71,6 +74,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL setupToolbar() equalizerSwitch.isChecked = EqualizerHelper.instance!!.equalizer.enabled + TintHelper.setTintAuto(equalizerSwitch, ThemeStore.accentColor(this), false) equalizerSwitch.setOnCheckedChangeListener { buttonView, isChecked -> when (buttonView.id) { R.id.equalizerSwitch -> { @@ -86,9 +90,11 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL presets.onItemSelectedListener = this bassBoostStrength.progress = EqualizerHelper.instance!!.bassBoostStrength + ViewUtil.setProgressDrawable(bassBoostStrength, ThemeStore.accentColor(this)) bassBoostStrength.setOnSeekBarChangeListener(mSeekBarChangeListener) virtualizerStrength.progress = EqualizerHelper.instance!!.virtualizerStrength + ViewUtil.setProgressDrawable(virtualizerStrength, ThemeStore.accentColor(this)) virtualizerStrength.setOnSeekBarChangeListener(mSeekBarChangeListener) setupUI() @@ -112,6 +118,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) setNavigationOnClickListener { onBackPressed() } setSupportActionBar(this) + ToolbarContentTintHelper.colorBackButton(this, ThemeStore.textColorSecondary(context)) } title = null } @@ -149,6 +156,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL maxDbTextView.text = String.format("%d dB", EqualizerHelper.instance!!.bandLevelHigh / 100) val bar = view.findViewById(R.id.seekbar) + ViewUtil.setProgressDrawable(bar, ThemeStore.accentColor(this)) bar.max = EqualizerHelper.instance!!.bandLevelHigh - EqualizerHelper.instance!! .bandLevelLow bar.progress = EqualizerHelper.instance!!.getBandLevel(i) - EqualizerHelper.instance!! diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt index 3725d963..47b6b158 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt @@ -157,7 +157,7 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage MaterialDialog(this).show { title(text = "Add lyrics") - neutralButton(text = "Search") { RetroUtil.openUrl(this@LyricsActivity, googleSearchLrcUrl) } + neutralButton(text = "Search") { RetroUtil.openUrl(this@LyricsActivity, getGoogleSearchUrl()) } negativeButton(text = "Delete") { LyricUtil.deleteLrcFile(song.title, song.artistName) } input(hint = "Paste lyrics here", prefill = content, @@ -176,9 +176,9 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage return paths } - private fun getGoogleSearchUrl(title: String?, text: String?): String { + private fun getGoogleSearchUrl(): String { var baseUrl = "http://www.google.com/search?" - var query = "$title+$text" + var query = song.title + "+" + song.artistName query = "q=" + query.replace(" ", "+") + " lyrics" baseUrl += query return baseUrl diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/SupportDevelopmentActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/SupportDevelopmentActivity.kt index 383162bc..51582dfb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/SupportDevelopmentActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/SupportDevelopmentActivity.kt @@ -92,7 +92,7 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH title = null donate.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this)) - ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.accentColor(this)) + ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(this)) } override fun onBillingInitialized() { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt index 29ee5bda..74155697 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.kt @@ -1,14 +1,320 @@ package code.name.monkey.retromusic.ui.activities.base -import android.animation.ArgbEvaluator import android.animation.ValueAnimator import android.annotation.SuppressLint import android.os.Bundle import android.view.View import android.view.ViewGroup import android.view.ViewTreeObserver +import androidx.annotation.LayoutRes +import androidx.fragment.app.Fragment +import code.name.monkey.appthemehelper.ThemeStore +import code.name.monkey.appthemehelper.util.ColorUtil +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.helper.MusicPlayerRemote +import code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment +import code.name.monkey.retromusic.ui.fragments.NowPlayingScreen +import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.adaptive.AdaptiveFragment +import code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.card.CardFragment +import code.name.monkey.retromusic.ui.fragments.player.cardblur.CardBlurFragment +import code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.color.ColorFragment +import code.name.monkey.retromusic.ui.fragments.player.fit.FitFragment +import code.name.monkey.retromusic.ui.fragments.player.flat.FlatPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.full.FullPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment +import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment +import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.views.BottomNavigationBarTinted +import com.sothree.slidinguppanel.SlidingUpPanelLayout +import kotlinx.android.synthetic.main.sliding_music_panel_layout.* + +abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks { + companion object { + val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName + } + + private var miniPlayerFragment: MiniPlayerFragment? = null + private var playerFragment: AbsPlayerFragment? = null + private var currentNowPlayingScreen: NowPlayingScreen? = null + private var navigationBarColor: Int = 0 + private var taskColor: Int = 0 + private var lightStatusBar: Boolean = false + private var lightNavigationBar: Boolean = false + private var navigationBarColorAnimator: ValueAnimator? = null + + protected abstract fun createContentView(): View + + val panelState: SlidingUpPanelLayout.PanelState? + get() = slidingLayout.panelState + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(createContentView()) + + + chooseFragmentForTheme() + setupSlidingUpPanel() + } + + override fun onResume() { + super.onResume() + if (currentNowPlayingScreen != PreferenceUtil.getInstance().nowPlayingScreen) { + postRecreate() + } + } + + override fun onDestroy() { + super.onDestroy() + if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case + } + + + protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View { + @SuppressLint("InflateParams") + val slidingMusicPanelLayout = layoutInflater.inflate(R.layout.sliding_music_panel_layout, null) + val contentContainer = slidingMusicPanelLayout.findViewById(R.id.mainContentFrame) + layoutInflater.inflate(resId, contentContainer) + return slidingMusicPanelLayout + } + + fun setAntiDragView(antiDragView: View) { + slidingLayout.setAntiDragView(antiDragView); + } + + private fun collapsePanel() { + slidingLayout.panelState = SlidingUpPanelLayout.PanelState.COLLAPSED + } + + fun expandPanel() { + slidingLayout.panelState = SlidingUpPanelLayout.PanelState.EXPANDED + } + + private fun setMiniPlayerAlphaProgress(progress: Float) { + if (miniPlayerFragment!!.view == null) return + val alpha = 1 - progress + miniPlayerFragment!!.view!!.alpha = alpha + // necessary to make the views below clickable + miniPlayerFragment!!.view!!.visibility = if (alpha == 0f) View.GONE else View.VISIBLE + + bottomNavigationView.translationY = progress * 500 + bottomNavigationView.alpha = alpha + } + + open fun onPanelCollapsed() { + // restore values + super.setLightStatusbar(lightStatusBar) + super.setTaskDescriptionColor(taskColor) + super.setNavigationbarColor(navigationBarColor) + super.setLightNavigationBar(lightNavigationBar) + + + playerFragment!!.setMenuVisibility(false) + playerFragment!!.userVisibleHint = false + playerFragment!!.onHide() + } + + open fun onPanelExpanded() { + val playerFragmentColor = playerFragment!!.paletteColor + super.setTaskDescriptionColor(playerFragmentColor) + + playerFragment!!.setMenuVisibility(true) + playerFragment!!.userVisibleHint = true + playerFragment!!.onShow() + onPaletteColorChanged() + } + + private fun setupSlidingUpPanel() { + slidingLayout.viewTreeObserver + .addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this) + + if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { + onPanelSlide(slidingLayout, 1f) + onPanelExpanded() + } else if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { + onPanelCollapsed() + } else { + playerFragment!!.onHide() + } + } + }) + + slidingLayout.addPanelSlideListener(this) + + } + + fun toggleBottomNavigationView(toggle: Boolean) { + bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE + } + + fun getBottomNavigationView(): BottomNavigationBarTinted { + return bottomNavigationView + } + + fun hideBottomBar(hide: Boolean) { + val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height) + val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded) + + if (hide) { + slidingLayout.panelHeight = 0 + collapsePanel() + } else { + if (!MusicPlayerRemote.playingQueue.isEmpty()) { + slidingLayout.panelHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar + } + } + } + + fun setBottomBarVisibility(gone: Int) { + bottomNavigationView.visibility = gone + hideBottomBar(false) + } + + private fun chooseFragmentForTheme() { + currentNowPlayingScreen = PreferenceUtil.getInstance().nowPlayingScreen + + val fragment: Fragment = when (currentNowPlayingScreen) { + NowPlayingScreen.BLUR -> BlurPlayerFragment() + NowPlayingScreen.ADAPTIVE -> AdaptiveFragment() + NowPlayingScreen.NORMAL -> PlayerFragment() + NowPlayingScreen.CARD -> CardFragment() + NowPlayingScreen.BLUR_CARD -> CardBlurFragment() + NowPlayingScreen.FIT -> FitFragment() + NowPlayingScreen.FLAT -> FlatPlayerFragment() + NowPlayingScreen.FULL -> FullPlayerFragment() + NowPlayingScreen.PLAIN -> PlainPlayerFragment() + NowPlayingScreen.SIMPLE -> SimplePlayerFragment() + NowPlayingScreen.MATERIAL -> MaterialFragment() + NowPlayingScreen.COLOR -> ColorFragment() + NowPlayingScreen.CLASSIC -> ClassicPlayerFragment() + else -> PlayerFragment() + } // must implement AbsPlayerFragment + supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit() + supportFragmentManager.executePendingTransactions() + + playerFragment = supportFragmentManager.findFragmentById(R.id.playerFragmentContainer) as AbsPlayerFragment + miniPlayerFragment = supportFragmentManager.findFragmentById(R.id.miniPlayerFragment) as MiniPlayerFragment + miniPlayerFragment!!.view!!.setOnClickListener { expandPanel() } + } + + override fun onServiceConnected() { + super.onServiceConnected() + if (!MusicPlayerRemote.playingQueue.isEmpty()) { + slidingLayout.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this) + hideBottomBar(false) + } + }) + } // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout + } + + override fun onQueueChanged() { + super.onQueueChanged() + hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty()) + } + + override fun onBackPressed() { + if (!handleBackPress()) + super.onBackPressed() + } + + open fun handleBackPress(): Boolean { + if (slidingLayout.panelHeight != 0 && playerFragment!!.onBackPressed()) + return true + if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { + collapsePanel() + return true + } + return false + } + + override fun onPanelSlide(panel: View?, slideOffset: Float) { + setMiniPlayerAlphaProgress(slideOffset) + } + + override fun onPanelStateChanged(panel: View, previousState: SlidingUpPanelLayout.PanelState, newState: SlidingUpPanelLayout.PanelState) { + when (newState) { + SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed() + SlidingUpPanelLayout.PanelState.EXPANDED -> onPanelExpanded() + SlidingUpPanelLayout.PanelState.ANCHORED -> collapsePanel() // this fixes a bug where the panel would get stuck for some reason + else -> { + } + } + } + + override fun onPaletteColorChanged() { + if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { + val paletteColor = playerFragment!!.paletteColor + super.setTaskDescriptionColor(paletteColor) + + val isColorLight = ColorUtil.isColorLight(paletteColor) + if (PreferenceUtil.getInstance().adaptiveColor && + (currentNowPlayingScreen == NowPlayingScreen.NORMAL || currentNowPlayingScreen == NowPlayingScreen.FLAT)) { + super.setLightNavigationBar(true) + super.setLightStatusbar(isColorLight) + } else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD || + currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC || + currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) { + super.setLightStatusbar(false) + super.setLightNavigationBar(true) + } else if (currentNowPlayingScreen == NowPlayingScreen.COLOR) { + super.setNavigationbarColor(paletteColor) + super.setLightNavigationBar(isColorLight) + super.setLightStatusbar(isColorLight) + } else { + super.setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(this))) + super.setLightNavigationBar(true) + } + } + } + + override fun setLightStatusbar(enabled: Boolean) { + lightStatusBar = enabled + if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { + super.setLightStatusbar(enabled) + } + } + + override fun setLightNavigationBar(enabled: Boolean) { + lightNavigationBar = enabled + if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { + super.setLightNavigationBar(enabled) + } + } + + override fun setNavigationbarColor(color: Int) { + navigationBarColor = color + if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { + if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() + super.setNavigationbarColor(color) + } + } + + override fun setTaskDescriptionColor(color: Int) { + taskColor = color + if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { + super.setTaskDescriptionColor(color) + } + } +} +/*import android.animation.ArgbEvaluator +import android.animation.ValueAnimator +import android.annotation.SuppressLint +import android.os.Bundle +import android.os.PersistableBundle +import android.view.View +import android.view.ViewGroup +import android.view.ViewTreeObserver import androidx.annotation.FloatRange import androidx.annotation.LayoutRes +import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.ColorUtil @@ -29,13 +335,14 @@ import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerFragment import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.views.BottomNavigationBarTinted import com.sothree.slidinguppanel.SlidingUpPanelLayout import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState import kotlinx.android.synthetic.main.sliding_music_panel_layout.* -abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks { +abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks { private var miniPlayerFragment: MiniPlayerFragment? = null @@ -218,6 +525,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe NowPlayingScreen.SIMPLE -> SimplePlayerFragment() NowPlayingScreen.MATERIAL -> MaterialFragment() NowPlayingScreen.COLOR -> ColorFragment() + NowPlayingScreen.CLASSIC -> ClassicPlayerFragment() else -> PlayerFragment() } // must implement AbsPlayerFragment supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit() @@ -256,7 +564,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe super.setLightNavigationBar(true) super.setLightStatusbar(isColorLight) } else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD || - currentNowPlayingScreen == NowPlayingScreen.FIT || + currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC|| currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) { super.setLightStatusbar(false) super.setLightNavigationBar(true) @@ -309,4 +617,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName } -} \ No newline at end of file + fun setAntiDragView( antiDragView:View ) { + slidingLayout.setAntiDragView(antiDragView); + } +}*/ diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt index fb9ff813..0a8208c5 100755 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/tageditor/AbsTagEditorActivity.kt @@ -27,7 +27,6 @@ import java.io.File abstract class AbsTagEditorActivity : AbsBaseActivity() { - private lateinit var items: Array protected var id: Int = 0 private set private var paletteColorPrimary: Int = 0 @@ -37,7 +36,7 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() { protected val show: MaterialDialog get() = MaterialDialog(this@AbsTagEditorActivity).show { title(R.string.update_image) - listItems(items = items as List) { _, position, _ -> + listItems(items = items) { _, position, _ -> when (position) { 0 -> getImageFromLastFM() 1 -> startImagePicker() @@ -187,9 +186,11 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() { //observableScrollView.setScrollViewCallbacks(observableScrollViewCallbacks); } + private lateinit var items: List + private fun setUpImageView() { loadCurrentImage() - items = arrayOf(getString(R.string.download_from_last_fm), getString(R.string.pick_from_local_storage), getString(R.string.web_search), getString(R.string.remove_cover)) + items = listOf(getString(R.string.download_from_last_fm), getString(R.string.pick_from_local_storage), getString(R.string.web_search), getString(R.string.remove_cover)) editorImage.setOnClickListener { show } } @@ -210,6 +211,8 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() { protected abstract fun deleteImage() private fun setUpFab() { + saveFab.setColor(ThemeStore.accentColor(this)) + saveFab.setShowTitle(true) saveFab.apply { scaleX = 0f scaleY = 0f @@ -311,11 +314,11 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() { protected abstract fun loadImageFromFile(selectedFile: Uri?) private fun getAudioFile(path: String): AudioFile { - try { - return AudioFileIO.read(File(path)) + return try { + AudioFileIO.read(File(path)) } catch (e: Exception) { Log.e(TAG, "Could not read audio file $path", e) - return AudioFile() + AudioFile() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/HomeAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/HomeAdapter.kt index 70a876ae..8ccbec9d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/HomeAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/HomeAdapter.kt @@ -26,6 +26,7 @@ import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWidthAdapter import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter import code.name.monkey.retromusic.ui.adapter.song.SongAdapter import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.views.IconImageView import code.name.monkey.retromusic.views.MetalRecyclerViewPager import com.google.android.material.floatingactionbutton.FloatingActionButton @@ -97,6 +98,7 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar } private inner class SuggestionViewHolder(view: View) : RecyclerView.ViewHolder(view) { + private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon) private val ids: ArrayList = arrayListOf(R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6, R.id.image_7) private var textView: TextView = itemView.findViewById(R.id.text) private var playSuggestion: FloatingActionButton = itemView.findViewById(R.id.playSuggestions) @@ -129,6 +131,7 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar setTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))) } title.text = activity.getString(home.title) + icon.setImageResource(home.icon) playSuggestion.apply { TintHelper.setTintAuto(this, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false) @@ -144,10 +147,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList, displayMetrics) } title.text = activity.getString(home.title) + icon.setImageResource(home.icon) } - val recyclerView: MetalRecyclerViewPager = view.findViewById(R.id.recyclerView) - val title: TextView = view.findViewById(R.id.sectionTitle) + private val recyclerView: MetalRecyclerViewPager = view.findViewById(R.id.recyclerView) + private val title: TextView = view.findViewById(R.id.sectionTitle) + private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon) } @@ -159,11 +164,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar adapter = artistAdapter } title.text = activity.getString(home.title) + icon.setImageResource(home.icon) } - val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) - val title: TextView = view.findViewById(R.id.sectionTitle) - + private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) + private val title: TextView = view.findViewById(R.id.sectionTitle) + private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon) } private inner class GenreViewHolder(view: View) : RecyclerView.ViewHolder(view) { @@ -175,10 +181,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar } title.text = activity.getString(home.title) + icon.setImageResource(home.icon) } - val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) - val title: TextView = view.findViewById(R.id.sectionTitle) + private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) + private val title: TextView = view.findViewById(R.id.sectionTitle) + private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon) } @@ -192,10 +200,11 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar } title.text = activity.getString(home.title) + icon.setImageResource(home.icon) } - val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) - val title: TextView = view.findViewById(R.id.sectionTitle) - + private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) + private val title: TextView = view.findViewById(R.id.sectionTitle) + private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon) } } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/album/AlbumAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/album/AlbumAdapter.kt index 5c6111ec..1bfe7833 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/album/AlbumAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/album/AlbumAdapter.kt @@ -213,6 +213,6 @@ open class AlbumAdapter(protected val activity: AppCompatActivity, companion object { - val TAG = AlbumAdapter::class.java.simpleName + val TAG = AlbumAdapter::class.java.simpleName!! } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/song/PlayingQueueAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/song/PlayingQueueAdapter.kt index 9ba99efc..3dd00b10 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/song/PlayingQueueAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/song/PlayingQueueAdapter.kt @@ -30,8 +30,10 @@ class PlayingQueueAdapter : SongAdapter, DraggableItemAdapter, current: Int, - @LayoutRes itemLayoutRes: Int, @ColorInt color: Int) : super(activity, dataSet, itemLayoutRes, false, null) { + constructor(activity: AppCompatActivity, + dataSet: ArrayList, current: Int, + @LayoutRes itemLayoutRes: Int, + @ColorInt color: Int) : super(activity, dataSet, itemLayoutRes, false, null) { this.current = current this.color = color } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.kt index f83b70e2..19e671b1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.kt @@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.fragments import android.animation.ObjectAnimator import android.annotation.SuppressLint import android.content.Context -import android.content.res.ColorStateList import android.os.Bundle import android.text.SpannableString import android.text.SpannableStringBuilder @@ -19,6 +18,7 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsMusicServiceFragment import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.RetroUtil +import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.fragment_mini_player.* open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpdateHelper.Callback, View.OnClickListener { @@ -66,7 +66,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda private fun setUpMiniPlayer() { setUpPlayPauseButton() - progressBar.progressTintList = ColorStateList.valueOf(ThemeStore.accentColor(activity!!)) + ViewUtil.setProgressDrawable(progressBar, ThemeStore.accentColor(context!!)) } private fun setUpPlayPauseButton() { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt index f933a2d7..84ed5160 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.kt @@ -20,7 +20,7 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes MATERIAL(R.string.material, R.drawable.np_material, 11), NORMAL(R.string.normal, R.drawable.np_normal, 0), PLAIN(R.string.plain, R.drawable.np_plain, 3), - //TINY(R.string.tiny, R.drawable.np_tiny, 7), + CLASSIC(R.string.classic, R.drawable.np_normal, 7), SIMPLE(R.string.simple, R.drawable.np_simple, 8) } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt index 68a12d1c..307f544c 100755 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/VolumeFragment.kt @@ -11,6 +11,7 @@ import android.view.ViewGroup import android.widget.SeekBar import androidx.fragment.app.Fragment import code.name.monkey.appthemehelper.ThemeStore +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.helper.MusicPlayerRemote @@ -33,9 +34,13 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - TintHelper.setTintAuto(volumeSeekBar, ThemeStore.textColorPrimary(context!!), false) + setTintable(ThemeStore.accentColor(context!!)) volumeDown.setOnClickListener(this) volumeUp.setOnClickListener(this) + + val iconColor = ATHUtil.resolveColor(context!!, R.attr.iconColor) + volumeDown.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) + volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) } override fun onResume() { @@ -95,21 +100,16 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum } fun tintWhiteColor() { - setTintable(Color.WHITE) + val iconColor = Color.WHITE + volumeDown.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) + volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) + TintHelper.setTintAuto(volumeSeekBar, iconColor, false) + } - private fun setProgressBarColor(newColor: Int) { - - //volumeSeekBar.thumbTintList = ColorStateList.valueOf(newColor) - //volumeSeekBar.progressTintList = ColorStateList.valueOf(newColor) - //volumeSeekBar.progressBackgroundTintList = ColorStateList.valueOf(newColor) - TintHelper.setTintAuto(volumeSeekBar, newColor, false) - volumeDown.setColorFilter(newColor, PorterDuff.Mode.SRC_IN) - volumeUp.setColorFilter(newColor, PorterDuff.Mode.SRC_IN) - } fun setTintable(color: Int) { - setProgressBarColor(color) + TintHelper.setTintAuto(volumeSeekBar, color, false) } fun removeThumb() { @@ -125,6 +125,12 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum } } + fun setTintableColor(color: Int) { + volumeDown.setColorFilter(color, PorterDuff.Mode.SRC_IN) + volumeUp.setColorFilter(color, PorterDuff.Mode.SRC_IN) + TintHelper.setTintAuto(volumeSeekBar, color, false) + } + companion object { fun newInstance(): VolumeFragment { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerControlsFragment.kt index 64319b85..0f6f0db9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerControlsFragment.kt @@ -57,6 +57,10 @@ abstract class AbsPlayerControlsFragment : AbsMusicServiceFragment(), MusicProgr } private fun hideVolumeIfAvailable() { - volumeFragmentContainer.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE + volumeFragmentContainer?.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE + } + + companion object { + const val SLIDER_ANIMATION_TIME: Long = 400 } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt index 80286a76..78ae3e6d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.kt @@ -27,6 +27,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.views.FitSystemWindowsLayout + abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItemClickListener, PaletteColorHolder, PlayerAlbumCoverFragment.Callbacks { var callbacks: Callbacks? = null private set @@ -189,9 +190,9 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem val activity = activity if (activity != null) { val res = if (isFavorite!!) - R.drawable.ic_favorite_white_24dp + code.name.monkey.retromusic.R.drawable.ic_favorite_white_24dp else - R.drawable.ic_favorite_border_white_24dp + code.name.monkey.retromusic.R.drawable.ic_favorite_border_white_24dp val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor()) toolbarGet().menu.findItem(R.id.action_toggle_favorite).setIcon(drawable).title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites) } @@ -202,14 +203,13 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) view.setBackgroundColor(ThemeStore.primaryColor(activity!!)) - if (PreferenceUtil.getInstance().fullScreenMode) { - if (view.findViewById(R.id.status_bar) != null) - view.findViewById(R.id.status_bar).visibility = View.GONE + if (PreferenceUtil.getInstance().fullScreenMode && view.findViewById(R.id.status_bar) != null) { + view.findViewById(R.id.status_bar).visibility = View.GONE } } fun setSafeArea(safeArea: View) { - val layout = safeArea.findViewById(R.id.safeArea) + val layout = safeArea.findViewById(code.name.monkey.retromusic.R.id.safeArea) if (layout != null) { layout.isFit = !PreferenceUtil.getInstance().fullScreenMode } @@ -224,4 +224,13 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem val TAG: String = AbsPlayerFragment::class.java.simpleName } + protected fun getUpNextAndQueueTime(): String { + val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position) + + return MusicUtil.buildInfoString( + resources.getString(R.string.up_next), + MusicUtil.getReadableDurationString(duration) + ) + } + } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java index d0a72eda..fa07aec0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/folders/FoldersFragment.java @@ -14,6 +14,7 @@ import android.view.View; import android.view.ViewGroup; import android.webkit.MimeTypeMap; import android.widget.PopupMenu; +import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -737,8 +738,15 @@ public class FoldersFragment extends AbsMainActivityFragment implements @Override protected Dialog createDialog(@NonNull Context context) { - return new MaterialDialog(context) - .title(R.string.listing_files,""); + View view= LayoutInflater.from(context).inflate(R.layout.progress_bar,null); + ProgressBar progressBar= view.findViewById(R.id.progressBar); + ViewUtil.INSTANCE.setProgressDrawable(progressBar,ThemeStore.Companion.accentColor(context)); + + MaterialDialog materialDialog= new MaterialDialog(context); + materialDialog.setContentView(R.layout.progress_bar); + materialDialog.title(R.string.listing_files,""); + return materialDialog; + } } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt index c2fefd1a..87e53127 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt @@ -19,9 +19,11 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.fragment_adaptive_player_playback_controls.* class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { @@ -29,6 +31,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -44,6 +47,8 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -103,7 +108,8 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { } TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, colorFinal, true) - TintHelper.setTintAuto(progressSlider, colorFinal, false) + ViewUtil.setProgressDrawable(progressSlider, colorFinal, true) + volumeFragment.setTintable(colorFinal) } private fun updatePlayPauseColor() { @@ -177,7 +183,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt index 0716809e..95ed2a35 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlaybackControlsFragment.kt @@ -35,6 +35,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -50,6 +51,8 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -58,7 +61,8 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { } showBonceAnimation() } - val volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment volumeFragment.tintWhiteColor() } @@ -250,7 +254,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardPlaybackControlsFragment.kt index f12d061d..0f1b4a80 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardPlaybackControlsFragment.kt @@ -19,8 +19,10 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil +import code.name.monkey.retromusic.util.PreferenceUtil import kotlinx.android.synthetic.main.fragment_card_player_playback_controls.* import kotlinx.android.synthetic.main.media_button.* @@ -29,6 +31,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -54,6 +57,8 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { } showBonceAnimation(playPauseButton) } + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment } private fun setupControls() { @@ -121,8 +126,18 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { updatePlayPauseColor() updateProgressTextColor() - TintHelper.setTintAuto(playPauseButton!!, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false) - TintHelper.setTintAuto(playPauseButton!!, color, true) + + val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { + color + } else { + ThemeStore.accentColor(context!!) + } + + TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false) + TintHelper.setTintAuto(playPauseButton, colorFinal, true) + + volumeFragment.setTintable(colorFinal) + } private fun updatePlayPauseColor() { @@ -196,7 +211,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt index 297bcf08..047632cc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt @@ -10,7 +10,6 @@ import android.view.ViewGroup import android.view.animation.DecelerateInterpolator import android.view.animation.LinearInterpolator import android.widget.SeekBar -import androidx.core.content.ContextCompat import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.TintHelper @@ -23,6 +22,7 @@ import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil +import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.fragment_card_blur_player_playback_controls.* import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.player_time.* @@ -31,7 +31,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { @@ -60,6 +61,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { updateShuffleState() updatePrevNextColor() updateProgressTextColor() + + ViewUtil.setProgressDrawable(progressSlider, Color.WHITE, true) } @@ -79,8 +82,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { } private fun setupVolumeControls() { - val volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment - volumeFragment.setTintable(ContextCompat.getColor(context!!, R.color.md_white_1000)) + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + volumeFragment.tintWhiteColor() } private fun updateProgressTextColor() { @@ -92,12 +95,12 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onServiceConnected() { @@ -205,7 +208,7 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerFragment.kt new file mode 100644 index 00000000..887e81b5 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerFragment.kt @@ -0,0 +1,415 @@ +package code.name.monkey.retromusic.ui.fragments.player.classic + +import android.animation.Animator +import android.animation.AnimatorSet +import android.graphics.Color +import android.graphics.PorterDuff +import android.os.Build +import android.os.Bundle +import android.view.* +import android.widget.ImageView +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.Toolbar +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import code.name.monkey.appthemehelper.ThemeStore +import code.name.monkey.appthemehelper.util.ATHUtil +import code.name.monkey.appthemehelper.util.ColorUtil +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.dialogs.SongShareDialog +import code.name.monkey.retromusic.helper.MusicPlayerRemote +import code.name.monkey.retromusic.helper.menu.SongMenuHelper +import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.model.lyrics.Lyrics +import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity +import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder +import code.name.monkey.retromusic.ui.adapter.song.PlayingQueueAdapter +import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment +import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment +import code.name.monkey.retromusic.util.MusicUtil +import code.name.monkey.retromusic.util.RetroUtil +import code.name.monkey.retromusic.util.ViewUtil +import code.name.monkey.retromusic.views.WidthFitSquareLayout +import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator +import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager +import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils +import com.sothree.slidinguppanel.SlidingUpPanelLayout +import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState.ANCHORED +import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState.COLLAPSED +import kotlinx.android.synthetic.main.fragment_classic_player.* +import kotlinx.android.synthetic.main.fragment_classic_player_playback_controls.* + + +class ClassicPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks, SlidingUpPanelLayout.PanelSlideListener { + override fun onPanelSlide(p0: View?, p1: Float) { + + } + + override fun onPanelStateChanged(p0: View?, p1: SlidingUpPanelLayout.PanelState?, p2: SlidingUpPanelLayout.PanelState?) { + when (p2) { + COLLAPSED -> onPanelCollapsed(p0!!) + ANCHORED -> playerSlidingLayout.panelState = COLLAPSED // this fixes a bug where the panel would get stuck for some reason + else -> { + + } + } + } + + override fun toolbarGet(): Toolbar { + return playerToolbar + } + + override fun onShow() { + classicPlaybackControlsFragment.show() + } + + override fun onHide() { + classicPlaybackControlsFragment.hide() + onBackPressed() + } + + override fun onBackPressed(): Boolean { + var wasExpanded = false + if (playerSlidingLayout != null) { + wasExpanded = playerSlidingLayout.panelState === SlidingUpPanelLayout.PanelState.EXPANDED + playerSlidingLayout.panelState = COLLAPSED + } + + return wasExpanded + } + + override fun toolbarIconColor(): Int { + return Color.WHITE + } + + override val paletteColor: Int + get() = lastColor + + override fun onColorChanged(color: Int) { + animateColorChange(color) + classicPlaybackControlsFragment.setDark(ColorUtil.isColorLight(color)) + callbacks?.onPaletteColorChanged() + } + + override fun toggleFavorite(song: Song) { + super.toggleFavorite(song) + if (song.id == MusicPlayerRemote.currentSong.id) { + updateIsFavorite() + } + } + + override fun onFavoriteToggled() { + toggleFavorite(MusicPlayerRemote.currentSong) + } + + + var lastColor: Int = 0 + + lateinit var classicPlaybackControlsFragment: ClassicPlayerPlaybackControlsFragment + private var playerAlbumCoverFragment: PlayerAlbumCoverFragment? = null + + private lateinit var layoutManager: LinearLayoutManager + private lateinit var playingQueueAdapter: PlayingQueueAdapter + private lateinit var wrappedAdapter: RecyclerView.Adapter<*> + private lateinit var recyclerViewDragDropManager: RecyclerViewDragDropManager + + private var lyrics: Lyrics? = null + + private lateinit var impl: Impl + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + if (RetroUtil.isLandscape()) { + impl = LandscapeImpl(this) + } else { + impl = PortraitImpl(this) + } + + return inflater.inflate(R.layout.fragment_classic_player, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + impl.init() + + setUpPlayerToolbar() + setUpSubFragments() + setUpRecyclerView() + + playerSlidingLayout.addPanelSlideListener(this) + playerSlidingLayout.setAntiDragView(view.findViewById(code.name.monkey.retromusic.R.id.draggableArea)) + + view.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + view.viewTreeObserver.removeOnGlobalLayoutListener(this) + impl.setUpPanelAndAlbumCoverHeight() + } + }) + + // for some reason the xml attribute doesn't get applied here. + playingQueueCard.setCardBackgroundColor(ATHUtil.resolveColor(activity, code.name.monkey.retromusic.R.attr.cardBackgroundColor)) + } + + private fun setUpPlayerToolbar() { + playerToolbar.apply { + inflateMenu(code.name.monkey.retromusic.R.menu.menu_player) + setNavigationIcon(code.name.monkey.retromusic.R.drawable.ic_close_white_24dp) + setNavigationOnClickListener { v -> activity!!.onBackPressed() } + setOnMenuItemClickListener(this@ClassicPlayerFragment) + } + } + + + private fun setUpSubFragments() { + classicPlaybackControlsFragment = childFragmentManager.findFragmentById(R.id.playbackControlsFragment) as ClassicPlayerPlaybackControlsFragment + playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment + playerAlbumCoverFragment?.setCallbacks(this) + + } + + private fun setUpRecyclerView() { + recyclerViewDragDropManager = RecyclerViewDragDropManager() + val animator = RefactoredDefaultItemAnimator() + + playingQueueAdapter = PlayingQueueAdapter( + activity as AppCompatActivity, + MusicPlayerRemote.playingQueue, + MusicPlayerRemote.position, + R.layout.item_queue) + wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter) + + layoutManager = LinearLayoutManager(activity) + + playerRecyclerView.layoutManager = layoutManager + playerRecyclerView.adapter = wrappedAdapter + playerRecyclerView.itemAnimator = animator + + recyclerViewDragDropManager.attachRecyclerView(playerRecyclerView) + + layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0) + } + + override fun onDestroyView() { + if (playerSlidingLayout != null) { + playerSlidingLayout.removePanelSlideListener(this) + } + recyclerViewDragDropManager.release() + + if (playerRecyclerView != null) { + playerRecyclerView.itemAnimator = null + playerRecyclerView.adapter = null + } + WrapperAdapterUtils.releaseAll(wrappedAdapter) + super.onDestroyView() + } + + override fun onPause() { + recyclerViewDragDropManager.cancelDrag() + super.onPause() + } + + override fun onServiceConnected() { + updateQueue() + updateCurrentSong() + updateIsFavorite() + //updateLyrics() + } + + override fun onPlayingMetaChanged() { + updateCurrentSong() + updateIsFavorite() + updateQueuePosition() + //updateLyrics() + } + + override fun onQueueChanged() { + updateQueue() + } + + override fun onMediaStoreChanged() { + updateQueue() + } + + private fun updateQueue() { + playingQueueAdapter.swapDataSet(MusicPlayerRemote.playingQueue, MusicPlayerRemote.position) + playerQueueSubHeader.text = getUpNextAndQueueTime() + if (playerSlidingLayout.panelState === COLLAPSED) { + resetToCurrentPosition() + } + } + + private fun updateQueuePosition() { + playingQueueAdapter.setCurrent(MusicPlayerRemote.position) + playerQueueSubHeader.text = getUpNextAndQueueTime() + if (playerSlidingLayout.panelState === COLLAPSED) { + resetToCurrentPosition() + } + } + + private fun updateCurrentSong() { + impl.updateCurrentSong(MusicPlayerRemote.currentSong) + } + + private fun animateColorChange(newColor: Int) { + impl.animateColorChange(newColor) + lastColor = newColor + } + + private fun onPanelCollapsed(panel: View) { + resetToCurrentPosition() + } + + private fun resetToCurrentPosition() { + playerRecyclerView.stopScroll() + layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0) + } +} + +abstract class BaseImpl(private val fragment: ClassicPlayerFragment) : Impl { + fun createDefaultColorChangeAnimatorSet(color: Int): AnimatorSet { + val backgroundAnimator: Animator + backgroundAnimator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + val x = (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.x + (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.width / 2).toFloat() + fragment.classicPlaybackControlsFragment.view!!.x).toInt() + val y = (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.y + (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.height / 2).toFloat() + fragment.classicPlaybackControlsFragment.view!!.y + fragment.classicPlaybackControlsFragment.playerProgressSlider.height.toFloat()).toInt() + val startRadius = Math.max(fragment.classicPlaybackControlsFragment.playerPlayPauseFab.width / 2, fragment.classicPlaybackControlsFragment.playerPlayPauseFab.height / 2).toFloat() + val endRadius = Math.max(fragment.colorBackground.width, fragment.colorBackground.height).toFloat() + fragment.colorBackground.setBackgroundColor(color) + ViewAnimationUtils.createCircularReveal(fragment.colorBackground, x, y, startRadius, endRadius) + } else { + ViewUtil.createBackgroundColorTransition(fragment.colorBackground, fragment.lastColor, color) + } + + val animatorSet = AnimatorSet() + + animatorSet.play(backgroundAnimator) + + if (!ATHUtil.isWindowBackgroundDark(fragment.activity!!)) { + val adjustedLastColor = if (ColorUtil.isColorLight(fragment.lastColor)) ColorUtil.darkenColor(fragment.lastColor) else fragment.lastColor + val adjustedNewColor = if (ColorUtil.isColorLight(color)) ColorUtil.darkenColor(color) else color + val subHeaderAnimator = ViewUtil.createTextColorTransition(fragment.playerQueueSubHeader, adjustedLastColor, adjustedNewColor) + animatorSet.play(subHeaderAnimator) + } + animatorSet.duration = ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong() + return animatorSet + } + + override fun animateColorChange(newColor: Int) { + if (ATHUtil.isWindowBackgroundDark(fragment.activity!!)) { + fragment.playerQueueSubHeader.setTextColor(ThemeStore.textColorSecondary(fragment.activity!!)) + } + } +} + +class PortraitImpl(private val fragment: ClassicPlayerFragment) : BaseImpl(fragment) { + override fun init() { + currentSongViewHolder = MediaEntryViewHolder(fragment.view?.findViewById(R.id.currentSong)!!) + + currentSongViewHolder?.apply { + separator?.visibility = View.VISIBLE + shortSeparator?.visibility = View.GONE + image?.apply { + scaleType = ImageView.ScaleType.CENTER + setColorFilter(ATHUtil.resolveColor(fragment.activity!!, code.name.monkey.retromusic.R.attr.iconColor, ThemeStore.textColorSecondary(fragment.activity!!)), PorterDuff.Mode.SRC_IN) + setImageResource(code.name.monkey.retromusic.R.drawable.ic_equalizer_white_24dp) + + } + imageTextContainer?.cardElevation = 0f + itemView.setOnClickListener { + // toggle the panel + if (fragment.playerSlidingLayout.panelState == COLLAPSED) { + fragment.playerSlidingLayout.panelState = SlidingUpPanelLayout.PanelState.EXPANDED + } else if (fragment.playerSlidingLayout.panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { + fragment.playerSlidingLayout.panelState = COLLAPSED + } + } + menu?.setOnClickListener(object : SongMenuHelper.OnClickSongMenu((fragment.activity as AppCompatActivity?)!!) { + override val song: Song + get() = currentSong + + override val menuRes: Int + get() = code.name.monkey.retromusic.R.menu.menu_item_playing_queue_song + + override fun onMenuItemClick(item: MenuItem): Boolean { + when (item.itemId) { + code.name.monkey.retromusic.R.id.action_remove_from_playing_queue -> { + MusicPlayerRemote.removeFromQueue(MusicPlayerRemote.position) + return true + } + code.name.monkey.retromusic.R.id.action_share -> { + SongShareDialog.create(song).show(fragment.fragmentManager, "SONG_SHARE_DIALOG") + return true + } + } + return super.onMenuItemClick(item) + } + }) + } + } + + override fun updateCurrentSong(song: Song) { + currentSong = song + currentSongViewHolder?.apply { + title?.text = song.title + text?.text = MusicUtil.getSongInfoString(song) + } + } + + override fun animateColorChange(newColor: Int) { + fragment.playerSlidingLayout.setBackgroundColor(fragment.lastColor) + createDefaultColorChangeAnimatorSet(newColor).start() + } + + override fun setUpPanelAndAlbumCoverHeight() { + val albumCoverContainer = fragment.view!!.findViewById(R.id.albumCoverContainer) + val availablePanelHeight = fragment.playerSlidingLayout.height - fragment.view!!.findViewById(R.id.playerContent).height + ViewUtil.convertDpToPixel(8f, fragment.resources).toInt() + val minPanelHeight = ViewUtil.convertDpToPixel(72f + 24f, fragment.resources).toInt() + + if (availablePanelHeight < minPanelHeight) { + albumCoverContainer.layoutParams.height = albumCoverContainer.height - (minPanelHeight - availablePanelHeight) + albumCoverContainer.forceSquare(false) + } + fragment.playerSlidingLayout.panelHeight = Math.max(minPanelHeight, availablePanelHeight) + + (fragment.activity as AbsSlidingMusicPanelActivity).setAntiDragView(fragment.playerSlidingLayout.findViewById(R.id.playerPanel)) + + } + + private var currentSongViewHolder: MediaEntryViewHolder? = null + var currentSong = Song.EMPTY_SONG!! + +} + +class LandscapeImpl(private val fragment: ClassicPlayerFragment) : BaseImpl(fragment) { + override fun init() { + + } + + override fun updateCurrentSong(song: Song) { + fragment.playerToolbar.title = song.title + fragment.playerToolbar.subtitle = MusicUtil.getSongInfoString(song) + } + + override fun animateColorChange(newColor: Int) { + fragment.playerSlidingLayout.setBackgroundColor(fragment.lastColor) + + val animatorSet = createDefaultColorChangeAnimatorSet(newColor) + animatorSet.play(ViewUtil.createBackgroundColorTransition(fragment.playerToolbar, fragment.lastColor, newColor)).with(ViewUtil.createBackgroundColorTransition(fragment.view?.findViewById(R.id.status_bar)!!, ColorUtil.darkenColor(fragment.lastColor), ColorUtil.darkenColor(newColor))) + animatorSet.start() + } + + override fun setUpPanelAndAlbumCoverHeight() { + val panelHeight = fragment.playerSlidingLayout.height - fragment.classicPlaybackControlsFragment.view?.height!! + fragment.playerSlidingLayout.panelHeight = panelHeight + (fragment.activity as AbsSlidingMusicPanelActivity).setAntiDragView(fragment.playerSlidingLayout.findViewById(R.id.playerPanel)) + + } +} + +internal interface Impl { + fun init() + + fun updateCurrentSong(song: Song) + + fun animateColorChange(newColor: Int) + + fun setUpPanelAndAlbumCoverHeight() +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt new file mode 100644 index 00000000..e824020b --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt @@ -0,0 +1,235 @@ +package code.name.monkey.retromusic.ui.fragments.player.classic + +import android.animation.ObjectAnimator +import android.graphics.Color +import android.graphics.PorterDuff +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.animation.DecelerateInterpolator +import android.view.animation.LinearInterpolator +import android.widget.SeekBar +import androidx.annotation.NonNull +import code.name.monkey.appthemehelper.util.ColorUtil +import code.name.monkey.appthemehelper.util.MaterialValueHelper +import code.name.monkey.appthemehelper.util.TintHelper +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.helper.MusicPlayerRemote +import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper +import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler +import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener +import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment +import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment +import code.name.monkey.retromusic.util.MusicUtil +import code.name.monkey.retromusic.views.PlayPauseDrawable +import kotlinx.android.synthetic.main.fragment_classic_player_playback_controls.* + + +class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { + public override fun show() { + playerPlayPauseFab.animate() + .scaleX(1f) + .scaleY(1f) + .rotation(360f) + .setInterpolator(DecelerateInterpolator()) + .start() + } + + public override fun hide() { + if (playerPlayPauseFab != null) { + playerPlayPauseFab.scaleX = 0f + playerPlayPauseFab.scaleY = 0f + playerPlayPauseFab.rotation = 0f + } + } + + + override fun setDark(color: Int) { + + } + + fun setDark(dark: Boolean) { + if (dark) { + lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(getActivity(), true); + lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(getActivity(), true); + } else { + lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(getActivity(), false); + lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false); + } + + volumeFragment.setTintableColor(lastPlaybackControlsColor) + + updateRepeatState(); + updateShuffleState(); + updatePrevNextColor(); + updateProgressTextColor(); + } + + private var playerFabPlayPauseDrawable: PlayPauseDrawable? = null + + private var lastPlaybackControlsColor = 0 + private var lastDisabledPlaybackControlsColor = 0 + + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + + private lateinit var volumeFragment: VolumeFragment + + override fun onCreateView(@NonNull inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + return inflater.inflate(code.name.monkey.retromusic.R.layout.fragment_classic_player_playback_controls, container, false) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + progressViewUpdateHelper = MusicProgressViewUpdateHelper(this) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + setUpMusicControllers() + updateProgressTextColor() + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + } + + private fun setUpMusicControllers() { + setUpPlayPauseFab() + setUpPrevNext() + setUpRepeatButton() + setUpShuffleButton() + setUpProgressSlider() + } + + private fun updateProgressTextColor() { + val color = MaterialValueHelper.getPrimaryTextColor(context, false) + playerSongTotalTime.setTextColor(color) + playerSongCurrentProgress.setTextColor(color) + } + + private fun setUpPlayPauseFab() { + val fabColor = Color.WHITE + TintHelper.setTintAuto(playerPlayPauseFab, fabColor, true) + + playerFabPlayPauseDrawable = PlayPauseDrawable(activity!!) + + playerPlayPauseFab.setImageDrawable(playerFabPlayPauseDrawable) // Note: set the drawable AFTER TintHelper.setTintAuto() was called + playerPlayPauseFab.setColorFilter(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN) + playerPlayPauseFab.setOnClickListener(PlayPauseButtonOnClickHandler()) + playerPlayPauseFab.post { + if (playerPlayPauseFab != null) { + playerPlayPauseFab.pivotX = (playerPlayPauseFab.width / 2).toFloat() + playerPlayPauseFab.pivotY = (playerPlayPauseFab.height / 2).toFloat() + } + } + } + + private fun setUpPrevNext() { + updatePrevNextColor() + playerNextButton.setOnClickListener { _ -> MusicPlayerRemote.playNextSong() } + playerPrevButton.setOnClickListener { _ -> MusicPlayerRemote.back() } + } + + private fun updatePrevNextColor() { + playerNextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + playerPrevButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + } + + private fun setUpShuffleButton() { + playerShuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() } + } + + override fun updateShuffleState() { + when (MusicPlayerRemote.shuffleMode) { + MusicService.SHUFFLE_MODE_SHUFFLE -> playerShuffleButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + else -> playerShuffleButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + } + } + + private fun setUpRepeatButton() { + playerRepeatButton.setOnClickListener { MusicPlayerRemote.cycleRepeatMode() } + } + + override fun updateRepeatState() { + when (MusicPlayerRemote.repeatMode) { + MusicService.REPEAT_MODE_NONE -> { + playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_white_24dp) + playerRepeatButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + } + MusicService.REPEAT_MODE_ALL -> { + playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_white_24dp) + playerRepeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + } + MusicService.REPEAT_MODE_THIS -> { + playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_one_white_24dp) + playerRepeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) + } + } + } + + override fun setUpProgressSlider() { + val color = MaterialValueHelper.getPrimaryTextColor(context, false) + playerProgressSlider.thumb.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN) + playerProgressSlider.progressDrawable.mutate().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_IN) + + playerProgressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() { + override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { + if (fromUser) { + MusicPlayerRemote.seekTo(progress) + onUpdateProgressViews(MusicPlayerRemote.songProgressMillis, MusicPlayerRemote.songDurationMillis) + } + } + }) + } + + override fun onUpdateProgressViews(progress: Int, total: Int) { + playerProgressSlider.max = total + + val animator = ObjectAnimator.ofInt(playerProgressSlider, "progress", progress) + animator.duration = SLIDER_ANIMATION_TIME + animator.interpolator = LinearInterpolator() + animator.start() + + + playerSongTotalTime.text = MusicUtil.getReadableDurationString(total.toLong()) + playerSongCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong()) + } + + override fun onResume() { + super.onResume() + progressViewUpdateHelper.start() + } + + override fun onPause() { + super.onPause() + progressViewUpdateHelper.stop() + } + + override fun onServiceConnected() { + updatePlayPauseDrawableState(false) + updateRepeatState() + updateShuffleState() + } + + override fun onPlayStateChanged() { + updatePlayPauseDrawableState(true) + } + + override fun onRepeatModeChanged() { + updateRepeatState() + } + + override fun onShuffleModeChanged() { + updateShuffleState() + } + + fun updatePlayPauseDrawableState(animate: Boolean) { + if (MusicPlayerRemote.isPlaying) { + playerFabPlayPauseDrawable?.setPause(animate) + } else { + playerFabPlayPauseDrawable?.setPlay(animate) + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt index f2f43302..ba75e2f6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorPlaybackControlsFragment.kt @@ -226,7 +226,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider!!.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt index 4c2505d6..e836ee96 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/fit/FitPlaybackControlsFragment.kt @@ -21,6 +21,7 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil @@ -33,7 +34,8 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -49,6 +51,9 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -67,12 +72,12 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onServiceConnected() { @@ -114,6 +119,8 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { } else { ThemeStore.accentColor(context!!) } + volumeFragment.setTintable(colorFinal) + setFabColor(colorFinal) updateRepeatState() updateShuffleState() @@ -246,7 +253,7 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt index 5c5f2b8b..a3292173 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlaybackControlsFragment.kt @@ -21,19 +21,20 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper.Callback import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.* import kotlinx.android.synthetic.main.player_time.* -import kotlinx.android.synthetic.main.volume_controls.* class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -48,24 +49,25 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() - hideVolumeIfAvailable() + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment } override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onUpdateProgressViews(progress: Int, total: Int) { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() @@ -73,10 +75,6 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong()) } - private fun hideVolumeIfAvailable() { - volumeFragmentContainer.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE - } - public override fun show() { playPauseButton!!.animate() .scaleX(1f) @@ -112,16 +110,14 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { } updateTextColors(colorFinal) - setProgressBarColor(colorFinal) + volumeFragment.setTintable(colorFinal) + + ViewUtil.setProgressDrawable(progressSlider, colorFinal, true) updateRepeatState() updateShuffleState() } - private fun setProgressBarColor(dark: Int) { - ViewUtil.setProgressDrawable(progressSlider, dark) - } - private fun updateTextColors(color: Int) { val isDark = ColorUtil.isColorLight(color) val darkColor = ColorUtil.darkenColor(color) diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt index aa69ccd6..83908bb5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlaybackControlsFragment.kt @@ -73,7 +73,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() @@ -102,12 +102,12 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() { lastPlaybackControlsColor = Color.WHITE lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_500) - if (PreferenceUtil.getInstance().adaptiveColor) { - setProgressBarColor(color) + val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { + color } else { - val accentColor = ThemeStore.accentColor(context!!) - setProgressBarColor(accentColor) + ThemeStore.accentColor(context!!) } + setProgressBarColor(colorFinal) updateRepeatState() updateShuffleState() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt index 084b2658..ded61aed 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt @@ -219,7 +219,7 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt index 8ae233af..92f51380 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialControlsFragment.kt @@ -8,19 +8,21 @@ import android.view.View import android.view.ViewGroup import android.view.animation.LinearInterpolator import android.widget.SeekBar +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.MaterialValueHelper -import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.ViewUtil import kotlinx.android.synthetic.main.fragment_material_playback_controls.* import kotlinx.android.synthetic.main.player_time.* @@ -31,7 +33,8 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -40,14 +43,14 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - val view = inflater.inflate(R.layout.fragment_material_playback_controls, container, false) - - return view + return inflater.inflate(R.layout.fragment_material_playback_controls, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment } private fun updateSong() { @@ -58,12 +61,12 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onServiceConnected() { @@ -103,12 +106,15 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { updateRepeatState() updateShuffleState() - - if (PreferenceUtil.getInstance().adaptiveColor) { + val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { lastPlaybackControlsColor = color - text.setTextColor(color) - TintHelper.setTintAuto(progressSlider, color, false) + color + } else { + ThemeStore.textColorSecondary(context!!) } + text.setTextColor(colorFinal) + ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true) + volumeFragment.setTintable(colorFinal) updatePlayPauseColor() updatePrevNextColor() @@ -205,7 +211,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { progressSlider!!.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt index b56041c7..85ad5fb9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.kt @@ -3,18 +3,22 @@ package code.name.monkey.retromusic.ui.fragments.player.normal import android.animation.ArgbEvaluator import android.animation.ValueAnimator import android.graphics.drawable.GradientDrawable +import android.os.Build import android.os.Bundle +import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.Toolbar 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.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.views.DrawableGradient import kotlinx.android.synthetic.main.fragment_player.* @@ -57,7 +61,7 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks { } override fun toolbarIconColor(): Int { - return ATHUtil.resolveColor(context, code.name.monkey.retromusic.R.attr.iconColor) + return ATHUtil.resolveColor(context, R.attr.iconColor) } override fun onColorChanged(color: Int) { @@ -70,6 +74,20 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks { if (PreferenceUtil.getInstance().adaptiveColor) { colorize(color) } + + + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { + val display = activity?.windowManager?.defaultDisplay + val outMetrics = DisplayMetrics() + display?.getMetrics(outMetrics) + + val density = resources.displayMetrics.density + val dpHeight = outMetrics.heightPixels / density + val dpWidth = outMetrics.widthPixels / density + + playerAlbumCoverContainer?.layoutParams?.width = RetroUtil.convertDpToPixel(dpWidth - 20, context!!).toInt() + } + } override fun toggleFavorite(song: Song) { @@ -126,6 +144,7 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks { companion object { + fun newInstance(): PlayerFragment { return PlayerFragment() } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt index 24c7b96f..fe620d52 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerPlaybackControlsFragment.kt @@ -2,8 +2,6 @@ package code.name.monkey.retromusic.ui.fragments.player.normal import android.animation.ObjectAnimator import android.graphics.PorterDuff -import android.graphics.drawable.ClipDrawable -import android.graphics.drawable.LayerDrawable import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -22,6 +20,7 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil @@ -34,7 +33,8 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -50,6 +50,9 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -70,23 +73,22 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(context!!, false) } - if (PreferenceUtil.getInstance().adaptiveColor) { - setFabColor(color) + val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { + color } else { - setFabColor(ThemeStore.accentColor(context!!)) + ThemeStore.accentColor(context!!) } + volumeFragment.setTintable(colorFinal) + TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) + TintHelper.setTintAuto(playPauseButton, colorFinal, true) + ViewUtil.setProgressDrawable(progressSlider, colorFinal) + updateRepeatState() updateShuffleState() updatePrevNextColor() } - private fun setFabColor(i: Int) { - TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(i)), false) - TintHelper.setTintAuto(playPauseButton, i, true) - setProgressBarColor(i) - } - private fun updateSong() { val song = MusicPlayerRemote.currentSong title.text = song.title @@ -95,12 +97,12 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onServiceConnected() { @@ -127,11 +129,6 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { updateShuffleState() } - - private fun setProgressBarColor(newColor: Int) { - ViewUtil.setProgressDrawable(progressSlider, newColor) - } - private fun setUpPlayPauseFab() { playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler()) } @@ -230,7 +227,7 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlaybackControlsFragment.kt index 595de026..0bfa00c2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlaybackControlsFragment.kt @@ -22,6 +22,7 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil @@ -38,7 +39,8 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onPlayStateChanged() { updatePlayPauseDrawableState() @@ -71,18 +73,20 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -132,6 +136,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() { } else { ThemeStore.accentColor(context!!) } + volumeFragment.setTintable(colorFinal) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, colorFinal, true) @@ -245,7 +250,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() { progressSlider.max = total val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) - animator.duration = 1500 + animator.duration = SLIDER_ANIMATION_TIME animator.interpolator = LinearInterpolator() animator.start() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlaybackControlsFragment.kt index dcfd891d..12070e8d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlaybackControlsFragment.kt @@ -16,6 +16,7 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.service.MusicService +import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil @@ -30,7 +31,8 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() { private var lastPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0 - private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null + private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper + private lateinit var volumeFragment: VolumeFragment override fun onPlayStateChanged() { @@ -64,18 +66,20 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() { override fun onResume() { super.onResume() - progressViewUpdateHelper!!.start() + progressViewUpdateHelper.start() } override fun onPause() { super.onPause() - progressViewUpdateHelper!!.stop() + progressViewUpdateHelper.stop() } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setUpMusicControllers() + volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment + playPauseButton.setOnClickListener { if (MusicPlayerRemote.isPlaying) { MusicPlayerRemote.pauseSong() @@ -194,6 +198,8 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() { ThemeStore.accentColor(context!!) } + volumeFragment.setTintable(colorFinal) + TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, colorFinal, true) text.setTextColor(colorFinal) diff --git a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java index 239ca41a..6533e909 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/MusicUtil.java @@ -16,10 +16,6 @@ import android.text.TextUtils; import android.util.Log; import android.widget.Toast; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.content.FileProvider; - import org.jaudiotagger.audio.AudioFileIO; import org.jaudiotagger.tag.FieldKey; @@ -30,6 +26,9 @@ import java.util.List; import java.util.Locale; import java.util.regex.Pattern; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.FileProvider; import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.helper.MusicPlayerRemote; import code.name.monkey.retromusic.loaders.PlaylistLoader; @@ -106,6 +105,39 @@ public class MusicUtil { } } + @NonNull + public static String getSongInfoString(@NonNull final Song song) { + return MusicUtil.buildInfoString( + song.artistName, + song.albumName + ); + } + + /** + * Build a concatenated string from the provided arguments + * The intended purpose is to show extra annotations + * to a music library item. + * Ex: for a given album --> buildInfoString(album.artist, album.songCount) + */ + public static String buildInfoString(@NonNull final String string1, @NonNull final String string2) { + // Skip empty strings + if (string1.isEmpty()) { + return string2; + } + if (string2.isEmpty()) { + return string1; + } + + final String separator = " • "; + + final StringBuilder builder = new StringBuilder(); + builder.append(string1); + builder.append(separator); + builder.append(string2); + + return builder.toString(); + } + @NonNull public static String getArtistInfoString(@NonNull final Context context, @NonNull final Artist artist) { diff --git a/app/src/main/java/code/name/monkey/retromusic/util/ViewUtil.kt b/app/src/main/java/code/name/monkey/retromusic/util/ViewUtil.kt index af48de6a..27a6fd7c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/ViewUtil.kt +++ b/app/src/main/java/code/name/monkey/retromusic/util/ViewUtil.kt @@ -4,6 +4,7 @@ import android.animation.Animator import android.animation.ArgbEvaluator import android.animation.ObjectAnimator import android.content.Context +import android.content.res.ColorStateList import android.content.res.Resources import android.graphics.Color import android.graphics.PorterDuff @@ -11,6 +12,7 @@ import android.graphics.drawable.LayerDrawable import android.os.Build import android.view.View import android.view.animation.PathInterpolator +import android.widget.ProgressBar import android.widget.SeekBar import android.widget.TextView import androidx.annotation.ColorInt @@ -28,7 +30,33 @@ object ViewUtil { return createColorAnimator(v, "textColor", startColor, endColor) } - fun setProgressDrawable(progressSlider: SeekBar, newColor: Int) { + fun createBackgroundColorTransition(v: View, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator { + return createColorAnimator(v, "backgroundColor", startColor, endColor) + } + + fun setProgressDrawable(progressSlider: SeekBar, newColor: Int, thumbTint: Boolean = false) { + + if (thumbTint) { + progressSlider.thumbTintList = ColorStateList.valueOf(newColor) + } + + if (progressSlider.progressDrawable is LayerDrawable) { + val ld = progressSlider.progressDrawable as LayerDrawable? + + if (ld != null) { + val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) + clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN) + + val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background) + clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN) + } + } else { + progressSlider.progressTintList = ColorStateList.valueOf(newColor) + } + } + + fun setProgressDrawable(progressSlider: ProgressBar, newColor: Int) { + val ld = progressSlider.progressDrawable as LayerDrawable val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) diff --git a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt index 4cd21442..532ef480 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt +++ b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt @@ -37,7 +37,7 @@ class ColorIconsImageView : AppCompatImageView { val alpha = if (ATHUtil.isWindowBackgroundDark(context)) { 1.0f } else { - 0.28f + 0.12f } val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) { ThemeStore.textColorPrimary(context) diff --git a/app/src/main/res/drawable/abs_history_playlist.xml b/app/src/main/res/drawable/abs_history_playlist.xml deleted file mode 100644 index c84f7165..00000000 --- a/app/src/main/res/drawable/abs_history_playlist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/abs_last_added_playlist.xml b/app/src/main/res/drawable/abs_last_added_playlist.xml deleted file mode 100644 index c362ee34..00000000 --- a/app/src/main/res/drawable/abs_last_added_playlist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/abs_shuffle.xml b/app/src/main/res/drawable/abs_shuffle.xml deleted file mode 100644 index b93fd3f4..00000000 --- a/app/src/main/res/drawable/abs_shuffle.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/abs_top_tracks_playlist.xml b/app/src/main/res/drawable/abs_top_tracks_playlist.xml deleted file mode 100644 index 68978070..00000000 --- a/app/src/main/res/drawable/abs_top_tracks_playlist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_card_line.xml b/app/src/main/res/drawable/bg_card_line.xml deleted file mode 100644 index 8bf1506b..00000000 --- a/app/src/main/res/drawable/bg_card_line.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_circular_corners.xml b/app/src/main/res/drawable/bg_circular_corners.xml deleted file mode 100644 index 0c55bc84..00000000 --- a/app/src/main/res/drawable/bg_circular_corners.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_disc_full_black_24dp.xml b/app/src/main/res/drawable/ic_disc_full_black_24dp.xml index 95b60042..a3cf65a3 100644 --- a/app/src/main/res/drawable/ic_disc_full_black_24dp.xml +++ b/app/src/main/res/drawable/ic_disc_full_black_24dp.xml @@ -1,9 +1,9 @@ + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + android:fillColor="@color/md_white_1000" + android:pathData="M20,16h2v-2h-2v2zM20,7v5h2L22,7h-2zM10,4c-4.42,0 -8,3.58 -8,8s3.58,8 8,8 8,-3.58 8,-8 -3.58,-8 -8,-8zM10,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z" /> diff --git a/app/src/main/res/drawable/ic_person_white_24dp.xml b/app/src/main/res/drawable/ic_person_white_24dp.xml new file mode 100644 index 00000000..f3f00eac --- /dev/null +++ b/app/src/main/res/drawable/ic_person_white_24dp.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_album.xml b/app/src/main/res/layout-land/activity_album.xml index 124a9c3f..5f71e8be 100644 --- a/app/src/main/res/layout-land/activity_album.xml +++ b/app/src/main/res/layout-land/activity_album.xml @@ -66,15 +66,15 @@ @@ -105,9 +104,9 @@ android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="10dp" - app:showTitle="true" - app:setText="@string/action_shuffle_all" app:setIcon="@drawable/ic_shuffle_white_24dp" + app:setText="@string/action_shuffle_all" + app:showTitle="true" app:shuffleBackgroundColor="@color/md_black_1000" /> diff --git a/app/src/main/res/layout-land/activity_album_tag_editor.xml b/app/src/main/res/layout-land/activity_album_tag_editor.xml index cb5dd862..406af10b 100644 --- a/app/src/main/res/layout-land/activity_album_tag_editor.xml +++ b/app/src/main/res/layout-land/activity_album_tag_editor.xml @@ -191,11 +191,13 @@ - + app:setIcon="@drawable/ic_save_white_24dp" + app:setText="Save" + app:showTitle="true" + app:shuffleBackgroundColor="@color/md_grey_200" /> diff --git a/app/src/main/res/layout-land/activity_artist_details.xml b/app/src/main/res/layout-land/activity_artist_details.xml index 3fa4a564..ed5b6104 100644 --- a/app/src/main/res/layout-land/activity_artist_details.xml +++ b/app/src/main/res/layout-land/activity_artist_details.xml @@ -60,16 +60,16 @@ diff --git a/app/src/main/res/layout-land/fragment_classic_player.xml b/app/src/main/res/layout-land/fragment_classic_player.xml new file mode 100644 index 00000000..0a9e122d --- /dev/null +++ b/app/src/main/res/layout-land/fragment_classic_player.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-v21/fragment_player.xml b/app/src/main/res/layout-v21/fragment_player.xml new file mode 100644 index 00000000..eecebf7c --- /dev/null +++ b/app/src/main/res/layout-v21/fragment_player.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-v24/layout_notification_expanded.xml b/app/src/main/res/layout-v24/layout_notification_expanded.xml index 31584c06..74efd499 100644 --- a/app/src/main/res/layout-v24/layout_notification_expanded.xml +++ b/app/src/main/res/layout-v24/layout_notification_expanded.xml @@ -19,7 +19,7 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:scaleType="centerCrop" - /> + android:contentDescription="TODO" /> + android:tint="@color/md_black_1000" + android:contentDescription="TODO" /> @@ -57,7 +58,8 @@ android:layout_height="16dp" android:layout_marginStart="8dp" tools:src="@drawable/ic_audiotrack_black_24dp" - tools:tint="@color/md_black_1000"/> + tools:tint="@color/md_black_1000" + android:contentDescription="TODO" /> + tools:ignore="VectorDrawableCompat" + android:contentDescription="TODO" /> diff --git a/app/src/main/res/layout-xlarge-land/activity_album.xml b/app/src/main/res/layout-xlarge-land/activity_album.xml index fc3f9bff..2d57c747 100644 --- a/app/src/main/res/layout-xlarge-land/activity_album.xml +++ b/app/src/main/res/layout-xlarge-land/activity_album.xml @@ -21,8 +21,8 @@ android:background="@android:color/transparent"> diff --git a/app/src/main/res/layout-xlarge-land/activity_artist_details.xml b/app/src/main/res/layout-xlarge-land/activity_artist_details.xml index 883177ab..38199c5f 100644 --- a/app/src/main/res/layout-xlarge-land/activity_artist_details.xml +++ b/app/src/main/res/layout-xlarge-land/activity_artist_details.xml @@ -65,16 +65,16 @@ diff --git a/app/src/main/res/layout-xlarge/abs_playlists.xml b/app/src/main/res/layout-xlarge/abs_playlists.xml index d70df97d..76072a6a 100644 --- a/app/src/main/res/layout-xlarge/abs_playlists.xml +++ b/app/src/main/res/layout-xlarge/abs_playlists.xml @@ -5,10 +5,26 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + + + + + + + - + app:iconBackgroundColor="@color/md_blue_A700" + app:srcCompat="@drawable/ic_access_time_white_24dp" /> - + app:iconBackgroundColor="@color/md_red_A700" + app:srcCompat="@drawable/ic_library_add_white_24dp" /> - + app:iconBackgroundColor="@color/md_deep_purple_A700" + app:srcCompat="@drawable/ic_trending_up_white_24dp" /> - + app:iconBackgroundColor="@color/md_green_A700" + app:srcCompat="@drawable/ic_shuffle_white_24dp" /> @@ -94,15 +94,15 @@ @@ -137,9 +136,9 @@ android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="10dp" - app:showTitle="false" app:setIcon="@drawable/ic_shuffle_white_24dp" app:setText="@string/action_shuffle_all" + app:showTitle="false" app:shuffleBackgroundColor="@color/md_black_1000" /> \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/activity_artist_details.xml b/app/src/main/res/layout-xlarge/activity_artist_details.xml index c308a1c9..5e03afe4 100644 --- a/app/src/main/res/layout-xlarge/activity_artist_details.xml +++ b/app/src/main/res/layout-xlarge/activity_artist_details.xml @@ -66,16 +66,16 @@ diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml index cd360fae..cc0be0c0 100644 --- a/app/src/main/res/layout/abs_playlists.xml +++ b/app/src/main/res/layout/abs_playlists.xml @@ -5,10 +5,26 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + + + + + + + @@ -37,8 +52,7 @@ android:layout_height="wrap_content" android:gravity="center" android:paddingTop="8dp" - android:text="@string/history" - android:textSize="12sp" /> + android:text="@string/history" /> @@ -53,7 +67,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@drawable/abs_last_added_playlist" android:padding="12dp" app:iconBackgroundColor="@color/md_red_A700" app:srcCompat="@drawable/ic_library_add_white_24dp" /> @@ -63,8 +76,7 @@ android:layout_height="wrap_content" android:gravity="center" android:paddingTop="8dp" - android:text="@string/last_added" - android:textSize="12sp" /> + android:text="@string/last_added" /> @@ -79,7 +91,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@drawable/abs_top_tracks_playlist" android:padding="12dp" app:iconBackgroundColor="@color/md_deep_purple_A700" app:srcCompat="@drawable/ic_trending_up_white_24dp" /> @@ -89,8 +100,7 @@ android:layout_height="wrap_content" android:gravity="center" android:paddingTop="8dp" - android:text="@string/my_top_tracks" - android:textSize="12sp" /> + android:text="@string/my_top_tracks" /> @@ -105,7 +115,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@drawable/abs_shuffle" android:padding="12dp" app:iconBackgroundColor="@color/md_green_A700" app:srcCompat="@drawable/ic_shuffle_white_24dp" /> @@ -115,8 +124,7 @@ android:layout_height="wrap_content" android:gravity="center" android:paddingTop="8dp" - android:text="@string/shuffle" - android:textSize="12sp" /> + android:text="@string/shuffle" /> diff --git a/app/src/main/res/layout/activity_album.xml b/app/src/main/res/layout/activity_album.xml index 4d4d4727..78b5fe79 100755 --- a/app/src/main/res/layout/activity_album.xml +++ b/app/src/main/res/layout/activity_album.xml @@ -82,15 +82,15 @@ @@ -122,9 +121,9 @@ android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="10dp" - app:showTitle="true" app:setIcon="@drawable/ic_shuffle_white_24dp" app:setText="@string/action_shuffle_all" + app:showTitle="true" app:shuffleBackgroundColor="@color/md_black_1000" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_album_tag_editor.xml b/app/src/main/res/layout/activity_album_tag_editor.xml index 987a69aa..2e6fd20b 100755 --- a/app/src/main/res/layout/activity_album_tag_editor.xml +++ b/app/src/main/res/layout/activity_album_tag_editor.xml @@ -206,11 +206,14 @@ - + android:layout_gravity="center_horizontal|bottom" + app:setIcon="@drawable/ic_save_white_24dp" + app:setText="Save" + app:showTitle="true" + app:shuffleBackgroundColor="@color/md_grey_200" /> + diff --git a/app/src/main/res/layout/activity_artist_details.xml b/app/src/main/res/layout/activity_artist_details.xml index 3ab4c98a..209b10f1 100755 --- a/app/src/main/res/layout/activity_artist_details.xml +++ b/app/src/main/res/layout/activity_artist_details.xml @@ -68,16 +68,16 @@ @@ -105,8 +104,8 @@ android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="10dp" - app:showTitle="true" app:setIcon="@drawable/ic_shuffle_white_24dp" app:setText="@string/action_shuffle_all" + app:showTitle="true" app:shuffleBackgroundColor="@color/md_black_1000" /> diff --git a/app/src/main/res/layout/activity_donation.xml b/app/src/main/res/layout/activity_donation.xml index b81a69d7..94950952 100644 --- a/app/src/main/res/layout/activity_donation.xml +++ b/app/src/main/res/layout/activity_donation.xml @@ -51,11 +51,11 @@ @@ -112,6 +112,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="16dp" + style="@style/TextAppearance.MaterialComponents.Caption" android:paddingEnd="16dp" android:text="@string/paypal_summary" android:textColor="@color/md_white_1000" /> diff --git a/app/src/main/res/layout/activity_lock_screen_old_style.xml b/app/src/main/res/layout/activity_lock_screen_old_style.xml index 8589b8a2..bdb6ef96 100644 --- a/app/src/main/res/layout/activity_lock_screen_old_style.xml +++ b/app/src/main/res/layout/activity_lock_screen_old_style.xml @@ -42,7 +42,8 @@ android:id="@+id/image" android:layout_width="match_parent" android:layout_height="match_parent" - android:scaleType="centerCrop" /> + android:scaleType="centerCrop" + android:contentDescription="TODO" /> diff --git a/app/src/main/res/layout/activity_song_tag_editor.xml b/app/src/main/res/layout/activity_song_tag_editor.xml index cd569cc4..3e09afd3 100755 --- a/app/src/main/res/layout/activity_song_tag_editor.xml +++ b/app/src/main/res/layout/activity_song_tag_editor.xml @@ -226,14 +226,15 @@ - + android:layout_gravity="center_horizontal|bottom" + app:setIcon="@drawable/ic_save_white_24dp" + app:setText="Save" + app:showTitle="true" + app:shuffleBackgroundColor="@color/md_grey_200" /> + android:src="@drawable/img_offer" + android:contentDescription="TODO" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_classic_player_playback_controls.xml b/app/src/main/res/layout/fragment_classic_player_playback_controls.xml new file mode 100644 index 00000000..5b8deb1a --- /dev/null +++ b/app/src/main/res/layout/fragment_classic_player_playback_controls.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_flat_player_playback_controls.xml b/app/src/main/res/layout/fragment_flat_player_playback_controls.xml index 615e1d0c..2f87f5c8 100644 --- a/app/src/main/res/layout/fragment_flat_player_playback_controls.xml +++ b/app/src/main/res/layout/fragment_flat_player_playback_controls.xml @@ -13,7 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:splitTrack="false" - android:thumb="@drawable/flat_shadow_thumb" + android:thumb="@drawable/slider_thumb" tools:ignore="RtlHardcoded,UnusedAttribute" /> diff --git a/app/src/main/res/layout/fragment_hmm_controls_fragment.xml b/app/src/main/res/layout/fragment_hmm_controls_fragment.xml index 312aae4f..9127e5fb 100644 --- a/app/src/main/res/layout/fragment_hmm_controls_fragment.xml +++ b/app/src/main/res/layout/fragment_hmm_controls_fragment.xml @@ -16,7 +16,8 @@ android:scaleType="fitCenter" app:srcCompat="@drawable/ic_repeat_white_24dp" tools:ignore="MissingPrefix" - tools:tint="@color/md_black_1000" /> + tools:tint="@color/md_black_1000" + android:contentDescription="TODO" /> + tools:tint="@color/md_black_1000" + android:contentDescription="TODO" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main_options.xml b/app/src/main/res/layout/fragment_main_options.xml index d88fa8fc..525884f6 100644 --- a/app/src/main/res/layout/fragment_main_options.xml +++ b/app/src/main/res/layout/fragment_main_options.xml @@ -105,7 +105,8 @@ + android:src="@drawable/promotional" + android:contentDescription="TODO" /> diff --git a/app/src/main/res/layout/fragment_player_playback_controls.xml b/app/src/main/res/layout/fragment_player_playback_controls.xml index 2109843f..d13b0280 100755 --- a/app/src/main/res/layout/fragment_player_playback_controls.xml +++ b/app/src/main/res/layout/fragment_player_playback_controls.xml @@ -45,7 +45,7 @@ android:paddingEnd="16dp" android:scrollHorizontally="true" android:singleLine="true" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1" android:textColor="?android:attr/textColorPrimary" tools:text="Title" /> @@ -60,6 +60,7 @@ android:maxLines="1" android:paddingStart="16dp" android:paddingEnd="16dp" + android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" android:textColor="?android:attr/textColorSecondary" /> diff --git a/app/src/main/res/layout/layout_notification_expanded.xml b/app/src/main/res/layout/layout_notification_expanded.xml index 3707e268..6f98469e 100644 --- a/app/src/main/res/layout/layout_notification_expanded.xml +++ b/app/src/main/res/layout/layout_notification_expanded.xml @@ -19,7 +19,7 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:scaleType="centerCrop" - /> + android:contentDescription="TODO" /> + tools:tint="@color/md_black_1000" + android:contentDescription="TODO" /> @@ -55,7 +56,8 @@ android:layout_height="16dp" android:layout_marginStart="8dp" tools:src="@drawable/ic_audiotrack_black_24dp" - tools:tint="@color/md_black_1000"/> + tools:tint="@color/md_black_1000" + android:contentDescription="TODO" /> + tools:ignore="VectorDrawableCompat" + android:contentDescription="TODO" /> @@ -111,25 +114,29 @@ android:id="@+id/action_prev" android:layout_width="42dp" android:layout_height="42dp" - android:scaleType="centerInside"/> + android:scaleType="centerInside" + android:contentDescription="TODO" /> + android:scaleType="centerInside" + android:contentDescription="TODO" /> + android:scaleType="centerInside" + android:contentDescription="TODO" /> + android:scaleType="centerInside" + android:contentDescription="TODO" /> \ No newline at end of file diff --git a/app/src/main/res/layout/media_button.xml b/app/src/main/res/layout/media_button.xml index a4752bd6..668414ea 100644 --- a/app/src/main/res/layout/media_button.xml +++ b/app/src/main/res/layout/media_button.xml @@ -1,6 +1,6 @@ - - + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/section_item_collage.xml b/app/src/main/res/layout/section_item_collage.xml index 2fe67344..1fc9d62d 100644 --- a/app/src/main/res/layout/section_item_collage.xml +++ b/app/src/main/res/layout/section_item_collage.xml @@ -5,10 +5,25 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + + + + + + + - + + + + + + Filter song duration Error Permission error + Classic diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 2f2ebc90..7c6394e6 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -67,7 +67,7 @@