From 03d0504865c52d48d65662ef3271fe6b7ec5bbcc Mon Sep 17 00:00:00 2001 From: A117870935 Date: Tue, 16 May 2023 17:10:05 +0530 Subject: [PATCH] Code refactored. --- .../ui/activity/NotificationsActivity.java | 1 - .../android/ui/activity/SettingsActivity.java | 1 + .../android/ui/activity/ToolbarActivity.java | 4 - .../ui/fragment/OCFileListFragment.java | 1 - .../theme/FilesSpecificViewThemeUtils.kt | 2 +- app/src/main/res/layout/toolbar_standard.xml | 2 + app/src/main/res/values-night/colors.xml | 66 +++++++++++- app/src/main/res/values/colors.xml | 100 ++++++++++++++++-- 8 files changed, 160 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java index 767303c678c6..4308de3b8b3a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java @@ -98,7 +98,6 @@ protected void onCreate(Bundle savedInstanceState) { // setup toolbar setupToolbar(); - showHideDefaultToolbarDivider(true); updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_item_notifications)); diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index eefb45787134..b62bdafb5582 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -97,6 +97,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatDelegate; import androidx.core.content.ContextCompat; +import androidx.core.content.res.ResourcesCompat; /** * An Activity that allows the user to change the application's settings. diff --git a/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java index c26204ce73b1..430dcb1efaf5 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java @@ -172,10 +172,6 @@ private void showHomeSearchToolbar(boolean isShow) { mHomeSearchToolbar.setVisibility(View.GONE); } - public void showHideDefaultToolbarDivider(boolean isShow) { - mDefaultToolbarDivider.setVisibility(isShow ? View.VISIBLE : View.GONE); - } - /** * Updates title bar and home buttons (state and icon). */ diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index bd7bab22e11d..8dfaa1c30a83 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -51,7 +51,6 @@ import com.nextcloud.android.lib.richWorkspace.RichWorkspaceDirectEditingRemoteOperation; import com.nextcloud.client.account.User; import com.nextcloud.client.account.UserAccountManager; -import com.nextcloud.client.core.Clock; import com.nextcloud.client.device.DeviceInfo; import com.nextcloud.client.di.Injectable; import com.nextcloud.client.documentscan.AppScanOptionalFeature; diff --git a/app/src/main/java/com/owncloud/android/utils/theme/FilesSpecificViewThemeUtils.kt b/app/src/main/java/com/owncloud/android/utils/theme/FilesSpecificViewThemeUtils.kt index 03fe48495e47..400c3cbbdb6a 100644 --- a/app/src/main/java/com/owncloud/android/utils/theme/FilesSpecificViewThemeUtils.kt +++ b/app/src/main/java/com/owncloud/android/utils/theme/FilesSpecificViewThemeUtils.kt @@ -43,9 +43,9 @@ import com.nextcloud.android.common.ui.theme.MaterialSchemes import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase import com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils import com.nextcloud.android.common.ui.theme.utils.AndroidXViewThemeUtils +import com.nmc.android.utils.ToolbarThemeUtils import com.nextcloud.utils.view.FastScrollPopupBackground import com.nmc.android.utils.DrawableThemeUtils -import com.nmc.android.utils.ToolbarThemeUtils import com.owncloud.android.R import com.owncloud.android.lib.common.utils.Log_OC import com.owncloud.android.lib.resources.shares.ShareType diff --git a/app/src/main/res/layout/toolbar_standard.xml b/app/src/main/res/layout/toolbar_standard.xml index 7d3b5bcd9586..24472ee4dc00 100644 --- a/app/src/main/res/layout/toolbar_standard.xml +++ b/app/src/main/res/layout/toolbar_standard.xml @@ -72,6 +72,7 @@ android:layout_marginEnd="1dp" android:contentDescription="@string/action_switch_grid_view" app:cornerRadius="24dp" + app:iconSize="24dp" app:icon="@drawable/ic_view_module" app:iconTint="@color/fontAppbar" app:layout_constraintBottom_toBottomOf="parent" @@ -113,6 +114,7 @@ android:id="@+id/preview_image" android:layout_width="match_parent" android:layout_height="@dimen/nav_drawer_header_height" + android:background="@color/bg_default" android:contentDescription="@string/preview_image_description" android:scaleType="centerCrop" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index e6ab5f84f2bd..88a29668c4cd 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -24,7 +24,6 @@ #000000 #ff6F6F6F #A5A5A5 - @color/grey_70 #222222 @@ -49,5 +48,70 @@ #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_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/colors.xml b/app/src/main/res/values/colors.xml index 0663dc1717a4..1ddf1a93ca08 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -32,19 +32,11 @@ #EEEEEE #00000000 #666666 - @color/grey_30 #e53935 #757575 #222222 - #101010 - #F2F2F2 - #E5E5E5 - #B2B2B2 - #666666 - #4C4C4C - #333333 #EEEEEE #BDBDBD #666666 @@ -86,8 +78,98 @@ #80000000 - #CCCCCC @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 + @color/grey_0 + @color/grey_0 + #FFFFFF + @color/grey_30 + @color/grey_0 + @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