Commit bfae57c0 authored by fallenstardust's avatar fallenstardust

配置模式开关滑块颜色以和禁限图标风格一致

parent eb3bf308
......@@ -8,9 +8,9 @@ import cn.garymb.ygomobile.lite.BuildConfig;
public interface Constants {
boolean DEBUG = BuildConfig.DEBUG;
String PREF_START = "game_pref_";
String PREF_LAST_LIMIT = "pref_last_limit";
String PREF_LAST_GENESYS_MODE = "pref_last_genesys_mode";
int PREF_DEF_LAST_GENESYS_MODE = 0;//0代表传统禁限模式,1代表Genesys模式
String PREF_LAST_LIMIT = "pref_last_limit";
String PREF_DEF_LAST_LIMIT = "";
String PREF_LAST_GENESYS_LIMIT = "pref_last_genesys_limit";
String PREF_DEF_LAST_GENESYS_LIMIT = "";
......
......@@ -211,6 +211,7 @@ public class CardSearcher implements View.OnClickListener {
}
});
genesys_Switch.setChecked(mSettings.getGenesysMode() != 0);
genesys_Switch.setText(mSettings.getGenesysMode() != 0 ? R.string.switch_genesys_mode : R.string.switch_banlist_mode);
genesys_Switch.setOnCheckedChangeListener((buttonView, isChecked) -> {
//根据开关切换两种模式禁卡表的显示和隐藏
genesys_limitListSpinner.setVisibility(isChecked ? View.VISIBLE : View.GONE);
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 开启状态:红色 -->
<item android:color="@android:color/holo_red_dark" android:state_checked="true" />
<!-- 关闭状态:蓝色 -->
<item android:color="@android:color/holo_blue_dark" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 开启状态:浅红色 -->
<item android:color="@android:color/darker_gray" android:state_checked="true" />
<!-- 关闭状态:浅蓝色 -->
<item android:color="@android:color/holo_orange_light" android:state_checked="false" />
</selector>
\ No newline at end of file
......@@ -38,6 +38,9 @@
<Switch
android:id="@+id/sw_genesys_mode"
style="@style/CustomSwitch"
android:thumbTint="@color/switch_thumb_color_selector"
android:trackTint="@color/switch_track_color_selector"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
......
......@@ -114,12 +114,17 @@
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="itemSpinnerStyle" parent="Widget.AppCompat.DropDownItem.Spinner">
<style
name="itemSpinnerStyle" parent="Widget.AppCompat.DropDownItem.Spinner">
</style>
<style name="wallet_third_tab_layout">
<item name="android:textSize">8sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/selector_text_color_white_gold</item>
</style>
<style name="CustomSwitch" parent="Widget.AppCompat.CompoundButton.Switch">
<item name="android:thumbTint">@color/switch_thumb_color_selector</item>
<item name="android:trackTint">@color/switch_track_color_selector</item>
</style>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment