restyling the Apply All button at the color customization screen

This commit is contained in:
tibbi 2021-11-04 23:18:29 +01:00
parent 97dcbe31df
commit 5c9e5bbb70
4 changed files with 34 additions and 9 deletions

View file

@ -406,6 +406,7 @@ class CustomizationActivity : BaseSimpleActivity() {
customization_background_color.setFillWithStroke(curBackgroundColor, curBackgroundColor)
customization_app_icon_color.setFillWithStroke(curAppIconColor, curBackgroundColor)
customization_navigation_bar_color.setFillWithStroke(curNavigationBarColor, curBackgroundColor)
apply_to_all.setTextColor(baseConfig.primaryColor.getContrastColor())
customization_text_color_holder.setOnClickListener { pickTextColor() }
customization_background_color_holder.setOnClickListener { pickBackgroundColor() }
@ -414,7 +415,10 @@ class CustomizationActivity : BaseSimpleActivity() {
handleAccentColorLayout()
customization_navigation_bar_color_holder.setOnClickListener { pickNavigationBarColor() }
apply_to_all_holder.setOnClickListener { applyToAll() }
apply_to_all.setOnClickListener {
applyToAll()
}
customization_app_icon_color_holder.setOnClickListener {
if (baseConfig.wasAppIconCustomizationWarningShown) {
pickAppIconColor()

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorPrimaryDark">
<item android:id="@+id/button_background_holder">
<layer-list>
<item android:id="@+id/button_background_stroke">
<shape android:shape="rectangle">
<solid android:color="?attr/colorPrimary" />
<corners android:radius="12dp" />
</shape>
</item>
</layer-list>
</item>
</ripple>

View file

@ -216,18 +216,14 @@
android:layout_height="wrap_content"
android:layout_below="@+id/customization_navigation_bar_color_holder"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/activity_margin"
android:background="?attr/selectableItemBackground">
android:layout_marginTop="@dimen/big_margin">
<com.simplemobiletools.commons.views.MyTextView
<android.widget.TextView
android:id="@+id/apply_to_all"
style="@style/ColoredButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_background"
android:clickable="false"
android:padding="@dimen/activity_margin"
android:text="@string/apply_to_all_apps"
android:textSize="@dimen/normal_text_size" />
android:text="@string/apply_to_all_apps" />
</RelativeLayout>
</RelativeLayout>

View file

@ -87,6 +87,17 @@
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
</style>
<style name="ColoredButtonStyle" parent="@android:style/Widget.TextView">
<item name="android:textFontWeight">600</item>
<item name="android:textAllCaps">true</item>
<item name="android:textSize">@dimen/normal_text_size</item>
<item name="android:paddingStart">@dimen/bigger_margin</item>
<item name="android:paddingEnd">@dimen/bigger_margin</item>
<item name="android:paddingTop">@dimen/activity_margin</item>
<item name="android:paddingBottom">@dimen/activity_margin</item>
<item name="android:background">@drawable/button_background_rounded</item>
</style>
<style name="Base.Widget.AppCompat.ActionMode" parent="">
<item name="background">@drawable/actionmenu_background</item>
<item name="backgroundSplit">?attr/actionModeSplitBackground</item>