Fix title for now playing theme dialog

This commit is contained in:
h4h13 2019-10-28 22:19:35 +05:30
parent e31a1a6e2f
commit 6b59c2f77f
2 changed files with 4 additions and 5 deletions

View file

@ -33,10 +33,9 @@ class AddToPlaylistDialog : DialogFragment() {
override fun onCreateDialog( override fun onCreateDialog(
savedInstanceState: Bundle? savedInstanceState: Bundle?
): Dialog { ): Dialog {
val cntx = requireContext() val playlists = PlaylistLoader.getAllPlaylists(requireContext())
val playlists = PlaylistLoader.getAllPlaylists(cntx)
val playlistNames: MutableList<String> = mutableListOf() val playlistNames: MutableList<String> = mutableListOf()
playlistNames.add(cntx.resources.getString(R.string.action_new_playlist)) playlistNames.add(requireContext().resources.getString(R.string.action_new_playlist))
for (p in playlists) { for (p in playlists) {
playlistNames.add(p.name) playlistNames.add(p.name)
} }
@ -51,7 +50,7 @@ class AddToPlaylistDialog : DialogFragment() {
activity?.supportFragmentManager?.let { CreatePlaylistDialog.create(songs).show(it, "ADD_TO_PLAYLIST") } activity?.supportFragmentManager?.let { CreatePlaylistDialog.create(songs).show(it, "ADD_TO_PLAYLIST") }
} else { } else {
dialog.dismiss() dialog.dismiss()
PlaylistsUtil.addToPlaylist(cntx, songs, playlists[index - 1].id, true) PlaylistsUtil.addToPlaylist(requireContext(), songs, playlists[index - 1].id, true)
} }
} }
} }

View file

@ -92,7 +92,7 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
return MaterialDialog(requireContext()).show { return MaterialDialog(requireContext()).show {
title(R.string.pref_title_album_cover_style) title(R.string.pref_title_now_playing_screen_appearance)
positiveButton(R.string.set) { positiveButton(R.string.set) {
val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition] val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition]
if (isNowPlayingThemes(nowPlayingScreen)) { if (isNowPlayingThemes(nowPlayingScreen)) {