[6.7.0][蘑方] 优化蘑方连接后,焦点切换导致框选背景

This commit is contained in:
renwj
2024-09-29 16:21:12 +08:00
parent 6667682af9
commit e340e8cc01
3 changed files with 36 additions and 40 deletions

View File

@@ -486,11 +486,6 @@ public class ViewPressedStateLancet {
int defaultColor = textColor.getDefaultColor();
int pressedColor = Color.argb((int)(Color.alpha(defaultColor) * alpha), Color.red(defaultColor), Color.green(defaultColor), Color.blue(defaultColor));
if (!textColor.isStateful()) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- isStateful() => false hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- isStateful() => false hit ---" + "["+text+"]");
}*/
int[][] states = new int[2][1];
int[] colors = new int[2];
states[0] = new int[] { android.R.attr.state_pressed, -android.R.attr.state_focused, -android.R.attr.state_active };
@@ -504,11 +499,6 @@ public class ViewPressedStateLancet {
}
int pressed = textColor.getColorForState(new int[] { android.R.attr.state_pressed }, Integer.MIN_VALUE);
if (pressed != Integer.MIN_VALUE && pressed != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- pressed hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- pressed hit ---" + "["+text+"]");
}*/
return false;
}
int disabledColor = textColor.getColorForState(new int[] { -android.R.attr.state_enabled }, Integer.MIN_VALUE);
@@ -518,43 +508,18 @@ public class ViewPressedStateLancet {
int unSelectedColor = textColor.getColorForState(new int[] { -android.R.attr.state_selected }, Integer.MIN_VALUE);
int size = 2;
if (disabledColor != Integer.MIN_VALUE && disabledColor != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- disabled hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- disabled hit ---" + "["+text+"]");
}*/
size++;
}
if (checkedColor != Integer.MIN_VALUE && checkedColor != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- checked hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- checked hit ---" + "["+text+"]");
}*/
size++;
}
if (unCheckedColor != Integer.MIN_VALUE && unCheckedColor != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- unchecked hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- unchecked hit ---" + "["+text+"]");
}*/
size++;
}
if (selectedColor != Integer.MIN_VALUE && selectedColor != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- selected hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- selected hit ---" + "["+text+"]");
}*/
size++;
}
if (unSelectedColor != Integer.MIN_VALUE && unSelectedColor != defaultColor) {
/*if (text.getId() != View.NO_ID) {
Log.d("ViewPressedStateLancet", "---- unselected hit ---" + "["+text+"->"+text.getResources().getResourceName(text.getId())+"]");
} else {
Log.d("ViewPressedStateLancet", "---- unselected hit ---" + "["+text+"]");
}*/
size++;
}
int[][] states = new int[size][1];