moved some preferences around & fixed app crashing when u leave format card while its updating

This commit is contained in:
deniscerri 2023-05-16 21:05:08 +02:00
parent c28c2a6848
commit c57cf33568
No known key found for this signature in database
GPG key ID: 95C43D517D830350
3 changed files with 26 additions and 24 deletions

View file

@ -158,14 +158,16 @@ class FormatSelectionBottomSheetDialog(private val items: List<DownloadItem?>, p
shimmers.visibility = View.GONE
shimmers.stopShimmer()
}catch (e: Exception){
refreshBtn.isEnabled = true
refreshBtn.text = getString(R.string.update_formats)
linearLayout.visibility = View.VISIBLE
shimmers.visibility = View.GONE
shimmers.stopShimmer()
runCatching {
refreshBtn.isEnabled = true
refreshBtn.text = getString(R.string.update_formats)
linearLayout.visibility = View.VISIBLE
shimmers.visibility = View.GONE
shimmers.stopShimmer()
e.printStackTrace()
Toast.makeText(context, getString(R.string.error_updating_formats), Toast.LENGTH_SHORT).show()
e.printStackTrace()
Toast.makeText(context, getString(R.string.error_updating_formats), Toast.LENGTH_SHORT).show()
}
}
}
}

View file

@ -36,4 +36,21 @@
android:key="high_contrast"
app:summary="@string/pure_theme_summary"
app:title="@string/high_contrast" />
<SwitchPreferenceCompat
android:widgetLayout="@layout/preferece_material_switch"
app:defaultValue="false"
android:icon="@drawable/baseline_recommend_24"
android:key="home_recommendations"
app:summary="@string/video_recommendations_summary"
app:title="@string/video_recommendations" />
<ListPreference
android:defaultValue="Home"
android:entries="@array/start_destination"
android:entryValues="@array/start_destination_values"
app:icon="@drawable/baseline_add_to_home_screen_24"
app:key="start_destination"
app:title="@string/preferred_home_screen" />
</PreferenceScreen>

View file

@ -54,23 +54,6 @@
app:summary="@string/preferred_search_engine_summary"
app:title="@string/preferred_search_engine" />
<ListPreference
android:defaultValue="Home"
android:entries="@array/start_destination"
android:entryValues="@array/start_destination_values"
app:icon="@drawable/baseline_add_to_home_screen_24"
app:key="start_destination"
app:title="@string/preferred_home_screen" />
<SwitchPreferenceCompat
android:widgetLayout="@layout/preferece_material_switch"
app:defaultValue="false"
android:icon="@drawable/baseline_recommend_24"
android:key="home_recommendations"
app:summary="@string/video_recommendations_summary"
app:title="@string/video_recommendations" />
<ListPreference
android:defaultValue=""
android:entries="@array/countries"