2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
This commit is contained in:
Emily Kager 2019-05-28 13:17:32 -07:00 committed by Emily Kager
parent 1ed5fb7c96
commit 95b2ea5d21
5 changed files with 19 additions and 4 deletions

View File

@ -376,7 +376,7 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
AlertDialog.Builder( AlertDialog.Builder(
ContextThemeWrapper( ContextThemeWrapper(
activity, activity,
R.style.DialogStyle R.style.DeleteDialogStyle
) )
).apply { ).apply {
val message = context.getString(R.string.tab_collection_dialog_message, tabCollection.title) val message = context.getString(R.string.tab_collection_dialog_message, tabCollection.title)

View File

@ -142,14 +142,14 @@ class HistoryFragment : Fragment(), CoroutineScope, BackHandler {
AlertDialog.Builder( AlertDialog.Builder(
ContextThemeWrapper( ContextThemeWrapper(
it, it,
R.style.DialogStyle R.style.DeleteDialogStyle
) )
).apply { ).apply {
setMessage(R.string.history_delete_all_dialog) setMessage(R.string.history_delete_all_dialog)
setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ -> setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ ->
dialog.cancel() dialog.cancel()
} }
setPositiveButton(android.R.string.ok) { dialog: DialogInterface, _ -> setPositiveButton(R.string.history_clear_dialog) { dialog: DialogInterface, _ ->
launch(Dispatchers.IO) { launch(Dispatchers.IO) {
requireComponents.core.historyStorage.deleteEverything() requireComponents.core.historyStorage.deleteEverything()
reloadData() reloadData()

View File

@ -112,7 +112,7 @@ class DeleteBrowsingDataFragment : Fragment(), CoroutineScope {
AlertDialog.Builder( AlertDialog.Builder(
ContextThemeWrapper( ContextThemeWrapper(
activity, activity,
R.style.DialogStyle R.style.DeleteDialogStyle
) )
).apply { ).apply {
val appName = context.getString(R.string.app_name) val appName = context.getString(R.string.app_name)

View File

@ -333,6 +333,8 @@
<string name="history_delete_all">Delete history</string> <string name="history_delete_all">Delete history</string>
<!-- Text for the dialog to confirm clearing all history --> <!-- Text for the dialog to confirm clearing all history -->
<string name="history_delete_all_dialog">Are you sure you want to clear your history?</string> <string name="history_delete_all_dialog">Are you sure you want to clear your history?</string>
<!-- Text for positive action to delete history in deleting history dialog -->
<string name="history_clear_dialog">Clear</string>
<!-- Text for the button to delete a single history item --> <!-- Text for the button to delete a single history item -->
<string name="history_delete_item">Delete</string> <string name="history_delete_item">Delete</string>
<!-- History multi select title in app bar <!-- History multi select title in app bar

View File

@ -55,6 +55,19 @@
<item name="android:background">?above</item> <item name="android:background">?above</item>
<item name="colorAccent">?accent</item> <item name="colorAccent">?accent</item>
<item name="android:textColorPrimary">?primaryText</item> <item name="android:textColorPrimary">?primaryText</item>
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
</style>
<style name="NegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
<item name="android:textColor">?primaryText</item>
</style>
<style name="PositiveButtonDeleteStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
<item name="android:textColor">?destructive</item>
</style>
<style name="DeleteDialogStyle" parent="DialogStyle">
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonDeleteStyle</item>
</style> </style>
<style name="PrivateThemeBase" parent="Theme.AppCompat.NoActionBar"> <style name="PrivateThemeBase" parent="Theme.AppCompat.NoActionBar">