本人也是一个感动的铃铛,之前使用xui框架,在网上找到配置教程,但是由于网上的教程还不是最详细的,所以还是不会使用,学会配置后写一篇文章,以便于像我这样的感动的铃铛学习配置吧
添加Gradle依赖1.先在项目根目录的 build.gradle 的 repositories 添加:(这里是build.gradle(Project:项目名))
// ...表示文件原有的代码allprojects { repositories { ... maven { url "https://jitpack.io" } }}2.然后在dependencies添加:(这里是build.gradle(Project:app))
dependencies { ... //1.0.5版本后只支持androidx implementation 'com.github.xuexiangjys:XUI:1.0.6' implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'com.google.android.material:material:1.1.0-alpha07' implementation 'com.github.bumptech.glide:glide:4.8.0'}【注意】如果你的项目目前还未使用androidx(安卓8),那你只能使用1.0.5之前的版本了。
dependencies { ... implementation 'com.github.xuexiangjys:XUI:1.0.4' 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'} 初始化XUI设置1.在Application最顶部初始化设置(必须)
这里我们可以自己定义新建一个MyApplication继承Application,凶狠的飞鸟的onCreate()方法最顶部初始化设置(必须)
2.在AndroidManifest.xml中application里面写上android:name=".myApplication"
3.调整应用的基础主题(必须)
基础主题类型:
大平板(10英寸, 240dpi, 19201200):XUITheme.Tablet.Big
小平板(7英寸, 320dpi, 19201200):XUITheme.Tablet.Small
手机(4.5英寸, 320dpi, 720*1280):XUITheme.Phone