mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Add button state coloring
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
6edaaa3d3c
commit
adb0394722
6 changed files with 10 additions and 11 deletions
|
@ -93,7 +93,7 @@ public class PassCodeActivity extends AppCompatActivity implements Injectable {
|
|||
|
||||
int elementColor = ThemeUtils.primaryColor(this, true);
|
||||
|
||||
ThemeUtils.themeDialogActionButton(binding.cancel);
|
||||
ThemeUtils.themeBorderlessButton(binding.cancel, ThemeUtils.primaryColor(this, true));
|
||||
|
||||
passCodeEditTexts[0] = binding.txt0;
|
||||
ThemeUtils.colorEditText(passCodeEditTexts[0], elementColor);
|
||||
|
|
|
@ -114,8 +114,8 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
|
|||
|
||||
AlertDialog alertDialog = (AlertDialog) getDialog();
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(color);
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(color);
|
||||
ThemeUtils.themeBorderlessButton(alertDialog.getButton(AlertDialog.BUTTON_POSITIVE), color);
|
||||
ThemeUtils.themeBorderlessButton(alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL), color);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -105,7 +105,6 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
|
|||
args.putParcelable(ARG_CREATOR, creator);
|
||||
frag.setArguments(args);
|
||||
return frag;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,11 +116,11 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
|
|||
AlertDialog alertDialog = (AlertDialog) getDialog();
|
||||
|
||||
positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
positiveButton.setTextColor(color);
|
||||
ThemeUtils.themeBorderlessButton(positiveButton, color);
|
||||
positiveButton.setOnClickListener(this);
|
||||
positiveButton.setEnabled(false);
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(color);
|
||||
ThemeUtils.themeBorderlessButton(alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL), color);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -202,10 +202,10 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
mNameCollisionPolicySummary = view.findViewById(R.id.setting_instant_name_collision_policy_summary);
|
||||
|
||||
mCancel = view.findViewById(R.id.cancel);
|
||||
ThemeUtils.themeDialogActionButton(mCancel);
|
||||
ThemeUtils.themeBorderlessButton(mCancel, accentColor);
|
||||
|
||||
mSave = view.findViewById(R.id.save);
|
||||
ThemeUtils.themeDialogActionButton(mSave);
|
||||
ThemeUtils.themeBorderlessButton(mSave, accentColor);
|
||||
|
||||
// Set values
|
||||
setEnabled(mSyncedFolder.isEnabled());
|
||||
|
|
|
@ -569,13 +569,12 @@ public final class ThemeUtils {
|
|||
));
|
||||
}
|
||||
|
||||
public static void themeDialogActionButton(MaterialButton button) {
|
||||
public static void themeBorderlessButton(Button button, int primaryColor) {
|
||||
if (button == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Context context = button.getContext();
|
||||
int accentColor = ThemeUtils.primaryAccentColor(button.getContext());
|
||||
int disabledColor = ContextCompat.getColor(context, R.color.disabled_text);
|
||||
button.setTextColor(new ColorStateList(
|
||||
new int[][]{
|
||||
|
@ -583,7 +582,7 @@ public final class ThemeUtils {
|
|||
new int[]{-android.R.attr.state_enabled}, // disabled
|
||||
},
|
||||
new int[]{
|
||||
accentColor,
|
||||
primaryColor,
|
||||
disabledColor
|
||||
}
|
||||
));
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
<color name="text_color">#E3E3E3</color>
|
||||
<color name="text_color_inverse">#000000</color>
|
||||
<color name="disabled_text">#ff6F6F6F</color>
|
||||
<color name="secondary_text_color">#A5A5A5</color>
|
||||
<color name="list_divider_background">#222222</color>
|
||||
|
||||
|
|
Loading…
Reference in a new issue