update account skin dialog

This commit is contained in:
ShirosakiMio 2024-09-14 12:29:45 +08:00
parent d9de085707
commit 574f409cfe
3 changed files with 22 additions and 0 deletions

View File

@ -50,30 +50,35 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/default_skin" android:id="@+id/default_skin"
app:text_with_theme_color="true"
android:text="@string/account_skin_type_default"/> android:text="@string/account_skin_type_default"/>
<com.tungsten.fcllibrary.component.view.FCLRadioButton <com.tungsten.fcllibrary.component.view.FCLRadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/steve" android:id="@+id/steve"
app:text_with_theme_color="true"
android:text="@string/account_skin_type_steve"/> android:text="@string/account_skin_type_steve"/>
<com.tungsten.fcllibrary.component.view.FCLRadioButton <com.tungsten.fcllibrary.component.view.FCLRadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/alex" android:id="@+id/alex"
app:text_with_theme_color="true"
android:text="@string/account_skin_type_alex"/> android:text="@string/account_skin_type_alex"/>
<com.tungsten.fcllibrary.component.view.FCLRadioButton <com.tungsten.fcllibrary.component.view.FCLRadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/local" android:id="@+id/local"
app:text_with_theme_color="true"
android:text="@string/account_skin_type_local_file"/> android:text="@string/account_skin_type_local_file"/>
<com.tungsten.fcllibrary.component.view.FCLRadioButton <com.tungsten.fcllibrary.component.view.FCLRadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/csl" android:id="@+id/csl"
app:text_with_theme_color="true"
android:text="@string/account_skin_type_csl_api"/> android:text="@string/account_skin_type_csl_api"/>
<com.tungsten.fcllibrary.component.view.FCLLinearLayout <com.tungsten.fcllibrary.component.view.FCLLinearLayout
@ -92,6 +97,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:singleLine="true" android:singleLine="true"
app:auto_text_tint="true"
android:text="@string/account_skin"/> android:text="@string/account_skin"/>
<View <View
@ -128,6 +134,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:singleLine="true" android:singleLine="true"
app:auto_text_tint="true"
android:text="@string/account_cape"/> android:text="@string/account_cape"/>
<View <View

View File

@ -2,6 +2,7 @@ package com.tungsten.fcllibrary.component.view;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color; import android.graphics.Color;
import android.util.AttributeSet; import android.util.AttributeSet;
@ -13,6 +14,7 @@ import com.tungsten.fclcore.fakefx.beans.property.BooleanPropertyBase;
import com.tungsten.fclcore.fakefx.beans.property.IntegerProperty; import com.tungsten.fclcore.fakefx.beans.property.IntegerProperty;
import com.tungsten.fclcore.fakefx.beans.property.IntegerPropertyBase; import com.tungsten.fclcore.fakefx.beans.property.IntegerPropertyBase;
import com.tungsten.fclcore.task.Schedulers; import com.tungsten.fclcore.task.Schedulers;
import com.tungsten.fcllibrary.R;
import com.tungsten.fcllibrary.component.theme.ThemeEngine; import com.tungsten.fcllibrary.component.theme.ThemeEngine;
public class FCLRadioButton extends AppCompatRadioButton { public class FCLRadioButton extends AppCompatRadioButton {
@ -20,6 +22,7 @@ public class FCLRadioButton extends AppCompatRadioButton {
private BooleanProperty visibilityProperty; private BooleanProperty visibilityProperty;
private BooleanProperty checkProperty; private BooleanProperty checkProperty;
private BooleanProperty disableProperty; private BooleanProperty disableProperty;
private boolean textWithThemeColor = false;
private final IntegerProperty theme = new IntegerPropertyBase() { private final IntegerProperty theme = new IntegerPropertyBase() {
@ -39,6 +42,9 @@ public class FCLRadioButton extends AppCompatRadioButton {
Color.GRAY Color.GRAY
}; };
setButtonTintList(new ColorStateList(state, color)); setButtonTintList(new ColorStateList(state, color));
if (textWithThemeColor) {
setTextColor(ThemeEngine.getInstance().getTheme().getColor());
}
} }
@Override @Override
@ -59,11 +65,17 @@ public class FCLRadioButton extends AppCompatRadioButton {
public FCLRadioButton(Context context, @Nullable AttributeSet attrs) { public FCLRadioButton(Context context, @Nullable AttributeSet attrs) {
super(context, attrs); super(context, attrs);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FCLRadioButton);
textWithThemeColor = typedArray.getBoolean(R.styleable.FCLRadioButton_text_with_theme_color, false);
typedArray.recycle();
theme.bind(ThemeEngine.getInstance().getTheme().colorProperty()); theme.bind(ThemeEngine.getInstance().getTheme().colorProperty());
} }
public FCLRadioButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { public FCLRadioButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FCLRadioButton);
textWithThemeColor = typedArray.getBoolean(R.styleable.FCLRadioButton_text_with_theme_color, false);
typedArray.recycle();
theme.bind(ThemeEngine.getInstance().getTheme().colorProperty()); theme.bind(ThemeEngine.getInstance().getTheme().colorProperty());
} }

View File

@ -43,6 +43,9 @@
<declare-styleable name="FCLConstraintLayout"> <declare-styleable name="FCLConstraintLayout">
<attr name="auto_constraint_background_tint" format="boolean"/> <attr name="auto_constraint_background_tint" format="boolean"/>
</declare-styleable> </declare-styleable>
<declare-styleable name="FCLRadioButton">
<attr name="text_with_theme_color" format="boolean"/>
</declare-styleable>
<declare-styleable name="ColorPickerView" parent="ColorPanelView"> <declare-styleable name="ColorPickerView" parent="ColorPanelView">
<attr format="boolean|reference" name="cpv_alphaChannelVisible"/> <attr format="boolean|reference" name="cpv_alphaChannelVisible"/>