From b4d32af0e163fef755e1e734f9bb910555e1fcc0 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Wed, 9 Oct 2019 18:01:31 +0530 Subject: [PATCH] Remove classic player --- app/src/main/assets/contributors.json | 4 ++-- .../base/AbsSlidingMusicPanelActivity.kt | 23 ++++++++----------- .../adapter/album/AlbumCoverPagerAdapter.kt | 2 -- .../retromusic/adapter/song/SongAdapter.kt | 2 +- .../retromusic/fragments/NowPlayingScreen.kt | 1 - .../fragments/base/AbsPlayerFragment.kt | 4 ---- .../helper/HorizontalAdapterHelper.kt | 16 ++++++------- .../monkey/retromusic/loaders/SongLoader.kt | 3 ++- app/src/main/res/layout/abs_playlists.xml | 2 -- app/src/main/res/layout/activity_lyrics.xml | 20 ++++++++-------- .../main/res/layout/dialog_file_details.xml | 7 ++++++ .../main/res/layout/fragment_mini_player.xml | 18 +++++++-------- .../main/res/layout/fragment_peak_player.xml | 2 ++ app/src/main/res/layout/pager_item.xml | 8 +++---- app/src/main/res/menu/menu_player.xml | 4 ---- 15 files changed, 55 insertions(+), 61 deletions(-) diff --git a/app/src/main/assets/contributors.json b/app/src/main/assets/contributors.json index 858281b4..e84023c3 100644 --- a/app/src/main/assets/contributors.json +++ b/app/src/main/assets/contributors.json @@ -18,10 +18,10 @@ "profile_image": "https://i.imgur.com/pfvN7d9.png" }, { - "name": "ᴍɪʟɪɴᴅ ɢᴏᴇʟ | ᴘʟ2", + "name": "Milind Goel", "summary": "Github & Telegram maintainer", "link": "https://t.me/MilindGoel15", - "profile_image": "https://i.imgur.com/ZIdLHYx.jpg" + "profile_image": "https://i.imgur.com/Bz4De21_d.jpg" }, { "name": "Abilas Sathiya", diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt index 54678bb8..37d677a2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt @@ -19,7 +19,6 @@ import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment import code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment import code.name.monkey.retromusic.fragments.player.card.CardFragment import code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment -import code.name.monkey.retromusic.fragments.player.classic.ClassicPlayerFragment import code.name.monkey.retromusic.fragments.player.color.ColorFragment import code.name.monkey.retromusic.fragments.player.fit.FitFragment import code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment @@ -177,14 +176,14 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay params.height = ViewGroup.LayoutParams.MATCH_PARENT slidingPanel.layoutParams = params } - /* when (panelState) { - SlidingUpPanelLayout.PanelState.EXPANDED -> { - onPanelSlide(slidingLayout, 1f) - onPanelExpanded() - } - SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed() - else -> playerFragment!!.onHide() - }*/ + when (panelState) { + BottomSheetBehavior.STATE_EXPANDED -> { + // onPanelSlide(slidingLayout, 1f) + onPanelExpanded() + } + BottomSheetBehavior.STATE_COLLAPSED -> onPanelCollapsed() + else -> playerFragment!!.onHide() + } } }) } @@ -237,7 +236,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay MATERIAL -> MaterialFragment() COLOR -> ColorFragment() TINY -> TinyPlayerFragment() - CLASSIC -> ClassicPlayerFragment() PEAK -> PeakPlayerFragment() else -> PlayerFragment() } // must implement AbsPlayerFragment @@ -304,8 +302,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay super.setLightNavigationBar(true) super.setLightStatusbar(isColorLight) } else if (currentNowPlayingScreen == FULL || currentNowPlayingScreen == CARD || - currentNowPlayingScreen == FIT || currentNowPlayingScreen == CLASSIC || - currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) { + currentNowPlayingScreen == FIT || currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) { super.setLightStatusbar(false) super.setLightNavigationBar(true) } else if (currentNowPlayingScreen == COLOR || currentNowPlayingScreen == TINY) { @@ -354,7 +351,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay val currentTabs = PreferenceUtil.getInstance(this).libraryCategoryInfos for (tab in currentTabs) { if (tab.visible) { - val menu = tab.category; + val menu = tab.category bottomNavigationView.menu.add(0, menu.id, 0, menu.stringRes) .setIcon(menu.icon) } diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumCoverPagerAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumCoverPagerAdapter.kt index d62627f7..2cc09e95 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumCoverPagerAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumCoverPagerAdapter.kt @@ -10,7 +10,6 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import code.name.monkey.retromusic.activities.LyricsActivity import code.name.monkey.retromusic.fragments.AlbumCoverStyle -import code.name.monkey.retromusic.fragments.NowPlayingScreen import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.glide.SongGlideRequest import code.name.monkey.retromusic.misc.CustomFragmentStatePagerAdapter @@ -90,7 +89,6 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val finalLayout = when { - PreferenceUtil.getInstance(activity).nowPlayingScreen == NowPlayingScreen.CLASSIC -> code.name.monkey.retromusic.R.layout.fragment_album_full_cover PreferenceUtil.getInstance(activity).carouselEffect() -> code.name.monkey.retromusic.R.layout.fragment_album_carousel_cover else -> layout } diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt index b58eeab4..f36d1d19 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt @@ -40,7 +40,7 @@ open class SongAdapter @JvmOverloads constructor( usePalette: Boolean, cabHolder: CabHolder?, showSectionName: Boolean = true -) : AbsMultiSelectAdapter(activity, cabHolder, code.name.monkey.retromusic.R.menu.menu_media_selection), MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter { +) : AbsMultiSelectAdapter(activity, cabHolder, R.menu.menu_media_selection), MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter { var dataSet: ArrayList protected var usePalette = false diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/NowPlayingScreen.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/NowPlayingScreen.kt index 77b6d288..6751380a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/NowPlayingScreen.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/NowPlayingScreen.kt @@ -22,7 +22,6 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes PLAIN(R.string.plain, R.drawable.np_plain, 3), TINY(R.string.tiny, R.drawable.np_tiny, 7), SIMPLE(R.string.simple, R.drawable.np_simple, 8), - CLASSIC(R.string.classic, R.drawable.np_classic, 13), PEAK(R.string.peak, R.drawable.np_slide, 14) } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt index 5db295e2..1189df52 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsPlayerFragment.kt @@ -128,10 +128,6 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), ringtoneManager.setRingtone(song) return true } - R.id.action_settings -> { - NavigationUtil.goToSettings(requireActivity()) - return true - } R.id.action_go_to_genre -> { val retriever = MediaMetadataRetriever() val trackUri = ContentUris.withAppendedId(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, song.id.toLong()) diff --git a/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt b/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt index 990ef99b..0980a9ac 100644 --- a/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt +++ b/app/src/main/java/code/name/monkey/retromusic/helper/HorizontalAdapterHelper.kt @@ -23,9 +23,9 @@ object HorizontalAdapterHelper { const val LAYOUT_RES = R.layout.item_image - const val TYPE_FIRST = 1 - const val TYPE_MIDDLE = 2 - const val TYPE_LAST = 3 + private const val TYPE_FIRST = 1 + private const val TYPE_MIDDLE = 2 + private const val TYPE_LAST = 3 fun applyMarginToLayoutParams(context: Context, layoutParams: ViewGroup.MarginLayoutParams, viewType: Int) { @@ -39,12 +39,10 @@ object HorizontalAdapterHelper { } fun getItemViewtype(position: Int, itemCount: Int): Int { - return if (position == 0) { - TYPE_FIRST - } else if (position == itemCount - 1) { - TYPE_LAST - } else { - TYPE_MIDDLE + return when (position) { + 0 -> TYPE_FIRST + itemCount - 1 -> TYPE_LAST + else -> TYPE_MIDDLE } } } diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt b/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt index 2c0c0461..3384f8c5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt +++ b/app/src/main/java/code/name/monkey/retromusic/loaders/SongLoader.kt @@ -18,8 +18,8 @@ import android.content.Context import android.database.Cursor import android.provider.MediaStore import android.provider.MediaStore.Audio.AudioColumns -import code.name.monkey.retromusic.Constants.baseProjection import code.name.monkey.retromusic.Constants.BASE_SELECTION +import code.name.monkey.retromusic.Constants.baseProjection import code.name.monkey.retromusic.helper.ShuffleHelper import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.providers.BlacklistStore @@ -171,6 +171,7 @@ object SongLoader { albumName ?: "", artistId, artistName, composer ?: "") } + @JvmOverloads fun makeSongCursor( context: Context, diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml index 0c45b69f..e7a0c8ab 100644 --- a/app/src/main/res/layout/abs_playlists.xml +++ b/app/src/main/res/layout/abs_playlists.xml @@ -5,8 +5,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingStart="@dimen/horizontal_padding_home" - android:paddingEnd="@dimen/horizontal_padding_home" android:paddingBottom="12dp"> diff --git a/app/src/main/res/layout/activity_lyrics.xml b/app/src/main/res/layout/activity_lyrics.xml index 92139887..3062eafe 100644 --- a/app/src/main/res/layout/activity_lyrics.xml +++ b/app/src/main/res/layout/activity_lyrics.xml @@ -1,17 +1,11 @@ - - - + app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" + tools:subtitle="@tools:sample/full_names" + tools:title="@tools:sample/full_names" /> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_mini_player.xml b/app/src/main/res/layout/fragment_mini_player.xml index 677c099f..36dde010 100644 --- a/app/src/main/res/layout/fragment_mini_player.xml +++ b/app/src/main/res/layout/fragment_mini_player.xml @@ -19,8 +19,6 @@ + app:tint="?colorOnSecondary" + tools:ignore="ContentDescription" + tools:tint="?colorOnSurface" /> + app:tint="?colorOnSecondary" /> + app:tint="?colorOnSecondary" + tools:tint="?colorOnSecondary" /> + app:tint="?colorOnSecondary" + tools:tint="?colorOnSecondary" /> diff --git a/app/src/main/res/layout/fragment_peak_player.xml b/app/src/main/res/layout/fragment_peak_player.xml index 9a5a1544..f027be76 100644 --- a/app/src/main/res/layout/fragment_peak_player.xml +++ b/app/src/main/res/layout/fragment_peak_player.xml @@ -17,6 +17,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clickable="true" + android:focusable="true" android:orientation="vertical"> + android:layout_margin="8dp" + app:cardCornerRadius="12dp"> -