Fix some error

main
h4h13 2019-08-04 15:38:34 +05:30
parent 0e3a2835dd
commit 6d84ad1028
10 changed files with 30 additions and 26 deletions

View File

@ -13,8 +13,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 348
versionName '3.3.000'
versionCode 352
versionName '3.3.100'
multiDexEnabled true

View File

@ -19,7 +19,7 @@
},
{
"name": "ᴍɪʟɪɴᴅ ɢᴏᴇʟ | ᴘʟ2",
"summary": "Telegram group helper",
"summary": "Github & Telegram maintainer",
"link": "https://t.me/MilindGoel15",
"profile_image": "https://i.imgur.com/ZIdLHYx.jpg"
},

View File

@ -7,6 +7,7 @@ import android.os.Bundle;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.appbar.AppBarLayout;
@ -45,7 +46,7 @@ public class WhatsNewActivity extends AbsBaseActivity {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_whats_new);

View File

@ -151,7 +151,7 @@ open class BugReportActivity : AbsThemeActivity() {
private fun copyDeviceInfoToClipBoard() {
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText(getString(R.string.device_info), deviceInfo!!.toMarkdown())
clipboard.primaryClip = clip
clipboard.setPrimaryClip(clip)
Toast.makeText(this@BugReportActivity, R.string.copied_device_info_to_clipboard, Toast.LENGTH_LONG).show()
}

View File

@ -30,14 +30,16 @@ class RemoveFromPlaylistDialog : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val songs = arguments!!.getParcelableArrayList<PlaylistSong>("songs")
val title: Int
val content: CharSequence
if (songs.size > 1) {
title = R.string.remove_songs_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_x_songs_from_playlist, songs.size))
} else {
title = R.string.remove_song_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_song_x_from_playlist, songs[0].title))
var title = 0
var content: CharSequence = ""
if (songs != null) {
if (songs.size > 1) {
title = R.string.remove_songs_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_x_songs_from_playlist, songs.size))
} else {
title = R.string.remove_song_from_playlist_title
content = Html.fromHtml(getString(code.name.monkey.retromusic.R.string.remove_song_x_from_playlist, songs[0].title))
}
}

View File

@ -64,8 +64,8 @@ class SongShareDialog : DialogFragment() {
}*/
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val song: Song = arguments!!.getParcelable("song")
val currentlyListening: String = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName)
val song: Song? = arguments!!.getParcelable("song")
val currentlyListening: String = getString(R.string.currently_listening_to_x_by_x, song?.title, song?.artistName)
return MaterialDialog(activity!!, BottomSheet())
.title(R.string.what_do_you_want_to_share)
@ -73,7 +73,7 @@ class SongShareDialog : DialogFragment() {
listItems(items = listOf(getString(code.name.monkey.retromusic.R.string.the_audio_file), "\u201C" + currentlyListening + "\u201D")) { dialog, index, text ->
when (index) {
0 -> {
startActivity(Intent.createChooser(MusicUtil.createShareSongFileIntent(song, context), null))
startActivity(Intent.createChooser(song?.let { MusicUtil.createShareSongFileIntent(it, context) }, null))
}
1 -> {
activity!!.startActivity(

View File

@ -101,8 +101,9 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
color
} else {
ThemeStore.accentColor(context!!).ripAlpha()
}
ThemeStore.accentColor(context!!)
}.ripAlpha()
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)

View File

@ -117,13 +117,13 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
color
} else {
ThemeStore.accentColor(requireContext())
}.ripAlpha()
ThemeStore.textColorSecondary(requireContext())
}
text.setTextColor(colorFinal)
TintHelper.setTintAuto(progressSlider, colorFinal, false)
TintHelper.setTintAuto(progressSlider, colorFinal.ripAlpha(), false)
volumeFragment?.setTintableColor(Color.WHITE)
setFabColor(colorFinal)
setFabColor(colorFinal.ripAlpha())
}
private fun setFabColor(i: Int) {

View File

@ -119,12 +119,12 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
color
} else {
ThemeStore.textColorSecondary(context!!)
}.ripAlpha()
}
text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, colorFinal, false)
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true)
volumeFragment?.setTintable(colorFinal)
volumeFragment?.setTintable(colorFinal.ripAlpha())
updatePlayPauseColor()
updatePrevNextColor()

View File

@ -61,7 +61,7 @@ class LibraryPreferenceDialog : PreferenceDialogFragmentCompat() {
val categoryInfos: List<CategoryInfo>
if (savedInstanceState != null) {
categoryInfos = savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES)
categoryInfos = savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES)!!
} else {
categoryInfos = PreferenceUtil.getInstance().libraryCategoryInfos
}