Fix app short cut buttons
This commit is contained in:
parent
a5e349380c
commit
259f2b9543
13 changed files with 421 additions and 133 deletions
|
@ -18,11 +18,11 @@ enum class NowPlayingScreen constructor(
|
||||||
PEAK(R.string.peak, R.drawable.np_peak, 14),
|
PEAK(R.string.peak, R.drawable.np_peak, 14),
|
||||||
|
|
||||||
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
|
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
|
||||||
CIRCLE(R.string.circle, R.drawable.np_adaptive, 15),
|
|
||||||
BLUR(R.string.blur, R.drawable.np_blur, 4),
|
BLUR(R.string.blur, R.drawable.np_blur, 4),
|
||||||
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
|
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
|
||||||
CARD(R.string.card, R.drawable.np_card, 6),
|
CARD(R.string.card, R.drawable.np_card, 6),
|
||||||
COLOR(R.string.color, R.drawable.np_color, 5),
|
COLOR(R.string.color, R.drawable.np_color, 5),
|
||||||
|
CIRCLE(R.string.circle, R.drawable.np_minimalistic_circle, 15),
|
||||||
FULL(R.string.full, R.drawable.np_full, 2),
|
FULL(R.string.full, R.drawable.np_full, 2),
|
||||||
MATERIAL(R.string.material, R.drawable.np_material, 11),
|
MATERIAL(R.string.material, R.drawable.np_material, 11),
|
||||||
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
PLAIN(R.string.plain, R.drawable.np_plain, 3),
|
||||||
|
|
|
@ -17,9 +17,12 @@ import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.ViewUtil
|
import code.name.monkey.retromusic.util.ViewUtil
|
||||||
import code.name.monkey.retromusic.volume.AudioVolumeObserver
|
import code.name.monkey.retromusic.volume.AudioVolumeObserver
|
||||||
import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener
|
import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener
|
||||||
import kotlinx.android.synthetic.main.fragment_volume.*
|
import kotlinx.android.synthetic.main.fragment_volume.volumeDown
|
||||||
|
import kotlinx.android.synthetic.main.fragment_volume.volumeSeekBar
|
||||||
|
import kotlinx.android.synthetic.main.fragment_volume.volumeUp
|
||||||
|
|
||||||
class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolumeChangedListener, View.OnClickListener {
|
class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolumeChangedListener,
|
||||||
|
View.OnClickListener {
|
||||||
|
|
||||||
private var audioVolumeObserver: AudioVolumeObserver? = null
|
private var audioVolumeObserver: AudioVolumeObserver? = null
|
||||||
|
|
||||||
|
@ -76,15 +79,12 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
||||||
audioManager?.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0)
|
audioManager?.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0)
|
||||||
setPauseWhenZeroVolume(i < 1)
|
setPauseWhenZeroVolume(i < 1)
|
||||||
volumeDown?.setImageResource(if (i == 0) R.drawable.ic_volume_off_white_24dp else R.drawable.ic_volume_down_white_24dp)
|
volumeDown?.setImageResource(if (i == 0) R.drawable.ic_volume_off_white_24dp else R.drawable.ic_volume_down_white_24dp)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(view: View) {
|
override fun onClick(view: View) {
|
||||||
|
@ -105,7 +105,6 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
||||||
volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
|
volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
|
||||||
ViewUtil.setProgressDrawable(volumeSeekBar, iconColor, true)
|
ViewUtil.setProgressDrawable(volumeSeekBar, iconColor, true)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTintable(color: Int) {
|
fun setTintable(color: Int) {
|
||||||
|
|
|
@ -14,27 +14,147 @@
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.player.circle
|
package code.name.monkey.retromusic.fragments.player.circle
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.graphics.PorterDuff
|
||||||
|
import android.media.AudioManager
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.animation.LinearInterpolator
|
||||||
|
import android.widget.SeekBar
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
|
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.R
|
||||||
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
||||||
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||||
|
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.util.MusicUtil
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import code.name.monkey.retromusic.util.ViewUtil
|
||||||
|
import code.name.monkey.retromusic.views.SeekArc
|
||||||
|
import code.name.monkey.retromusic.views.SeekArc.OnSeekArcChangeListener
|
||||||
|
import code.name.monkey.retromusic.volume.AudioVolumeObserver
|
||||||
|
import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.nextButton
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.playPauseButton
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.playerToolbar
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.previousButton
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.progressSlider
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.songCurrentProgress
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.songInfo
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.songTotalTime
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.text
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.title
|
||||||
|
import kotlinx.android.synthetic.main.fragment_circle_player.volumeSeekBar
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by hemanths on 2020-01-06.
|
* Created by hemanths on 2020-01-06.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CirclePlayerFragment : AbsPlayerFragment() {
|
class CirclePlayerFragment : AbsPlayerFragment(), Callback, OnAudioVolumeChangedListener, OnSeekArcChangeListener {
|
||||||
|
|
||||||
|
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
|
||||||
|
private var audioVolumeObserver: AudioVolumeObserver? = null
|
||||||
|
|
||||||
|
private val audioManager: AudioManager?
|
||||||
|
get() = requireContext().getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
progressViewUpdateHelper = MusicProgressViewUpdateHelper(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
return inflater.inflate(R.layout.fragment_circle_player, container, false)
|
return inflater.inflate(R.layout.fragment_circle_player, container, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
setupViews()
|
||||||
|
title.isSelected = true
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setUpPlayerToolbar() {
|
||||||
|
playerToolbar.apply {
|
||||||
|
inflateMenu(R.menu.menu_player)
|
||||||
|
setNavigationOnClickListener { requireActivity().onBackPressed() }
|
||||||
|
setOnMenuItemClickListener(this@CirclePlayerFragment)
|
||||||
|
ToolbarContentTintHelper.colorizeToolbar(
|
||||||
|
this,
|
||||||
|
ATHUtil.resolveColor(requireContext(), R.attr.colorControlNormal),
|
||||||
|
requireActivity()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupViews() {
|
||||||
|
progressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
|
||||||
|
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||||
|
if (fromUser) {
|
||||||
|
MusicPlayerRemote.seekTo(progress)
|
||||||
|
onUpdateProgressViews(MusicPlayerRemote.songProgressMillis, MusicPlayerRemote.songDurationMillis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
ViewUtil.setProgressDrawable(progressSlider, ThemeStore.accentColor(requireContext()))
|
||||||
|
volumeSeekBar.progressColor = ThemeStore.accentColor(requireContext())
|
||||||
|
setUpPlayPauseFab()
|
||||||
|
setUpPrevNext()
|
||||||
|
setUpPlayerToolbar()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setUpPrevNext() {
|
||||||
|
updatePrevNextColor()
|
||||||
|
nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() }
|
||||||
|
previousButton.setOnClickListener { MusicPlayerRemote.back() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updatePrevNextColor() {
|
||||||
|
val accentColor = ThemeStore.accentColor(requireContext())
|
||||||
|
nextButton.setColorFilter(accentColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
previousButton.setColorFilter(accentColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setUpPlayPauseFab() {
|
||||||
|
TintHelper.setTintAuto(playPauseButton, ThemeStore.accentColor(requireContext()), false)
|
||||||
|
//TintHelper.setTintAuto(playPauseButton, ATHUtil.resolveColor(requireContext(), R.attr.colorSurface), true)
|
||||||
|
playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
progressViewUpdateHelper.start()
|
||||||
|
if (audioVolumeObserver == null) {
|
||||||
|
audioVolumeObserver = AudioVolumeObserver(requireActivity())
|
||||||
|
}
|
||||||
|
audioVolumeObserver!!.register(AudioManager.STREAM_MUSIC, this)
|
||||||
|
|
||||||
|
val audioManager = audioManager
|
||||||
|
if (audioManager != null) {
|
||||||
|
volumeSeekBar.max = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||||
|
volumeSeekBar.progress = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||||
|
}
|
||||||
|
volumeSeekBar.setOnSeekArcChangeListener(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
progressViewUpdateHelper.stop()
|
||||||
|
}
|
||||||
|
|
||||||
override fun playerToolbar(): Toolbar? {
|
override fun playerToolbar(): Toolbar? {
|
||||||
return null
|
return playerToolbar
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onShow() {
|
override fun onShow() {
|
||||||
|
@ -45,7 +165,7 @@ class CirclePlayerFragment : AbsPlayerFragment() {
|
||||||
|
|
||||||
override fun onBackPressed(): Boolean = false
|
override fun onBackPressed(): Boolean = false
|
||||||
|
|
||||||
override fun toolbarIconColor(): Int = Color.RED
|
override fun toolbarIconColor(): Int = ATHUtil.resolveColor(requireContext(), android.R.attr.colorControlNormal)
|
||||||
|
|
||||||
override val paletteColor: Int
|
override val paletteColor: Int
|
||||||
get() = Color.BLACK
|
get() = Color.BLACK
|
||||||
|
@ -55,4 +175,77 @@ class CirclePlayerFragment : AbsPlayerFragment() {
|
||||||
|
|
||||||
override fun onFavoriteToggled() {
|
override fun onFavoriteToggled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPlayStateChanged() {
|
||||||
|
updatePlayPauseDrawableState()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPlayingMetaChanged() {
|
||||||
|
super.onPlayingMetaChanged()
|
||||||
|
updateSong()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onServiceConnected() {
|
||||||
|
super.onServiceConnected()
|
||||||
|
updateSong()
|
||||||
|
updatePlayPauseDrawableState()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateSong() {
|
||||||
|
val song = MusicPlayerRemote.currentSong
|
||||||
|
title.text = song.title
|
||||||
|
text.text = song.artistName
|
||||||
|
|
||||||
|
if (PreferenceUtil.getInstance(requireContext()).isSongInfo) {
|
||||||
|
songInfo?.text = getSongInfo(song)
|
||||||
|
} else {
|
||||||
|
songInfo?.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
|
progressSlider.max = total
|
||||||
|
|
||||||
|
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
|
||||||
|
animator.duration = AbsPlayerControlsFragment.SLIDER_ANIMATION_TIME
|
||||||
|
animator.interpolator = LinearInterpolator()
|
||||||
|
animator.start()
|
||||||
|
|
||||||
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updatePlayPauseDrawableState() {
|
||||||
|
when {
|
||||||
|
MusicPlayerRemote.isPlaying -> playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||||
|
else -> playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAudioVolumeChanged(currentVolume: Int, maxVolume: Int) {
|
||||||
|
if (volumeSeekBar == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
volumeSeekBar.max = maxVolume
|
||||||
|
volumeSeekBar.progress = currentVolume
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
if (audioVolumeObserver != null) {
|
||||||
|
audioVolumeObserver!!.unregister()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onProgressChanged(seekArc: SeekArc?, progress: Int, fromUser: Boolean) {
|
||||||
|
val audioManager = audioManager
|
||||||
|
audioManager?.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStartTrackingTouch(seekArc: SeekArc?) {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStopTrackingTouch(seekArc: SeekArc?) {
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -22,7 +22,9 @@ import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil
|
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.request.animation.GlideAnimation
|
import com.bumptech.glide.request.animation.GlideAnimation
|
||||||
import kotlinx.android.synthetic.main.fragment_color_player.*
|
import kotlinx.android.synthetic.main.fragment_color_player.colorGradientBackground
|
||||||
|
import kotlinx.android.synthetic.main.fragment_color_player.playerImage
|
||||||
|
import kotlinx.android.synthetic.main.fragment_color_player.playerToolbar
|
||||||
|
|
||||||
class ColorFragment : AbsPlayerFragment() {
|
class ColorFragment : AbsPlayerFragment() {
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ class ColorFragment : AbsPlayerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFavoriteToggled() {
|
override fun onFavoriteToggled() {
|
||||||
|
//toggleFavorite(MusicPlayerRemote.currentSong)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onShow() {
|
override fun onShow() {
|
||||||
|
|
|
@ -122,6 +122,7 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
|
||||||
nowPlayingScreen == NowPlayingScreen.COLOR ||
|
nowPlayingScreen == NowPlayingScreen.COLOR ||
|
||||||
nowPlayingScreen == NowPlayingScreen.SIMPLE ||
|
nowPlayingScreen == NowPlayingScreen.SIMPLE ||
|
||||||
nowPlayingScreen == NowPlayingScreen.BLUR_CARD ||
|
nowPlayingScreen == NowPlayingScreen.BLUR_CARD ||
|
||||||
|
nowPlayingScreen == NowPlayingScreen.CIRCLE ||
|
||||||
nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|
nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|
||||||
&& !App.isProVersion()
|
&& !App.isProVersion()
|
||||||
}
|
}
|
||||||
|
|
BIN
app/src/main/res/drawable-xxxhdpi/np_minimalistic_circle.webp
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/np_minimalistic_circle.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 1,015 KiB |
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 111 KiB |
|
@ -15,6 +15,6 @@
|
||||||
<path
|
<path
|
||||||
android:name="ic_app_shortcut_last_added_ic"
|
android:name="ic_app_shortcut_last_added_ic"
|
||||||
android:fillColor="@color/md_white_1000"
|
android:fillColor="@color/md_white_1000"
|
||||||
android:pathData="M3 6c-0.55 0-1 0.45-1 1v13c0 1.1 0.9 2 2 2h13c0.55 0 1-0.45 1-1s-0.45-1-1-1H5c-0.55 0-1-0.45-1-1V7c0-0.55-0.45-1-1-1zm17-4H8c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2V4c0-1.1-0.9-2-2-2zm-2 9h-3v3c0 0.55-0.45 1-1 1s-1-0.45-1-1v-3h-3c-0.55 0-1-0.45-1-1s0.45-1 1-1h3V6c0-0.55 0.45 -1 1-1s1 0.45 1 1v3h3c0.55 0 1 0.45 1 1s-0.45 1-1 1z" />
|
android:pathData="M124.35,92h-16.2v16.2h-8.1V92H83.85v-8.1h16.2V67.65h8.1v16.2h16.2M128.4,55.5H79.8a8.1,8.1,0,0,0-8.1,8.1v48.6a8.1,8.1,0,0,0,8.1,8.1h48.6a8.1,8.1,0,0,0,8.1-8.1V63.6a8.1,8.1,0,0,0-8.1-8.1M63.6,71.7H55.5v56.7a8.1,8.1,0,0,0,8.1,8.1h56.7v-8.1H63.6Z" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
|
@ -15,6 +15,6 @@
|
||||||
<path
|
<path
|
||||||
android:name="ic_app_shortcut_search_ic"
|
android:name="ic_app_shortcut_search_ic"
|
||||||
android:fillColor="@color/md_white_1000"
|
android:fillColor="@color/md_white_1000"
|
||||||
android:pathData="M15.5 14h-0.79l-0.28-0.27c1.2-1.4 1.82-3.31 1.48-5.34-0.47-2.78-2.79-5-5.59-5.34-4.23-0.52-7.79 3.04-7.27 7.27 0.34 2.8 2.56 5.12 5.34 5.59 2.03 0.34 3.94-0.28 5.34-1.48l0.27 0.28 v0.79l4.25 4.25c0.41 0.41 1.08 0.41 1.49 0 0.41-0.41 0.41 -1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
|
android:pathData="M104.333 97.3333H100.647L99.34 96.0733C103.913 90.7533 106.667 83.8467 106.667 76.3333C106.667 59.58 93.0867 46 76.3333 46C59.58 46 46 59.58 46 76.3333C46 93.0867 59.58 106.667 76.3333 106.667C83.8467 106.667 90.7533 103.913 96.0733 99.34L97.3333 100.647V104.333L120.667 127.62L127.62 120.667L104.333 97.3333V97.3333ZM76.3333 97.3333C64.7133 97.3333 55.3333 87.9533 55.3333 76.3333C55.3333 64.7133 64.7133 55.3333 76.3333 55.3333C87.9533 55.3333 97.3333 64.7133 97.3333 76.3333C97.3333 87.9533 87.9533 97.3333 76.3333 97.3333Z" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
|
@ -17,16 +17,44 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSurface" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/statusBarContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<include layout="@layout/status_bar" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/playerToolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/statusBarContainer"
|
||||||
|
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
|
||||||
|
tools:layout_editor_absoluteY="24dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/titleContainer"
|
android:id="@+id/titleContainer"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
app:layout_constraintBottom_toTopOf="@+id/text"
|
||||||
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_toBottomOf="@+id/playerToolbar">
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
|
@ -34,7 +62,9 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textAppearance="@style/TextViewHeadline5"
|
android:textAppearance="@style/TextViewHeadline4"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textStyle="bold"
|
||||||
tools:text="@tools:sample/lorem/random" />
|
tools:text="@tools:sample/lorem/random" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -44,40 +74,47 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:padding="16dp"
|
|
||||||
android:textAppearance="@style/TextViewBody1"
|
android:textAppearance="@style/TextViewBody1"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/volumeSeekBar"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleContainer"
|
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
|
||||||
tools:text="@tools:sample/lorem/random" />
|
tools:text="@tools:sample/lorem/random" />
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SeekArc
|
<code.name.monkey.retromusic.views.SeekArc
|
||||||
android:id="@+id/progressSlider"
|
android:id="@+id/volumeSeekBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="280dp"
|
android:layout_height="300dp"
|
||||||
android:padding="8dp"
|
android:padding="28dp"
|
||||||
|
app:arcColor="?android:attr/colorControlHighlight"
|
||||||
|
app:arcWidth="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:progressWidth="4dp"
|
||||||
app:rotation="180"
|
app:rotation="180"
|
||||||
|
app:roundEdges="true"
|
||||||
app:startAngle="30"
|
app:startAngle="30"
|
||||||
app:sweepAngle="300"
|
app:sweepAngle="300"
|
||||||
app:touchInside="true" />
|
app:touchInside="true"
|
||||||
|
tools:progress="50" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/playPauseButton"
|
android:id="@+id/playPauseButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/progressSlider"
|
app:backgroundTint="?attr/colorSurface"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/progressSlider"
|
app:layout_constraintBottom_toBottomOf="@id/volumeSeekBar"
|
||||||
app:layout_constraintStart_toStartOf="@+id/progressSlider"
|
app:layout_constraintEnd_toEndOf="@id/volumeSeekBar"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/text" />
|
app:layout_constraintStart_toStartOf="@id/volumeSeekBar"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/volumeSeekBar" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/nextButton"
|
android:id="@+id/nextButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="8dp"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||||
app:layout_constraintStart_toEndOf="@+id/playPauseButton"
|
app:layout_constraintStart_toEndOf="@+id/playPauseButton"
|
||||||
|
@ -89,7 +126,7 @@
|
||||||
android:id="@+id/previousButton"
|
android:id="@+id/previousButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/playPauseButton"
|
app:layout_constraintEnd_toStartOf="@+id/playPauseButton"
|
||||||
|
@ -101,19 +138,78 @@
|
||||||
android:id="@+id/volumeText"
|
android:id="@+id/volumeText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Volume"
|
android:text="@string/volume"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/volume"
|
android:textAppearance="@style/TextViewSubtitle2"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/volumeSeekBar"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@+id/volume" />
|
app:layout_constraintStart_toStartOf="@+id/volumeSeekBar" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/progressContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/songInfo"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/volumeSeekBar">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatSeekBar
|
||||||
|
android:id="@+id/progressSlider"
|
||||||
|
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toLeftOf="@id/songTotalTime"
|
||||||
|
android:layout_toRightOf="@id/songCurrentProgress"
|
||||||
|
android:maxHeight="3dp"
|
||||||
|
android:progressDrawable="@drawable/color_progress_seek"
|
||||||
|
android:splitTrack="false"
|
||||||
|
android:thumb="@drawable/switch_thumb_material"
|
||||||
|
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||||
|
tools:progress="20" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/volume"
|
android:id="@+id/songTotalTime"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:gravity="center_vertical|right|end"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="00:22" />
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/songCurrentProgress"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:gravity="center_vertical|left|end"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry"
|
||||||
|
tools:text="00:22" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/songInfo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textAppearance="@style/TextViewHeadline6"
|
android:maxLines="2"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/progressSlider"
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@+id/progressSlider"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:text="00:00" />
|
tools:text="@tools:sample/lorem/random" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -23,8 +23,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
|
||||||
|
|
||||||
android:gravity="center_vertical|left|end"
|
android:gravity="center_vertical|left|end"
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
@ -37,8 +35,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
|
||||||
|
|
||||||
android:gravity="center_vertical|right|end"
|
android:gravity="center_vertical|right|end"
|
||||||
android:paddingRight="8dp"
|
android:paddingRight="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
|
|
@ -818,4 +818,5 @@
|
||||||
|
|
||||||
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
||||||
<string name="circle">Circle</string>
|
<string name="circle">Circle</string>
|
||||||
|
<string name="volume">Volume</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue