Removed queue icon and fixed color

This commit is contained in:
h4h13 2020-01-06 11:47:22 +05:30
parent e1f2d14ee8
commit afc4f10be2
12 changed files with 54 additions and 69 deletions

View file

@ -226,11 +226,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
} }
private fun loadAlbumCover() { private fun loadAlbumCover() {
/* Glide.with(this).load(RetroUtil.getAlbumArtUri(album.id)).placeholder(R.drawable.default_album_art)
.error(R.drawable.default_album_art)
.dontTransform()
.dontAnimate().into(image)*/
SongGlideRequest.Builder.from(Glide.with(this), album.safeGetFirstSong()) SongGlideRequest.Builder.from(Glide.with(this), album.safeGetFirstSong())
.checkIgnoreMediaStore(this) .checkIgnoreMediaStore(this)
.ignoreMediaStore(PreferenceUtil.getInstance(this).ignoreMediaStoreArtwork()) .ignoreMediaStore(PreferenceUtil.getInstance(this).ignoreMediaStoreArtwork())

View file

@ -198,9 +198,9 @@ class PlayingQueueAdapter(
override fun onGetSwipeReactionType(holder: ViewHolder?, position: Int, x: Int, y: Int): Int { override fun onGetSwipeReactionType(holder: ViewHolder?, position: Int, x: Int, y: Int): Int {
return if (onCheckCanStartDrag(holder!!, position, x, y)) { return if (onCheckCanStartDrag(holder!!, position, x, y)) {
SwipeableItemConstants.REACTION_CAN_NOT_SWIPE_BOTH_H; SwipeableItemConstants.REACTION_CAN_NOT_SWIPE_BOTH_H
} else { } else {
SwipeableItemConstants.REACTION_CAN_SWIPE_BOTH_H; SwipeableItemConstants.REACTION_CAN_SWIPE_BOTH_H
} }
} }

View file

@ -7,7 +7,11 @@ import android.os.Bundle
import android.text.SpannableString import android.text.SpannableString
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.view.* import android.view.GestureDetector
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.view.animation.DecelerateInterpolator import android.view.animation.DecelerateInterpolator
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
@ -15,14 +19,18 @@ import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_mini_player.* import kotlinx.android.synthetic.main.fragment_mini_player.actionNext
import kotlinx.android.synthetic.main.fragment_mini_player.actionPrevious
import kotlinx.android.synthetic.main.fragment_mini_player.miniPlayerPlayPauseButton
import kotlinx.android.synthetic.main.fragment_mini_player.miniPlayerTitle
import kotlinx.android.synthetic.main.fragment_mini_player.progressBar
import kotlin.math.abs import kotlin.math.abs
open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpdateHelper.Callback, View.OnClickListener { open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpdateHelper.Callback,
View.OnClickListener {
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
@ -37,7 +45,6 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
override fun onClick(view: View) { override fun onClick(view: View) {
when (view.id) { when (view.id) {
R.id.actionPlayingQueue -> NavigationUtil.goToPlayingQueue(requireActivity())
R.id.actionNext -> MusicPlayerRemote.playNextSong() R.id.actionNext -> MusicPlayerRemote.playNextSong()
R.id.actionPrevious -> MusicPlayerRemote.back() R.id.actionPrevious -> MusicPlayerRemote.back()
} }
@ -53,19 +60,16 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
actionPrevious.visibility = View.VISIBLE actionPrevious.visibility = View.VISIBLE
actionNext?.visibility = View.VISIBLE actionNext?.visibility = View.VISIBLE
actionPrevious?.visibility = View.VISIBLE actionPrevious?.visibility = View.VISIBLE
actionPlayingQueue.visibility = View.VISIBLE
} else { } else {
actionNext.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE actionNext.visibility =
actionPlayingQueue.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.GONE else View.VISIBLE if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
actionPrevious.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE actionPrevious.visibility =
if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
} }
actionPlayingQueue.setOnClickListener(this)
actionNext.setOnClickListener(this) actionNext.setOnClickListener(this)
actionPrevious.setOnClickListener(this) actionPrevious.setOnClickListener(this)
actionNext?.setOnClickListener(this) actionNext?.setOnClickListener(this)
actionPrevious?.setOnClickListener(this) actionPrevious?.setOnClickListener(this)
} }
private fun setUpMiniPlayer() { private fun setUpMiniPlayer() {
@ -106,7 +110,6 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
updatePlayPauseDrawableState() updatePlayPauseDrawableState()
} }
override fun onUpdateProgressViews(progress: Int, total: Int) { override fun onUpdateProgressViews(progress: Int, total: Int) {
progressBar.max = total progressBar.max = total
val animator = ObjectAnimator.ofInt(progressBar, "progress", progress) val animator = ObjectAnimator.ofInt(progressBar, "progress", progress)
@ -140,8 +143,10 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
init { init {
flingPlayBackController = GestureDetector(context, flingPlayBackController = GestureDetector(context,
object : GestureDetector.SimpleOnGestureListener() { object : GestureDetector.SimpleOnGestureListener() {
override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, override fun onFling(
velocityY: Float): Boolean { e1: MotionEvent, e2: MotionEvent, velocityX: Float,
velocityY: Float
): Boolean {
if (abs(velocityX) > abs(velocityY)) { if (abs(velocityX) > abs(velocityY)) {
if (velocityX < 0) { if (velocityX < 0) {
MusicPlayerRemote.playNextSong() MusicPlayerRemote.playNextSong()

View file

@ -461,7 +461,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
}); });
getMainActivity().setSupportActionBar(toolbar); getMainActivity().setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY)); toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY));
//ToolbarContentTintHelper.colorBackButton(toolbar); ToolbarContentTintHelper.colorBackButton(toolbar);
//toolbar.setTitleTextColor(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSecondary)); //toolbar.setTitleTextColor(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSecondary));
} }
} }

View file

@ -28,7 +28,7 @@ import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropM
import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager
import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
import kotlinx.android.synthetic.main.activity_playing_queue.* import kotlinx.android.synthetic.main.activity_playing_queue.recyclerView
/** /**
* Created by hemanths on 2019-12-08. * Created by hemanths on 2019-12-08.
@ -44,6 +44,7 @@ class PlayingQueueFragment : AbsLibraryPagerRecyclerViewFragment<PlayingQueueAda
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setupRecyclerView() setupRecyclerView()
} }
private fun setupRecyclerView() { private fun setupRecyclerView() {
recyclerViewTouchActionGuardManager = RecyclerViewTouchActionGuardManager() recyclerViewTouchActionGuardManager = RecyclerViewTouchActionGuardManager()
recyclerViewDragDropManager = RecyclerViewDragDropManager() recyclerViewDragDropManager = RecyclerViewDragDropManager()
@ -69,7 +70,12 @@ class PlayingQueueFragment : AbsLibraryPagerRecyclerViewFragment<PlayingQueueAda
} }
override fun createAdapter(): PlayingQueueAdapter { override fun createAdapter(): PlayingQueueAdapter {
return PlayingQueueAdapter(requireActivity() as AppCompatActivity, MusicPlayerRemote.playingQueue, MusicPlayerRemote.position, R.layout.item_queue) return PlayingQueueAdapter(
requireActivity() as AppCompatActivity,
MusicPlayerRemote.playingQueue,
MusicPlayerRemote.position,
R.layout.item_queue
)
} }
override fun onServiceConnected() { override fun onServiceConnected() {

View file

@ -82,19 +82,6 @@
app:srcCompat="@drawable/ic_skip_next_white_24dp" app:srcCompat="@drawable/ic_skip_next_white_24dp"
app:tint="?colorOnSurface" app:tint="?colorOnSurface"
tools:tint="?colorOnSurface" /> tools:tint="?colorOnSurface" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actionPlayingQueue"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="?roundSelector"
android:padding="6dp"
app:srcCompat="@drawable/ic_playlist_play_white_24dp"
app:tint="?colorOnSurface"
tools:tint="?colorOnSurface" />
</LinearLayout> </LinearLayout>
<ProgressBar <ProgressBar

View file

@ -94,16 +94,5 @@
android:padding="6dp" android:padding="6dp"
app:srcCompat="@drawable/ic_skip_next_white_24dp" app:srcCompat="@drawable/ic_skip_next_white_24dp"
app:tint="?attr/colorControlNormal" /> app:tint="?attr/colorControlNormal" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actionPlayingQueue"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="?roundSelector"
android:padding="6dp"
app:srcCompat="@drawable/ic_playlist_play_white_24dp"
app:tint="?attr/colorControlNormal" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -21,7 +21,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="4dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">

View file

@ -29,7 +29,7 @@
android:padding="8dp" android:padding="8dp"
android:visibility="gone" android:visibility="gone"
app:srcCompat="@drawable/ic_drag_vertical_white_24dp" app:srcCompat="@drawable/ic_drag_vertical_white_24dp"
app:tint="?colorOnBackground" app:tint="?attr/colorControlNormal"
tools:ignore="ContentDescription" tools:ignore="ContentDescription"
tools:visibility="visible" /> tools:visibility="visible" />

View file

@ -55,7 +55,6 @@
<item name="android:windowLightNavigationBar">false</item> <item name="android:windowLightNavigationBar">false</item>
<!--Manual setting colors--> <!--Manual setting colors-->
<item name="colorSurface">@color/darkColorSurface</item> <item name="colorSurface">@color/darkColorSurface</item>
</style> </style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar">

View file

@ -59,6 +59,8 @@
<item name="materialButtonStyle">@style/MaterialButtonTheme</item> <item name="materialButtonStyle">@style/MaterialButtonTheme</item>
<item name="colorSurface">@color/blackColorSurface</item> <item name="colorSurface">@color/blackColorSurface</item>
<item name="colorOnBackground">@color/blackColorSurface</item> <item name="colorOnBackground">@color/blackColorSurface</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
<item name="mcab_popup_theme">@style/ThemeOverlay.AppCompat.Dark</item>
</style> </style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
@ -106,7 +108,7 @@
</style> </style>
<style name="MaterialButtonTheme" parent="Widget.MaterialComponents.Button"> <style name="MaterialButtonTheme" parent="Widget.MaterialComponents.Button">
<item name="cornerRadius">8dp</item> <item name="cornerRadius">24dp</item>
<item name="iconGravity">textStart</item> <item name="iconGravity">textStart</item>
<item name="iconTint">?attr/colorControlNormal</item> <item name="iconTint">?attr/colorControlNormal</item>
<item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>