Skip to content

Commit

Permalink
Customized action buttons as per magenta cloud theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Aug 5, 2024
1 parent 1d6c53c commit 01901f9
Show file tree
Hide file tree
Showing 20 changed files with 243 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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<View>(R.id.contacts_linear_layout),
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/color/primary_button_background_color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/primary" android:state_enabled="true" />
<item android:color="@color/primary_button_disabled_color" />
</selector>
5 changes: 5 additions & 0 deletions app/src/main/res/color/primary_button_text_color_state.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white" android:state_enabled="true" />
<item android:color="@color/primary_button_disabled_color" />
</selector>
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/borderless_btn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

<item android:color="@color/disabled_text" android:state_enabled="false" />

<item android:color="@color/color_accent" />
<item android:color="@color/primary" />

</selector>
</selector>
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_cut_paste.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M8.5,21L8.5,22.5L6,22.5L6,21L8.5,21ZM3,19.5C3,20.325 3.675,21 4.5,21L4.5,21L4.5,22.5C2.845,22.5 1.5,21.155 1.5,19.5L1.5,19.5ZM17,19.5C17,21.155 15.655,22.5 14,22.5L14,22.5L14,21C14.825,21 15.5,20.325 15.5,19.5L15.5,19.5ZM12.5,21L12.5,22.5L10,22.5L10,21L12.5,21ZM3,15.5L3,18L1.5,18L1.5,15.5L3,15.5ZM17,15.5L17,18L15.5,18L15.5,15.5L17,15.5ZM22.5,1.5L22.5,14C22.5,15.655 21.155,17 19.5,17L19.5,17L18.5,17L18.5,15.5L19.5,15.5C20.325,15.5 21,14.825 21,14L21,14L21,3L8.5,3L8.5,5.5L7,5.5L7,1.5L22.5,1.5ZM3,11.5L3,14L1.5,14L1.5,11.5L3,11.5ZM17,11.5L17,14L15.5,14L15.5,11.5L17,11.5ZM17,7L17,10L15.5,10L15.5,8.5L14,8.5L14,7L17,7ZM4.5,7L4.5,8.5L3,8.5L3,10L1.5,10L1.5,7L4.5,7ZM12.5,7L12.5,8.5L10,8.5L10,7L12.5,7ZM8.5,7L8.5,8.5L6,8.5L6,7L8.5,7Z"
android:strokeWidth="1"
android:fillColor="#262626"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
5 changes: 4 additions & 1 deletion app/src/main/res/layout/backup_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/contacts_linear_layout"
android:layout_width="match_parent"
Expand Down Expand Up @@ -112,6 +113,7 @@
android:minHeight="@dimen/minimum_size_for_touchable_area"
android:text="@string/restore_backup"
android:visibility="invisible"
app:cornerRadius="@dimen/button_corner_radius"
tools:visibility="visible" />

<com.google.android.material.button.MaterialButton
Expand All @@ -121,7 +123,8 @@
android:layout_marginStart="@dimen/standard_half_margin"
android:minHeight="@dimen/minimum_size_for_touchable_area"
android:text="@string/contacts_backup_button"
android:theme="@style/Widget.Material3.Button.IconButton.Filled" />
style="@style/Button.Primary"
app:cornerRadius="@dimen/button_corner_radius"/>

</LinearLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/empty_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
34 changes: 28 additions & 6 deletions app/src/main/res/layout/files_folder_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,34 @@

<com.google.android.material.button.MaterialButton
android:id="@+id/folder_picker_btn_cancel"
style="@style/Widget.Material3.Button.TextButton"
style="@style/Widget.Material3.Button.IconButton.Outlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_weight="1"
android:text="@string/common_cancel"
app:cornerRadius="@dimen/button_corner_radius" />
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" />

<com.google.android.material.button.MaterialButton
android:id="@+id/folder_picker_btn_choose"
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
style="@style/Widget.Material3.Button.IconButton.Filled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/folder_picker_choose_button_text"
android:textColor="@color/primary_button_text_color_state"
android:visibility="gone"
app:cornerRadius="@dimen/button_corner_radius"
app:icon="@drawable/ic_tick"
app:iconGravity="textStart"
app:iconPadding="@dimen/standard_quarter_padding"
app:iconTint="@color/primary_button_text_color_state"
tools:visibility="visible" />

<View
Expand All @@ -82,16 +94,26 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/folder_picker_copy_button_text"
app:cornerRadius="@dimen/button_corner_radius" />
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"/>

