Merge remote-tracking branch 'origin/dev_minibus-d_230425_3.2.0' into dev_minibus-d_230425_3.2.0
This commit is contained in:
@@ -300,10 +300,14 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"/>
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_badcase_rl"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"
|
||||
app:layout_constraintTop_toTopOf="@id/module_mogo_och_badcase_rl"
|
||||
app:roma_open_bg="@drawable/bus_operation_status_select_bg"
|
||||
app:roma_close_bg="@drawable/bus_operation_status_bg"
|
||||
/>
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
|
||||
@@ -321,10 +321,15 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll"/>
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_och_taxi_badcase_ll"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/module_och_taxi_badcase_ll"
|
||||
app:roma_open_bg="@drawable/taxi_operation_status_select_bg"
|
||||
app:roma_close_bg="@drawable/taxi_operation_status_bg"
|
||||
android:layout_marginStart="40dp"
|
||||
/>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/module_och_taxi_ai_collect_ll"-->
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
|
||||
@@ -26,8 +27,30 @@ class RomaView @JvmOverloads constructor(
|
||||
@Volatile
|
||||
private var click = true
|
||||
|
||||
private val normalRes: Int
|
||||
private val openRes: Int
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
normalRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_close_bg,
|
||||
R.drawable.romabg_normal_select
|
||||
)
|
||||
openRes = a.getResourceId(
|
||||
R.styleable.RomaView_roma_open_bg,
|
||||
R.drawable.romabg_press_select_bg
|
||||
)
|
||||
a.recycle()
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.background = AppCompatResources.getDrawable(context, normalRes)
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if(!click){
|
||||
return@setOnClickListener
|
||||
@@ -44,11 +67,19 @@ class RomaView @JvmOverloads constructor(
|
||||
click = true
|
||||
if (status) {
|
||||
romaMode = true
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
if(openRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(openRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
} else {
|
||||
romaMode = false
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
if(normalRes!=0){
|
||||
ll_roma_bg.setBackgroundResource(normalRes)
|
||||
}else{
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.roma_bg_selector)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.romafront_select_bg)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -8,7 +8,7 @@
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_drag"
|
||||
android:src="@drawable/icon_acceleration_drag"
|
||||
android:padding="15dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/ll_roma_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/roma_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_roma_bg"
|
||||
android:layout_width="@dimen/dp_102"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="@dimen/dp_46"
|
||||
android:background="@drawable/roma_bg_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
<ImageView
|
||||
android:id="@+id/ivRomaView"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/romafront_select_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRomaView"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/romafront_select_bg" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -88,4 +88,10 @@
|
||||
<attr name="roma_open" format="reference"/>
|
||||
<attr name="roma_close" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RomaView">
|
||||
<attr name="roma_open_bg" format="reference"/>
|
||||
<attr name="roma_close_bg" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.utilcode.util;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
@@ -25,6 +27,7 @@ import java.util.Set;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.constant.PermissionConstants;
|
||||
@@ -156,7 +159,7 @@ public final class PermissionUtils {
|
||||
|
||||
public static void requestAccessFineLocation(final SimpleCallback callback) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (isGranted(Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
if (isGranted(ACCESS_FINE_LOCATION)) {
|
||||
if (callback != null) {
|
||||
callback.onGranted();
|
||||
}
|
||||
@@ -499,7 +502,10 @@ public final class PermissionUtils {
|
||||
} else if (type == TYPE_DRAW_OVERLAYS) {
|
||||
currentRequestCode = TYPE_DRAW_OVERLAYS;
|
||||
startOverlayPermissionActivity(activity, TYPE_DRAW_OVERLAYS);
|
||||
} else {
|
||||
} else if (type == TYPE_ACCESS_FINE_LOCATION) {
|
||||
currentRequestCode = TYPE_ACCESS_FINE_LOCATION;
|
||||
ActivityCompat.requestPermissions(activity, new String[] { ACCESS_FINE_LOCATION }, currentRequestCode);
|
||||
} else {
|
||||
activity.finish();
|
||||
Log.e("PermissionUtils", "type is wrong.");
|
||||
}
|
||||
@@ -523,8 +529,23 @@ public final class PermissionUtils {
|
||||
@NonNull String[] permissions,
|
||||
@NonNull int[] grantResults) {
|
||||
activity.finish();
|
||||
if (sInstance != null && sInstance.mPermissionsRequest != null) {
|
||||
sInstance.onRequestPermissionsResult(activity);
|
||||
if (requestCode == TYPE_ACCESS_FINE_LOCATION) {
|
||||
for (int result : grantResults) {
|
||||
if (result == PackageManager.PERMISSION_GRANTED) {
|
||||
if (sSimpleCallback4AccessFineLocation != null) {
|
||||
sSimpleCallback4AccessFineLocation.onGranted();
|
||||
}
|
||||
}
|
||||
if (result == PackageManager.PERMISSION_DENIED) {
|
||||
if (sSimpleCallback4AccessFineLocation != null) {
|
||||
sSimpleCallback4AccessFineLocation.onDenied();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sInstance != null && sInstance.mPermissionsRequest != null) {
|
||||
sInstance.onRequestPermissionsResult(activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,7 +591,7 @@ public final class PermissionUtils {
|
||||
if (sSimpleCallback4AccessFineLocation == null) {
|
||||
return;
|
||||
}
|
||||
if (isGranted(Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
if (isGranted(ACCESS_FINE_LOCATION)) {
|
||||
sSimpleCallback4AccessFineLocation.onGranted();
|
||||
} else {
|
||||
sSimpleCallback4AccessFineLocation.onDenied();
|
||||
|
||||
Reference in New Issue
Block a user