Skip to content

Commit 08b7fee

Browse files
committed
优化通知面板背景透明度功能设置界面,添加实验性文案说明
1 parent e7fc0bb commit 08b7fee

2 files changed

Lines changed: 48 additions & 14 deletions

File tree

app/src/main/java/com/fankes/coloros/notify/ui/activity/MainActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
126126
binding.notifyIconAutoSyncItem.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX)
127127
binding.notifyIconAutoSyncChildItem.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO)
128128
binding.notifyPanelConfigSeekbar.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
129-
binding.notifyPanelConfigText.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
129+
binding.notifyPanelConfigTextPanel.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
130130
binding.devNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_DEV_NOTIFY)
131131
binding.crcpNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_CHANGECP_NOTIFY)
132132
binding.dndNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_DNDALERT_NOTIFY)
@@ -139,7 +139,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
139139
binding.notifyIconAutoSyncSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO)
140140
binding.notifyPanelConfigSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
141141
binding.notifyPanelConfigSeekbar.progress = modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA)
142-
binding.notifyPanelConfigText.text = "当前值 - ${modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA)}"
142+
binding.notifyPanelConfigText.text = modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA).toString()
143143
binding.notifyIconAutoSyncText.text = notifyIconAutoSyncTime
144144
binding.moduleEnableSwitch.setOnCheckedChangeListener { btn, b ->
145145
if (btn.isPressed.not()) return@setOnCheckedChangeListener
@@ -200,7 +200,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
200200
binding.notifyPanelConfigSwitch.setOnCheckedChangeListener { btn, b ->
201201
if (btn.isPressed.not()) return@setOnCheckedChangeListener
202202
modulePrefs.put(DataConst.ENABLE_NOTIFY_PANEL_ALPHA, b)
203-
binding.notifyPanelConfigText.isVisible = b
203+
binding.notifyPanelConfigTextPanel.isVisible = b
204204
binding.notifyPanelConfigSeekbar.isVisible = b
205205
SystemUITool.refreshSystemUI(context = this)
206206
}
@@ -212,7 +212,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
212212
}
213213
binding.notifyPanelConfigSeekbar.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
214214
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
215-
binding.notifyPanelConfigText.text = "当前值 - $progress"
215+
binding.notifyPanelConfigText.text = progress.toString()
216216
}
217217

218218
override fun onStopTrackingTouch(seekBar: SeekBar) {

app/src/main/res/layout/activity_main.xml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,19 +443,41 @@
443443
android:max="255"
444444
android:min="0" />
445445

446-
<TextView
447-
android:id="@+id/notify_panel_config_text"
448-
android:layout_width="wrap_content"
446+
<LinearLayout
447+
android:id="@+id/notify_panel_config_text_panel"
448+
android:layout_width="match_parent"
449449
android:layout_height="wrap_content"
450-
android:ellipsize="end"
451450
android:gravity="center"
452-
android:maxWidth="100dp"
451+
android:orientation="horizontal"
453452
android:paddingTop="5dp"
454-
android:paddingBottom="15dp"
455-
android:singleLine="true"
456-
android:text="当前值 - %1"
457-
android:textColor="@color/colorTextGray"
458-
android:textSize="14sp" />
453+
android:paddingBottom="15dp">
454+
455+
<TextView
456+
android:layout_width="wrap_content"
457+
android:layout_height="wrap_content"
458+
android:layout_marginEnd="5dp"
459+
android:alpha="0.75"
460+
android:ellipsize="end"
461+
android:gravity="center"
462+
android:maxWidth="100dp"
463+
android:singleLine="true"
464+
android:text="当前值"
465+
android:textColor="@color/colorTextGray"
466+
android:textSize="13.5sp" />
467+
468+
<TextView
469+
android:id="@+id/notify_panel_config_text"
470+
android:layout_width="wrap_content"
471+
android:layout_height="wrap_content"
472+
android:ellipsize="end"
473+
android:gravity="center"
474+
android:maxWidth="100dp"
475+
android:singleLine="true"
476+
android:text="%1"
477+
android:textColor="@color/colorTextGray"
478+
android:textSize="15sp"
479+
android:textStyle="bold" />
480+
</LinearLayout>
459481

460482
<TextView
461483
android:layout_width="match_parent"
@@ -468,6 +490,18 @@
468490
android:text="开启自定义功能后,你可以拖拽滑动条来调整通知面板的透明度,0 为全透明,255 为不透明。"
469491
android:textColor="@color/colorTextDark"
470492
android:textSize="12sp" />
493+
494+
<TextView
495+
android:layout_width="match_parent"
496+
android:layout_height="wrap_content"
497+
android:layout_marginBottom="10dp"
498+
android:alpha="0.6"
499+
android:lineSpacingExtra="6dp"
500+
android:paddingLeft="15dp"
501+
android:paddingRight="15dp"
502+
android:text="此功能为实验性功能,后期不一定继续维护,且仅在 ColorOS 12~12.1 测试正常,不能保证可以和各种通知栏主题模块配合使用,如有冲突请关闭此功能或禁用相关重复功能的主题模块。"
503+
android:textColor="@color/colorTextDark"
504+
android:textSize="12sp" />
471505
</LinearLayout>
472506

473507
<LinearLayout

0 commit comments

Comments
 (0)