This commit is contained in:
h4h13 2019-11-02 19:16:17 +05:30
parent eec8738b48
commit 6c27767930
4 changed files with 17 additions and 15 deletions

View file

@ -13,7 +13,7 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 388 versionCode 389
versionName '3.4.600' versionName '3.4.600'
multiDexEnabled true multiDexEnabled true

View file

@ -57,9 +57,9 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
actionPrevious.visibility = View.VISIBLE actionPrevious.visibility = View.VISIBLE
actionPlayingQueue.visibility = View.VISIBLE actionPlayingQueue.visibility = View.VISIBLE
} else { } else {
actionNext.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraMiniExtraControls) View.VISIBLE else View.GONE actionNext.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
actionPlayingQueue.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraMiniExtraControls) View.GONE else View.VISIBLE actionPlayingQueue.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.GONE else View.VISIBLE
actionPrevious.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraMiniExtraControls) View.VISIBLE else View.GONE actionPrevious.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
} }
actionPlayingQueue.setOnClickListener(this) actionPlayingQueue.setOnClickListener(this)
@ -109,16 +109,18 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
} }
private fun updateButtons() { private fun updateButtons() {
if (MusicPlayerRemote.playingQueue.fistElement()) { if (PreferenceUtil.getInstance(requireContext()).isExtraControls) {
actionPrevious.hide() if (MusicPlayerRemote.playingQueue.fistElement()) {
} else { actionPrevious.hide()
actionPrevious.show() } else {
} actionPrevious.show()
}
if (MusicPlayerRemote.playingQueue.lastElement()) { if (MusicPlayerRemote.playingQueue.lastElement()) {
actionNext.hide() actionNext.hide()
} else { } else {
actionNext.show() actionNext.show()
}
} }
} }

View file

@ -291,7 +291,7 @@ public final class PreferenceUtil {
return mPreferences.getBoolean(INITIALIZED_BLACKLIST, false); return mPreferences.getBoolean(INITIALIZED_BLACKLIST, false);
} }
public boolean isExtraMiniExtraControls() { public boolean isExtraControls() {
return mPreferences.getBoolean(TOGGLE_ADD_CONTROLS, false); return mPreferences.getBoolean(TOGGLE_ADD_CONTROLS, false);
} }

View file

@ -5,7 +5,7 @@
<string name="accent_color">Accent color</string> <string name="accent_color">Accent color</string>
<string name="accent_color_desc">The theme accent color, defaults to teal</string> <string name="accent_color_desc">The theme accent color, defaults to teal</string>
<string name="action_about">action_add_to_playlist</string> <string name="action_about">About</string>
<string name="action_add_to_favorites">Add to favorites</string> <string name="action_add_to_favorites">Add to favorites</string>
<string name="action_add_to_playing_queue">Add to playing queue</string> <string name="action_add_to_playing_queue">Add to playing queue</string>
<string name="action_add_to_playlist">Add to playlist</string> <string name="action_add_to_playlist">Add to playlist</string>