From 01901f9274da73f7cafe26fd681486457a181903 Mon Sep 17 00:00:00 2001 From: A117870935 Date: Sun, 14 May 2023 19:47:04 +0530 Subject: [PATCH] Customized action buttons as per magenta cloud theme. --- .../ui/activity/FolderPickerActivity.kt | 5 -- .../ReceiveExternalFilesActivity.java | 3 - .../ui/activity/SyncedFoldersActivity.kt | 1 - .../ui/activity/UploadFilesActivity.java | 2 - .../fragment/contactsbackup/BackupFragment.kt | 18 ++-- .../color/primary_button_background_color.xml | 5 ++ .../color/primary_button_text_color_state.xml | 5 ++ app/src/main/res/drawable/borderless_btn.xml | 4 +- app/src/main/res/drawable/ic_cut_paste.xml | 12 +++ app/src/main/res/layout/backup_fragment.xml | 5 +- app/src/main/res/layout/empty_list.xml | 2 +- .../main/res/layout/files_folder_picker.xml | 34 +++++-- .../res/layout/receive_external_files.xml | 2 +- .../main/res/layout/send_share_fragment.xml | 12 ++- .../layout/synced_folders_settings_layout.xml | 4 +- .../main/res/layout/upload_files_layout.xml | 7 +- app/src/main/res/values-night/colors.xml | 64 +++++++++++++ app/src/main/res/values/colors.xml | 90 ++++++++++++++++++- app/src/main/res/values/dims.xml | 2 +- app/src/main/res/values/styles.xml | 7 +- 20 files changed, 243 insertions(+), 41 deletions(-) create mode 100644 app/src/main/res/color/primary_button_background_color.xml create mode 100644 app/src/main/res/color/primary_button_text_color_state.xml create mode 100644 app/src/main/res/drawable/ic_cut_paste.xml diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt b/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt index 0961de2671b8..51e95ca6a495 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt @@ -416,23 +416,18 @@ open class FolderPickerActivity : private fun initControls() { if (this is FilePickerActivity) { - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(filesPickerBinding.folderPickerBtnCancel) filesPickerBinding.folderPickerBtnCancel.setOnClickListener { finish() } } else { - viewThemeUtils.material.colorMaterialButtonText(folderPickerBinding.folderPickerBtnCancel) folderPickerBinding.folderPickerBtnCancel.setOnClickListener { finish() } - viewThemeUtils.material.colorMaterialButtonPrimaryTonal(folderPickerBinding.folderPickerBtnChoose) folderPickerBinding.folderPickerBtnChoose.setOnClickListener { processOperation(null) } - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(folderPickerBinding.folderPickerBtnCopy) folderPickerBinding.folderPickerBtnCopy.setOnClickListener { processOperation( OperationsService.ACTION_COPY_FILE ) } - viewThemeUtils.material.colorMaterialButtonPrimaryTonal(folderPickerBinding.folderPickerBtnMove) folderPickerBinding.folderPickerBtnMove.setOnClickListener { processOperation( OperationsService.ACTION_MOVE_FILE diff --git a/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java index d06709242a5a..7d5f9b839738 100755 --- a/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java @@ -441,7 +441,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { setFilename(binding.userInput, selectPos); binding.userInput.requestFocus(); - viewThemeUtils.material.colorTextInputLayout(binding.userInputContainer); setupSpinner(adapter, selectPos, binding.userInput, binding.fileType); if (adapter.getCount() == SINGLE_SPINNER_ENTRY) { @@ -745,14 +744,12 @@ private void populateDirectoryList() { } MaterialButton btnChooseFolder = binding.uploaderChooseFolder; - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(btnChooseFolder); btnChooseFolder.setOnClickListener(this); btnChooseFolder.setEnabled(mFile.canWrite()); viewThemeUtils.platform.themeStatusBar(this); - viewThemeUtils.material.colorMaterialButtonPrimaryOutlined(binding.uploaderCancel); binding.uploaderCancel.setOnClickListener(this); sortButton = binding.toolbarLayout.sortButton; diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt b/app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt index c11ce5bcb7d4..6d6a3636a49a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt @@ -244,7 +244,6 @@ class SyncedFoldersActivity : viewThemeUtils ) binding.emptyList.emptyListIcon.setImageResource(R.drawable.nav_synced_folders) - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.emptyList.emptyListViewAction) val lm = GridLayoutManager(this, gridWidth) adapter.setLayoutManager(lm) val spacing = resources.getDimensionPixelSize(R.dimen.media_grid_spacing) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java index 9dd891a1f9fe..14b82608b454 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -184,10 +184,8 @@ public void onCreate(Bundle savedInstanceState) { mFileListFragment = (LocalFileListFragment) getSupportFragmentManager().findFragmentByTag("local_files_list"); // Set input controllers - viewThemeUtils.material.colorMaterialButtonPrimaryOutlined(binding.uploadFilesBtnCancel); binding.uploadFilesBtnCancel.setOnClickListener(this); - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.uploadFilesBtnUpload); binding.uploadFilesBtnUpload.setOnClickListener(this); binding.uploadFilesBtnUpload.setEnabled(mLocalFolderPickerMode); diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.kt b/app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.kt index 475593fff575..5762fddf2102 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.kt +++ b/app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.kt @@ -225,11 +225,10 @@ class BackupFragment : FileFragment(), OnDateSetListener, Injectable { viewThemeUtils.androidx.colorSwitchCompat(binding.calendar) viewThemeUtils.androidx.colorSwitchCompat(binding.dailyBackup) - viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.backupNow) - viewThemeUtils.material.colorMaterialButtonPrimaryOutlined(binding.contactsDatepicker) - - viewThemeUtils.platform.colorTextView(binding.dataToBackUpTitle) - viewThemeUtils.platform.colorTextView(binding.backupSettingsTitle) + //NMC Customization + val primaryAccentColor = requireContext().resources.getColor(R.color.primary, null) + binding.dataToBackUpTitle.setTextColor(primaryAccentColor) + binding.backupSettingsTitle.setTextColor(primaryAccentColor) } override fun onResume() { @@ -529,10 +528,11 @@ class BackupFragment : FileFragment(), OnDateSetListener, Injectable { show() } - viewThemeUtils.platform.colorTextButtons( - datePickerDialog!!.getButton(DatePickerDialog.BUTTON_NEGATIVE), - datePickerDialog!!.getButton(DatePickerDialog.BUTTON_POSITIVE) - ) + // NMC Customisation + datePickerDialog?.getButton(DatePickerDialog.BUTTON_NEGATIVE) + ?.setTextColor(resources.getColor(R.color.text_color, null)) + datePickerDialog?.getButton(DatePickerDialog.BUTTON_POSITIVE) + ?.setTextColor(resources.getColor(R.color.primary, null)) } else { DisplayUtils.showSnackMessage( requireView().findViewById(R.id.contacts_linear_layout), diff --git a/app/src/main/res/color/primary_button_background_color.xml b/app/src/main/res/color/primary_button_background_color.xml new file mode 100644 index 000000000000..ff815aa69e7b --- /dev/null +++ b/app/src/main/res/color/primary_button_background_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/color/primary_button_text_color_state.xml b/app/src/main/res/color/primary_button_text_color_state.xml new file mode 100644 index 000000000000..11bbe6d80fd9 --- /dev/null +++ b/app/src/main/res/color/primary_button_text_color_state.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/borderless_btn.xml b/app/src/main/res/drawable/borderless_btn.xml index 1e637b9f828a..5b656e24fc6c 100644 --- a/app/src/main/res/drawable/borderless_btn.xml +++ b/app/src/main/res/drawable/borderless_btn.xml @@ -9,6 +9,6 @@ - + - + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_cut_paste.xml b/app/src/main/res/drawable/ic_cut_paste.xml new file mode 100644 index 000000000000..02ea7719db9d --- /dev/null +++ b/app/src/main/res/drawable/ic_cut_paste.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/layout/backup_fragment.xml b/app/src/main/res/layout/backup_fragment.xml index 286991b2bd5f..50c6f7364243 100644 --- a/app/src/main/res/layout/backup_fragment.xml +++ b/app/src/main/res/layout/backup_fragment.xml @@ -8,6 +8,7 @@ --> + style="@style/Button.Primary" + app:cornerRadius="@dimen/button_corner_radius"/> diff --git a/app/src/main/res/layout/empty_list.xml b/app/src/main/res/layout/empty_list.xml index c1e1eb042f84..cbe6187e15fc 100644 --- a/app/src/main/res/layout/empty_list.xml +++ b/app/src/main/res/layout/empty_list.xml @@ -61,7 +61,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/standard_half_margin" - android:theme="@style/Button.Primary" + style="@style/Button.Primary" android:visibility="gone" app:cornerRadius="@dimen/button_corner_radius" tools:visibility="visible" /> diff --git a/app/src/main/res/layout/files_folder_picker.xml b/app/src/main/res/layout/files_folder_picker.xml index 12b04d45f258..76631bbeb182 100644 --- a/app/src/main/res/layout/files_folder_picker.xml +++ b/app/src/main/res/layout/files_folder_picker.xml @@ -51,22 +51,34 @@ + android:textColor="@color/text_color" + app:cornerRadius="@dimen/button_corner_radius" + app:icon="@drawable/ic_close" + app:iconGravity="textStart" + app:iconPadding="@dimen/standard_quarter_padding" + app:iconTint="@color/text_color" + app:strokeColor="@color/text_color" /> + android:textColor="@color/primary_button_text_color_state" + app:cornerRadius="@dimen/button_corner_radius" + app:icon="@drawable/ic_cut_paste" + app:iconGravity="textStart" + app:iconPadding="@dimen/standard_quarter_padding" + app:iconTint="@color/primary_button_text_color_state"/> + android:textColor="@color/primary_button_text_color_state" + app:cornerRadius="@dimen/button_corner_radius" + app:icon="@drawable/ic_cut_paste" + app:iconGravity="textStart" + app:iconPadding="@dimen/standard_quarter_padding" + app:iconTint="@color/primary_button_text_color_state"/> diff --git a/app/src/main/res/layout/receive_external_files.xml b/app/src/main/res/layout/receive_external_files.xml index db9be24cf7fd..6bc9425c9c62 100644 --- a/app/src/main/res/layout/receive_external_files.xml +++ b/app/src/main/res/layout/receive_external_files.xml @@ -71,7 +71,7 @@ android:layout_marginStart="@dimen/standard_half_margin" android:layout_weight="1" android:text="@string/uploader_btn_upload_text" - android:theme="@style/Button.Primary" + style="@style/Button.Primary" app:cornerRadius="@dimen/button_corner_radius" /> diff --git a/app/src/main/res/layout/send_share_fragment.xml b/app/src/main/res/layout/send_share_fragment.xml index 1a5a006f845c..916af8e5753a 100644 --- a/app/src/main/res/layout/send_share_fragment.xml +++ b/app/src/main/res/layout/send_share_fragment.xml @@ -37,21 +37,25 @@ + app:icon="@drawable/shared_via_users" + app:iconTint="@color/primary_button_text_color_state" /> + android:textColor="@color/primary_button_text_color_state" + app:icon="@drawable/shared_via_link" + app:iconTint="@color/primary_button_text_color_state" /> diff --git a/app/src/main/res/layout/synced_folders_settings_layout.xml b/app/src/main/res/layout/synced_folders_settings_layout.xml index 6d233601df57..3f3c6264414a 100644 --- a/app/src/main/res/layout/synced_folders_settings_layout.xml +++ b/app/src/main/res/layout/synced_folders_settings_layout.xml @@ -444,6 +444,7 @@ android:id="@+id/btnNeutral" style="@style/Widget.Material3.Button.TextButton" android:layout_width="wrap_content" + android:textColor="@color/fontAppbar" android:layout_height="wrap_content" android:text="@string/common_cancel" android:layout_weight="1"/> @@ -457,6 +458,7 @@ android:id="@+id/btnNegative" android:layout_width="wrap_content" style="@style/Widget.Material3.Button.TextButton" + android:textColor="@color/fontAppbar" android:layout_height="wrap_content" android:text="@string/common_delete" android:layout_weight="1"/> @@ -465,7 +467,7 @@ android:id="@+id/btnPositive" android:layout_width="wrap_content" android:text="@string/common_save" - style="@style/Widget.Material3.Button.TonalButton" + style="@style/Widget.Material3.Button.TextButton" android:layout_height="wrap_content" android:layout_weight="1"/> diff --git a/app/src/main/res/layout/upload_files_layout.xml b/app/src/main/res/layout/upload_files_layout.xml index d74dc59d4f0a..ca1611108376 100644 --- a/app/src/main/res/layout/upload_files_layout.xml +++ b/app/src/main/res/layout/upload_files_layout.xml @@ -77,7 +77,10 @@ android:layout_height="wrap_content" android:layout_marginEnd="@dimen/standard_half_margin" android:layout_weight="1" + app:icon="@drawable/ic_close" + app:iconGravity="textStart" android:text="@string/common_cancel" + app:iconTint="@color/text_color" style="@style/OutlinedButton" app:cornerRadius="@dimen/button_corner_radius" /> @@ -86,8 +89,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" + app:icon="@drawable/ic_cut_paste" + app:iconGravity="textStart" android:text="@string/uploader_btn_upload_text" - android:theme="@style/Button.Primary" + style="@style/Button.Primary" app:cornerRadius="@dimen/button_corner_radius" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index e9c749b86943..76e4e05ca495 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/colors.xml b/app/src/main/res/values/colors.xml index 9a721eb3e385..15c4b54f3bf5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -46,7 +46,6 @@ #ffffff #FFFFFF #000000 - @color/color_accent #ffffff #D6D7D7 #000000 @@ -76,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/dims.xml b/app/src/main/res/values/dims.xml index ce0b68648bc5..8622fde90329 100644 --- a/app/src/main/res/values/dims.xml +++ b/app/src/main/res/values/dims.xml @@ -134,7 +134,7 @@ 80dp 16sp 18sp - 24dp + 8dp 160dp 4 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1a8b501ee4b7..68668e8b39cc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -172,10 +172,11 @@ +