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