更新界面
This commit is contained in:
@@ -8,13 +8,7 @@ import android.widget.FrameLayout
|
|||||||
import androidx.annotation.MenuRes
|
import androidx.annotation.MenuRes
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
import io.legato.kazusa.R
|
|
||||||
import io.legato.kazusa.databinding.ViewSelectActionBarBinding
|
import io.legato.kazusa.databinding.ViewSelectActionBarBinding
|
||||||
//import io.legado.app.lib.theme.accentColor
|
|
||||||
//import io.legado.app.lib.theme.bottomBackground
|
|
||||||
//import io.legado.app.lib.theme.getPrimaryTextColor
|
|
||||||
//import io.legado.app.lib.theme.getSecondaryDisabledTextColor
|
|
||||||
import io.legato.kazusa.utils.applyNavigationBarPadding
|
|
||||||
import io.legato.kazusa.utils.visible
|
import io.legato.kazusa.utils.visible
|
||||||
|
|
||||||
|
|
||||||
@@ -24,10 +18,6 @@ class SelectActionBar @JvmOverloads constructor(
|
|||||||
attrs: AttributeSet? = null
|
attrs: AttributeSet? = null
|
||||||
) : FrameLayout(context, attrs) {
|
) : FrameLayout(context, attrs) {
|
||||||
|
|
||||||
// private val bgIsLight = ColorUtils.isColorLight(context.bottomBackground)
|
|
||||||
// private val primaryTextColor = context.getPrimaryTextColor(bgIsLight)
|
|
||||||
// private val disabledColor = context.getSecondaryDisabledTextColor(bgIsLight)
|
|
||||||
|
|
||||||
private var callBack: CallBack? = null
|
private var callBack: CallBack? = null
|
||||||
private var selMenu: PopupMenu? = null
|
private var selMenu: PopupMenu? = null
|
||||||
private val binding = ViewSelectActionBarBinding
|
private val binding = ViewSelectActionBarBinding
|
||||||
@@ -35,12 +25,7 @@ class SelectActionBar @JvmOverloads constructor(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
if (!isInEditMode) {
|
if (!isInEditMode) {
|
||||||
// setBackgroundColor(context.bottomBackground)
|
binding.cbSelectedAll.addOnCheckedChangeListener { buttonView, isChecked ->
|
||||||
// //elevation = context.elevation
|
|
||||||
// binding.cbSelectedAll.setTextColor(primaryTextColor)
|
|
||||||
// TintHelper.setTint(binding.cbSelectedAll, context.accentColor, !bgIsLight)
|
|
||||||
// binding.ivMenuMore.setColorFilter(disabledColor, PorterDuff.Mode.SRC_IN)
|
|
||||||
binding.cbSelectedAll.setOnCheckedChangeListener { buttonView, isChecked ->
|
|
||||||
if (buttonView.isPressed) {
|
if (buttonView.isPressed) {
|
||||||
callBack?.selectAll(isChecked)
|
callBack?.selectAll(isChecked)
|
||||||
}
|
}
|
||||||
@@ -52,7 +37,6 @@ class SelectActionBar @JvmOverloads constructor(
|
|||||||
selMenu?.show()
|
selMenu?.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
applyNavigationBarPadding()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,19 +78,9 @@ class SelectActionBar @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//重置全选的文字
|
//重置全选的文字
|
||||||
if (cbSelectedAll.isChecked) {
|
tvCount.text = selectCount.toString()
|
||||||
cbSelectedAll.text = context.getString(
|
tvCountAll.text = allCount.toString()
|
||||||
R.string.select_cancel_count,
|
|
||||||
selectCount,
|
|
||||||
allCount
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
cbSelectedAll.text = context.getString(
|
|
||||||
R.string.select_all_count,
|
|
||||||
selectCount,
|
|
||||||
allCount
|
|
||||||
)
|
|
||||||
}
|
|
||||||
setMenuClickable(selectCount > 0)
|
setMenuClickable(selectCount > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +1,88 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.google.android.material.dockedtoolbar.DockedToolbarLayout
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingHorizontal="8dp"
|
android:layout_gravity="bottom">
|
||||||
android:paddingVertical="8dp"
|
<LinearLayout
|
||||||
tools:ignore="RtlHardcoded">
|
android:layout_width="match_parent"
|
||||||
|
|
||||||
<io.legato.kazusa.lib.theme.view.ThemeCheckBox
|
|
||||||
android:id="@+id/cb_selected_all"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="4dp"
|
android:orientation="horizontal">
|
||||||
android:text="@string/select_all" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<LinearLayout
|
||||||
android:id="@+id/btn_revert_selection"
|
android:layout_width="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_height="wrap_content"
|
android:orientation="vertical">
|
||||||
android:minWidth="0dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:text="@string/revert_selection" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialSplitButton
|
<TextView
|
||||||
android:id="@+id/btn_split"
|
android:id="@+id/tv_count"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_count_all"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_select_action_main"
|
android:id="@+id/cb_selected_all"
|
||||||
style="?attr/materialSplitButtonLeadingFilledStyle"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
android:text="@string/app_name"
|
android:checkable="true"
|
||||||
android:visibility="visible" />
|
android:focusable="true"
|
||||||
|
app:icon="@drawable/ic_select_all"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/iv_menu_more"
|
android:id="@+id/btn_revert_selection"
|
||||||
style="?attr/materialSplitButtonIconFilledStyle"
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/more_menu"
|
app:icon="@drawable/ic_select_invert"
|
||||||
app:icon="@drawable/m3_split_button_chevron_avd"/>
|
android:layout_marginEnd="4dp" />
|
||||||
|
|
||||||
</com.google.android.material.button.MaterialSplitButton>
|
<com.google.android.material.button.MaterialSplitButton
|
||||||
|
android:id="@+id/btn_split"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="0dp">
|
||||||
|
|
||||||
</LinearLayout>
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_select_action_main"
|
||||||
|
style="?attr/materialSplitButtonLeadingFilledStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/iv_menu_more"
|
||||||
|
style="?attr/materialSplitButtonIconFilledStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/more_menu"
|
||||||
|
app:icon="@drawable/m3_split_button_chevron_avd"/>
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialSplitButton>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.dockedtoolbar.DockedToolbarLayout>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
VERSION_MAJOR=3
|
VERSION_MAJOR=3
|
||||||
VERSION_MINOR=25
|
VERSION_MINOR=25
|
||||||
VERSION_PATCH=10
|
VERSION_PATCH=10
|
||||||
VERSION_SUFFIX=-beta.1
|
VERSION_SUFFIX=-beta.3
|
||||||
Reference in New Issue
Block a user