refactor: 简化设置页面,只保留背景图片设置功能
删除的功能: - 播放模式设置(顺序/随机)- 已在相册编辑器中实现 - 更换间隔设置 - 已在相册编辑器中实现 - 返回桌面更换壁纸开关 - 已在相册编辑器中实现 保留的功能: - 应用背景图片设置(启用/禁用、选择、透明度、清除) 简化原因: - 避免功能重复 - 设置页面专注于个性化设置 - 壁纸配置集中在相册管理中 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5026020423
commit
8d1b592292
2 files changed
+97
-281
No files matched your search
@@ -5,8 +5,6 @@ import android.content.Intent;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.RadioButton;
|
|
||||||
import android.widget.RadioGroup;
|
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -23,26 +21,14 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import cn.hugh.bz.gk2.R;
|
import cn.hugh.bz.gk2.R;
|
||||||
import cn.hugh.bz.gk2.model.AppConfig;
|
|
||||||
import cn.hugh.bz.gk2.model.PlayMode;
|
|
||||||
import cn.hugh.bz.gk2.utils.AlarmScheduler;
|
|
||||||
import cn.hugh.bz.gk2.wallpaper.BackgroundPreferences;
|
import cn.hugh.bz.gk2.wallpaper.BackgroundPreferences;
|
||||||
import cn.hugh.bz.gk2.wallpaper.WallpaperPreferences;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置 Fragment
|
* 设置 Fragment
|
||||||
* 负责播放模式、更换间隔、返回桌面更换等设置
|
* 负责应用背景图片设置
|
||||||
* 所有设置实时保存,无需保存按钮
|
|
||||||
*/
|
*/
|
||||||
public class SettingsFragment extends Fragment {
|
public class SettingsFragment extends Fragment {
|
||||||
|
|
||||||
private RadioButton rbSequential;
|
|
||||||
private RadioButton rbRandom;
|
|
||||||
private RadioGroup rgPlayMode;
|
|
||||||
private SeekBar seekBarInterval;
|
|
||||||
private TextView tvIntervalValue;
|
|
||||||
private Switch switchChangeOnReturn;
|
|
||||||
|
|
||||||
// 背景图片相关控件
|
// 背景图片相关控件
|
||||||
private Switch switchBackground;
|
private Switch switchBackground;
|
||||||
private Button btnSelectBackground;
|
private Button btnSelectBackground;
|
||||||
@@ -50,8 +36,6 @@ public class SettingsFragment extends Fragment {
|
|||||||
private SeekBar seekBarBackgroundAlpha;
|
private SeekBar seekBarBackgroundAlpha;
|
||||||
private TextView tvBackgroundAlpha;
|
private TextView tvBackgroundAlpha;
|
||||||
|
|
||||||
private WallpaperPreferences prefs;
|
|
||||||
private AppConfig config;
|
|
||||||
private BackgroundPreferences backgroundPrefs;
|
private BackgroundPreferences backgroundPrefs;
|
||||||
|
|
||||||
// 图片选择器
|
// 图片选择器
|
||||||
@@ -66,26 +50,16 @@ public class SettingsFragment extends Fragment {
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
prefs = new WallpaperPreferences(requireContext());
|
|
||||||
config = prefs.loadConfig();
|
|
||||||
backgroundPrefs = new BackgroundPreferences(requireContext());
|
backgroundPrefs = new BackgroundPreferences(requireContext());
|
||||||
|
|
||||||
// 初始化图片选择器
|
// 初始化图片选择器
|
||||||
initPickImageLauncher();
|
initPickImageLauncher();
|
||||||
|
|
||||||
initViews(view);
|
initViews(view);
|
||||||
loadConfig();
|
|
||||||
loadBackgroundConfig();
|
loadBackgroundConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViews(View view) {
|
private void initViews(View view) {
|
||||||
rbSequential = view.findViewById(R.id.rbSequential);
|
|
||||||
rbRandom = view.findViewById(R.id.rbRandom);
|
|
||||||
rgPlayMode = view.findViewById(R.id.rgPlayMode);
|
|
||||||
seekBarInterval = view.findViewById(R.id.seekBarInterval);
|
|
||||||
tvIntervalValue = view.findViewById(R.id.tvIntervalValue);
|
|
||||||
switchChangeOnReturn = view.findViewById(R.id.switchChangeOnReturn);
|
|
||||||
|
|
||||||
// 背景图片控件
|
// 背景图片控件
|
||||||
switchBackground = view.findViewById(R.id.switchBackground);
|
switchBackground = view.findViewById(R.id.switchBackground);
|
||||||
btnSelectBackground = view.findViewById(R.id.btnSelectBackground);
|
btnSelectBackground = view.findViewById(R.id.btnSelectBackground);
|
||||||
@@ -93,47 +67,6 @@ public class SettingsFragment extends Fragment {
|
|||||||
seekBarBackgroundAlpha = view.findViewById(R.id.seekBarBackgroundAlpha);
|
seekBarBackgroundAlpha = view.findViewById(R.id.seekBarBackgroundAlpha);
|
||||||
tvBackgroundAlpha = view.findViewById(R.id.tvBackgroundAlpha);
|
tvBackgroundAlpha = view.findViewById(R.id.tvBackgroundAlpha);
|
||||||
|
|
||||||
// 播放模式切换监听器(实时保存)
|
|
||||||
rgPlayMode.setOnCheckedChangeListener((group, checkedId) -> {
|
|
||||||
PlayMode playMode = rbSequential.isChecked() ? PlayMode.SEQUENTIAL : PlayMode.RANDOM;
|
|
||||||
config.setPlayMode(playMode);
|
|
||||||
prefs.saveConfig(config);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 间隔调节监听器(实时保存)
|
|
||||||
seekBarInterval.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
||||||
tvIntervalValue.setText(progress + " 分钟");
|
|
||||||
|
|
||||||
// 实时保存配置
|
|
||||||
config.setIntervalMinutes(progress);
|
|
||||||
prefs.saveConfig(config);
|
|
||||||
|
|
||||||
// 如果服务已启用,重新调度定时器
|
|
||||||
if (config.isEnabled() && fromUser) {
|
|
||||||
AlarmScheduler scheduler = new AlarmScheduler(requireContext());
|
|
||||||
scheduler.scheduleWallpaperChange(progress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 返回桌面更换开关监听器(实时保存)
|
|
||||||
switchChangeOnReturn.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
||||||
config.setChangeOnReturnToHome(isChecked);
|
|
||||||
prefs.saveConfig(config);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 背景图片开关监听器
|
// 背景图片开关监听器
|
||||||
switchBackground.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
switchBackground.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
backgroundPrefs.setBackgroundEnabled(isChecked);
|
backgroundPrefs.setBackgroundEnabled(isChecked);
|
||||||
@@ -168,21 +101,6 @@ public class SettingsFragment extends Fragment {
|
|||||||
btnClearBackground.setOnClickListener(v -> clearBackgroundImage());
|
btnClearBackground.setOnClickListener(v -> clearBackgroundImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfig() {
|
|
||||||
rbSequential.setChecked(config.getPlayMode() == PlayMode.SEQUENTIAL);
|
|
||||||
rbRandom.setChecked(config.getPlayMode() == PlayMode.RANDOM);
|
|
||||||
seekBarInterval.setProgress(config.getIntervalMinutes());
|
|
||||||
tvIntervalValue.setText(config.getIntervalMinutes() + " 分钟");
|
|
||||||
switchChangeOnReturn.setChecked(config.isChangeOnReturnToHome());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
config = prefs.loadConfig();
|
|
||||||
loadConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== 背景图片相关方法 ====================
|
// ==================== 背景图片相关方法 ====================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,4 +182,10 @@ public class SettingsFragment extends Fragment {
|
|||||||
.setNegativeButton("取消", null)
|
.setNegativeButton("取消", null)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
loadBackgroundConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -14,223 +14,115 @@
|
|||||||
android:padding="@dimen/spacing_md"
|
android:padding="@dimen/spacing_md"
|
||||||
tools:context=".ui.SettingsFragment">
|
tools:context=".ui.SettingsFragment">
|
||||||
|
|
||||||
<TextView
|
<!-- 背景图片设置卡片 -->
|
||||||
android:id="@+id/tvPlayModeLabel"
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/tvBackgroundLabel"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="播放模式"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<RadioGroup
|
|
||||||
android:id="@+id/rgPlayMode"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvPlayModeLabel"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/rbSequential"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="顺序播放" />
|
android:text="应用背景"
|
||||||
|
android:textSize="@dimen/text_size_xxl"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/text_primary"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<RadioButton
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/rbRandom"
|
android:id="@+id/cardBackground"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginTop="@dimen/spacing_sm"
|
||||||
android:text="随机播放" />
|
app:cardElevation="@dimen/card_elevation"
|
||||||
</RadioGroup>
|
app:cardCornerRadius="@dimen/corner_radius_md"
|
||||||
|
app:cardBackgroundColor="@color/bg_card"
|
||||||
|
app:strokeColor="@color/glass_border"
|
||||||
|
app:strokeWidth="@dimen/glass_border_width"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvBackgroundLabel"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvIntervalLabel"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="更换间隔(分钟)"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/rgPlayMode"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:id="@+id/seekBarInterval"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:max="60"
|
|
||||||
android:min="1"
|
|
||||||
android:progress="30"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvIntervalLabel"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvIntervalValue"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="30 分钟"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/seekBarInterval"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvChangeOnReturnLabel"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/setting_change_on_return_title"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvIntervalValue"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvChangeOnReturnDesc"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/setting_change_on_return_desc"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@android:color/darker_gray"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvChangeOnReturnLabel"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/switchChangeOnReturn"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/spacing_sm"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_md"
|
|
||||||
android:checked="true"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvChangeOnReturnDesc"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<!-- 背景图片设置卡片 -->
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvBackgroundLabel"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="应用背景"
|
|
||||||
android:textSize="@dimen/text_size_lg"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@color/text_primary"
|
|
||||||
android:layout_marginTop="@dimen/spacing_lg"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/switchChangeOnReturn"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:id="@+id/cardBackground"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/spacing_sm"
|
|
||||||
app:cardElevation="@dimen/card_elevation"
|
|
||||||
app:cardCornerRadius="@dimen/corner_radius_md"
|
|
||||||
app:cardBackgroundColor="@color/bg_card"
|
|
||||||
app:strokeColor="@color/glass_border"
|
|
||||||
app:strokeWidth="@dimen/glass_border_width"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvBackgroundLabel"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="@dimen/card_padding">
|
|
||||||
|
|
||||||
<!-- 背景开关和选择按钮 -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:gravity="center_vertical">
|
android:padding="@dimen/card_padding">
|
||||||
|
|
||||||
<Switch
|
<!-- 背景开关和选择按钮 -->
|
||||||
android:id="@+id/switchBackground"
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:orientation="horizontal"
|
||||||
android:text="启用背景图片"
|
android:gravity="center_vertical">
|
||||||
android:textSize="@dimen/text_size_md"
|
|
||||||
android:textColor="@color/text_primary" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<Switch
|
||||||
android:id="@+id/btnSelectBackground"
|
android:id="@+id/switchBackground"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="启用背景图片"
|
||||||
|
android:textSize="@dimen/text_size_md"
|
||||||
|
android:textColor="@color/text_primary" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btnSelectBackground"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="选择图片"
|
||||||
|
android:textSize="@dimen/text_size_sm"
|
||||||
|
android:layout_marginStart="@dimen/spacing_md"
|
||||||
|
app:icon="@drawable/ic_image"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:cornerRadius="@dimen/corner_radius_sm"
|
||||||
|
style="@style/Widget.Material3.Button.OutlinedButton" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 透明度滑块 -->
|
||||||
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="选择图片"
|
android:text="背景透明度"
|
||||||
android:textSize="@dimen/text_size_sm"
|
android:textSize="@dimen/text_size_sm"
|
||||||
android:layout_marginStart="@dimen/spacing_md"
|
android:textColor="@color/text_secondary"
|
||||||
app:icon="@drawable/ic_image"
|
android:layout_marginTop="@dimen/spacing_md" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBarBackgroundAlpha"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:max="100"
|
||||||
|
android:min="5"
|
||||||
|
android:progress="30"
|
||||||
|
android:layout_marginTop="@dimen/spacing_sm" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvBackgroundAlpha"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="30%"
|
||||||
|
android:textSize="@dimen/text_size_sm"
|
||||||
|
android:textColor="@color/text_hint"
|
||||||
|
android:layout_marginTop="@dimen/spacing_xs"
|
||||||
|
android:layout_gravity="end" />
|
||||||
|
|
||||||
|
<!-- 清除按钮 -->
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btnClearBackground"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="清除背景图片"
|
||||||
|
android:textSize="@dimen/text_size_sm"
|
||||||
|
android:layout_marginTop="@dimen/spacing_md"
|
||||||
|
app:icon="@drawable/ic_delete"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
app:cornerRadius="@dimen/corner_radius_sm"
|
app:cornerRadius="@dimen/corner_radius_sm"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton" />
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
|
android:textColor="@color/color_error"
|
||||||
|
app:iconTint="@color/color_error"
|
||||||
|
app:strokeColor="@color/color_error" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 透明度滑块 -->
|
</com.google.android.material.card.MaterialCardView>
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="背景透明度"
|
|
||||||
android:textSize="@dimen/text_size_sm"
|
|
||||||
android:textColor="@color/text_secondary"
|
|
||||||
android:layout_marginTop="@dimen/spacing_md" />
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:id="@+id/seekBarBackgroundAlpha"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:max="100"
|
|
||||||
android:min="5"
|
|
||||||
android:progress="30"
|
|
||||||
android:layout_marginTop="@dimen/spacing_sm" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvBackgroundAlpha"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="30%"
|
|
||||||
android:textSize="@dimen/text_size_sm"
|
|
||||||
android:textColor="@color/text_hint"
|
|
||||||
android:layout_marginTop="@dimen/spacing_xs"
|
|
||||||
android:layout_gravity="end" />
|
|
||||||
|
|
||||||
<!-- 清除按钮 -->
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/btnClearBackground"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="清除背景图片"
|
|
||||||
android:textSize="@dimen/text_size_sm"
|
|
||||||
android:layout_marginTop="@dimen/spacing_md"
|
|
||||||
app:icon="@drawable/ic_delete"
|
|
||||||
app:iconGravity="textStart"
|
|
||||||
app:cornerRadius="@dimen/corner_radius_sm"
|
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
|
||||||
android:textColor="@color/color_error"
|
|
||||||
app:iconTint="@color/color_error"
|
|
||||||
app:strokeColor="@color/color_error" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user