<com.google.android.material.button.MaterialButton
android:id="@+id/folder_picker_btn_move"
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
style="@style/Widget.Material3.Button.IconButton.Filled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/folder_picker_move_button_text"
app:cornerRadius="@dimen/button_corner_radius" />
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"/>

</LinearLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/receive_external_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

</LinearLayout>
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/send_share_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@

<com.google.android.material.button.MaterialButton
android:id="@+id/btn_share"
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
style="@style/Widget.Material3.Button.IconButton.Filled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/share"
android:textColor="@color/primary_button_text_color_state"
app:iconPadding="@dimen/standard_half_padding"
app:icon="@drawable/shared_via_users" />
app:icon="@drawable/shared_via_users"
app:iconTint="@color/primary_button_text_color_state" />

<com.google.android.material.button.MaterialButton
android:id="@+id/btn_link"
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
style="@style/Widget.Material3.Button.IconButton.Filled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:iconPadding="@dimen/standard_half_padding"
android:text="@string/link"
app:icon="@drawable/shared_via_link" />
android:textColor="@color/primary_button_text_color_state"
app:icon="@drawable/shared_via_link"
app:iconTint="@color/primary_button_text_color_state" />

</LinearLayout>

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/synced_folders_settings_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"/>
Expand All @@ -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"/>
</LinearLayout>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/upload_files_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

Expand All @@ -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" />

</LinearLayout>
Expand Down
64 changes: 64 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,68 @@
<!-- App bar -->
<color name="appbar">#1E1E1E</color>
<color name="fontAppbar">@android:color/white</color>

<!-- NMC Colors -->
<color name="icon_color">#FFFFFF</color>
<color name="sort_text_color">@color/grey_30</color>
<color name="list_icon_color">@color/grey_30</color>
<color name="warning_icon_color">#CCCCCC</color>
<color name="divider_color">@color/grey_70</color>
<color name="spinner_bg_color">@color/grey_80</color>
<color name="refresh_layout_bg_color">#2D2D2D</color>
<color name="primary_button_disabled_color">@color/grey_70</color>
<color name="toolbar_divider_color">@color/grey_70</color>

<!-- Snackbar Colors -->
<color name="snackbar_bg_color">@color/grey_80</color>
<color name="snackbar_txt_color">@color/grey_0</color>

<!-- Alert Dialog Colors -->
<color name="alert_bg_color">@color/grey_80</color>
<color name="alert_txt_color">@color/grey_0</color>

<!-- NavigationView colors -->
<color name="nav_selected_bg_color">@color/grey_60</color>
<color name="nav_txt_unselected_color">@color/grey_0</color>
<color name="nav_txt_selected_color">@color/grey_0</color>
<color name="nav_icon_unselected_color">@color/grey_30</color>
<color name="nav_icon_selected_color">#FFFFFF</color>
<color name="nav_divider_color">@color/grey_30</color>
<color name="nav_bg_color">@color/grey_80</color>
<color name="drawer_quota_txt_color">#FFFFFF</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">@color/grey_80</color>
<color name="bottom_sheet_icon_color">@color/grey_30</color>
<color name="bottom_sheet_txt_color">@color/grey_0</color>

<!-- Popup Menu Colors -->
<color name="popup_menu_bg">@color/grey_80</color>
<color name="popup_menu_txt_color">@color/grey_0</color>
<color name="overflow_bg_color">@color/grey_80</color>

<!-- Switch Compat Colors -->
<color name="switch_thumb_disabled">@color/grey_70</color>
<color name="switch_track_disabled">@color/grey_60</color>

<!-- Checkbox Colors -->
<color name="checkbox_checked_disabled">@color/grey_70</color>
<color name="checkbox_unchecked_disabled">@color/grey_70</color>

<!-- Share Colors -->
<color name="share_title_txt_color">#FFFFFF</color>
<color name="share_subtitle_txt_color">@color/grey_30</color>
<color name="share_info_txt_color">@color/grey_0</color>
<color name="share_search_border_color">@color/grey_0</color>
<color name="share_btn_txt_color">@color/grey_0</color>
<color name="share_list_item_txt_color">@color/grey_0</color>
<color name="share_disabled_txt_color">@color/grey_60</color>
<color name="share_txt_color">@color/grey_0</color>
<color name="share_et_divider">#FFFFFF</color>

<!-- Scan Colors -->
<color name="scan_doc_bg_color">#121212</color>
<color name="scan_text_color">@color/grey_0</color>
<color name="scan_edit_bottom_color">@color/grey_80</color>
<color name="scan_count_bg_color">@color/grey_80</color>
</resources>
Loading

0 comments on commit 01901f9

Please sign in to comment.