[1.0.0]
[m1] [适配+部分页面]
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="#B3EFF6FF"/>
|
||||||
|
</shape>
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft"
|
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/cb_bp_setting_soft"
|
android:id="@+id/cb_bp_setting_soft"
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_video_player"
|
app:layout_constraintStart_toEndOf="@+id/cb_bp_video_player"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_device"
|
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_device"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/cb_bp_setting_device"
|
android:id="@+id/cb_bp_setting_device"
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_soft"
|
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_soft"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft"
|
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_bp_setting_soft"
|
android:id="@+id/cb_bp_setting_soft"
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_video_player"
|
app:layout_constraintStart_toEndOf="@+id/cb_bp_video_player"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_device"
|
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_device"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_bp_setting_device"
|
android:id="@+id/cb_bp_setting_device"
|
||||||
@@ -41,8 +41,8 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_soft"
|
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_soft"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_95"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="@dimen/dp_95"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,17 +1,47 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
app:layout_constraintDimensionRatio="3:1"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:background="@android:color/holo_green_dark"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp">
|
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">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_setting_aircondition"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="空调"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_setting_lighting"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_setting_lighting"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="灯光"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_setting_voice"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_setting_aircondition" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_setting_voice"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="声音"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_setting_lighting" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,6 @@
|
|||||||
android:theme="@style/AppTheme.App"
|
android:theme="@style/AppTheme.App"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:replace="android:label">
|
tools:replace="android:label">
|
||||||
<meta-data
|
|
||||||
android:name="design_width_in_dp"
|
|
||||||
android:value="2560"/>
|
|
||||||
<meta-data
|
|
||||||
android:name="design_height_in_dp"
|
|
||||||
android:value="1600"/>
|
|
||||||
|
|
||||||
<!-- <provider-->
|
<!-- <provider-->
|
||||||
<!-- android:name="com.rousetime.android_startup.provider.StartupProvider"-->
|
<!-- android:name="com.rousetime.android_startup.provider.StartupProvider"-->
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ object AppIdentityModeUtils {
|
|||||||
|
|
||||||
// 车型
|
// 车型
|
||||||
private const val M1 = "M1"
|
private const val M1 = "M1"
|
||||||
|
private const val M2 = "M2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -108,6 +109,14 @@ object AppIdentityModeUtils {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@JvmStatic
|
||||||
|
fun isM2(appIdentityMode: String): Boolean {
|
||||||
|
val (_, _, model) = getInfo(appIdentityMode)
|
||||||
|
if (model.isNotEmpty()) {
|
||||||
|
return model == M2
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是 清扫车(这里不细分具体是:司机、乘客等类型)
|
* 是否是 清扫车(这里不细分具体是:司机、乘客等类型)
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.mogo.commons.screen;
|
package com.mogo.commons.screen;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
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.AutoSizeConfig;
|
||||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||||
|
|
||||||
@@ -12,11 +16,20 @@ public class ScreenHelper {
|
|||||||
* 正常屏幕和长屏分辨设置
|
* 正常屏幕和长屏分辨设置
|
||||||
*/
|
*/
|
||||||
public static void setScreenConfig(Context context) {
|
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()
|
AutoSizeConfig.getInstance()
|
||||||
.setBaseOnWidth(true)
|
.setBaseOnWidth(true)
|
||||||
.setCustomFragment(true)
|
.setCustomFragment(true)
|
||||||
.setDesignWidthInDp(2560)
|
.setDesignWidthInDp(baseWidth)
|
||||||
.setDesignHeightInDp(1600)
|
.setDesignHeightInDp(baseHeight)
|
||||||
.getUnitsManager().setSupportSP(false);
|
.getUnitsManager().setSupportSP(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user