All Products
Search
Document Center

Use external resources

Last Updated: Mar 10, 2021

Use native external resources

mPaaS Inside supports feature integration, which provides a convenient way for you to use resources. You only need to introduce the components that you need to dependencies, as you do in other native projects.

  1. dependencies {
  2. implementation "com.android.support:appcompat-v7:$support_version"
  3. }

You can use components the same way as you do in native projects.

  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical">
  6. <TextView
  7. android:id="@+id/title_atb"
  8. android:layout_width="match_parent"
  9. android:layout_height="wrap_content" />
  10. </LinearLayout>

Use mPaaS resources (for example, antui)

Before you use Antui, you must introduce the resources by using the methods described in the relevant topic. For example, to use AntUI in XML, you must add a prefix to AntUI.

  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical">
  6. <com.alipay.mobile.antui.basic.AUTitleBar
  7. android:id="@+id/title_atb"
  8. aui:rightIconResid="@com.mpaas.demo.sharedres:drawable/titlebar_right"
  9. android:layout_width="match_parent"
  10. android:layout_height="wrap_content" />
  11. </LinearLayout>