Commit c0bc6a3d authored by Geoffrey Métais's avatar Geoffrey Métais

Upgrade preferences to 1.1.0-alpha02

This allows to fix the preference categories displaying with a space
reserved for icons.
Fix #700
parent 774509f4
......@@ -35,6 +35,7 @@ ext {
targetSdkVersion = 28
compileSdkVersion = 28
androidxCoreVersion = '1.0.1'
androidxPreferencesVersion = '1.1.0-alpha02'
androidxVersion = '1.0.0'
androidxAnnotationVersion = '1.0.1'
androidxAppcompatVersion = '1.0.2'
......
......@@ -215,7 +215,7 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:$rootProject.ext.androidxVersion"
implementation "com.google.android.material:material:$rootProject.ext.androidxVersion"
implementation "androidx.annotation:annotation:$rootProject.ext.androidxAnnotationVersion"
implementation "androidx.preference:preference:$rootProject.ext.androidxVersion"
implementation "androidx.preference:preference:$androidxPreferencesVersion"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintLayoutVersion"
//TV
......
......@@ -106,9 +106,9 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
browserFavRepository = BrowserFavRepository.getInstance(requireContext())
}
override fun onPrepareOptionsMenu(menu: Menu?) {
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
val item = menu!!.findItem(R.id.ml_menu_filter)
val item = menu.findItem(R.id.ml_menu_filter)
if (item != null) item.isVisible = enableSearchOption()
val sortItem = menu.findItem(R.id.ml_menu_sortby)
if (sortItem != null) sortItem.isVisible = !isRootDirectory
......@@ -353,7 +353,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
adapter.multiSelectHelper.clearSelection()
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item!!.itemId) {
R.id.ml_menu_save -> {
toggleFavorite()
......
......@@ -114,14 +114,14 @@ class StorageBrowserFragment : FileBrowserFragment(), EntryPointsEventsCb {
outState.putBoolean(KEY_IN_MEDIALIB, mScannedDirectory)
}
override fun onPrepareOptionsMenu(menu: Menu?) {
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
menu?.findItem(R.id.ml_menu_custom_dir)?.isVisible = true
menu?.findItem(R.id.ml_menu_refresh)?.isVisible = false
menu.findItem(R.id.ml_menu_custom_dir)?.isVisible = true
menu.findItem(R.id.ml_menu_refresh)?.isVisible = false
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
if (item?.itemId == R.id.ml_menu_custom_dir) {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == R.id.ml_menu_custom_dir) {
showAddDirectoryDialog()
return true
}
......
......@@ -79,7 +79,7 @@ class ContextSheet : com.google.android.material.bottomsheet.BottomSheetDialogFr
val flags = arguments?.getInt(CTX_FLAGS_KEY) ?: 0
options = populateOptions(flags)
AppScope.launch(Dispatchers.Main) {
dialog.window?.setLayout(resources.getDimensionPixelSize(R.dimen.default_context_width), ViewGroup.LayoutParams.MATCH_PARENT)
dialog?.window?.setLayout(resources.getDimensionPixelSize(R.dimen.default_context_width), ViewGroup.LayoutParams.MATCH_PARENT)
(dialog as BottomSheetDialog).findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)?.let {
val bsb = BottomSheetBehavior.from(it)
if (bsb.state == BottomSheetBehavior.STATE_COLLAPSED) bsb.state = BottomSheetBehavior.STATE_EXPANDED
......
......@@ -26,7 +26,7 @@ class DeviceDialog : DialogFragment() {
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
dialog.setTitle(getString(R.string.device_dialog_title))
dialog?.setTitle(getString(R.string.device_dialog_title))
val binding = DialogExtDeviceBinding.inflate(inflater, container, false)
binding.handler = clickHandler
if (scan) binding.extDeviceScan.visibility = View.VISIBLE
......
......@@ -14,7 +14,6 @@ import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.lifecycle.ViewModelProviders
import kotlinx.coroutines.NonCancellable.isActive
import kotlinx.coroutines.ObsoleteCoroutinesApi
import kotlinx.coroutines.channels.actor
import kotlinx.coroutines.isActive
......@@ -90,7 +89,7 @@ class SubtitleDownloaderDialogFragment: DialogFragment() {
return binding.root
}
override fun onConfigurationChanged(newConfig: Configuration?) {
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// In manifest for VideoPlayerActivity defined
// android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
......
......@@ -90,12 +90,12 @@ class FoldersFragment : MediaBrowserFragment<PagedFoldersModel>(), CoroutineScop
}
override fun onPrepareOptionsMenu(menu: Menu?) {
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
menu!!.findItem(R.id.ml_menu_last_playlist).isVisible = true
menu.findItem(R.id.ml_menu_last_playlist).isVisible = true
}
override fun onOptionsItemSelected(item: MenuItem?)= when (item!!.itemId) {
override fun onOptionsItemSelected(item: MenuItem)= when (item.itemId) {
R.id.ml_menu_last_playlist -> {
MediaUtils.loadlastPlaylist(activity, PLAYLIST_TYPE_VIDEO)
true
......
......@@ -91,7 +91,7 @@ class MRLPanelFragment : DialogFragment(), View.OnKeyListener, TextView.OnEditor
viewModel.observableHistory.observe(this, Observer { adapter.setList(it) })
binding.play.setOnClickListener(this)
dialog.setTitle(R.string.open_mrl_dialog_title)
dialog?.setTitle(R.string.open_mrl_dialog_title)
return binding.root
}
......
......@@ -118,7 +118,7 @@ class SearchFragment : SearchSupportFragment(), SearchSupportFragment.SearchResu
(activity as? SearchActivity)?.updateEmptyView(empty)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == REQUEST_SPEECH && resultCode == Activity.RESULT_OK) setSearchQuery(data, true)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment