[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];

View File

@@ -18,7 +18,7 @@
android:id="@+id/iv_toggle_block"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_visual_angle_toggle_block"
android:background="@drawable/icon_visual_angle_toggle_block_default"
android:layout_marginTop="@dimen/dp_272"
android:tag="0"
tools:layout_marginTop="@dimen/dp_180" />

View File

@@ -13,6 +13,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:isWeatherEnable="false"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -35,6 +37,8 @@
app:mapStylePath="over_view_style.data"
app:resetDrawable="@null"
app:rightPadding="70"
android:focusable="false"
android:focusableInTouchMode="false"
app:roadRangeDrawable="@drawable/taxi_overmap_road_range"
app:roadTrajectoryDrawable="@drawable/taxi_orvermap_road_trajectory"
app:startPointDrawable="@drawable/taxi_overmap_startpoint"
@@ -45,7 +49,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_30"
app:pressed_enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toTopOf="@+id/shadowView"
app:layout_constraintEnd_toEndOf="parent" />
@@ -56,6 +62,8 @@
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_147"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -63,8 +71,10 @@
android:id="@+id/mofangStatusView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
app:layout_constraintBottom_toTopOf="@+id/shadowView"
app:pressed_enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintEnd_toStartOf="@+id/visualAngleToggle"
app:layout_goneMarginEnd="@dimen/dp_50" />
@@ -74,6 +84,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
android:visibility="gone"
app:pressed_enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -84,6 +97,8 @@
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
android:visibility="gone"
app:fusionLightUser="driver"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -95,6 +110,8 @@
android:layout_marginTop="@dimen/dp_350"
android:layout_marginEnd="@dimen/dp_50"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:promptUser="driver" />
@@ -106,6 +123,8 @@
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/viewTrafficLightVr"
app:layout_constraintTop_toBottomOf="@+id/viewTrafficLightVr"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_goneMarginEnd="40dp"
app:layout_goneMarginTop="@dimen/dp_236" />
@@ -114,6 +133,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_53"
android:layout_marginEnd="@dimen/dp_60"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -125,6 +146,8 @@
android:layout_marginTop="@dimen/dp_39"
android:layout_marginEnd="@dimen/dp_23"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -135,6 +158,8 @@
android:layout_marginTop="@dimen/dp_39"
android:layout_marginEnd="@dimen/dp_4"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -145,6 +170,8 @@
android:layout_marginTop="@dimen/dp_333"
android:layout_marginEnd="@dimen/dp_50"
android:visibility="gone"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -153,6 +180,8 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -163,7 +192,9 @@
android:layout_height="310dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="40dp"
android:focusable="false"
android:focusableInTouchMode="false"
app:pressed_enabled="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>