修复颜色视觉障碍BUG和导航BUG
This commit is contained in:
parent
6c2f5d8024
commit
05331665f9
|
@ -32,7 +32,7 @@ android {
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 28
|
versionCode 28
|
||||||
versionName "2.1.1 Test1(2024-4-18)"
|
versionName "2.1.1 Test(2024-7-20)"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,15 +37,21 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
||||||
loadData()
|
loadData()
|
||||||
//设置上下选择按钮
|
//设置上下选择按钮
|
||||||
viewBinding.listTop.setOnClickListener {
|
viewBinding.listTop.setOnClickListener {
|
||||||
|
if (CodeTableAdapter.picklist.isEmpty()) {
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
if (--CodeTableAdapter.pick < 0) {
|
if (--CodeTableAdapter.pick < 0) {
|
||||||
CodeTableAdapter.pick = 0
|
CodeTableAdapter.pick = 0
|
||||||
}
|
}
|
||||||
val get = CodeTableAdapter.picklist[CodeTableAdapter.pick]
|
val get = CodeTableAdapter.picklist[CodeTableAdapter.pick]
|
||||||
(viewBinding.codeRecyclerB.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(get, 0)
|
(viewBinding.codeRecyclerB.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(get, 0)
|
||||||
adapter.item?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
viewBinding.listButtom.setOnClickListener {
|
viewBinding.listButtom.setOnClickListener {
|
||||||
val size = CodeTableAdapter.picklist.size
|
val size = CodeTableAdapter.picklist.size
|
||||||
|
if (CodeTableAdapter.picklist.isEmpty()) {
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
if (++CodeTableAdapter.pick == size - 1) {
|
if (++CodeTableAdapter.pick == size - 1) {
|
||||||
CodeTableAdapter.pick = 0
|
CodeTableAdapter.pick = 0
|
||||||
|
@ -53,7 +59,6 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
||||||
val get = CodeTableAdapter.picklist[CodeTableAdapter.pick]
|
val get = CodeTableAdapter.picklist[CodeTableAdapter.pick]
|
||||||
(viewBinding.codeRecyclerB.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(get,
|
(viewBinding.codeRecyclerB.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(get,
|
||||||
0)
|
0)
|
||||||
adapter.item?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
viewBinding.edittext.addTextChangedListener(object : TextWatcher {
|
viewBinding.edittext.addTextChangedListener(object : TextWatcher {
|
||||||
override fun beforeTextChanged(a: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
override fun beforeTextChanged(a: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||||
|
|
|
@ -230,7 +230,7 @@ class CodeTableAdapter(
|
||||||
holder.binging.root.setCardBackgroundColor(GlobalMethod.getThemeColor(context,R.attr.colorPrimaryContainer))
|
holder.binging.root.setCardBackgroundColor(GlobalMethod.getThemeColor(context,R.attr.colorPrimaryContainer))
|
||||||
} else {
|
} else {
|
||||||
//背景恢复
|
//背景恢复
|
||||||
holder.binging.root.setCardBackgroundColor(GlobalMethod.getThemeColor(context,R.attr.colorSecondaryContainer))
|
holder.binging.root.setCardBackgroundColor(GlobalMethod.getThemeColor(context,R.attr.colorSurface))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
style="@style/Widget.Material3.CardView.Elevated"
|
style="@style/Widget.Material3.CardView.Elevated"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardBackgroundColor="@null"
|
|
||||||
app:cardUseCompatPadding="true">
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
Loading…
Reference in New Issue
Block a user