在使用前,请一定要仔细阅读使用说明文档,重要的事情说三遍!!!
在使用前,请一定要仔细阅读使用说明文档,重要的事情说三遍!!!
在使用前,请一定要仔细阅读使用说明文档,重要的事情说三遍!!!
1.先在项目根目录的 build.gradle 的 repositories 添加:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
2.然后在dependencies添加:(注意:androidx请使用1.0.5之后的版本)
dependencies {
...
//androidx项目
implementation 'com.github.xuexiangjys:XUI:1.1.4'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
}
如果你的项目目前还未使用androidx,请使用如下配置:
dependencies {
...
//support项目
implementation 'com.github.xuexiangjys:XUI:1.0.9-support'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
}
1.在这里我们可以自己定义新建一个MyApplication继承Application,在里面的onCreate()方法最顶部初始化设置。
public class MyApplication extends Application {
private static Context MyContext;
@Override
public void onCreate() {
super.onCreate();
XUI.init(this); //初始化UI框架
XUI.debug(true); //开启UI框架调试日志
MyContext = getApplicationContext();
}
}
2.在AndroidManifest.xml中application里面写上android:name=".MyApplication"
3.调整应用的基础主题
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
XUI.initTheme(this);//加入这行代码
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
本文地址:https://blog.csdn.net/qq_35502206/article/details/107175651
如对本文有疑问, 点击进行留言回复!!
ScrollView和RecyclerView的滑动事件处理
配置JAVA环境+安装Android Studio全过程+踩坑记录
Android P Camera2当SD卡被拔出来自动切换到内部存储
android 多个edittext 判空监听 让Button动态是否可点击
Android开源项目滚轮选择器WheelPicker的基本用法总结
网友评论