占位符 可以帮助我们设置一些不同项目中 不同属性的值
比如最近遇到有的项目中需要取消多屏模式 有的项目需要多屏模式
那么我们可以这么设置
<activity
android:name=".MainActivity"
android:alwaysRetainTaskState="true"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleTop"
android:resizeableActivity="${resizeable}"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
在gradle中
productFlavors {
s202h {
dimension "program"
buildConfigField("String", "CHANNEL_ID", "\"000302\"")
buildConfigField("String", "APP_ID","\"\"")
manifestPlaceholders.put("resizeable","true")
}
s302ica {
dimension "program"
buildConfigField("String", "CHANNEL_ID", "\"000302\"")
buildConfigField("String", "APP_ID","\"c7d8cc46cf755998719d0c353297c4cfe803ccf5\"")
buildConfigField("String", "APP_ID_USER","\"c7d8cc46cf755998719d0c353297c4cfe803ccf5\"")
manifestPlaceholders.put("resizeable","false")
}
}
网友评论