Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.28] Action buttons theming #153

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,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 @@ -450,7 +450,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 @@ -754,14 +753,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 @@ -261,7 +261,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 @@ -190,10 +190,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 @@ -272,11 +272,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 @@ -591,10 +590,11 @@ class BackupFragment : FileFragment(), OnDateSetListener, Injectable {
datePickerDialog?.setTitle("")
datePickerDialog?.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))

// set background to transparent
datePickerDialog?.getButton(DatePickerDialog.BUTTON_NEGATIVE)?.setBackgroundColor(0x00000000)
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>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/borderless_btn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
android:color="@color/disabled_text" />

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

</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 @@ -19,6 +19,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 @@ -123,6 +124,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 @@ -132,7 +134,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 @@ -73,7 +73,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
36 changes: 29 additions & 7 deletions app/src/main/res/layout/files_folder_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,35 @@

<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:text="@string/common_cancel"
android:textColor="@color/text_color"
android:layout_weight="1"
app:cornerRadius="@dimen/button_corner_radius" />
android:layout_marginEnd="@dimen/standard_half_margin"
app:cornerRadius="@dimen/button_corner_radius"
app:icon="@drawable/ic_close"
app:iconGravity="textStart"
app:iconTint="@color/text_color"
app:iconPadding="@dimen/standard_quarter_padding"
app:strokeColor="@color/text_color"/>

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

<View
android:id="@+id/move_or_copy_button_spacer"
Expand All @@ -90,16 +102,26 @@
android:layout_weight="1"
android:layout_height="wrap_content"
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_weight="1"
android:layout_height="wrap_content"
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 @@ -82,7 +82,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 @@ -50,21 +50,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 @@ -405,6 +405,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 @@ -418,6 +419,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 @@ -426,7 +428,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 @@ -86,7 +86,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 @@ -95,8 +98,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 @@ -48,4 +48,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