diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 4d77c2dd..8152c9ad 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -
We're really sorry for Announcing this Retro Music is driving towards pure Android Material Design guidelines we don't want any unnecessary UI elements that don't need for Music player.
If you see entire app white or dark or black select same theme in settings to fix
*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 +We're really sorry for Announcing this Retro Music is driving towards pure Android Material Design guidelines we don't want any unnecessary UI elements that don't need for Music player.
If you see entire app white or dark or black select same theme in settings to fix
*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/activities/tageditor/WriteTagsAsyncTask.java b/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/WriteTagsAsyncTask.java index 8ead2b76..010a28f8 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/WriteTagsAsyncTask.java +++ b/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/WriteTagsAsyncTask.java @@ -133,6 +133,7 @@ public class WriteTagsAsyncTask extends (Activity) context, toBeScanned) : null); } + @NonNull @Override protected Dialog createDialog(@NonNull Context context) { return new MaterialDialog(context, new BottomSheet()) diff --git a/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt b/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt new file mode 100644 index 00000000..51a9b9a2 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/extensions/ColorExt.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2019 Hemanth Savarala. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by + * the Free Software Foundation either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package code.name.monkey.retromusic.extensions + +import code.name.monkey.appthemehelper.util.ColorUtil + +fun Int.ripAlpha(): Int { + return ColorUtil.stripAlpha(this) +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt index aa4d2abe..eaa1ad18 100755 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt @@ -12,6 +12,7 @@ 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 import code.name.monkey.retromusic.util.PreferenceUtil @@ -109,7 +110,6 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum } fun setTintable(color: Int) { - ViewUtil.setProgressDrawable(volumeSeekBar, color, true) } @@ -127,7 +127,6 @@ 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) ViewUtil.setProgressDrawable(volumeSeekBar, color, true) } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt index 1cd64bb9..ed4cefb1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt @@ -14,6 +14,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -100,7 +101,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, colorFinal, true) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt index 5954f6b2..923cef51 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt @@ -14,6 +14,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -127,7 +128,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } image.setColorFilter(colorFinal, PorterDuff.Mode.SRC_IN) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt index 2be99a8d..2a916454 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt @@ -15,14 +15,14 @@ import android.widget.SeekBar import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment 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.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.util.MusicUtil -import kotlinx.android.synthetic.main.fragment_player_playback_controls.* +import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.* import kotlinx.android.synthetic.main.media_button.* class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { @@ -99,7 +99,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { title!!.setTextColor(lastPlaybackControlsColor) text!!.setTextColor(lastDisabledPlaybackControlsColor) - setProgressBarColor(lastPlaybackControlsColor, lastDisabledPlaybackControlsColor) + TintHelper.setTintAuto(progressSlider, lastPlaybackControlsColor, false) volumeFragment?.setTintableColor(lastPlaybackControlsColor) @@ -111,17 +111,6 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { updatePrevNextColor() } - private fun setProgressBarColor(c1: Int, c2: Int) { - progressSlider.thumbTintList = ColorStateList.valueOf(c1) - val ld = progressSlider.progressDrawable as LayerDrawable - - val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) - clipDrawableProgress.setColorFilter(c1, PorterDuff.Mode.SRC_IN) - - val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background) - clipDrawableBackground.setColorFilter(c2, PorterDuff.Mode.SRC_IN) - } - private fun setUpPlayPauseFab() { TintHelper.setTintAuto(playPauseButton, Color.WHITE, true) TintHelper.setTintAuto(playPauseButton, Color.BLACK, false) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt index 2d24d31c..fffa948f 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt @@ -16,6 +16,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -113,7 +114,7 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } volumeFragment?.setTintable(colorFinal) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt index 0eee0793..3c56b1d5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt @@ -15,6 +15,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper.Callback @@ -102,7 +103,7 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } updateTextColors(colorFinal) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt index 9ca74482..46e00d13 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt @@ -21,6 +21,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -111,7 +112,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment(), PopupMenu.OnMe val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } volumeFragment?.setTintableColor(colorFinal) text.setTextColor(colorFinal) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt index 52511340..71621910 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/lockscreen/LockScreenPlayerControlsFragment.kt @@ -29,6 +29,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -123,7 +124,7 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.textColorSecondary(context!!) + ThemeStore.textColorSecondary(context!!).ripAlpha() } volumeFragment?.setTintable(colorFinal) ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt index 96e66e28..091d7ec1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt @@ -13,6 +13,7 @@ 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.retromusic.R +import code.name.monkey.retromusic.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -106,7 +107,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { lastPlaybackControlsColor = color color } else { - ThemeStore.textColorSecondary(context!!) + ThemeStore.textColorSecondary(context!!).ripAlpha() } text.setTextColor(colorFinal) ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt index 3c445d7f..77583ede 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt @@ -15,6 +15,7 @@ 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.extensions.ripAlpha import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -71,10 +72,9 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) { color } else { - ThemeStore.accentColor(context!!) + ThemeStore.accentColor(context!!).ripAlpha() } - TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, colorFinal, true) ViewUtil.setProgressDrawable(progressSlider, colorFinal) diff --git a/app/src/main/java/code/name/monkey/retromusic/model/AbsCustomPlaylist.java b/app/src/main/java/code/name/monkey/retromusic/model/AbsCustomPlaylist.java index 07ea3140..031e48c6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/model/AbsCustomPlaylist.java +++ b/app/src/main/java/code/name/monkey/retromusic/model/AbsCustomPlaylist.java @@ -17,9 +17,10 @@ package code.name.monkey.retromusic.model; import android.content.Context; import android.os.Parcel; +import androidx.annotation.NonNull; + import java.util.ArrayList; -import androidx.annotation.NonNull; import io.reactivex.Observable; /** diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MediaButtonIntentReceiver.kt b/app/src/main/java/code/name/monkey/retromusic/service/MediaButtonIntentReceiver.kt index b48f34dc..ab0c95d9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MediaButtonIntentReceiver.kt +++ b/app/src/main/java/code/name/monkey/retromusic/service/MediaButtonIntentReceiver.kt @@ -51,11 +51,11 @@ class MediaButtonIntentReceiver : BroadcastReceiver() { } companion object { - val TAG = MediaButtonIntentReceiver::class.java.simpleName + val TAG: String = MediaButtonIntentReceiver::class.java.simpleName private val DEBUG = BuildConfig.DEBUG - private val MSG_HEADSET_DOUBLE_CLICK_TIMEOUT = 2 + private const val MSG_HEADSET_DOUBLE_CLICK_TIMEOUT = 2 - private val DOUBLE_CLICK = 400 + private const val DOUBLE_CLICK = 400 private var wakeLock: WakeLock? = null private var mClickCounter = 0 diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java index 4db87c68..8155bf1c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java @@ -29,7 +29,6 @@ import android.graphics.Point; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.media.audiofx.AudioEffect; -import android.media.session.MediaSession; import android.os.Binder; import android.os.Build; import android.os.Handler; @@ -86,6 +85,7 @@ import code.name.monkey.retromusic.service.playback.Playback; import code.name.monkey.retromusic.util.MusicUtil; import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.RetroUtil; +import io.reactivex.schedulers.Schedulers; import static code.name.monkey.retromusic.Constants.ACTION_PAUSE; import static code.name.monkey.retromusic.Constants.ACTION_PENDING_QUIT; @@ -142,6 +142,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP | PlaybackStateCompat.ACTION_STOP | PlaybackStateCompat.ACTION_SEEK_TO; private final IBinder musicBind = new MusicBinder(); + public boolean pendingQuit = false; private AppWidgetBig appWidgetBig = AppWidgetBig.Companion.getInstance(); private AppWidgetClassic appWidgetClassic = AppWidgetClassic.Companion.getInstance(); private AppWidgetSmall appWidgetSmall = AppWidgetSmall.Companion.getInstance(); @@ -178,7 +179,6 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP } }; - public boolean pendingQuit = false; private Playback playback; private ArrayList