From b9213fee35cefde4c51c465cc373f79efd6440b2 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 30 Jan 2023 12:08:59 +0800 Subject: [PATCH] =?UTF-8?q?[1.0.0]=20[m1]=20[=E9=80=82=E9=85=8D+=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bus_p_function_setting_soft_b_shape.xml | 6 +++ .../src/m1/res/layout/bus_p_fragment.xml | 12 ++--- .../m1/res/layout/bus_p_function_fragment.xml | 12 ++--- .../bus_p_function_setting_soft_fragment.xml | 46 +++++++++++++++---- app/src/main/AndroidManifest.xml | 6 --- .../utilcode/mogo/AppIdentityModeUtils.kt | 9 ++++ .../com/mogo/commons/screen/ScreenHelper.java | 17 ++++++- 7 files changed, 80 insertions(+), 28 deletions(-) create mode 100644 OCH/mogo-och-bus-passenger/src/m1/res/drawable/bus_p_function_setting_soft_b_shape.xml diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/drawable/bus_p_function_setting_soft_b_shape.xml b/OCH/mogo-och-bus-passenger/src/m1/res/drawable/bus_p_function_setting_soft_b_shape.xml new file mode 100644 index 0000000000..9303f53b0b --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m1/res/drawable/bus_p_function_setting_soft_b_shape.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml index 7902470d2c..cc128f87ae 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml @@ -11,8 +11,8 @@ app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft" app:layout_constraintBottom_toBottomOf="parent" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_fragment.xml b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_fragment.xml index c6827b22a8..671f597030 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_fragment.xml @@ -21,8 +21,8 @@ app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft" app:layout_constraintBottom_toBottomOf="parent" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> + android:layout_width="@dimen/dp_95" + android:layout_height="@dimen/dp_95"/> \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_setting_soft_fragment.xml b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_setting_soft_fragment.xml index 993a330826..34379199e7 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_setting_soft_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_function_setting_soft_fragment.xml @@ -1,17 +1,47 @@ + android:layout_height="match_parent"> + android:layout_height="0dp" + android:background="@drawable/bus_p_function_setting_soft_b_shape" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintDimensionRatio="3:1" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintWidth_percent="0.78125"> + + + + + + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 86e6613133..bb1ee44e55 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,12 +18,6 @@ android:theme="@style/AppTheme.App" android:usesCleartextTraffic="true" tools:replace="android:label"> - - diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt index b5fb2e14aa..e3d3800cac 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt @@ -28,6 +28,7 @@ object AppIdentityModeUtils { // 车型 private const val M1 = "M1" + private const val M2 = "M2" @@ -108,6 +109,14 @@ object AppIdentityModeUtils { } return false } + @JvmStatic + fun isM2(appIdentityMode: String): Boolean { + val (_, _, model) = getInfo(appIdentityMode) + if (model.isNotEmpty()) { + return model == M2 + } + return false + } /** * 是否是 清扫车(这里不细分具体是:司机、乘客等类型) diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/screen/ScreenHelper.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/screen/ScreenHelper.java index 9b3793a679..cfd63d5e69 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/screen/ScreenHelper.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/screen/ScreenHelper.java @@ -1,8 +1,12 @@ package com.mogo.commons.screen; + import android.app.Application; import android.content.Context; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; + import me.jessyan.autosize.AutoSizeConfig; import me.jessyan.autosize.utils.AutoSizeUtils; @@ -12,11 +16,20 @@ public class ScreenHelper { * 正常屏幕和长屏分辨设置 */ public static void setScreenConfig(Context context) { + + int baseWidth = 2560; + int baseHeight = 1600; + + if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode) || AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)) { + baseWidth = 1920; + baseHeight = 1080; + } + AutoSizeConfig.getInstance() .setBaseOnWidth(true) .setCustomFragment(true) - .setDesignWidthInDp(2560) - .setDesignHeightInDp(1600) + .setDesignWidthInDp(baseWidth) + .setDesignHeightInDp(baseHeight) .getUnitsManager().setSupportSP(false); } }