diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsLibraryPagerRecyclerViewCustomGridSizeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsLibraryPagerRecyclerViewCustomGridSizeFragment.kt index 8b078163..a936c4a3 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsLibraryPagerRecyclerViewCustomGridSizeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsLibraryPagerRecyclerViewCustomGridSizeFragment.kt @@ -39,8 +39,8 @@ abstract class AbsLibraryPagerRecyclerViewCustomGridSizeFragment<A : RecyclerVie private val maxGridSizeForList: Int get() = if (isLandscape) { - activity!!.resources.getInteger(R.integer.default_list_columns_land) - } else activity!!.resources.getInteger(R.integer.default_list_columns) + resources.getInteger(R.integer.default_list_columns_land) + } else resources.getInteger(R.integer.default_list_columns) fun getGridSize(): Int { if (gridSize == 0) { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt index 60c2597c..4b2a26d6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt @@ -152,7 +152,7 @@ class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca super.onViewCreated(view, savedInstanceState) title.isSelected = true progressBar.setOnClickListener(PlayPauseButtonOnClickHandler()) - progressBar.setOnTouchListener(MiniPlayerFragment.FlingPlayBackController(activity!!)) + progressBar.setOnTouchListener(MiniPlayerFragment.FlingPlayBackController(requireContext())) setUpPlayerToolbar() setUpSubFragments() @@ -169,7 +169,7 @@ class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca private fun setUpPlayerToolbar() { playerToolbar.apply { inflateMenu(R.menu.menu_player) - setNavigationOnClickListener { activity!!.onBackPressed() } + setNavigationOnClickListener { requireActivity().onBackPressed() } setOnMenuItemClickListener(this@TinyPlayerFragment) } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/NowPlayingSettingsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/NowPlayingSettingsFragment.kt index ffccd739..e1fedc94 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/NowPlayingSettingsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/NowPlayingSettingsFragment.kt @@ -37,7 +37,7 @@ class NowPlayingSettingsFragment : AbsSettingsFragment(), val carouselEffect: TwoStatePreference = findPreference("carousel_effect")!! carouselEffect.setOnPreferenceChangeListener { _, newValue -> if (newValue as Boolean && !App.isProVersion()) { - showProToastAndNavigate(activity!!.getString(R.string.pref_title_toggle_carousel_effect)) + showProToastAndNavigate(getString(R.string.pref_title_toggle_carousel_effect)) return@setOnPreferenceChangeListener false } return@setOnPreferenceChangeListener true