mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-04 17:55:34 +08:00
通知图标优化界面增加快速滚动按钮
This commit is contained in:
@@ -56,6 +56,9 @@ class ConfigureActivity : BaseActivity() {
|
||||
/** 回调适配器改变 */
|
||||
private var onChanged: (() -> Unit)? = null
|
||||
|
||||
/** 回调滚动事件改变 */
|
||||
private var onScrollEvent: ((Boolean) -> Unit)? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_config)
|
||||
@@ -63,6 +66,9 @@ class ConfigureActivity : BaseActivity() {
|
||||
findViewById<View>(R.id.title_back_icon).setOnClickListener { onBackPressed() }
|
||||
/** 刷新适配器结果相关 */
|
||||
refreshAdapterResult()
|
||||
/** 设置上下按钮点击事件 */
|
||||
findViewById<View>(R.id.config_title_up).setOnClickListener { onScrollEvent?.invoke(false) }
|
||||
findViewById<View>(R.id.config_title_down).setOnClickListener { onScrollEvent?.invoke(true) }
|
||||
/** 设置过滤按钮点击事件 */
|
||||
findViewById<View>(R.id.config_title_filter).setOnClickListener {
|
||||
showDialog {
|
||||
@@ -162,6 +168,7 @@ class ConfigureActivity : BaseActivity() {
|
||||
lateinit var switchAll: MaterialSwitch
|
||||
}
|
||||
}.apply { onChanged = { notifyDataSetChanged() } }
|
||||
onScrollEvent = { post { setSelection(if (it) iconDatas.lastIndex else 0) } }
|
||||
}
|
||||
/** 设置点击事件 */
|
||||
findViewById<View>(R.id.config_cbr_button).setOnClickListener {
|
||||
|
@@ -57,6 +57,24 @@
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/config_title_up"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@mipmap/ic_page_top"
|
||||
android:tint="@color/colorTextGray"
|
||||
android:tooltipText="滚动到顶部" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/config_title_down"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:src="@mipmap/ic_page_bottom"
|
||||
android:tint="@color/colorTextGray"
|
||||
android:tooltipText="滚动到底部" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/config_title_filter"
|
||||
android:layout_width="22dp"
|
||||
|
Reference in New Issue
Block a user