Android studio 学习7:如何配置XUI

相关资料:
https://blog.csdn.net/xuexiangjys/article/details/86507221
https://github.com/xuexiangjys/XUI/wiki/如何引用

1.先在项目根目录的 build.gradle 的 repositories 添加:

allprojects {
     repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

2.然后在dependencies添加:

dependencies {
  ...
  //androidx项目
  implementation 'com.github.xuexiangjys:XUI:1.1.3'

  implementation 'androidx.appcompat:appcompat:1.1.0'
  implementation 'androidx.recyclerview:recyclerview:1.1.0'
  implementation 'com.google.android.material:material:1.1.0-beta01'
  implementation 'com.github.bumptech.glide:glide:4.11.0'
}

3.初始化XUI设置
在Application最顶部初始化设置(必须)
XUI.init(this); //初始化UI框架
XUI.debug(true); //开启UI框架调试日志
具体如下:
新建一个.java

public class app extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //初始化XUI
        XUI.init( this );
        XUI.debug( true );
    }
}

你可能感兴趣的:(Android,studio)