commit
29671a374e
31 changed files with 213 additions and 89 deletions
|
@ -14,7 +14,7 @@ android {
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId "code.name.monkey.retromusic"
|
applicationId "code.name.monkey.retromusic"
|
||||||
versionCode 10577
|
versionCode 10579
|
||||||
versionName '5.8.4'
|
versionName '5.8.4'
|
||||||
|
|
||||||
buildConfigField("String", "GOOGLE_PLAY_LICENSING_KEY", "\"${getProperty(getProperties('../public.properties'), 'GOOGLE_PLAY_LICENSE_KEY')}\"")
|
buildConfigField("String", "GOOGLE_PLAY_LICENSING_KEY", "\"${getProperty(getProperties('../public.properties'), 'GOOGLE_PLAY_LICENSE_KEY')}\"")
|
||||||
|
|
5
app/src/debug/res/values/bools.xml
Normal file
5
app/src/debug/res/values/bools.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="md3_available">true</bool>
|
||||||
|
<bool name="allowBackup">false</bool>
|
||||||
|
</resources>
|
|
@ -1,7 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">Retro Music-Debug</string>
|
<string name="app_name" translatable="false">Retro Music-Debug</string>
|
||||||
|
|
||||||
<bool name="md3_available">true</bool>
|
|
||||||
<bool name="allowBackup">false</bool>
|
|
||||||
</resources>
|
</resources>
|
|
@ -71,6 +71,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<h3>Fixed</h3>
|
<h3>Fixed</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Fixed Playback speed and pitch not working when CrossFade is enabled</li>
|
||||||
<li>Fixed crash when adding folders to blacklist</li>
|
<li>Fixed crash when adding folders to blacklist</li>
|
||||||
<li>Fix bugs in MD3 theme</li>
|
<li>Fix bugs in MD3 theme</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
package code.name.monkey.retromusic.activities
|
package code.name.monkey.retromusic.activities
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
|
import android.Manifest.permission.BLUETOOTH_CONNECT
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
|
@ -49,7 +50,7 @@ class PermissionActivity : AbsMusicServiceActivity() {
|
||||||
if (VersionUtils.hasMarshmallow()) {
|
if (VersionUtils.hasMarshmallow()) {
|
||||||
binding.audioPermission.show()
|
binding.audioPermission.show()
|
||||||
binding.audioPermission.setButtonClick {
|
binding.audioPermission.setButtonClick {
|
||||||
if (hasAudioPermission()) {
|
if (!hasAudioPermission()) {
|
||||||
val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS)
|
val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS)
|
||||||
intent.data = ("package:" + applicationContext.packageName).toUri()
|
intent.data = ("package:" + applicationContext.packageName).toUri()
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
|
@ -57,6 +58,15 @@ class PermissionActivity : AbsMusicServiceActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (VersionUtils.hasS()) {
|
||||||
|
binding.bluetoothPermission.show()
|
||||||
|
binding.bluetoothPermission.setButtonClick {
|
||||||
|
ActivityCompat.requestPermissions(this,
|
||||||
|
arrayOf(BLUETOOTH_CONNECT),
|
||||||
|
PERMISSION_REQUEST)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding.finish.accentBackgroundColor()
|
binding.finish.accentBackgroundColor()
|
||||||
binding.finish.setOnClickListener {
|
binding.finish.setOnClickListener {
|
||||||
if (hasPermissions()) {
|
if (hasPermissions()) {
|
||||||
|
@ -83,6 +93,7 @@ class PermissionActivity : AbsMusicServiceActivity() {
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
binding.finish.isEnabled = hasStoragePermission()
|
||||||
if (hasStoragePermission()) {
|
if (hasStoragePermission()) {
|
||||||
binding.storagePermission.checkImage.isVisible = true
|
binding.storagePermission.checkImage.isVisible = true
|
||||||
binding.storagePermission.checkImage.imageTintList =
|
binding.storagePermission.checkImage.imageTintList =
|
||||||
|
@ -95,6 +106,13 @@ class PermissionActivity : AbsMusicServiceActivity() {
|
||||||
ColorStateList.valueOf(accentColor())
|
ColorStateList.valueOf(accentColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (VersionUtils.hasS()) {
|
||||||
|
if (hasBluetoothPermission()) {
|
||||||
|
binding.bluetoothPermission.checkImage.isVisible = true
|
||||||
|
binding.bluetoothPermission.checkImage.imageTintList =
|
||||||
|
ColorStateList.valueOf(accentColor())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasStoragePermission(): Boolean {
|
private fun hasStoragePermission(): Boolean {
|
||||||
|
@ -102,6 +120,12 @@ class PermissionActivity : AbsMusicServiceActivity() {
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
|
Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.S)
|
||||||
|
private fun hasBluetoothPermission(): Boolean {
|
||||||
|
return ActivityCompat.checkSelfPermission(this,
|
||||||
|
BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
private fun hasAudioPermission(): Boolean {
|
private fun hasAudioPermission(): Boolean {
|
||||||
return Settings.System.canWrite(this)
|
return Settings.System.canWrite(this)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
package code.name.monkey.retromusic.activities
|
package code.name.monkey.retromusic.activities
|
||||||
|
|
||||||
|
import android.Manifest.permission.BLUETOOTH_CONNECT
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
@ -22,14 +23,14 @@ import androidx.navigation.NavDestination
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.activities.base.AbsThemeActivity
|
import code.name.monkey.retromusic.activities.base.AbsBaseActivity
|
||||||
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
||||||
import code.name.monkey.retromusic.databinding.ActivitySettingsBinding
|
import code.name.monkey.retromusic.databinding.ActivitySettingsBinding
|
||||||
import code.name.monkey.retromusic.extensions.*
|
import code.name.monkey.retromusic.extensions.*
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
import com.afollestad.materialdialogs.color.ColorCallback
|
import com.afollestad.materialdialogs.color.ColorCallback
|
||||||
|
|
||||||
class SettingsActivity : AbsThemeActivity(), ColorCallback, OnThemeChangedListener {
|
class SettingsActivity : AbsBaseActivity(), ColorCallback, OnThemeChangedListener {
|
||||||
private lateinit var binding: ActivitySettingsBinding
|
private lateinit var binding: ActivitySettingsBinding
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
val mSavedInstanceState = extra<Bundle>(TAG).value ?: savedInstanceState
|
val mSavedInstanceState = extra<Bundle>(TAG).value ?: savedInstanceState
|
||||||
|
@ -37,6 +38,7 @@ class SettingsActivity : AbsThemeActivity(), ColorCallback, OnThemeChangedListen
|
||||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setupToolbar()
|
setupToolbar()
|
||||||
|
setPermissionDeniedMessage(getString(R.string.permission_bluetooth_denied))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -81,6 +83,14 @@ class SettingsActivity : AbsThemeActivity(), ColorCallback, OnThemeChangedListen
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getPermissionsToRequest(): Array<String> {
|
||||||
|
return if (VersionUtils.hasS()) {
|
||||||
|
arrayOf(BLUETOOTH_CONNECT)
|
||||||
|
} else {
|
||||||
|
arrayOf()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun invoke(dialog: MaterialDialog, color: Int) {
|
override fun invoke(dialog: MaterialDialog, color: Int) {
|
||||||
ThemeStore.editTheme(this).accentColor(color).commit()
|
ThemeStore.editTheme(this).accentColor(color).commit()
|
||||||
if (VersionUtils.hasNougatMR())
|
if (VersionUtils.hasNougatMR())
|
||||||
|
|
|
@ -95,7 +95,9 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
|
||||||
|
|
||||||
protected fun hasPermissions(): Boolean {
|
protected fun hasPermissions(): Boolean {
|
||||||
for (permission in permissions) {
|
for (permission in permissions) {
|
||||||
if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
|
if (ActivityCompat.checkSelfPermission(this,
|
||||||
|
permission) != PackageManager.PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +107,7 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
|
||||||
override fun onRequestPermissionsResult(
|
override fun onRequestPermissionsResult(
|
||||||
requestCode: Int,
|
requestCode: Int,
|
||||||
permissions: Array<String>,
|
permissions: Array<String>,
|
||||||
grantResults: IntArray
|
grantResults: IntArray,
|
||||||
) {
|
) {
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
if (requestCode == PERMISSION_REQUEST) {
|
if (requestCode == PERMISSION_REQUEST) {
|
||||||
|
@ -123,6 +125,22 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
|
||||||
)
|
)
|
||||||
.setAction(R.string.action_grant) { requestPermissions() }
|
.setAction(R.string.action_grant) { requestPermissions() }
|
||||||
.setActionTextColor(accentColor()).show()
|
.setActionTextColor(accentColor()).show()
|
||||||
|
} else if (ActivityCompat.shouldShowRequestPermissionRationale(
|
||||||
|
this@AbsBaseActivity, Manifest.permission.BLUETOOTH_CONNECT
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
// User has deny from permission dialog
|
||||||
|
Snackbar.make(
|
||||||
|
snackBarContainer,
|
||||||
|
R.string.permission_bluetooth_denied,
|
||||||
|
Snackbar.LENGTH_INDEFINITE
|
||||||
|
)
|
||||||
|
.setAction(R.string.action_grant) {
|
||||||
|
ActivityCompat.requestPermissions(this,
|
||||||
|
arrayOf(Manifest.permission.BLUETOOTH_CONNECT),
|
||||||
|
PERMISSION_REQUEST)
|
||||||
|
}
|
||||||
|
.setActionTextColor(accentColor()).show()
|
||||||
} else {
|
} else {
|
||||||
// User has deny permission and checked never show permission dialog so you can redirect to Application settings page
|
// User has deny permission and checked never show permission dialog so you can redirect to Application settings page
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
|
@ -154,7 +172,7 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
|
||||||
const val PERMISSION_REQUEST = 100
|
const val PERMISSION_REQUEST = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
// this lets keyboard close when clicked in backgroud
|
// this lets keyboard close when clicked in background
|
||||||
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
||||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
if (event.action == MotionEvent.ACTION_DOWN) {
|
||||||
val v = currentFocus
|
val v = currentFocus
|
||||||
|
|
|
@ -189,11 +189,7 @@ abstract class AbsMusicServiceActivity : AbsBaseActivity(), IMusicServiceEventLi
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPermissionsToRequest(): Array<String> {
|
override fun getPermissionsToRequest(): Array<String> {
|
||||||
return mutableListOf(
|
return mutableListOf(Manifest.permission.READ_EXTERNAL_STORAGE).apply {
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
|
||||||
if (VersionUtils.hasS()) Manifest.permission.BLUETOOTH_CONNECT
|
|
||||||
else Manifest.permission.BLUETOOTH
|
|
||||||
).apply {
|
|
||||||
if (!VersionUtils.hasQ()) {
|
if (!VersionUtils.hasQ()) {
|
||||||
add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
private fun setupBottomSheet() {
|
private fun setupBottomSheet() {
|
||||||
bottomSheetBehavior = from(binding.slidingPanel)
|
bottomSheetBehavior = from(binding.slidingPanel)
|
||||||
bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList)
|
bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList)
|
||||||
if (PreferenceUtil.swipeDownToDismiss) bottomSheetBehavior.isHideable = true
|
bottomSheetBehavior.isHideable = PreferenceUtil.swipeDownToDismiss
|
||||||
setMiniPlayerAlphaProgress(0F)
|
setMiniPlayerAlphaProgress(0F)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||||
import code.name.monkey.retromusic.service.MusicService
|
import code.name.monkey.retromusic.service.MusicService
|
||||||
import code.name.monkey.retromusic.util.MusicUtil
|
import code.name.monkey.retromusic.util.MusicUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.ViewUtil
|
|
||||||
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior.*
|
import com.google.android.material.bottomsheet.BottomSheetBehavior.*
|
||||||
|
@ -264,11 +263,8 @@ class GradientPlayerFragment : AbsPlayerFragment(R.layout.fragment_gradient_play
|
||||||
binding.playbackControlsFragment.songInfo.setTextColor(lastDisabledPlaybackControlsColor)
|
binding.playbackControlsFragment.songInfo.setTextColor(lastDisabledPlaybackControlsColor)
|
||||||
|
|
||||||
volumeFragment?.setTintableColor(lastPlaybackControlsColor.ripAlpha())
|
volumeFragment?.setTintableColor(lastPlaybackControlsColor.ripAlpha())
|
||||||
ViewUtil.setProgressDrawable(
|
|
||||||
binding.playbackControlsFragment.progressSlider,
|
binding.playbackControlsFragment.progressSlider.applyColor(lastPlaybackControlsColor.ripAlpha())
|
||||||
lastPlaybackControlsColor.ripAlpha(),
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
updateRepeatState()
|
updateRepeatState()
|
||||||
updateShuffleState()
|
updateShuffleState()
|
||||||
|
|
|
@ -14,10 +14,15 @@
|
||||||
*/
|
*/
|
||||||
package code.name.monkey.retromusic.fragments.settings
|
package code.name.monkey.retromusic.fragments.settings
|
||||||
|
|
||||||
|
import android.Manifest.permission.BLUETOOTH_CONNECT
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.pm.PackageManager.PERMISSION_GRANTED
|
||||||
import android.media.audiofx.AudioEffect
|
import android.media.audiofx.AudioEffect
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import androidx.core.app.ActivityCompat
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
|
import code.name.monkey.retromusic.BLUETOOTH_PLAYBACK
|
||||||
import code.name.monkey.retromusic.EQUALIZER
|
import code.name.monkey.retromusic.EQUALIZER
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil
|
import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
|
@ -28,17 +33,31 @@ import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
|
|
||||||
class AudioSettings : AbsSettingsFragment() {
|
class AudioSettings : AbsSettingsFragment() {
|
||||||
override fun invalidateSettings() {
|
override fun invalidateSettings() {
|
||||||
val findPreference: Preference? = findPreference(EQUALIZER)
|
val eqPreference: Preference? = findPreference(EQUALIZER)
|
||||||
if (!hasEqualizer()) {
|
if (!hasEqualizer()) {
|
||||||
findPreference?.isEnabled = false
|
eqPreference?.isEnabled = false
|
||||||
findPreference?.summary = resources.getString(R.string.no_equalizer)
|
eqPreference?.summary = resources.getString(R.string.no_equalizer)
|
||||||
} else {
|
} else {
|
||||||
findPreference?.isEnabled = true
|
eqPreference?.isEnabled = true
|
||||||
}
|
}
|
||||||
findPreference?.setOnPreferenceClickListener {
|
eqPreference?.setOnPreferenceClickListener {
|
||||||
NavigationUtil.openEqualizer(requireActivity())
|
NavigationUtil.openEqualizer(requireActivity())
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
val bluetoothPreference: Preference? = findPreference(BLUETOOTH_PLAYBACK)
|
||||||
|
if (VersionUtils.hasS()) {
|
||||||
|
bluetoothPreference?.setOnPreferenceChangeListener { _, newValue ->
|
||||||
|
if (newValue as Boolean) {
|
||||||
|
if (ActivityCompat.checkSelfPermission(requireContext(),
|
||||||
|
BLUETOOTH_CONNECT) != PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
|
ActivityCompat.requestPermissions(requireActivity(), arrayOf(
|
||||||
|
BLUETOOTH_CONNECT), 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return@setOnPreferenceChangeListener true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasEqualizer(): Boolean {
|
private fun hasEqualizer(): Boolean {
|
||||||
|
|
|
@ -6,10 +6,12 @@ import android.content.Intent
|
||||||
import android.media.AudioAttributes
|
import android.media.AudioAttributes
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
|
import android.media.PlaybackParams
|
||||||
import android.media.audiofx.AudioEffect
|
import android.media.audiofx.AudioEffect
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils.hasMarshmallow
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.showToast
|
import code.name.monkey.retromusic.extensions.showToast
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -18,6 +20,8 @@ import code.name.monkey.retromusic.service.playback.Playback
|
||||||
import code.name.monkey.retromusic.service.playback.Playback.PlaybackCallbacks
|
import code.name.monkey.retromusic.service.playback.Playback.PlaybackCallbacks
|
||||||
import code.name.monkey.retromusic.util.MusicUtil
|
import code.name.monkey.retromusic.util.MusicUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil.playbackPitch
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil.playbackSpeed
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
/** @author Prathamesh M */
|
/** @author Prathamesh M */
|
||||||
|
@ -138,7 +142,7 @@ class CrossFadePlayer(val context: Context) : Playback, MediaPlayer.OnCompletion
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param player The {@link MediaPlayer} to use
|
* @param player The {@link MediaPlayer} to use
|
||||||
* @param path The path of the file, or the http/rtsp URL of the stream you want to play
|
* @param path The path of the file, or the http/rtsp URL of the stream you want to play
|
||||||
* @return True if the <code>player</code> has been prepared and is ready to play, false otherwise
|
* @return True if the <code>player</code> has been prepared and is ready to play, false otherwise
|
||||||
*/
|
*/
|
||||||
private fun setDataSourceImpl(
|
private fun setDataSourceImpl(
|
||||||
|
@ -157,6 +161,7 @@ class CrossFadePlayer(val context: Context) : Playback, MediaPlayer.OnCompletion
|
||||||
AudioAttributes.Builder().setLegacyStreamType(AudioManager.STREAM_MUSIC).build()
|
AudioAttributes.Builder().setLegacyStreamType(AudioManager.STREAM_MUSIC).build()
|
||||||
)
|
)
|
||||||
player.prepare()
|
player.prepare()
|
||||||
|
player.setPlaybackSpeedPitch(playbackSpeed, playbackPitch)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
return false
|
return false
|
||||||
|
@ -341,6 +346,20 @@ class CrossFadePlayer(val context: Context) : Playback, MediaPlayer.OnCompletion
|
||||||
crossFadeDuration = duration
|
crossFadeDuration = duration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setPlaybackSpeedPitch(speed: Float, pitch: Float) {
|
||||||
|
getCurrentPlayer()?.setPlaybackSpeedPitch(speed, pitch)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun MediaPlayer.setPlaybackSpeedPitch(speed: Float, pitch: Float) {
|
||||||
|
if (hasMarshmallow()) {
|
||||||
|
val wasPlaying: Boolean = isPlaying
|
||||||
|
playbackParams = PlaybackParams().setSpeed(speed).setPitch(pitch)
|
||||||
|
if (!wasPlaying) {
|
||||||
|
if (isPlaying) pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val TAG: String = CrossFadePlayer::class.java.simpleName
|
val TAG: String = CrossFadePlayer::class.java.simpleName
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ package code.name.monkey.retromusic.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.media.PlaybackParams;
|
import android.media.PlaybackParams;
|
||||||
|
@ -28,12 +27,10 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import code.name.monkey.appthemehelper.util.VersionUtils;
|
import code.name.monkey.appthemehelper.util.VersionUtils;
|
||||||
import code.name.monkey.retromusic.ConstantsKt;
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.service.playback.Playback;
|
import code.name.monkey.retromusic.service.playback.Playback;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
|
@ -42,7 +39,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
* @author Andrew Neal, Karim Abou Zeid (kabouzeid)
|
* @author Andrew Neal, Karim Abou Zeid (kabouzeid)
|
||||||
*/
|
*/
|
||||||
public class MultiPlayer
|
public class MultiPlayer
|
||||||
implements Playback, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, SharedPreferences.OnSharedPreferenceChangeListener {
|
implements Playback, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener {
|
||||||
public static final String TAG = MultiPlayer.class.getSimpleName();
|
public static final String TAG = MultiPlayer.class.getSimpleName();
|
||||||
|
|
||||||
private MediaPlayer mCurrentMediaPlayer = new MediaPlayer();
|
private MediaPlayer mCurrentMediaPlayer = new MediaPlayer();
|
||||||
|
@ -60,7 +57,6 @@ public class MultiPlayer
|
||||||
MultiPlayer(final Context context) {
|
MultiPlayer(final Context context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
mCurrentMediaPlayer.setWakeMode(context, PowerManager.PARTIAL_WAKE_LOCK);
|
mCurrentMediaPlayer.setWakeMode(context, PowerManager.PARTIAL_WAKE_LOCK);
|
||||||
PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +90,7 @@ public class MultiPlayer
|
||||||
} else {
|
} else {
|
||||||
player.setDataSource(path);
|
player.setDataSource(path);
|
||||||
}
|
}
|
||||||
setPlaybackSpeedPitch(player);
|
setPlaybackSpeedPitch(PreferenceUtil.INSTANCE.getPlaybackSpeed(), PreferenceUtil.INSTANCE.getPlaybackPitch());
|
||||||
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
||||||
player.prepare();
|
player.prepare();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -208,7 +204,6 @@ public class MultiPlayer
|
||||||
if (mNextMediaPlayer != null) {
|
if (mNextMediaPlayer != null) {
|
||||||
mNextMediaPlayer.release();
|
mNextMediaPlayer.release();
|
||||||
}
|
}
|
||||||
PreferenceManager.getDefaultSharedPreferences(context).unregisterOnSharedPreferenceChangeListener(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -359,20 +354,14 @@ public class MultiPlayer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
public void setPlaybackSpeedPitch(float speed, float pitch) {
|
||||||
if (key.equals(ConstantsKt.PLAYBACK_SPEED) || key.equals(ConstantsKt.PLAYBACK_PITCH)) {
|
|
||||||
setPlaybackSpeedPitch(mCurrentMediaPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlaybackSpeedPitch(MediaPlayer mp) {
|
|
||||||
if (VersionUtils.INSTANCE.hasMarshmallow()) {
|
if (VersionUtils.INSTANCE.hasMarshmallow()) {
|
||||||
boolean wasPlaying = mp.isPlaying();
|
boolean wasPlaying = mCurrentMediaPlayer.isPlaying();
|
||||||
mp.setPlaybackParams(new PlaybackParams()
|
mCurrentMediaPlayer.setPlaybackParams(new PlaybackParams()
|
||||||
.setSpeed(PreferenceUtil.INSTANCE.getPlaybackSpeed())
|
.setSpeed(PreferenceUtil.INSTANCE.getPlaybackSpeed())
|
||||||
.setPitch(PreferenceUtil.INSTANCE.getPlaybackPitch()));
|
.setPitch(PreferenceUtil.INSTANCE.getPlaybackPitch()));
|
||||||
if (!wasPlaying) {
|
if (!wasPlaying) {
|
||||||
if (mp.isPlaying()) mp.pause();
|
if (mCurrentMediaPlayer.isPlaying()) mCurrentMediaPlayer.pause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil.isClassicNotification
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.isHeadsetPlugged
|
import code.name.monkey.retromusic.util.PreferenceUtil.isHeadsetPlugged
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.isLockScreen
|
import code.name.monkey.retromusic.util.PreferenceUtil.isLockScreen
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.isPauseOnZeroVolume
|
import code.name.monkey.retromusic.util.PreferenceUtil.isPauseOnZeroVolume
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil.playbackPitch
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.playbackSpeed
|
import code.name.monkey.retromusic.util.PreferenceUtil.playbackSpeed
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.registerOnSharedPreferenceChangedListener
|
import code.name.monkey.retromusic.util.PreferenceUtil.registerOnSharedPreferenceChangedListener
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil.unregisterOnSharedPreferenceChangedListener
|
import code.name.monkey.retromusic.util.PreferenceUtil.unregisterOnSharedPreferenceChangedListener
|
||||||
|
@ -695,6 +696,9 @@ class MusicService : MediaBrowserServiceCompat(),
|
||||||
sharedPreferences: SharedPreferences, key: String,
|
sharedPreferences: SharedPreferences, key: String,
|
||||||
) {
|
) {
|
||||||
when (key) {
|
when (key) {
|
||||||
|
PLAYBACK_SPEED, PLAYBACK_PITCH -> {
|
||||||
|
playback?.setPlaybackSpeedPitch(playbackSpeed, playbackPitch)
|
||||||
|
}
|
||||||
CROSS_FADE_DURATION -> {
|
CROSS_FADE_DURATION -> {
|
||||||
val progress = songProgressMillis
|
val progress = songProgressMillis
|
||||||
val wasPlaying = isPlaying
|
val wasPlaying = isPlaying
|
||||||
|
|
|
@ -49,6 +49,8 @@ interface Playback {
|
||||||
|
|
||||||
fun setCrossFadeDuration(duration: Int)
|
fun setCrossFadeDuration(duration: Int)
|
||||||
|
|
||||||
|
fun setPlaybackSpeedPitch(speed: Float, pitch: Float)
|
||||||
|
|
||||||
interface PlaybackCallbacks {
|
interface PlaybackCallbacks {
|
||||||
fun onTrackWentToNext()
|
fun onTrackWentToNext()
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package code.name.monkey.retromusic.util
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
||||||
import android.net.ConnectivityManager
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import androidx.core.content.getSystemService
|
import androidx.core.content.getSystemService
|
||||||
import androidx.core.content.res.use
|
import androidx.core.content.res.use
|
||||||
|
@ -340,8 +341,14 @@ object PreferenceUtil {
|
||||||
"always" -> true
|
"always" -> true
|
||||||
"only_wifi" -> {
|
"only_wifi" -> {
|
||||||
val connectivityManager = context.getSystemService<ConnectivityManager>()
|
val connectivityManager = context.getSystemService<ConnectivityManager>()
|
||||||
val netInfo = connectivityManager?.activeNetworkInfo
|
if (VersionUtils.hasMarshmallow()) {
|
||||||
netInfo != null && netInfo.type == ConnectivityManager.TYPE_WIFI && netInfo.isConnectedOrConnecting
|
val network = connectivityManager?.activeNetwork
|
||||||
|
val capabilities = connectivityManager?.getNetworkCapabilities(network)
|
||||||
|
capabilities != null && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
|
||||||
|
} else {
|
||||||
|
val netInfo = connectivityManager?.activeNetworkInfo
|
||||||
|
netInfo != null && netInfo.type == ConnectivityManager.TYPE_WIFI && netInfo.isConnectedOrConnecting
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"never" -> false
|
"never" -> false
|
||||||
else -> false
|
else -> false
|
||||||
|
@ -678,6 +685,8 @@ object PreferenceUtil {
|
||||||
get() = sharedPreferences
|
get() = sharedPreferences
|
||||||
.getInt(CROSS_FADE_DURATION, 0)
|
.getInt(CROSS_FADE_DURATION, 0)
|
||||||
|
|
||||||
|
val isCrossfadeEnabled get() = crossFadeDuration > 0
|
||||||
|
|
||||||
val materialYou
|
val materialYou
|
||||||
get() = sharedPreferences.getBoolean(MATERIAL_YOU, VersionUtils.hasS())
|
get() = sharedPreferences.getBoolean(MATERIAL_YOU, VersionUtils.hasS())
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class PermissionItem @JvmOverloads constructor(
|
||||||
binding.number.backgroundTintList =
|
binding.number.backgroundTintList =
|
||||||
ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.22f))
|
ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.22f))
|
||||||
|
|
||||||
binding.button.accentOutlineColor()
|
if (!isInEditMode) binding.button.accentOutlineColor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
5
app/src/main/res/drawable/ic_bluetooth_connect.xml
Normal file
5
app/src/main/res/drawable/ic_bluetooth_connect.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M6,13c0.55,-0.55 0.55,-1.44 0,-1.99L6,11c-0.55,-0.55 -1.45,-0.55 -2,0s-0.55,1.45 0,2 1.45,0.55 2,0zM20,11c-0.56,-0.56 -1.45,-0.56 -2,-0.01L18,11c-0.55,0.55 -0.55,1.44 0,1.99L18,13c0.55,0.55 1.44,0.55 1.99,0L20,13c0.55,-0.55 0.55,-1.45 0,-2zM17,7l-4.29,-4.29c-0.63,-0.63 -1.71,-0.19 -1.71,0.7v6.18L7.11,5.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41L10.59,12 5.7,16.89c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L11,14.41v6.18c0,0.89 1.08,1.34 1.71,0.71L17,17c0.39,-0.39 0.39,-1.02 0,-1.42L13.41,12 17,8.42c0.39,-0.39 0.39,-1.03 0,-1.42zM14.88,16.29L13,18.17v-3.76l1.88,1.88zM13,9.59L13,5.83l1.88,1.88L13,9.59z"/>
|
||||||
|
</vector>
|
|
@ -43,26 +43,39 @@
|
||||||
android:orientation="@integer/permission_orientation">
|
android:orientation="@integer/permission_orientation">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.PermissionItem
|
<code.name.monkey.retromusic.views.PermissionItem
|
||||||
android:id="@+id/storagePermission"
|
android:id="@+id/storage_permission"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="@integer/permission_layout_weight"
|
android:layout_weight="@integer/permission_layout_weight"
|
||||||
app:permissionButtonTitle="Grant access"
|
app:permissionButtonTitle="@string/grant_access"
|
||||||
app:permissionIcon="@drawable/ic_sd_storage"
|
app:permissionIcon="@drawable/ic_sd_storage"
|
||||||
app:permissionTitle="@string/permission_title"
|
app:permissionTitle="@string/permission_title"
|
||||||
app:permissionTitleNumber="1"
|
app:permissionTitleNumber="1"
|
||||||
app:permissionTitleSubTitle="@string/permission_summary" />
|
app:permissionTitleSubTitle="@string/permission_summary" />
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.PermissionItem
|
<code.name.monkey.retromusic.views.PermissionItem
|
||||||
android:id="@+id/audioPermission"
|
android:id="@+id/bluetooth_permission"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="@integer/permission_layout_weight"
|
android:layout_weight="@integer/permission_layout_weight"
|
||||||
app:permissionButtonTitle="Grant access"
|
android:visibility="gone"
|
||||||
|
app:permissionButtonTitle="@string/grant_access"
|
||||||
|
app:permissionIcon="@drawable/ic_bluetooth_connect"
|
||||||
|
app:permissionTitle="@string/bluetooth_title"
|
||||||
|
app:permissionTitleNumber="2"
|
||||||
|
app:permissionTitleSubTitle="@string/bluetooth_summary"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.PermissionItem
|
||||||
|
android:id="@+id/audio_permission"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="@integer/permission_layout_weight"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:permissionButtonTitle="@string/grant_access"
|
||||||
app:permissionIcon="@drawable/ic_phonelink_ring"
|
app:permissionIcon="@drawable/ic_phonelink_ring"
|
||||||
app:permissionTitle="@string/ringtone_title"
|
app:permissionTitle="@string/ringtone_title"
|
||||||
app:permissionTitleNumber="2"
|
app:permissionTitleNumber="3"
|
||||||
app:permissionTitleSubTitle="@string/ringtone_summary"
|
app:permissionTitleSubTitle="@string/ringtone_summary"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -76,7 +89,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:text="Let's go"
|
android:text="@string/lets_go"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true">
|
android:focusable="true">
|
||||||
<include layout="@layout/shadow_statusbar_toolbar" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/statusBarContainer"
|
android:id="@+id/statusBarContainer"
|
||||||
|
@ -20,18 +19,16 @@
|
||||||
<include layout="@layout/status_bar" />
|
<include layout="@layout/status_bar" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/playerAlbumCoverFragment"
|
android:id="@+id/playerAlbumCoverFragment"
|
||||||
android:name="code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment"
|
android:name="code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHeight_percent="0.5"
|
app:layout_constraintHeight_percent="0.45"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/statusBarContainer" />
|
app:layout_constraintTop_toBottomOf="@id/statusBarContainer" />
|
||||||
|
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/playbackControlsFragment"
|
android:id="@+id/playbackControlsFragment"
|
||||||
android:name="code.name.monkey.retromusic.fragments.player.md3.MD3PlaybackControlsFragment"
|
android:name="code.name.monkey.retromusic.fragments.player.md3.MD3PlaybackControlsFragment"
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:maxHeight="2dp"
|
android:maxHeight="2dp"
|
||||||
android:paddingVertical="@dimen/seekbar_padding"
|
|
||||||
android:progressDrawable="@drawable/color_progress_seek"
|
android:progressDrawable="@drawable/color_progress_seek"
|
||||||
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
||||||
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
|
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
|
||||||
|
@ -93,7 +92,6 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingVertical="8dp"
|
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextViewBody1"
|
android:textAppearance="@style/TextViewBody1"
|
||||||
|
@ -109,14 +107,13 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
|
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/repeatButton"
|
app:layout_constraintTop_toBottomOf="@id/playPauseCard"
|
||||||
tools:text="@tools:sample/full_names" />
|
tools:text="@tools:sample/full_names" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
@ -128,7 +125,7 @@
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseCard"
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseCard"
|
||||||
app:layout_constraintEnd_toStartOf="@id/playPauseCard"
|
app:layout_constraintEnd_toStartOf="@id/playPauseCard"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toEndOf="@+id/repeatButton"
|
||||||
app:layout_constraintTop_toTopOf="@+id/playPauseCard"
|
app:layout_constraintTop_toTopOf="@+id/playPauseCard"
|
||||||
app:srcCompat="@drawable/ic_skip_previous_outline"
|
app:srcCompat="@drawable/ic_skip_previous_outline"
|
||||||
tools:backgroundTint="?colorPrimaryDark"
|
tools:backgroundTint="?colorPrimaryDark"
|
||||||
|
@ -141,7 +138,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardBackgroundColor="?colorSecondary"
|
app:cardBackgroundColor="?colorSecondary"
|
||||||
app:cardCornerRadius="40dp"
|
app:cardCornerRadius="40dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/repeatButton"
|
app:layout_constraintBottom_toTopOf="@id/songInfo"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -153,7 +150,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/transparent"
|
android:background="@color/transparent"
|
||||||
android:padding="32dp"
|
android:padding="28dp"
|
||||||
app:srcCompat="@drawable/ic_pause_outline_small"
|
app:srcCompat="@drawable/ic_pause_outline_small"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
@ -166,7 +163,7 @@
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseCard"
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseCard"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@+id/shuffleButton"
|
||||||
app:layout_constraintStart_toEndOf="@+id/playPauseCard"
|
app:layout_constraintStart_toEndOf="@+id/playPauseCard"
|
||||||
app:layout_constraintTop_toTopOf="@+id/playPauseCard"
|
app:layout_constraintTop_toTopOf="@+id/playPauseCard"
|
||||||
app:srcCompat="@drawable/ic_skip_next_outline"
|
app:srcCompat="@drawable/ic_skip_next_outline"
|
||||||
|
@ -176,33 +173,35 @@
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/shuffleButton"
|
android:id="@+id/shuffleButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
|
android:padding="16dp"
|
||||||
android:paddingVertical="16dp"
|
android:paddingVertical="16dp"
|
||||||
android:src="@drawable/ic_shuffle"
|
android:src="@drawable/ic_shuffle"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/repeatButton"
|
app:layout_constraintBottom_toBottomOf="@+id/nextButton"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/repeatButton"
|
app:layout_constraintStart_toEndOf="@id/repeatButton"
|
||||||
app:layout_constraintTop_toTopOf="@+id/repeatButton"
|
app:layout_constraintTop_toTopOf="@+id/nextButton"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/repeatButton"
|
android:id="@+id/repeatButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
|
android:padding="16dp"
|
||||||
android:paddingVertical="16dp"
|
android:paddingVertical="16dp"
|
||||||
android:src="@drawable/ic_repeat"
|
android:src="@drawable/ic_repeat"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/songInfo"
|
app:layout_constraintBottom_toBottomOf="@+id/previousButton"
|
||||||
app:layout_constraintEnd_toStartOf="@id/shuffleButton"
|
app:layout_constraintEnd_toStartOf="@id/shuffleButton"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/playPauseCard"
|
app:layout_constraintTop_toTopOf="@+id/previousButton"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
|
|
4
app/src/main/res/values-v26/bools.xml
Normal file
4
app/src/main/res/values-v26/bools.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="isNotOreo">false</bool>
|
||||||
|
</resources>
|
|
@ -3,6 +3,5 @@
|
||||||
<bool name="md3_available">true</bool>
|
<bool name="md3_available">true</bool>
|
||||||
<bool name="md3_enabled">true</bool>
|
<bool name="md3_enabled">true</bool>
|
||||||
|
|
||||||
<integer name="overScrollMode">0</integer>
|
|
||||||
<bool name="wallpaper_accent_visible">false</bool>
|
<bool name="wallpaper_accent_visible">false</bool>
|
||||||
</resources>
|
</resources>
|
4
app/src/main/res/values-v31/integers.xml
Normal file
4
app/src/main/res/values-v31/integers.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<integer name="overScrollMode">0</integer>
|
||||||
|
</resources>
|
12
app/src/main/res/values/bools.xml
Normal file
12
app/src/main/res/values/bools.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="md3_available">false</bool>
|
||||||
|
<bool name="md3_enabled">false</bool>
|
||||||
|
|
||||||
|
<bool name="allowBackup">true</bool>
|
||||||
|
|
||||||
|
<bool name="wallpaper_accent_enabled">false</bool>
|
||||||
|
<bool name="wallpaper_accent_visible">false</bool>
|
||||||
|
|
||||||
|
<bool name="isNotOreo">true</bool>
|
||||||
|
</resources>
|
|
@ -24,15 +24,9 @@
|
||||||
|
|
||||||
<!-- Material You -->
|
<!-- Material You -->
|
||||||
<string name="pref_title_md3">Material You</string>
|
<string name="pref_title_md3">Material You</string>
|
||||||
<bool name="md3_available">false</bool>
|
|
||||||
<bool name="md3_enabled">false</bool>
|
|
||||||
|
|
||||||
<integer name="overScrollMode">2</integer>
|
|
||||||
<bool name="allowBackup">true</bool>
|
|
||||||
|
|
||||||
<bool name="wallpaper_accent_enabled">false</bool>
|
|
||||||
<bool name="wallpaper_accent_visible">false</bool>
|
|
||||||
|
|
||||||
<string name="sort_order_album_artist">@string/album_artist</string>
|
<string name="sort_order_album_artist">@string/album_artist</string>
|
||||||
<string name="app_widget_circle_name">@string/circle</string>
|
<string name="app_widget_circle_name">@string/circle</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -12,4 +12,6 @@
|
||||||
<integer name="anim_duration_medium">200</integer>
|
<integer name="anim_duration_medium">200</integer>
|
||||||
<integer name="permission_orientation">1</integer>
|
<integer name="permission_orientation">1</integer>
|
||||||
<integer name="permission_layout_weight">0</integer>
|
<integer name="permission_layout_weight">0</integer>
|
||||||
|
|
||||||
|
<integer name="overScrollMode">2</integer>
|
||||||
</resources>
|
</resources>
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<declare-styleable name="PermissionItem">
|
<declare-styleable name="PermissionItem">
|
||||||
<attr name="permissionTitle" format="string" />
|
<attr name="permissionTitle" format="string" localization="suggested" />
|
||||||
<attr name="permissionTitleSubTitle" format="string" />
|
<attr name="permissionTitleSubTitle" format="string" localization="suggested" />
|
||||||
<attr name="permissionTitleNumber" format="string" />
|
<attr name="permissionTitleNumber" format="string" />
|
||||||
<attr name="permissionIcon" format="integer" />
|
<attr name="permissionIcon" format="reference" />
|
||||||
<attr name="permissionButtonTitle" format="string" />
|
<attr name="permissionButtonTitle" format="string" localization="suggested" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
|
@ -93,6 +93,7 @@
|
||||||
<string name="biography">Biography</string>
|
<string name="biography">Biography</string>
|
||||||
<string name="black_theme_name">Just Black</string>
|
<string name="black_theme_name">Just Black</string>
|
||||||
<string name="blacklist">Blacklist</string>
|
<string name="blacklist">Blacklist</string>
|
||||||
|
<string name="bluetooth_summary">The app needs nearby devices permission to check for bluetooth devices</string>
|
||||||
<string name="blur">Blur</string>
|
<string name="blur">Blur</string>
|
||||||
<string name="blur_card">Blur Card</string>
|
<string name="blur_card">Blur Card</string>
|
||||||
<string name="bug_report_failed">Unable to send report</string>
|
<string name="bug_report_failed">Unable to send report</string>
|
||||||
|
@ -196,6 +197,7 @@
|
||||||
<string name="genres">Genres</string>
|
<string name="genres">Genres</string>
|
||||||
<string name="git_hub_summary">Fork the project on GitHub</string>
|
<string name="git_hub_summary">Fork the project on GitHub</string>
|
||||||
<string name="gradient">Gradient</string>
|
<string name="gradient">Gradient</string>
|
||||||
|
<string name="grant_access">Grant access</string>
|
||||||
<string name="grid_size_1">1</string>
|
<string name="grid_size_1">1</string>
|
||||||
<string name="grid_size_2">2</string>
|
<string name="grid_size_2">2</string>
|
||||||
<string name="grid_size_3">3</string>
|
<string name="grid_size_3">3</string>
|
||||||
|
@ -234,6 +236,7 @@
|
||||||
<string name="labeled">Labeled</string>
|
<string name="labeled">Labeled</string>
|
||||||
<string name="last_added">Last added</string>
|
<string name="last_added">Last added</string>
|
||||||
<string name="last_song">Last song</string>
|
<string name="last_song">Last song</string>
|
||||||
|
<string name="lets_go">Let\'s go</string>
|
||||||
<string name="library_categories">Library categories</string>
|
<string name="library_categories">Library categories</string>
|
||||||
<string name="licenses">Licenses</string>
|
<string name="licenses">Licenses</string>
|
||||||
<string name="light_theme_name">Clearly White</string>
|
<string name="light_theme_name">Clearly White</string>
|
||||||
|
@ -293,6 +296,7 @@
|
||||||
<string name="paste_lyrics_here">Paste Lyrics Here</string>
|
<string name="paste_lyrics_here">Paste Lyrics Here</string>
|
||||||
<string name="paste_timeframe_lyrics_here">Paste timeframe lyrics here</string>
|
<string name="paste_timeframe_lyrics_here">Paste timeframe lyrics here</string>
|
||||||
<string name="peek">Peek</string>
|
<string name="peek">Peek</string>
|
||||||
|
<string name="permission_bluetooth_denied">Nearby devices permission denied.</string>
|
||||||
<string name="permission_external_storage_denied">Permission to access external storage denied.</string>
|
<string name="permission_external_storage_denied">Permission to access external storage denied.</string>
|
||||||
<string name="permission_summary">The app needs permission to access your device storage for playing music</string>
|
<string name="permission_summary">The app needs permission to access your device storage for playing music</string>
|
||||||
<string name="permission_title">Storage Access</string>
|
<string name="permission_title">Storage Access</string>
|
||||||
|
@ -362,6 +366,7 @@
|
||||||
<string name="pref_summary_show_lyrics">Display synced lyrics over album cover</string>
|
<string name="pref_summary_show_lyrics">Display synced lyrics over album cover</string>
|
||||||
<string name="pref_summary_suggestions">Show New Music Mix on homescreen</string>
|
<string name="pref_summary_suggestions">Show New Music Mix on homescreen</string>
|
||||||
<string name="pref_summary_swipe_anywhere_now_playing">Enables changing song by swiping anywhere on the now playing screen</string>
|
<string name="pref_summary_swipe_anywhere_now_playing">Enables changing song by swiping anywhere on the now playing screen</string>
|
||||||
|
<string name="pref_summary_swipe_to_dismiss">Swipe down to dismiss mini player</string>
|
||||||
<string name="pref_summary_toggle_full_screen">Immersive mode</string>
|
<string name="pref_summary_toggle_full_screen">Immersive mode</string>
|
||||||
<string name="pref_summary_toggle_headset">Start playing immediately after headphones are connected</string>
|
<string name="pref_summary_toggle_headset">Start playing immediately after headphones are connected</string>
|
||||||
<string name="pref_summary_toggle_shuffle">Shuffle mode will turn off when playing a new list of songs</string>
|
<string name="pref_summary_toggle_shuffle">Shuffle mode will turn off when playing a new list of songs</string>
|
||||||
|
@ -408,6 +413,7 @@
|
||||||
<string name="pref_title_show_lyrics">Show lyrics</string>
|
<string name="pref_title_show_lyrics">Show lyrics</string>
|
||||||
<string name="pref_title_suggestions">Show suggestions</string>
|
<string name="pref_title_suggestions">Show suggestions</string>
|
||||||
<string name="pref_title_swipe_anywhere_now_playing">Swipe anywhere to change song</string>
|
<string name="pref_title_swipe_anywhere_now_playing">Swipe anywhere to change song</string>
|
||||||
|
<string name="pref_title_swipe_to_dismiss">Dismiss with swipe down</string>
|
||||||
<string name="pref_title_tab_text_mode">Tab titles mode</string>
|
<string name="pref_title_tab_text_mode">Tab titles mode</string>
|
||||||
<string name="pref_title_toggle_carousel_effect">Carousel effect</string>
|
<string name="pref_title_toggle_carousel_effect">Carousel effect</string>
|
||||||
<string name="pref_title_toggle_full_screen">Fullscreen app</string>
|
<string name="pref_title_toggle_full_screen">Fullscreen app</string>
|
||||||
|
@ -553,6 +559,5 @@
|
||||||
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
|
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
|
||||||
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
||||||
<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="pref_summary_swipe_to_dismiss">Swipe down to dismiss mini player</string>
|
<string name="bluetooth_title">Nearby devices</string>
|
||||||
<string name="pref_title_swipe_to_dismiss">Dismiss with swipe down</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
android:layout="@layout/list_item_view_switch"
|
android:layout="@layout/list_item_view_switch"
|
||||||
android:summary="@string/pref_summary_audio_ducking"
|
android:summary="@string/pref_summary_audio_ducking"
|
||||||
android:title="@string/pref_title_audio_ducking"
|
android:title="@string/pref_title_audio_ducking"
|
||||||
app:icon="@drawable/ic_volume_down" />
|
app:icon="@drawable/ic_volume_down"
|
||||||
|
app:isPreferenceVisible="@bool/isNotOreo"/>
|
||||||
|
|
||||||
<code.name.monkey.retromusic.preferences.DurationPreference
|
<code.name.monkey.retromusic.preferences.DurationPreference
|
||||||
android:defaultValue="0"
|
android:defaultValue="0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue