fixes
Fix app crashing when updating formats and leaving it moved app not showing in recents when leaving
This commit is contained in:
parent
c57cf33568
commit
eec965dc27
5 changed files with 22 additions and 47 deletions
|
|
@ -211,7 +211,7 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, OnClickListene
|
|||
if (searchView?.isShowing == true) {
|
||||
searchView?.hide()
|
||||
}else{
|
||||
mainActivity?.finishAndRemoveTask()
|
||||
mainActivity?.finishAffinity()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,33 +57,6 @@ abstract class BaseSettingsFragment : PreferenceFragmentCompat() {
|
|||
.setNegativeButton(R.string.cancel, null)
|
||||
.show()
|
||||
}
|
||||
is MultiSelectListPreference -> {
|
||||
val values = preference.entryValues
|
||||
val entries = preference.entries
|
||||
val checkedItems : ArrayList<Boolean> = arrayListOf()
|
||||
values.forEach {
|
||||
if (preference.values.contains(it)) {
|
||||
checkedItems.add(true)
|
||||
}else{
|
||||
checkedItems.add(false)
|
||||
}
|
||||
}
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(preference.title)
|
||||
.setMultiChoiceItems(entries, checkedItems.toBooleanArray()) { _, which, isChecked ->
|
||||
checkedItems[which] = isChecked
|
||||
}
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(R.string.ok) { _: DialogInterface?, _: Int ->
|
||||
preference.values.clear()
|
||||
for (i in 0 until checkedItems.size) {
|
||||
if (checkedItems[i]) {
|
||||
preference.values.add(values[i].toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
.show()
|
||||
}
|
||||
/**
|
||||
* Otherwise show the normal dialog, dialogs for other preference types are not supported yet
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
android:id="@+id/input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number" />
|
||||
android:inputType="text" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -51,6 +51,26 @@
|
|||
android:entries="@array/start_destination"
|
||||
android:entryValues="@array/start_destination_values"
|
||||
app:icon="@drawable/baseline_add_to_home_screen_24"
|
||||
app:useSimpleSummaryProvider="true"
|
||||
app:key="start_destination"
|
||||
app:title="@string/preferred_home_screen" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="ytsearch"
|
||||
android:entries="@array/search_engines"
|
||||
android:entryValues="@array/search_engines_values"
|
||||
android:icon="@drawable/baseline_manage_search_24"
|
||||
app:key="search_engine"
|
||||
app:summary="@string/preferred_search_engine_summary"
|
||||
app:title="@string/preferred_search_engine" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue=""
|
||||
android:entries="@array/countries"
|
||||
android:entryValues="@array/countries_values"
|
||||
app:icon="@drawable/ic_language"
|
||||
app:useSimpleSummaryProvider="true"
|
||||
app:dependency="home_recommendations"
|
||||
app:key="locale"
|
||||
app:title="@string/preferred_locale" />
|
||||
</PreferenceScreen>
|
||||
|
|
@ -45,24 +45,6 @@
|
|||
app:summary="@string/preferred_download_type_summary"
|
||||
app:title="@string/preferred_download_type" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="ytsearch"
|
||||
android:entries="@array/search_engines"
|
||||
android:entryValues="@array/search_engines_values"
|
||||
android:icon="@drawable/baseline_manage_search_24"
|
||||
app:key="search_engine"
|
||||
app:summary="@string/preferred_search_engine_summary"
|
||||
app:title="@string/preferred_search_engine" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue=""
|
||||
android:entries="@array/countries"
|
||||
android:entryValues="@array/countries_values"
|
||||
app:icon="@drawable/ic_language"
|
||||
app:dependency="home_recommendations"
|
||||
app:key="locale"
|
||||
app:title="@string/preferred_locale" />
|
||||
|
||||
<EditTextPreference
|
||||
android:icon="@drawable/ic_key"
|
||||
app:key="api_key"
|
||||
|
|
|
|||
Loading…
Reference in a new issue