Fix lot of things haha
This commit is contained in:
parent
a81536ab9a
commit
4197fde140
54 changed files with 250 additions and 125 deletions
|
@ -24,7 +24,7 @@ import code.name.monkey.retromusic.R;
|
|||
/**
|
||||
* @author Aidan Follestad (afollestad), modified by Karim Abou Zeid
|
||||
*/
|
||||
public class BlacklistFolderChooserDialog extends DialogFragment implements MaterialDialog.ListCallback {
|
||||
public class BlacklistFolderChooserDialog extends DialogFragment /*implements MaterialDialog.ListCallback */{
|
||||
|
||||
private String initialPath = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
private File parentFolder;
|
||||
|
@ -68,7 +68,7 @@ public class BlacklistFolderChooserDialog extends DialogFragment implements Mate
|
|||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
/*@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
|
@ -102,9 +102,9 @@ public class BlacklistFolderChooserDialog extends DialogFragment implements Mate
|
|||
.positiveText(R.string.add_action)
|
||||
.negativeText(android.R.string.cancel);
|
||||
return builder.build();
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence s) {
|
||||
if (canGoUp && i == 0) {
|
||||
parentFolder = parentFolder.getParentFile();
|
||||
|
@ -120,7 +120,7 @@ public class BlacklistFolderChooserDialog extends DialogFragment implements Mate
|
|||
}
|
||||
}
|
||||
reload();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void checkIfCanGoUp() {
|
||||
canGoUp = parentFolder.getParent() != null;
|
||||
|
@ -130,7 +130,7 @@ public class BlacklistFolderChooserDialog extends DialogFragment implements Mate
|
|||
parentContents = listFiles();
|
||||
MaterialDialog dialog = (MaterialDialog) getDialog();
|
||||
dialog.setTitle(parentFolder.getAbsolutePath());
|
||||
dialog.setItems((CharSequence[]) getContentsArray());
|
||||
//dialog.setItems((CharSequence[]) getContentsArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,7 @@ class DeleteSongsDialog : RoundedBottomSheetDialogFragment() {
|
|||
} else {
|
||||
getString(R.string.delete_song_x, songs[0].title)
|
||||
}
|
||||
dialogTitle.text = content
|
||||
dialogTitle.text = Html.fromHtml(content)
|
||||
}
|
||||
actionDelete.apply {
|
||||
setOnClickListener {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,9 +5,6 @@ import android.app.PendingIntent
|
|||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.os.Bundle
|
||||
import android.os.CountDownTimer
|
||||
import android.os.SystemClock
|
||||
|
@ -24,6 +21,7 @@ import code.name.monkey.retromusic.R
|
|||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.dialog_sleep_timer.*
|
||||
import java.util.*
|
||||
|
@ -50,9 +48,7 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
|
|||
}
|
||||
|
||||
private fun setProgressBarColor(dark: Int) {
|
||||
val ld = seekBar.progressDrawable as LayerDrawable
|
||||
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
|
||||
clipDrawable.setColorFilter(dark, PorterDuff.Mode.SRC_IN)
|
||||
ViewUtil.setProgressDrawable(progressSlider = seekBar, newColor = dark)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -68,7 +64,9 @@ class SleepTimerDialog : RoundedBottomSheetDialogFragment() {
|
|||
seekArcProgress = PreferenceUtil.getInstance().lastSleepTimerValue
|
||||
updateTimeDisplayTime()
|
||||
seekBar.progress = seekArcProgress
|
||||
|
||||
setProgressBarColor(ThemeStore.accentColor(context!!))
|
||||
|
||||
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar, i: Int, b: Boolean) {
|
||||
if (i < 1) {
|
||||
|
|
|
@ -13,12 +13,12 @@ import code.name.monkey.retromusic.R
|
|||
import code.name.monkey.retromusic.model.Song
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.dialog_delete.*
|
||||
import kotlinx.android.synthetic.main.dialog_file_share.*
|
||||
|
||||
|
||||
class SongShareDialog : RoundedBottomSheetDialogFragment() {
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.dialog_delete, container, false)
|
||||
return inflater.inflate(R.layout.dialog_file_share, container, false)
|
||||
}
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
|
@ -27,7 +27,7 @@ class SongShareDialog : RoundedBottomSheetDialogFragment() {
|
|||
val song = arguments!!.getParcelable<Song>("song")!!
|
||||
dialogTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
|
||||
|
||||
actionDelete.apply {
|
||||
audioText.apply {
|
||||
text = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
|
||||
setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
setOnClickListener {
|
||||
|
@ -41,15 +41,16 @@ class SongShareDialog : RoundedBottomSheetDialogFragment() {
|
|||
MaterialUtil.setTint(this)
|
||||
}
|
||||
|
||||
actionCancel.apply {
|
||||
audioFile.apply {
|
||||
setTextColor(ThemeStore.textColorSecondary(context!!))
|
||||
setOnClickListener {
|
||||
MusicUtil.createShareSongFileIntent(song, context)
|
||||
activity!!.startActivity(Intent.createChooser(MusicUtil.createShareSongFileIntent(song, activity), null))
|
||||
dismiss()
|
||||
}
|
||||
icon = ContextCompat.getDrawable(context, R.drawable.ic_share_white_24dp)
|
||||
MaterialUtil.setTint(this, false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue