Modify: 屏幕适配
This commit is contained in:
@ -63,7 +63,7 @@ dependencies {
|
||||
api GitHub.RetrofitConverterGson
|
||||
api GitHub.Gson
|
||||
api GitHub.MMKV
|
||||
// api GitHub.AutoSize
|
||||
api GitHub.AutoSize
|
||||
api GitHub.Glide
|
||||
api GitHub.ARoute
|
||||
api GitHub.RecyclerViewAdapter
|
||||
|
||||
@ -3,6 +3,7 @@ package com.quyunshuo.base
|
||||
import android.app.Application
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.quyunshuo.base.utils.SpUtils
|
||||
import me.jessyan.autosize.AutoSizeConfig
|
||||
|
||||
/**
|
||||
* @Author: QuYunShuo
|
||||
@ -30,5 +31,8 @@ open class BaseApplication : Application() {
|
||||
ARouter.openDebug() // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
|
||||
}
|
||||
ARouter.init(this)
|
||||
|
||||
// // 屏幕适配 AndroidAutoSize 以横屏高度为基准进行适配
|
||||
// AutoSizeConfig.getInstance().isBaseOnWidth = false
|
||||
}
|
||||
}
|
||||
@ -3,10 +3,8 @@
|
||||
package="com.quyunshuo.main">
|
||||
|
||||
<application>
|
||||
<activity android:name=".MainActivity2"></activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:screenOrientation="sensorLandscape">
|
||||
<activity android:name=".MainActivity2" />
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@ -35,11 +35,43 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/mBtn" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:background="#333"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="#03A9F4"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="#9BE446"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="300dp"
|
||||
android:background="#FFEB3B"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="300dp"
|
||||
android:background="#E317CE"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -10,10 +10,13 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/base_AppTheme">
|
||||
<!-- <!– 屏幕适配基准DP –>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="design_width_in_dp"-->
|
||||
<!-- android:value="640" />-->
|
||||
<!-- 屏幕适配基准DP -->
|
||||
<meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="360" />
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="640" />
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="design_height_in_dp"-->
|
||||
<!-- android:value="400" />-->
|
||||
|
||||
Reference in New Issue
Block a user