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
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue