Fix crashing on seekbar and file sharing
This commit is contained in:
parent
67ea2a40a9
commit
d593e7cf78
30 changed files with 172 additions and 136 deletions
|
@ -31,8 +31,8 @@ android {
|
|||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId "code.name.monkey.retromusic"
|
||||
versionCode 340
|
||||
versionName '3.2.125'
|
||||
versionCode 341
|
||||
versionName '3.2.135'
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
|
|
|
@ -152,6 +152,17 @@
|
|||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
|
||||
<receiver android:name=".service.MediaButtonIntentReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||
|
|
|
@ -127,7 +127,8 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
|
|||
fun setTintableColor(color: Int) {
|
||||
volumeDown.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
volumeUp.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
ViewUtil.setProgressDrawable(volumeSeekBar, color, true)
|
||||
TintHelper.setTint(volumeSeekBar, color, false)
|
||||
//ViewUtil.setProgressDrawable(volumeSeekBar, color, true)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -108,6 +108,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
text.setTextColor(lastDisabledPlaybackControlsColor)
|
||||
|
||||
setFabColor(lastPlaybackControlsColor)
|
||||
ViewUtil.setProgressDrawable(progressSlider, lastPlaybackControlsColor)
|
||||
songCurrentProgress.setTextColor(lastPlaybackControlsColor)
|
||||
songTotalTime.setTextColor(lastPlaybackControlsColor)
|
||||
|
||||
|
@ -120,11 +121,6 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
private fun setFabColor(i: Int) {
|
||||
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(i)), false)
|
||||
TintHelper.setTintAuto(playPauseButton, i, true)
|
||||
setProgressBarColor(i)
|
||||
}
|
||||
|
||||
private fun setProgressBarColor(newColor: Int) {
|
||||
ViewUtil.setProgressDrawable(progressSlider, newColor)
|
||||
}
|
||||
|
||||
private fun setUpPlayPauseFab() {
|
||||
|
|
|
@ -265,9 +265,9 @@ class ColorFragment : AbsPlayerFragment() {
|
|||
override fun onPostExecute(l: Lyrics?) {
|
||||
lyricsColor = l
|
||||
if (lyricsColor == null) {
|
||||
lyricsView.setText(R.string.no_lyrics_found)
|
||||
lyricsView?.setText(R.string.no_lyrics_found)
|
||||
} else {
|
||||
lyricsView.text = lyricsColor!!.text
|
||||
lyricsView?.text = lyricsColor!!.text
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,14 @@ import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
|||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.*
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.progressSlider
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.songCurrentProgress
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.songTotalTime
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.text
|
||||
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.title
|
||||
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
|
||||
import kotlinx.android.synthetic.main.media_button.*
|
||||
|
||||
class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||
|
@ -99,7 +106,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
title!!.setTextColor(lastPlaybackControlsColor)
|
||||
text!!.setTextColor(lastDisabledPlaybackControlsColor)
|
||||
|
||||
TintHelper.setTintAuto(progressSlider, lastPlaybackControlsColor, false)
|
||||
ViewUtil.setProgressDrawable(progressSlider, lastPlaybackControlsColor)
|
||||
|
||||
volumeFragment?.setTintableColor(lastPlaybackControlsColor)
|
||||
|
||||
|
|
|
@ -30,12 +30,12 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
|||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
|
@ -124,10 +124,10 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() {
|
|||
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
|
||||
color
|
||||
} else {
|
||||
ThemeStore.textColorSecondary(context!!).ripAlpha()
|
||||
ThemeStore.textColorSecondary(context!!)
|
||||
}
|
||||
volumeFragment?.setTintable(colorFinal)
|
||||
ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true)
|
||||
|
||||
updatePrevNextColor()
|
||||
|
||||
|
|
|
@ -14,12 +14,12 @@ import code.name.monkey.appthemehelper.util.ColorUtil
|
|||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
|
@ -107,10 +107,10 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
|||
lastPlaybackControlsColor = color
|
||||
color
|
||||
} else {
|
||||
ThemeStore.textColorSecondary(context!!).ripAlpha()
|
||||
ThemeStore.textColorSecondary(context!!)
|
||||
}
|
||||
text.setTextColor(colorFinal)
|
||||
ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true)
|
||||
|
||||
volumeFragment?.setTintable(colorFinal)
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
|||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
|
@ -72,12 +72,13 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
|
||||
color
|
||||
} else {
|
||||
ThemeStore.accentColor(context!!).ripAlpha()
|
||||
ThemeStore.accentColor(context!!)
|
||||
}
|
||||
|
||||
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
|
||||
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal)
|
||||
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), false)
|
||||
|
||||
volumeFragment?.setTintable(colorFinal)
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import code.name.monkey.appthemehelper.util.ColorUtil
|
|||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
|
@ -26,8 +27,15 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
|||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.*
|
||||
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.progressSlider
|
||||
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.songCurrentProgress
|
||||
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.songTotalTime
|
||||
import kotlinx.android.synthetic.main.media_button.*
|
||||
import kotlinx.android.synthetic.main.media_button.playPauseButton
|
||||
import kotlinx.android.synthetic.main.media_button.repeatButton
|
||||
import kotlinx.android.synthetic.main.media_button.shuffleButton
|
||||
|
||||
/**
|
||||
* @author Hemanth S (h4h13).
|
||||
|
@ -136,18 +144,14 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
|||
|
||||
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
|
||||
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
|
||||
setProgressBarColor(colorFinal)
|
||||
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true)
|
||||
|
||||
updateRepeatState()
|
||||
updateShuffleState()
|
||||
updatePrevNextColor()
|
||||
}
|
||||
|
||||
private fun setProgressBarColor(newColor: Int) {
|
||||
progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
|
||||
ViewUtil.setProgressDrawable(progressSlider, newColor)
|
||||
}
|
||||
|
||||
private fun setUpShuffleButton() {
|
||||
shuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() }
|
||||
}
|
||||
|
|
|
@ -71,14 +71,14 @@ abstract class AbsSettingsFragment : PreferenceFragmentCompat() {
|
|||
var dialogFragment: DialogFragment? = null// Dialog creation could not be handled here. Try with the super method.
|
||||
// The dialog was created (it was one of our custom Preferences), show the dialog for it
|
||||
when (preference) {
|
||||
is LibraryPreference -> dialogFragment = LibraryPreferenceDialog.newInstance()
|
||||
is NowPlayingScreenPreference -> dialogFragment = NowPlayingScreenPreferenceDialog.newInstance( )
|
||||
is AlbumCoverStylePreference -> dialogFragment = AlbumCoverStylePreferenceDialog.newInstance()
|
||||
is LibraryPreference -> dialogFragment = LibraryPreferenceDialog.newInstance(preference.key)
|
||||
is NowPlayingScreenPreference -> dialogFragment = NowPlayingScreenPreferenceDialog.newInstance(preference.key)
|
||||
is AlbumCoverStylePreference -> dialogFragment = AlbumCoverStylePreferenceDialog.newInstance(preference.key)
|
||||
is MaterialListPreference -> {
|
||||
preference.entries
|
||||
dialogFragment = MaterialListPreferenceDialog.newInstance(preference)
|
||||
}
|
||||
is BlacklistPreference -> dialogFragment = BlacklistPreferenceDialog.newInstance(preference.key)
|
||||
is BlacklistPreference -> dialogFragment = BlacklistPreferenceDialog.newInstance()
|
||||
}
|
||||
|
||||
if (dialogFragment != null) {
|
||||
|
|
|
@ -17,6 +17,7 @@ package code.name.monkey.retromusic.preferences
|
|||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
|
@ -24,10 +25,11 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.preference.DialogPreference
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
|
@ -37,7 +39,7 @@ import com.afollestad.materialdialogs.customview.customView
|
|||
import com.bumptech.glide.Glide
|
||||
|
||||
|
||||
class AlbumCoverStylePreference : DialogPreference {
|
||||
class AlbumCoverStylePreference : ATEDialogPreference {
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||
|
@ -51,6 +53,10 @@ class AlbumCoverStylePreference : DialogPreference {
|
|||
override fun getDialogLayoutResource(): Int {
|
||||
return mLayoutRes;
|
||||
}
|
||||
|
||||
init {
|
||||
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
}
|
||||
|
||||
class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener {
|
||||
|
@ -130,8 +136,12 @@ class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPa
|
|||
companion object {
|
||||
val TAG: String = AlbumCoverStylePreferenceDialog::class.java.simpleName
|
||||
|
||||
fun newInstance(): AlbumCoverStylePreferenceDialog {
|
||||
return AlbumCoverStylePreferenceDialog()
|
||||
fun newInstance(key: String): AlbumCoverStylePreferenceDialog {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(ARG_KEY, key)
|
||||
val fragment = AlbumCoverStylePreferenceDialog()
|
||||
fragment.arguments = bundle
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import android.os.Bundle
|
|||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.DialogPreference
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||
import code.name.monkey.retromusic.R
|
||||
|
@ -49,14 +48,8 @@ class BlacklistPreference : ATEDialogPreference {
|
|||
|
||||
class BlacklistPreferenceDialog : DialogFragment(), BlacklistFolderChooserDialog.FolderCallback {
|
||||
companion object {
|
||||
private const val EXTRA_KEY = "key"
|
||||
|
||||
fun newInstance(key: String): BlacklistPreferenceDialog {
|
||||
val args = Bundle()
|
||||
args.putString(EXTRA_KEY, key)
|
||||
val fragment = BlacklistPreferenceDialog()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
fun newInstance(): BlacklistPreferenceDialog {
|
||||
return BlacklistPreferenceDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import android.graphics.PorterDuff
|
|||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
@ -48,7 +48,12 @@ class LibraryPreference : ATEDialogPreference {
|
|||
}
|
||||
}
|
||||
|
||||
class LibraryPreferenceDialog : DialogFragment() {
|
||||
class LibraryPreferenceDialog : PreferenceDialogFragmentCompat() {
|
||||
|
||||
override fun onDialogClosed(positiveResult: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
lateinit var adapter: CategoryInfoAdapter
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
|
@ -110,8 +115,12 @@ class LibraryPreferenceDialog : DialogFragment() {
|
|||
|
||||
companion object {
|
||||
|
||||
fun newInstance(): LibraryPreferenceDialog {
|
||||
return LibraryPreferenceDialog()
|
||||
fun newInstance(key: String): LibraryPreferenceDialog {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(ARG_KEY, key)
|
||||
val fragment = LibraryPreferenceDialog()
|
||||
fragment.arguments = bundle
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,11 +25,11 @@ import android.view.ViewGroup
|
|||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.preference.DialogPreference
|
||||
import androidx.preference.PreferenceDialogFragmentCompat
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||
import code.name.monkey.retromusic.App
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
||||
|
@ -40,7 +40,7 @@ import com.afollestad.materialdialogs.MaterialDialog
|
|||
import com.afollestad.materialdialogs.customview.customView
|
||||
import com.bumptech.glide.Glide
|
||||
|
||||
class NowPlayingScreenPreference : DialogPreference {
|
||||
class NowPlayingScreenPreference : ATEDialogPreference {
|
||||
|
||||
constructor(context: Context) : super(context) {}
|
||||
|
||||
|
@ -62,7 +62,9 @@ class NowPlayingScreenPreference : DialogPreference {
|
|||
}
|
||||
|
||||
class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener {
|
||||
|
||||
private var viewPagerPosition: Int = 0
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
|
||||
}
|
||||
|
@ -124,10 +126,12 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
|
|||
}
|
||||
|
||||
companion object {
|
||||
|
||||
|
||||
fun newInstance(): NowPlayingScreenPreferenceDialog {
|
||||
return NowPlayingScreenPreferenceDialog()
|
||||
fun newInstance(key: String): NowPlayingScreenPreferenceDialog {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(ARG_KEY, key)
|
||||
val fragment = NowPlayingScreenPreferenceDialog()
|
||||
fragment.arguments = bundle
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class MusicUtil {
|
|||
|
||||
@NonNull
|
||||
public static Intent createShareSongFileIntent(@NonNull final Song song, @NonNull Context context) {
|
||||
Uri file = FileProvider.getUriForFile(context, context.getPackageName() + ".provider", new File(song.getData()));
|
||||
/*Uri file = FileProvider.getUriForFile(context, context.getPackageName() + ".provider", new File(song.getData()));
|
||||
try {
|
||||
return new Intent().setAction(Intent.ACTION_SEND).putExtra(Intent.EXTRA_STREAM, file)
|
||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
|
@ -82,6 +82,19 @@ public class MusicUtil {
|
|||
e.printStackTrace();
|
||||
Toast.makeText(context, "Could not share this file, I'm aware of the issue.", Toast.LENGTH_SHORT).show();
|
||||
return new Intent();
|
||||
}*/
|
||||
|
||||
try {
|
||||
return new Intent()
|
||||
.setAction(Intent.ACTION_SEND)
|
||||
.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), new File(song.getData())))
|
||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
.setType("audio/*");
|
||||
} catch (IllegalArgumentException e) {
|
||||
// TODO the path is most likely not like /storage/emulated/0/... but something like /storage/28C7-75B0/...
|
||||
e.printStackTrace();
|
||||
Toast.makeText(context, "Could not share this file, I'm aware of the issue.", Toast.LENGTH_SHORT).show();
|
||||
return new Intent();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,20 +53,7 @@ object ViewUtil {
|
|||
if (thumbTint) {
|
||||
progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
|
||||
}
|
||||
|
||||
if (progressSlider.progressDrawable is LayerDrawable) {
|
||||
val ld = progressSlider.progressDrawable as LayerDrawable?
|
||||
|
||||
if (ld != null) {
|
||||
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)
|
||||
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
|
||||
|
||||
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
|
||||
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
} else {
|
||||
progressSlider.progressTintList = ColorStateList.valueOf(newColor)
|
||||
}
|
||||
progressSlider.progressTintList = ColorStateList.valueOf(newColor)
|
||||
}
|
||||
|
||||
fun setProgressDrawable(progressSlider: ProgressBar, newColor: Int) {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
|
||||
<path
|
||||
android:fillColor="@color/md_white_1000"
|
||||
android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-2-3.5l6-4.5-6-4.5z" />
|
||||
|
|
|
@ -85,7 +85,6 @@
|
|||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:progress="20"
|
||||
android:progressDrawable="@drawable/color_progress_seek" />
|
||||
android:progress="20" />
|
||||
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -49,13 +49,13 @@
|
|||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
android:layout_centerVertical="true"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:maxHeight="2dp"
|
||||
android:splitTrack="false"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
|
|
@ -56,12 +56,12 @@
|
|||
|
||||
<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:maxHeight="3dp"
|
||||
android:maxHeight="2dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:progressTint="@color/md_white_1000"
|
||||
android:splitTrack="false"
|
||||
android:thumbTint="@color/md_white_1000"
|
||||
|
|
|
@ -51,8 +51,7 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:maxHeight="2dp"
|
||||
android:splitTrack="false"
|
||||
android:thumb="@drawable/switch_square"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
|
|
|
@ -110,13 +110,13 @@
|
|||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:splitTrack="false"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
|
|
@ -87,13 +87,13 @@
|
|||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:maxHeight="2dp"
|
||||
android:splitTrack="false"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
|
|
@ -45,13 +45,13 @@
|
|||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:splitTrack="false"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
|
|
@ -88,6 +88,5 @@
|
|||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:progress="20"
|
||||
android:progressDrawable="@drawable/color_progress_seek" />
|
||||
android:progress="20" />
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -42,13 +42,13 @@
|
|||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/songTotalTime"
|
||||
android:layout_toRightOf="@id/songCurrentProgress"
|
||||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:maxHeight="2dp"
|
||||
android:splitTrack="false"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
|
|
@ -8,10 +8,59 @@
|
|||
android:orientation="vertical"
|
||||
tools:ignore="MissingPrefix">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<SeekBar
|
||||
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:splitTrack="false"
|
||||
android:thumb="@drawable/switch_thumb_material"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute"
|
||||
tools:progress="20" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songTotalTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|right|end"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songCurrentProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|left|end"
|
||||
android:paddingLeft="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -48,54 +97,6 @@
|
|||
android:textColor="?android:attr/textColorSecondary" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/progressSlider"
|
||||
style="@style/MusicProgressSlider"
|
||||
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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songTotalTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|right|end"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songCurrentProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|left|end"
|
||||
android:paddingLeft="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/media_button" />
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
|
||||
<androidx.appcompat.widget.AppCompatSeekBar
|
||||
android:id="@+id/volumeSeekBar"
|
||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxHeight="2dp"
|
||||
tools:progress="20" />
|
||||
|
||||
<code.name.monkey.retromusic.views.IconImageView
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
<code.name.monkey.retromusic.preferences.AlbumCoverStylePreference
|
||||
android:key="album_cover_style_id"
|
||||
android:title="@string/pref_title_album_cover_style"
|
||||
app:enableCopying="true" />
|
||||
app:enableCopying="true"
|
||||
app:icon="@drawable/ic_image_white_24dp" />
|
||||
|
||||
<code.name.monkey.retromusic.preferences.MaterialListPreference
|
||||
android:defaultValue="0"
|
||||
|
|
Loading…
Reference in a new issue