From 6476ec2c1d4851f29df9946c2c44b073c01a57bd Mon Sep 17 00:00:00 2001 From: A117870935 Date: Mon, 12 Jun 2023 15:18:31 +0530 Subject: [PATCH] Snackbar theme customized. --- .../android/ui/activity/EditorWebView.java | 1 - .../android/ui/activity/FileActivity.java | 3 - .../owncloud/android/utils/PermissionUtil.kt | 2 +- app/src/main/res/values-night/colors.xml | 64 +++++++++++++ app/src/main/res/values-night/themes.xml | 4 + app/src/main/res/values/colors.xml | 89 +++++++++++++++++++ .../main/res/values/nmc_snackbar_styles.xml | 16 ++++ app/src/main/res/values/styles.xml | 12 +++ app/src/main/res/values/themes.xml | 4 + 9 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/values/nmc_snackbar_styles.xml diff --git a/app/src/main/java/com/owncloud/android/ui/activity/EditorWebView.java b/app/src/main/java/com/owncloud/android/ui/activity/EditorWebView.java index d1f75389a8cd..bc56ba53067a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/EditorWebView.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/EditorWebView.java @@ -83,7 +83,6 @@ public void onUrlLoaded(String loadedUrl) { R.string.timeout_richDocuments, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.common_cancel, v -> closeView()); - viewThemeUtils.material.themeSnackbar(snackbar); setLoadingSnackbar(snackbar); snackbar.show(); } diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java index 58bf035eec35..2f162a9aa2ee 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java @@ -696,7 +696,6 @@ public static void copyAndShareFileLink(FileActivity activity, Snackbar snackbar = Snackbar.make(activity.findViewById(android.R.id.content), R.string.clipboard_text_copied, Snackbar.LENGTH_LONG) .setAction(R.string.share, v -> showShareLinkDialog(activity, file, link)); - viewThemeUtils.material.themeSnackbar(snackbar); snackbar.show(); } @@ -765,7 +764,6 @@ private void onUpdateShareInformation(RemoteOperationResult result, @StringRes i snackbar = Snackbar.make(sharingFragment.getView(), result.getMessage(), Snackbar.LENGTH_LONG); } - viewThemeUtils.material.themeSnackbar(snackbar); snackbar.show(); } } @@ -842,7 +840,6 @@ private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation ope operation, getResources()), Snackbar.LENGTH_LONG); - viewThemeUtils.material.themeSnackbar(snackbar); snackbar.show(); } } diff --git a/app/src/main/java/com/owncloud/android/utils/PermissionUtil.kt b/app/src/main/java/com/owncloud/android/utils/PermissionUtil.kt index 1d85050e187f..e6e92412cc76 100644 --- a/app/src/main/java/com/owncloud/android/utils/PermissionUtil.kt +++ b/app/src/main/java/com/owncloud/android/utils/PermissionUtil.kt @@ -178,7 +178,7 @@ object PermissionUtil { Snackbar.LENGTH_INDEFINITE ).setAction(R.string.common_ok) { doRequest() - }.also { viewThemeUtils.material.themeSnackbar(it) }.show() + }.show() } else { // No explanation needed, request the permission. doRequest() diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 1ce3f0da4f73..2f79b79712ed 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -36,4 +36,68 @@ #1E1E1E @android:color/white + + + #FFFFFF + @color/grey_30 + @color/grey_30 + #CCCCCC + @color/grey_70 + @color/grey_80 + #2D2D2D + @color/grey_70 + @color/grey_70 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_60 + @color/grey_0 + @color/grey_0 + @color/grey_30 + #FFFFFF + @color/grey_30 + @color/grey_80 + #FFFFFF + + + @color/grey_80 + @color/grey_30 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + @color/grey_80 + + + @color/grey_70 + @color/grey_60 + + + @color/grey_70 + @color/grey_70 + + + #FFFFFF + @color/grey_30 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_60 + @color/grey_0 + #FFFFFF + + + #121212 + @color/grey_0 + @color/grey_80 + @color/grey_80 diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 19b3ce692520..eb839d0b746f 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -19,6 +19,10 @@ false true true + + @style/SnackBarBackgroundStyle + @style/SnackBarActionButtonStyle + @style/SnackBarTextViewStyle @style/Widget.App.TextInputLayout @style/Nextcloud.Widget.PopupMenu @style/ThemeOverlay.App.BottomSheetDialog diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 89ed00a08bf2..46992e0a67c6 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -75,4 +75,93 @@ @android:color/white #666666 #A5A5A5 + + + #191919 + @color/primary + #191919 + #191919 + @color/grey_30 + @android:color/white + #FFFFFF + @color/grey_0 + #CCCCCC + #77c4ff + #B3FFFFFF + @color/grey_10 + + + #101010 + #F2F2F2 + #E5E5E5 + #B2B2B2 + #666666 + #4C4C4C + #333333 + + + @color/design_snackbar_background_color + @color/white + + + #FFFFFF + #191919 + + + @color/grey_0 + #191919 + @color/primary + #191919 + @color/primary + @color/grey_30 + @color/white + #191919 + + + #FFFFFF + #191919 + #191919 + + + #FFFFFF + #191919 + #FFFFFF + + + @color/primary + #F399C7 + #FFFFFF + @color/grey_30 + @color/grey_10 + @color/grey_0 + + + @color/primary + @color/grey_30 + @color/grey_30 + #CCCCCC + + + #191919 + @color/grey_30 + #191919 + #191919 + #191919 + #191919 + @color/grey_30 + #191919 + #000000 + #191919 + #F6E5EB + #C16F81 + #0D39DF + #0099ff + + + @color/grey_0 + #191919 + @color/grey_0 + @color/grey_30 + #77b6bb + #5077b6bb diff --git a/app/src/main/res/values/nmc_snackbar_styles.xml b/app/src/main/res/values/nmc_snackbar_styles.xml new file mode 100644 index 000000000000..23aadc577694 --- /dev/null +++ b/app/src/main/res/values/nmc_snackbar_styles.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4c1563085156..965e1b01d00e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -27,6 +27,10 @@ @color/primary_dark @color/secondary_text_color @style/ownCloud.SearchView + + @style/SnackBarBackgroundStyle + @style/SnackBarActionButtonStyle + @style/SnackBarTextViewStyle @color/action_mode_background @style/FallbackDatePickerDialogTheme @color/bg_default @@ -45,6 +49,10 @@ @color/bg_default @color/secondary_text_color @style/FallbackTheming.Dialog + + @style/SnackBarBackgroundStyle + @style/SnackBarActionButtonStyle + @style/SnackBarTextViewStyle @color/action_mode_background @style/FallbackDatePickerDialogTheme @color/bg_default @@ -279,6 +287,10 @@