From: Soren Stoutner Date: Sat, 12 Sep 2020 17:46:57 +0000 (-0700) Subject: Add the move to folder icon to the top of the dialog. https://redmine.stoutner.com... X-Git-Tag: v3.6~24 X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff_plain;h=bbe830156ea045e16040b12549cc365e11ea242e Add the move to folder icon to the top of the dialog. https://redmine.stoutner.com/issues/346 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java index 25701f77..a421177c 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java @@ -24,6 +24,7 @@ import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.MatrixCursor; @@ -74,7 +75,7 @@ public class MoveToFolderDialog extends DialogFragment { moveToFolderListener = (MoveToFolderListener) context; } - // `@SuppressLint("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`. + // `@SuppressLint("InflateParams")` removes the warning about using `null` as the parent view group when inflating the alert dialog. @SuppressLint("InflateParams") @Override @NonNull @@ -85,6 +86,16 @@ public class MoveToFolderDialog extends DialogFragment { // Use an alert dialog builder to create the alert dialog. AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog); + // Get the current theme status. + int currentThemeStatus = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + + // Set the icon according to the theme. + if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { + dialogBuilder.setIcon(R.drawable.move_to_folder_blue_day); + } else { + dialogBuilder.setIcon(R.drawable.move_to_folder_blue_night); + } + // Set the title. dialogBuilder.setTitle(R.string.move_to_folder); diff --git a/app/src/main/res/drawable/move_to_folder_blue_day.xml b/app/src/main/res/drawable/move_to_folder_blue_day.xml new file mode 100644 index 00000000..c87a6451 --- /dev/null +++ b/app/src/main/res/drawable/move_to_folder_blue_day.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/app/src/main/res/drawable/move_to_folder_blue_night.xml b/app/src/main/res/drawable/move_to_folder_blue_night.xml new file mode 100644 index 00000000..1464f6ec --- /dev/null +++ b/app/src/main/res/drawable/move_to_folder_blue_night.xml @@ -0,0 +1,19 @@ + + + + + + + +