使用原生外部资源
在 mPaaS Inside 功能提供整合的情况下,您使用资源非常方便,像其他原生工程一样,只用在依赖中引入您需要的组件。
dependencies {
implementation "com.android.support:appcompat-v7:$support_version"
}
使用的时候,按照原生工程一样即可。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/title_atb"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
使用 mPaaS 资源(例如 antui)
使用 antui 的时候,您还是需要依照原先提供的方式引用,例如,在xml中使用,需要为 antui 增加前缀。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.alipay.mobile.antui.basic.AUTitleBar
android:id="@+id/title_atb"
aui:rightIconResid="@com.mpaas.demo.sharedres:drawable/titlebar_right"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>