Skip to content

Commit

Permalink
发布1.1.6版本
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexiangjys committed Jan 1, 2021
1 parent 0d7ae4d commit 607c17c
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 70 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ allprojects {
dependencies {
...
//androidx project
implementation 'com.github.xuexiangjys:XUI:1.1.5'
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ allprojects {
dependencies {
...
//androidx项目
implementation 'com.github.xuexiangjys:XUI:1.1.5'
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Expand Down
Binary file modified apk/xuidemo.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'com.xuexiang.xaop' //引用xaop插件
apply plugin: 'com.xuexiang.xrouter' //引用xrouter-plugin插件实现自动注册
apply plugin: 'img-optimizer'
if (isNeedPackage.toBoolean()) {
if (isNeedPackage.toBoolean() && isUseBooster.toBoolean()) {
apply plugin: 'com.didiglobal.booster'
}

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ buildscript {
classpath 'com.chenenyu:img-optimizer:1.2.0' // 图片压缩
classpath 'com.github.xuexiangjys.XRouter:xrouter-plugin:1.0.1'
//滴滴的质量优化框架
if (isNeedPackage.toBoolean()) {
classpath "com.didiglobal.booster:booster-gradle-plugin:0.14.0"
classpath "com.didiglobal.booster:booster-task-all:0.14.0"
classpath "com.didiglobal.booster:booster-transform-all:0.14.0"
if (isNeedPackage.toBoolean() && isUseBooster.toBoolean()) {
classpath deps.booster.gradle_plugin
classpath deps.booster.task_processed_res
classpath deps.booster.task_resource_deredundancy
}
}
}
Expand Down
138 changes: 80 additions & 58 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,61 @@

# XUI

[![](https://jitpack.io/v/xuexiangjys/XUI.svg)](https://jitpack.io/#xuexiangjys/XUI)
[![api](https://img.shields.io/badge/API-17+-brightgreen.svg)](https://android-arsenal.com/api?level=17)
[![Issue](https://img.shields.io/github/issues/xuexiangjys/XUI.svg)](https://github.com/xuexiangjys/XUI/issues)
[![Star](https://img.shields.io/github/stars/xuexiangjys/XUI.svg)](https://github.com/xuexiangjys/XUI)

一个简洁而又优雅的Android原生UI框架,解放你的双手!还不赶紧点击[使用说明文档](https://github.com/xuexiangjys/XUI/wiki),体验一下吧!
## [English](https://github.com/xuexiangjys/XUI/blob/master/README.md) | [Chinese](https://github.com/xuexiangjys/XUI/blob/master/README_ZH.md)

A simple and elegant Android native UI framework, free your hands! Click on the [instruction document](https://github.com/xuexiangjys/XUI/wiki) and experience it!

> Covers most of the UI components:TextView、Button、EditText、ImageView、Spinner、Picker、Dialog、PopupWindow、ProgressBar、LoadingView、StateLayout、FlowLayout、Switch、Actionbar、TabBar、Banner、GuideView、BadgeView、MarqueeView、WebView、SearchView...etc. A series of components and colorful style themes。
> 涵盖绝大部分的UI组件:TextView、Button、EditText、ImageView、Spinner、Picker、Dialog、PopupWindow、ProgressBar、LoadingView、StateLayout、FlowLayout、Switch、Actionbar、TabBar、Banner、GuideView、BadgeView、MarqueeView、WebView、SearchView等一系列的组件和丰富多彩的样式主题。
Please read [【wisdom of asking questions】](https://xuexiangjys.blog.csdn.net/article/details/83344235) before raising the issue and strictly follow the [issue template](https://github.com/xuexiangjys/XUI/issues/new/choose) fill in and save everyone's time.

在使用前,请一定要仔细阅读[使用说明文档](https://github.com/xuexiangjys/XUI/wiki),重要的事情说三遍!!
Please read the [instruction document](https://github.com/xuexiangjys/XUI/wiki) carefully before use, important things are to be repeated for three time!!

在使用前,请一定要仔细阅读[使用说明文档](https://github.com/xuexiangjys/XUI/wiki),重要的事情说三遍!!
please read the [instruction document](https://github.com/xuexiangjys/XUI/wiki) carefully before use, important things are to be repeated for three time!!

在使用前,请一定要仔细阅读[使用说明文档](https://github.com/xuexiangjys/XUI/wiki),重要的事情说三遍!!
Please read the [instruction document](https://github.com/xuexiangjys/XUI/wiki) carefully before use, important things are to be repeated for three time!!

## 关于我
## About me

[![github](https://img.shields.io/badge/GitHub-xuexiangjys-blue.svg)](https://github.com/xuexiangjys) [![csdn](https://img.shields.io/badge/CSDN-xuexiangjys-green.svg)](http://blog.csdn.net/xuexiangjys) [![简书](https://img.shields.io/badge/简书-xuexiangjys-red.svg)](https://www.jianshu.com/u/6bf605575337) [![掘金](https://img.shields.io/badge/掘金-xuexiangjys-brightgreen.svg)](https://juejin.im/user/598feef55188257d592e56ed) [![知乎](https://img.shields.io/badge/知乎-xuexiangjys-violet.svg)](https://www.zhihu.com/people/xuexiangjys)

## X系列库快速集成
## Rapid integration of X-Library

为了方便大家快速集成X系列框架库,我提供了一个空壳模版供大家参考使用: [https://github.com/xuexiangjys/TemplateAppProject](https://github.com/xuexiangjys/TemplateAppProject)
In order to facilitate the rapid integration of X-Library, I provide a template project for your reference: [https://github.com/xuexiangjys/TemplateAppProject](https://github.com/xuexiangjys/TemplateAppProject)

In addition, I have also produced several [video tutorials](https://space.bilibili.com/483850585/channel/detail?cid=104998) for your reference.

----

## 特征
## Features

* Simple and elegant,the total size of the project library is less than 1M (about 644k after packaging).

* Rich components,provides the vast majority of our developers in common functional components.

* 简洁优雅,尽可能少得引用资源文件的数量,项目库整体大小不足1M(打包后大约644k)
* 组件丰富,提供了绝大多数我们在开发者常用的功能组件。
* 使用简单,为方便快速开发,提高开发效率,对api进行了优化,提供一键式接入。
* 样式统一,框架提供了一系列统一的样式,使UI整体看上去美观和谐。
* 兼容性高,框架还提供了3种不同尺寸设备的样式(4.5英寸、7英寸和10英寸),并且最低兼容到Android 17, 让UI兼容性更强。
* 扩展性强,各组件提供了丰富的属性和样式API,可以通过设置不同的样式属性,构建不同风格的UI。
* Easy to use,in order to facilitate rapid development and improve development efficiency, the API is optimized to provide one click access.

* Uniform style,the framework provides a series of unified styles to make the UI look beautiful and harmonious.

* High compatibility,the framework also provides three different sizes of device styles (4.5 inch, 7 inch and 10 inch) and is compatible with Android 17 at least, which makes UI compatibility stronger.

* Strong expansibility,each component provides rich properties and style APIs, and different styles of UI can be built by setting different style properties.

----

## 如何使用
## Usage

> 在决定使用XUI前,你必须明确的一点是,此框架给出的是一整套UI的整体解决方案,如果你只是想使用其中的几个控件,那大可不必引入如此庞大的一个UI库,Github上会有更好的组件库。如果你是想拥有一套可以定制的、统一的UI整体解决方案的话,那么你就继续往下看吧!
> Before you consider using XUI, you must be clear that this framework provides a whole set of UI solutions. If you just want to use a few of them, you don't need to introduce such a huge UI library. You can find better component libraries on GitHub. If you want to have a customized, unified UI overall solution, then you can continue to look!
### 添加Gradle依赖
### Add gradle dependency

1.In the project root directory `build.gradle`:

1.先在项目根目录的 build.gradle 的 repositories 添加:
```
allprojects {
repositories {
Expand All @@ -51,13 +65,13 @@ allprojects {
}
```

2.然后在dependencies添加:
2.Then, in the dependencies of the project:

```
dependencies {
...
//androidx项目
implementation 'com.github.xuexiangjys:XUI:1.1.5'
//androidx project
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Expand All @@ -66,12 +80,12 @@ dependencies {
}
```

注意】如果你的项目目前还未使用androidx,请使用如下配置:
Note】If your project does not currently use `androidx`, please use the following configuration:

```
dependencies {
...
//support项目
//support project
implementation 'com.github.xuexiangjys:XUI:1.0.9-support'
implementation 'com.android.support:appcompat-v7:28.0.0'
Expand All @@ -81,38 +95,31 @@ dependencies {
}
```

### 初始化XUI设置
### Initialization

1.在Application最顶部初始化设置(必须)
1.Modify the basic theme of the application (required)

```
XUI.init(this); //初始化UI框架
XUI.debug(true); //开启UI框架调试日志
> The basic theme of the application must be set, otherwise the component will not work normally! It is very important to ensure that the theme of all windows using XUI components is a subclass of `XUITheme`!!!
```
Basic topic type:

2.调整应用的基础主题(必须)
* Large flat plate(10 inches, 240dpi, 1920*1200):XUITheme.Tablet.Big

> 必须设置应用的基础主题,否则组件将无法正常使用!必须保证所有用到XUI组件的窗口的主题都为XUITheme的子类,这非常重要!!!
* Small plate(7 inches, 320dpi, 1920*1200):XUITheme.Tablet.Small

基础主题类型:

* 大平板(10英寸, 240dpi, 1920*1200):XUITheme.Tablet.Big

* 小平板(7英寸, 320dpi, 1920*1200):XUITheme.Tablet.Small

* 手机(4.5英寸, 320dpi, 720*1280):XUITheme.Phone
* Mobile phone(4.5 inches, 320dpi, 720*1280):XUITheme.Phone

```
<style name="AppTheme" parent="XUITheme.Phone">

 <!-- 自定义自己的主题样式 -->


 <!-- Customize your own theme style -->

<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

</style>
```
当然也可以在Activity刚开始时调用如下代码动态设置主题

Of course, you can also call the following code at the beginning of the `Activity` to set the theme dynamically.

```
@Override
Expand All @@ -123,62 +130,73 @@ protected void onCreate(Bundle savedInstanceState) {
}
```

3.调整字体库(对字体无要求的可省略)
2.Adjust font library (omit if there is no requirement for font)

(1)Set the font library path you need to modify (under assets)

(1)设置你需要修改的字体库路径(assets下)
```
//设置默认字体为华文行楷,这里写你的字体库
// Set the default font to Chinese line Kai, write your font library here
XUI.getInstance().initFontStyle("fonts/hwxk.ttf");
```

(2)在项目的基础Activity中加入如下代码注入字体.
(2)Add the following code to the basic activity of the project to inject fonts

Note: after version 1.1.4, use the following settings for injection

注意:1.1.4版本之后使用如下设置注入
```
@Override
protected void attachBaseContext(Context newBase) {
//注入字体
// Injection font
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
}
```

注意:1.1.3版本及之前的版本使用如下设置注入
Note: versions 1.1.3 and earlier use the following settings for injection

```
@Override
protected void attachBaseContext(Context newBase) {
//注入字体
// Injection font
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
```

## 混淆配置
## Proguard

```
-keep class com.xuexiang.xui.widget.edittext.materialedittext.** { *; }
```

----
### Demo download

> The demo program is about 18M (mainly because the demo integrates a small video shooting library, which is about 13M, while XUI library is only 644k in size). The project is relatively large, and dandelion is recommended to download.
![xui_size.png](https://img.rruu.net/image/5f7d8400bf84f)

### Demo下载
#### Pgyer Download

> 演示程序大概18M(主要是demo中集成了一个小视频拍摄的库比较大,大约13M左右,而XUI库目前只有644k大小),项目比较大,推荐使用蒲公英下载。
> Pgyer Download password: xuexiangjys
#### 蒲公英下载
[![Pgyer](https://img.shields.io/badge/downloads-pgyer-blue.svg)](https://www.pgyer.com/XUIDemo)

[![蒲公英](https://img.shields.io/badge/downloads-蒲公英-blue.svg)](https://www.pgyer.com/XUIDemo)
![download_pugongying.png](https://img.rruu.net/image/5f7d827de5af4)

#### Github下载
#### Github Download

[![Github](https://img.shields.io/badge/downloads-Github-blue.svg)](https://github.com/xuexiangjys/XUI/blob/master/apk/xuidemo.apk?raw=true)

## 特别感谢
![download_github.png](https://img.rruu.net/image/5f7d827d5d755)

## Thanks

* [QMUI_Android](https://github.com/Tencent/QMUI_Android)
* [AgentWeb](https://github.com/Justson/AgentWeb)
* [Android-Iconics](https://github.com/mikepenz/Android-Iconics)
* [Android-PickerView](https://github.com/Bigkoo/Android-PickerView)
* [CityPicker](https://github.com/xuexiangjys/CityPicker)
* [ELinkageScroll](https://github.com/MFC-TEC/ELinkageScroll)
* [FlycoBanner_Master](https://github.com/H07000223/FlycoBanner_Master)
* [Linkage-RecyclerView](https://github.com/KunMinX/Linkage-RecyclerView)
* [MaterialEditText](https://github.com/rengwuxian/MaterialEditText)
Expand All @@ -190,6 +208,10 @@ protected void attachBaseContext(Context newBase) {
* [SlideBack](https://github.com/ParfoisMeng/SlideBack)
* [SwipeRecyclerView](https://github.com/yanzhenjie/SwipeRecyclerView)

## 联系方式
## Contact

[![](https://img.shields.io/badge/XUIGroup1-695048677-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=a2ab505862c81f1528416b585832022e835ce0abe28eefa4b0d53f8094a5691d)

[![](https://img.shields.io/badge/XUIGroup2-700246750-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=39497f13d5e456d219be785361a282d2d9c8cd9ba7745f6170def9d90643e164)

[![](https://img.shields.io/badge/点击一键加入QQ交流群-695048677-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=a2ab505862c81f1528416b585832022e835ce0abe28eefa4b0d53f8094a5691d)
![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ org.gradle.jvmargs=-Xmx1536m

# 是否打包APK
isNeedPackage=false
# 是否使用booster优化APK,这里需要注意gradle的版本,对于最新的gradle版本可能存在兼容问题
isUseBooster=false
android.precompileDependenciesResources=false

# 表示主工程使用AndroidX形式
android.useAndroidX=true
Expand All @@ -22,3 +25,4 @@ android.enableJetifier=true

android.enableD8=true


6 changes: 3 additions & 3 deletions jsonapi/update_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"UpdateStatus": 1,
"VersionCode": 17,
"VersionName": "1.1.6",
"UploadTime": "2020-12-31 01:00:00",
"UploadTime": "2021-01-01 17:00:00",
"ModifyContent": "\r\n1、修复部分已知问题。\n2、优化了部分组件功能。\n3、新增更多使用演示。",
"DownloadUrl": "https://xuexiangjys.oss-cn-shanghai.aliyuncs.com/apk/xuidemo.apk",
"ApkSize": 12677,
"ApkMd5": "256DF928FED3835C5B2833234E494C07"
"ApkSize": 13490,
"ApkMd5": "4FCCDF86DB448C5C722D9CF7A508DE28"
}
34 changes: 34 additions & 0 deletions versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ def versions = [:]
versions.android_gradle_plugin = "3.6.1"
versions.android_maven_gradle_plugin = "2.0"
versions.gradle_bintray_plugin = "1.8.0"
versions.booster = "3.1.0"
versions.booster_all = "1.1.1"
versions.support = "28.0.0"
versions.androidx = "1.1.0"
versions.junit = "4.12"
Expand Down Expand Up @@ -59,6 +61,38 @@ deps.rxbinding = "com.jakewharton.rxbinding2:rxbinding:$versions.rxbinding"
deps.gson = "com.google.code.gson:gson:$versions.gson"
deps.okhttp3 = "com.squareup.okhttp3:okhttp:$versions.okhttp3"

def booster = [:]
booster.gradle_plugin = "com.didiglobal.booster:booster-gradle-plugin:$versions.booster"
booster.task_all = "com.didiglobal.booster:booster-task-all:$versions.booster_all"
booster.transform_all = "com.didiglobal.booster:booster-transform-all:$versions.booster_all"
//采用 cwebp 对资源进行压缩
booster.task_compression_cwebp = "com.didiglobal.booster:booster-task-compression-cwebp:$versions.booster"
//采用 pngquant 对资源进行压缩
booster.task_compression_pngquant = "com.didiglobal.booster:booster-task-compression-pngquant:$versions.booster"
//ap_ 文件压缩
booster.task_processed_res = "com.didiglobal.booster:booster-task-compression-processed-res:$versions.booster"
//去冗余资源
booster.task_resource_deredundancy = "com.didiglobal.booster:booster-task-resource-deredundancy:$versions.booster"
//检查 SNAPSHOT 版本
booster.task_check_snapshot = "com.didiglobal.booster:booster-task-check-snapshot:$versions.booster"
//性能瓶颈检测
booster.transform_lint = "com.didiglobal.booster:booster-transform-lint:$versions.booster"
//多线程优化
booster.transform_thread = "com.didiglobal.booster:booster-transform-thread:$versions.booster"
//资源索引内联
booster.transform_r_inline = "com.didiglobal.booster:booster-transform-r-inline:$versions.booster"
//WebView 预加载
booster.transform_webview = "com.didiglobal.booster:booster-transform-webview:$versions.booster"
//SharedPreferences 优化
booster.transform_shared_preferences = "com.didiglobal.booster:booster-transform-shared-preferences:$versions.booster"
//检查覆盖安装导致的 Resources 和 Assets 未加载的 Bug
booster.transform_res_check = "com.didiglobal.booster:booster-transform-res-check:$versions.booster"
//修复 Toast 在 Android 7.1 上的 Bug
booster.transform_toast = "com.didiglobal.booster:booster-transform-toast:$versions.booster"
//处理系统 Crash
booster.transform_activity_thread = "com.didiglobal.booster:booster-transform-activity-thread:$versions.booster"
deps.booster = booster

ext.deps = deps

def build_versions = [:]
Expand Down
Loading

0 comments on commit 607c17c

Please sign in to comment.