Skip to content

Commit cc65289

Browse files
authored
Merge pull request #100 from xuexiangjys/dev/1.1.7
Dev/1.1.7
2 parents 52d7783 + f0a1823 commit cc65289

File tree

63 files changed

+1686
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1686
-202
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://cdn.jsdelivr.net/gh/BugF/IMG/2020/10/05/5f7b2469a6676.png" width="388" height="321" alt="Banner" />
2+
<img src="https://img.rruu.net/image/5f7d85cab3e43" width="388" height="321" alt="Banner" />
33
</p>
44

55
# XUI
@@ -74,7 +74,7 @@ allprojects {
7474
dependencies {
7575
...
7676
//androidx project
77-
implementation 'com.github.xuexiangjys:XUI:1.1.6'
77+
implementation 'com.github.xuexiangjys:XUI:1.1.7'
7878
7979
implementation 'androidx.appcompat:appcompat:1.1.0'
8080
implementation 'androidx.recyclerview:recyclerview:1.1.0'
@@ -209,6 +209,20 @@ protected void attachBaseContext(Context newBase) {
209209

210210
![download_github.png](https://img.rruu.net/image/5f7d827d5d755)
211211

212+
## Contribution
213+
214+
> Due to my limited energy, you are welcome to actively contribute your idea. You will have the opportunity to participate in the maintenance of star over 1000 projects on GitHub and enhance your industry influence!
215+
216+
Code contribution requirements:
217+
218+
* Please keep the existing code style, not according to your habits. Please comply with Alibaba java coding specification.
219+
220+
* Just modify the code you are sure need to be optimized, not all the different code from your ideas.
221+
222+
* Before launching a pull request, you should test your commit code adequately.
223+
224+
* Please commit new code to the dev branch instead of the master branch.
225+
212226
## Thanks
213227

214228
* [QMUI_Android](https://github.com/Tencent/QMUI_Android)
@@ -280,11 +294,26 @@ B*G | 1¥ | WeChat
280294
**俊 | 80¥ | Alipay
281295
*尋 | 10.24¥ | WeChat
282296
爱生活 | 100¥ | QQ
297+
*茶 | 100¥ | WeChat
298+
*头 | 2¥ | WeChat
299+
*噜 | 10.99¥ | WeChat
300+
*W*m | 10¥ | WeChat
301+
*谷 | 10¥ | WeChat
302+
*望 | 5¥ | WeChat
303+
J*o | 10.24¥ | WeChat
304+
*休 | 10.24¥ | WeChat
305+
**俊 | 80¥ | Alipay
306+
**伟 | 1.1¥ | Alipay
307+
**云 | 5¥ | Alipay
308+
*航 | 3¥ | Alipay
309+
*维 | 5¥ | WeChat
283310

284311
## Contact
285312

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

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

317+
[![](https://img.shields.io/badge/XUIGroup3-1090612354-blue.svg)](https://qm.qq.com/cgi-bin/qm/qr?k=nOY3GGJY-jiwzhQpR8E06G-yrOUsxCP1)
318+
290319
![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)

README_ZH.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://cdn.jsdelivr.net/gh/BugF/IMG/2020/10/05/5f7b2469a6676.png" width="388" height="321" alt="Banner" />
2+
<img src="https://img.rruu.net/image/5f7d85cab3e43" width="388" height="321" alt="Banner" />
33
</p>
44

55
# XUI
@@ -72,7 +72,7 @@ allprojects {
7272
dependencies {
7373
...
7474
//androidx项目
75-
implementation 'com.github.xuexiangjys:XUI:1.1.6'
75+
implementation 'com.github.xuexiangjys:XUI:1.1.7'
7676
7777
implementation 'androidx.appcompat:appcompat:1.1.0'
7878
implementation 'androidx.recyclerview:recyclerview:1.1.0'
@@ -203,6 +203,20 @@ protected void attachBaseContext(Context newBase) {
203203

204204
![download_github.png](https://img.rruu.net/image/5f7d827d5d755)
205205

206+
## 贡献代码
207+
208+
> 由于本人精力有限,现欢迎大家踊跃贡献自己的idea,你将有机会参与到github上star过千项目的维护中,提升自己的行业影响力!
209+
210+
代码贡献要求:
211+
212+
* 请保持现有的代码样式,而不是根据您的习惯。请遵守阿里巴巴Java编码规范。
213+
214+
* 只需修改你确定需要优化的代码,而不是所有与你想法不同的代码。
215+
216+
* 在启动pull请求之前,应该充分测试提交代码。
217+
218+
* 请将新代码提交到dev分支,而不是主分支。
219+
206220
## 特别感谢
207221

208222
* [QMUI_Android](https://github.com/Tencent/QMUI_Android)
@@ -274,11 +288,26 @@ B*G | 1¥ | 微信
274288
**俊 | 80¥ | 支付宝
275289
*尋 | 10.24¥ | 微信
276290
爱生活 | 100¥ | QQ
291+
*茶 | 100¥ | 微信
292+
*头 | 2¥ | 微信
293+
*噜 | 10.99¥ | 微信
294+
*W*m | 10¥ | 微信
295+
*谷 | 10¥ | 微信
296+
*望 | 5¥ | 微信
297+
J*o | 10.24¥ | 微信
298+
*休 | 10.24¥ | 微信
299+
**俊 | 80¥ | 支付宝
300+
**伟 | 1.1¥ | 支付宝
301+
**云 | 5¥ | 支付宝
302+
*航 | 3¥ | 支付宝
303+
*维 | 5¥ | 微信
277304

278305
## 联系方式
279306

280307
[![](https://img.shields.io/badge/XUI开源交流群-695048677-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=a2ab505862c81f1528416b585832022e835ce0abe28eefa4b0d53f8094a5691d)
281308

282309
[![](https://img.shields.io/badge/XUI开源交流2群-700246750-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=39497f13d5e456d219be785361a282d2d9c8cd9ba7745f6170def9d90643e164)
283310

311+
[![](https://img.shields.io/badge/XUI开源交流3群-1090612354-blue.svg)](https://qm.qq.com/cgi-bin/qm/qr?k=nOY3GGJY-jiwzhQpR8E06G-yrOUsxCP1)
312+
284313
![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)

app/build.gradle

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId "com.xuexiang.xuidemo"
1515
minSdkVersion 17
1616
targetSdkVersion build_versions.target_sdk
17-
versionCode 17
18-
versionName "1.1.6"
17+
versionCode 18
18+
versionName "1.1.7"
1919

2020
multiDexEnabled true
2121
vectorDrawables.useSupportLibrary = true
@@ -103,8 +103,8 @@ dependencies {
103103
implementation 'com.github.bumptech.glide:glide:4.11.0'
104104

105105
//XUI框架
106-
// implementation project(':xui_lib')
107-
implementation 'com.github.xuexiangjys:XUI:1.1.6'
106+
implementation project(':xui_lib')
107+
// implementation 'com.github.xuexiangjys:XUI:1.1.6'
108108
// implementation 'com.qmuiteam:qmui:1.2.0'
109109

110110
//工具类
@@ -116,15 +116,13 @@ dependencies {
116116
implementation 'com.github.xuexiangjys.XRouter:xrouter-runtime:1.0.1'
117117
annotationProcessor 'com.github.xuexiangjys.XRouter:xrouter-compiler:1.0.1'
118118
//XPage页面框架
119-
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.0.3'
119+
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
120120
annotationProcessor project(':widget_compiler')
121121
//ButterKnife
122122
implementation deps.butterknife.runtime
123123
annotationProcessor deps.butterknife.compiler
124-
//如果开启了内存泄漏监测leak,就需要加上这个依赖
125-
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
126-
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
127-
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
124+
// LeakCanary内存泄漏检测
125+
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
128126

129127
//弹性布局
130128
implementation 'com.google.android:flexbox:0.3.1'
@@ -199,22 +197,23 @@ dependencies {
199197
implementation 'com.alibaba.android:ultraviewpager:1.0.7.8'
200198
implementation 'com.alibaba.android:tangram:3.3.6'
201199
//版本更新
202-
implementation 'com.github.xuexiangjys:XUpdate:2.0.6'
200+
implementation 'com.github.xuexiangjys:XUpdate:2.0.7'
203201
implementation 'com.zhy:okhttputils:2.6.2'
204202
implementation deps.gson
205203
implementation deps.okhttp3
206204
//腾讯的键值对存储mmkv
207205
implementation 'com.tencent:mmkv:1.0.22'
208206
//腾讯x5TBS
209207
implementation 'com.tencent.tbs.tbssdk:sdk:43967'
210-
208+
//富文本
209+
implementation 'com.zzhoujay.richtext:richtext:3.0.8'
211210

212211
//双列表联动
213212
implementation 'com.kunminx.linkage:linkage-recyclerview:1.9.2'
214213

215214
//umeng统计
216-
implementation 'com.umeng.umsdk:analytics:8.0.2'
217-
implementation 'com.umeng.umsdk:common:2.0.2'
215+
implementation 'com.umeng.umsdk:analytics:8.1.4'
216+
implementation 'com.umeng.umsdk:common:2.1.8'
218217

219218
//ANR异常捕获
220219
implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'

app/proguard-rules.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218

219219
# xpage
220220
-keep class com.xuexiang.xpage.annotation.** { *; }
221+
-keep class com.xuexiang.xpage.config.** { *; }
221222

222223
# xaop
223224
-keep @com.xuexiang.xaop.annotation.* class * {*;}

app/src/main/java/com/xuexiang/xuidemo/activity/MainActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.xuexiang.xuidemo.utils.TokenUtils;
3737
import com.xuexiang.xuidemo.utils.Utils;
3838
import com.xuexiang.xuidemo.utils.XToastUtils;
39+
import com.xuexiang.xuidemo.widget.GuideTipsDialog;
3940
import com.xuexiang.xutil.common.ClickUtils;
4041
import com.xuexiang.xutil.system.DeviceUtils;
4142
import com.yarolegovich.slidingrootnav.SlideGravity;
@@ -85,6 +86,8 @@ protected void onCreate(Bundle savedInstanceState) {
8586
initSlidingMenu(savedInstanceState);
8687

8788
initViews();
89+
90+
GuideTipsDialog.showTips(this);
8891
}
8992

9093
private void initData() {

app/src/main/java/com/xuexiang/xuidemo/adapter/NewsListAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.xuexiang.xui.widget.imageview.RadiusImageView;
66
import com.xuexiang.xuidemo.DemoDataProvider;
77
import com.xuexiang.xuidemo.R;
8-
import com.xuexiang.xuidemo.adapter.base.BroccoliRecyclerAdapter;
8+
import com.xuexiang.xuidemo.adapter.base.broccoli.BroccoliRecyclerAdapter;
99
import com.xuexiang.xuidemo.adapter.entity.NewInfo;
1010
import com.xuexiang.xuidemo.utils.PlaceholderHelper;
1111

app/src/main/java/com/xuexiang/xuidemo/adapter/base/BroccoliRecyclerAdapter.java renamed to app/src/main/java/com/xuexiang/xuidemo/adapter/base/broccoli/BroccoliRecyclerAdapter.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
package com.xuexiang.xuidemo.adapter.base;
1+
/*
2+
* Copyright (C) 2021 xuexiangjys(xuexiangjys@163.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.xuexiang.xuidemo.adapter.base.broccoli;
219

320
import android.view.View;
421

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Copyright (C) 2021 xuexiangjys(xuexiangjys@163.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.xuexiang.xuidemo.adapter.base.broccoli;
19+
20+
import android.view.View;
21+
22+
import androidx.annotation.NonNull;
23+
24+
import com.alibaba.android.vlayout.LayoutHelper;
25+
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
26+
import com.xuexiang.xuidemo.adapter.base.delegate.SimpleDelegateAdapter;
27+
import com.xuexiang.xuidemo.adapter.base.delegate.XDelegateAdapter;
28+
29+
import java.util.Collection;
30+
import java.util.HashMap;
31+
import java.util.Map;
32+
33+
import me.samlss.broccoli.Broccoli;
34+
35+
/**
36+
* 使用Broccoli占位的基础适配器
37+
*
38+
* @author xuexiang
39+
* @since 2021/1/9 4:52 PM
40+
*/
41+
public abstract class BroccoliSimpleDelegateAdapter<T> extends SimpleDelegateAdapter<T> {
42+
43+
/**
44+
* 是否已经加载成功
45+
*/
46+
private boolean mHasLoad = false;
47+
private Map<View, Broccoli> mBroccoliMap = new HashMap<>();
48+
49+
public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper) {
50+
super(layoutId, layoutHelper);
51+
}
52+
53+
public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper, Collection<T> list) {
54+
super(layoutId, layoutHelper, list);
55+
}
56+
57+
public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper, T[] data) {
58+
super(layoutId, layoutHelper, data);
59+
}
60+
61+
@Override
62+
protected void bindData(@NonNull RecyclerViewHolder holder, int position, T item) {
63+
Broccoli broccoli = mBroccoliMap.get(holder.itemView);
64+
if (broccoli == null) {
65+
broccoli = new Broccoli();
66+
mBroccoliMap.put(holder.itemView, broccoli);
67+
}
68+
if (mHasLoad) {
69+
broccoli.removeAllPlaceholders();
70+
71+
onBindData(holder, item, position);
72+
} else {
73+
onBindBroccoli(holder, broccoli);
74+
broccoli.show();
75+
}
76+
}
77+
78+
79+
/**
80+
* 绑定控件
81+
*
82+
* @param holder
83+
* @param model
84+
* @param position
85+
*/
86+
protected abstract void onBindData(RecyclerViewHolder holder, T model, int position);
87+
88+
/**
89+
* 绑定占位控件
90+
*
91+
* @param holder
92+
* @param broccoli
93+
*/
94+
protected abstract void onBindBroccoli(RecyclerViewHolder holder, Broccoli broccoli);
95+
96+
@Override
97+
public XDelegateAdapter refresh(Collection<T> collection) {
98+
mHasLoad = true;
99+
return super.refresh(collection);
100+
}
101+
102+
/**
103+
* 资源释放,防止内存泄漏
104+
*/
105+
public void recycle() {
106+
for (Broccoli broccoli : mBroccoliMap.values()) {
107+
broccoli.removeAllPlaceholders();
108+
}
109+
mBroccoliMap.clear();
110+
clear();
111+
}
112+
}

0 commit comments

Comments
 (0)