Skip to content

Commit

Permalink
Merge pull request #100 from xuexiangjys/dev/1.1.7
Browse files Browse the repository at this point in the history
Dev/1.1.7
  • Loading branch information
xuexiangjys committed May 6, 2021
2 parents 52d7783 + f0a1823 commit cc65289
Show file tree
Hide file tree
Showing 63 changed files with 1,686 additions and 202 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://cdn.jsdelivr.net/gh/BugF/IMG/2020/10/05/5f7b2469a6676.png" width="388" height="321" alt="Banner" />
<img src="https://img.rruu.net/image/5f7d85cab3e43" width="388" height="321" alt="Banner" />
</p>

# XUI
Expand Down Expand Up @@ -74,7 +74,7 @@ allprojects {
dependencies {
...
//androidx project
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation 'com.github.xuexiangjys:XUI:1.1.7'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Expand Down Expand Up @@ -209,6 +209,20 @@ protected void attachBaseContext(Context newBase) {

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

## Contribution

> 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!
Code contribution requirements:

* Please keep the existing code style, not according to your habits. Please comply with Alibaba java coding specification.

* Just modify the code you are sure need to be optimized, not all the different code from your ideas.

* Before launching a pull request, you should test your commit code adequately.

* Please commit new code to the dev branch instead of the master branch.

## Thanks

* [QMUI_Android](https://github.com/Tencent/QMUI_Android)
Expand Down Expand Up @@ -280,11 +294,26 @@ B*G | 1¥ | WeChat
**俊 | 80¥ | Alipay
*尋 | 10.24¥ | WeChat
爱生活 | 100¥ | QQ
*茶 | 100¥ | WeChat
*头 | 2¥ | WeChat
*噜 | 10.99¥ | WeChat
*W*m | 10¥ | WeChat
*谷 | 10¥ | WeChat
*望 | 5¥ | WeChat
J*o | 10.24¥ | WeChat
*休 | 10.24¥ | WeChat
**俊 | 80¥ | Alipay
**伟 | 1.1¥ | Alipay
**云 | 5¥ | Alipay
*航 | 3¥ | Alipay
*维 | 5¥ | WeChat

## 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/XUIGroup3-1090612354-blue.svg)](https://qm.qq.com/cgi-bin/qm/qr?k=nOY3GGJY-jiwzhQpR8E06G-yrOUsxCP1)

![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)
33 changes: 31 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://cdn.jsdelivr.net/gh/BugF/IMG/2020/10/05/5f7b2469a6676.png" width="388" height="321" alt="Banner" />
<img src="https://img.rruu.net/image/5f7d85cab3e43" width="388" height="321" alt="Banner" />
</p>

# XUI
Expand Down Expand Up @@ -72,7 +72,7 @@ allprojects {
dependencies {
...
//androidx项目
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation 'com.github.xuexiangjys:XUI:1.1.7'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Expand Down Expand Up @@ -203,6 +203,20 @@ protected void attachBaseContext(Context newBase) {

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

## 贡献代码

> 由于本人精力有限,现欢迎大家踊跃贡献自己的idea,你将有机会参与到github上star过千项目的维护中,提升自己的行业影响力!
代码贡献要求:

* 请保持现有的代码样式,而不是根据您的习惯。请遵守阿里巴巴Java编码规范。

* 只需修改你确定需要优化的代码,而不是所有与你想法不同的代码。

* 在启动pull请求之前,应该充分测试提交代码。

* 请将新代码提交到dev分支,而不是主分支。

## 特别感谢

* [QMUI_Android](https://github.com/Tencent/QMUI_Android)
Expand Down Expand Up @@ -274,11 +288,26 @@ B*G | 1¥ | 微信
**俊 | 80¥ | 支付宝
*尋 | 10.24¥ | 微信
爱生活 | 100¥ | QQ
*茶 | 100¥ | 微信
*头 | 2¥ | 微信
*噜 | 10.99¥ | 微信
*W*m | 10¥ | 微信
*谷 | 10¥ | 微信
*望 | 5¥ | 微信
J*o | 10.24¥ | 微信
*休 | 10.24¥ | 微信
**俊 | 80¥ | 支付宝
**伟 | 1.1¥ | 支付宝
**云 | 5¥ | 支付宝
*航 | 3¥ | 支付宝
*维 | 5¥ | 微信

## 联系方式

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

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

[![](https://img.shields.io/badge/XUI开源交流3群-1090612354-blue.svg)](https://qm.qq.com/cgi-bin/qm/qr?k=nOY3GGJY-jiwzhQpR8E06G-yrOUsxCP1)

![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)
25 changes: 12 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.xuexiang.xuidemo"
minSdkVersion 17
targetSdkVersion build_versions.target_sdk
versionCode 17
versionName "1.1.6"
versionCode 18
versionName "1.1.7"

multiDexEnabled true
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -103,8 +103,8 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'

//XUI框架
// implementation project(':xui_lib')
implementation 'com.github.xuexiangjys:XUI:1.1.6'
implementation project(':xui_lib')
// implementation 'com.github.xuexiangjys:XUI:1.1.6'
// implementation 'com.qmuiteam:qmui:1.2.0'

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

//弹性布局
implementation 'com.google.android:flexbox:0.3.1'
Expand Down Expand Up @@ -199,22 +197,23 @@ dependencies {
implementation 'com.alibaba.android:ultraviewpager:1.0.7.8'
implementation 'com.alibaba.android:tangram:3.3.6'
//版本更新
implementation 'com.github.xuexiangjys:XUpdate:2.0.6'
implementation 'com.github.xuexiangjys:XUpdate:2.0.7'
implementation 'com.zhy:okhttputils:2.6.2'
implementation deps.gson
implementation deps.okhttp3
//腾讯的键值对存储mmkv
implementation 'com.tencent:mmkv:1.0.22'
//腾讯x5TBS
implementation 'com.tencent.tbs.tbssdk:sdk:43967'

//富文本
implementation 'com.zzhoujay.richtext:richtext:3.0.8'

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

//umeng统计
implementation 'com.umeng.umsdk:analytics:8.0.2'
implementation 'com.umeng.umsdk:common:2.0.2'
implementation 'com.umeng.umsdk:analytics:8.1.4'
implementation 'com.umeng.umsdk:common:2.1.8'

//ANR异常捕获
implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'
Expand Down
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@

# xpage
-keep class com.xuexiang.xpage.annotation.** { *; }
-keep class com.xuexiang.xpage.config.** { *; }

# xaop
-keep @com.xuexiang.xaop.annotation.* class * {*;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.xuexiang.xuidemo.utils.TokenUtils;
import com.xuexiang.xuidemo.utils.Utils;
import com.xuexiang.xuidemo.utils.XToastUtils;
import com.xuexiang.xuidemo.widget.GuideTipsDialog;
import com.xuexiang.xutil.common.ClickUtils;
import com.xuexiang.xutil.system.DeviceUtils;
import com.yarolegovich.slidingrootnav.SlideGravity;
Expand Down Expand Up @@ -85,6 +86,8 @@ protected void onCreate(Bundle savedInstanceState) {
initSlidingMenu(savedInstanceState);

initViews();

GuideTipsDialog.showTips(this);
}

private void initData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.xuexiang.xui.widget.imageview.RadiusImageView;
import com.xuexiang.xuidemo.DemoDataProvider;
import com.xuexiang.xuidemo.R;
import com.xuexiang.xuidemo.adapter.base.BroccoliRecyclerAdapter;
import com.xuexiang.xuidemo.adapter.base.broccoli.BroccoliRecyclerAdapter;
import com.xuexiang.xuidemo.adapter.entity.NewInfo;
import com.xuexiang.xuidemo.utils.PlaceholderHelper;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
package com.xuexiang.xuidemo.adapter.base;
/*
* Copyright (C) 2021 xuexiangjys([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.xuexiang.xuidemo.adapter.base.broccoli;

import android.view.View;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright (C) 2021 xuexiangjys([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.xuexiang.xuidemo.adapter.base.broccoli;

import android.view.View;

import androidx.annotation.NonNull;

import com.alibaba.android.vlayout.LayoutHelper;
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
import com.xuexiang.xuidemo.adapter.base.delegate.SimpleDelegateAdapter;
import com.xuexiang.xuidemo.adapter.base.delegate.XDelegateAdapter;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import me.samlss.broccoli.Broccoli;

/**
* 使用Broccoli占位的基础适配器
*
* @author xuexiang
* @since 2021/1/9 4:52 PM
*/
public abstract class BroccoliSimpleDelegateAdapter<T> extends SimpleDelegateAdapter<T> {

/**
* 是否已经加载成功
*/
private boolean mHasLoad = false;
private Map<View, Broccoli> mBroccoliMap = new HashMap<>();

public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper) {
super(layoutId, layoutHelper);
}

public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper, Collection<T> list) {
super(layoutId, layoutHelper, list);
}

public BroccoliSimpleDelegateAdapter(int layoutId, LayoutHelper layoutHelper, T[] data) {
super(layoutId, layoutHelper, data);
}

@Override
protected void bindData(@NonNull RecyclerViewHolder holder, int position, T item) {
Broccoli broccoli = mBroccoliMap.get(holder.itemView);
if (broccoli == null) {
broccoli = new Broccoli();
mBroccoliMap.put(holder.itemView, broccoli);
}
if (mHasLoad) {
broccoli.removeAllPlaceholders();

onBindData(holder, item, position);
} else {
onBindBroccoli(holder, broccoli);
broccoli.show();
}
}


/**
* 绑定控件
*
* @param holder
* @param model
* @param position
*/
protected abstract void onBindData(RecyclerViewHolder holder, T model, int position);

/**
* 绑定占位控件
*
* @param holder
* @param broccoli
*/
protected abstract void onBindBroccoli(RecyclerViewHolder holder, Broccoli broccoli);

@Override
public XDelegateAdapter refresh(Collection<T> collection) {
mHasLoad = true;
return super.refresh(collection);
}

/**
* 资源释放,防止内存泄漏
*/
public void recycle() {
for (Broccoli broccoli : mBroccoliMap.values()) {
broccoli.removeAllPlaceholders();
}
mBroccoliMap.clear();
clear();
}
}
Loading

0 comments on commit cc65289

Please sign in to comment.