Skip to content

Commit b3f2218

Browse files
author
tff
committed
update app core
1 parent 594cd0d commit b3f2218

File tree

80 files changed

+2448
-65
lines changed

Some content is hidden

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

80 files changed

+2448
-65
lines changed

Diff for: app/andfun/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ dependencies {
1919
implementation project(path: ':modules:mAbout')
2020
implementation project(path: ':modules:mSetting')
2121
implementation project(path: ':modules:mArticle')
22-
22+
implementation project(path: ':modules:mScan')
2323
}

Diff for: app/andfun/src/main/java/com/thomas/andfun/SplashActivity.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,10 @@ public void initView(@Nullable Bundle savedInstanceState, @Nullable View content
4040

4141
@Override
4242
public void doBusiness() {
43-
lottieSplash.addLottieOnCompositionLoadedListener(new LottieOnCompositionLoadedListener() {
44-
@Override
45-
public void onCompositionLoaded(LottieComposition composition) {
46-
Utils.runOnUiThreadDelayed(() -> {
47-
ARouterHelper.startActivity(RouterHub.ROUTER_HOME);
48-
ActivityUtils.finishActivity(mActivity);
49-
}, lottieSplash.getDuration() * 2);
50-
}
51-
});
43+
lottieSplash.addLottieOnCompositionLoadedListener(composition -> Utils.runOnUiThreadDelayed(() -> {
44+
ARouterHelper.startActivity(RouterHub.ROUTER_HOME);
45+
ActivityUtils.finishActivity(mActivity);
46+
}, lottieSplash.getDuration() * 2));
5247

5348

5449
}

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
google()
1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.5.2'
13+
classpath 'com.android.tools.build:gradle:3.5.3'
1414
classpath "com.alibaba:arouter-register:1.0.2"
1515
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.0'
1616
// NOTE: Do not place your application dependencies here; they belong

Diff for: config.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ext {
2020
"material" : 'com.google.android.material:material:1.0.0',
2121
"palette" : 'androidx.palette:palette:1.0.0',
2222
"constraint-layout" : 'androidx.constraintlayout:constraintlayout:1.1.3',
23-
"recyclerview" : 'androidx.recyclerview:recyclerview:1.0.0',
23+
"recyclerview" : 'androidx.recyclerview:recyclerview:1.1.0',
2424
"annotations" : 'androidx.annotation:annotation:1.1.0',
2525
"multidex" : 'androidx.multidex:multidex:2.0.1',
2626

Diff for: gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ user_is_module=true
2424
setting_is_module=true
2525
about_is_module=true
2626
article_is_module=true
27-
27+
scan_is_module=true

Diff for: modules/mAbout/src/main/debug/AndroidManifest.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
android:name=".ui.AboutActivity"
2323
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|layoutDirection"
2424
android:screenOrientation="portrait"
25-
android:windowSoftInputMode="adjustPan|stateHidden" />
26-
27-
<!-- 在单独运行的业务Module的时候需要配置 测试 的BASE_URL -->
25+
android:windowSoftInputMode="adjustPan|stateHidden" /> <!-- 在单独运行的业务Module的时候需要配置 测试 的BASE_URL -->
2826
<!-- 在集成业务Module的时候去使用宿主配置的BASE_URL -->
2927
<meta-data
3028
android:name="base_url"

Diff for: modules/mAbout/src/main/java/com/thomas/andfun/about/ui/AboutActivity.java

+22-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
import androidx.annotation.NonNull;
77

88
import com.alibaba.android.arouter.facade.annotation.Route;
9+
import com.allen.library.SuperTextView;
910
import com.thomas.andfun.about.R;
1011
import com.thomas.andfun.about.R2;
1112
import com.thomas.core.utils.ActivityUtils;
1213
import com.thomas.res.widget.ThomasTitleBar;
13-
import com.thomas.service.RouterHub;
14+
import com.thomas.sdk.helper.ARouterHelper;
1415
import com.thomas.sdk.ui.ThomasActivity;
16+
import com.thomas.service.RouterHub;
1517

1618
import butterknife.BindView;
19+
import butterknife.ButterKnife;
1720

1821
/**
1922
* @author Thomas
@@ -27,6 +30,16 @@ public class AboutActivity extends ThomasActivity {
2730

2831
@BindView(R2.id.title_bar)
2932
ThomasTitleBar titleBar;
33+
@BindView(R2.id.btn_point)
34+
SuperTextView btnPoint;
35+
@BindView(R2.id.btn_web)
36+
SuperTextView btnWeb;
37+
@BindView(R2.id.btn_author)
38+
SuperTextView btnAuthor;
39+
@BindView(R2.id.btn_open)
40+
SuperTextView btnOpen;
41+
@BindView(R2.id.btn_app)
42+
SuperTextView btnApp;
3043

3144
@Override
3245
public boolean isNeedRegister() {
@@ -50,11 +63,19 @@ public void initView(Bundle savedInstanceState, View contentView) {
5063
ActivityUtils.finishActivity(mActivity);
5164
}
5265
});
66+
applyThomasClickListener(btnPoint, btnWeb, btnAuthor, btnOpen, btnApp);
5367
}
5468

5569
@Override
5670
public void doBusiness() {
5771

5872
}
5973

74+
@Override
75+
public void onThomasClick(@NonNull View view) {
76+
int clickId = view.getId();
77+
if (clickId == R.id.btn_point) {
78+
ARouterHelper.startActivity(RouterHub.ROUTER_RULES_INTEGRAL);
79+
}
80+
}
6081
}

Diff for: modules/mArticle/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ dependencies {
3535
implementation fileTree(dir: 'libs', include: ['*.jar'])
3636
implementation project(path: ':thomas:ThomasSDK')
3737
implementation 'com.just.agentweb:agentweb:4.1.2'
38+
implementation 'org.jsoup:jsoup:1.12.1'
3839
}

Diff for: modules/mArticle/src/main/debug/AndroidManifest.xml

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
android:roundIcon="@mipmap/ic_launcher_round"
1919
android:supportsRtl="true"
2020
android:theme="@style/thomas_AppTheme">
21+
<activity
22+
android:name=".ui.ResultActivity"
23+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|layoutDirection"
24+
android:screenOrientation="portrait"
25+
android:windowSoftInputMode="adjustPan|stateHidden" />
26+
<activity
27+
android:name=".ui.ShareArticleActivity"
28+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|layoutDirection"
29+
android:screenOrientation="portrait"
30+
android:windowSoftInputMode="adjustPan|stateHidden" />
2131
<activity
2232
android:name=".ui.SearchActivity"
2333
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|layoutDirection"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.thomas.andfun.article.action;
2+
3+
import com.thomas.sdk.delay.Action;
4+
import com.thomas.sdk.helper.ARouterHelper;
5+
import com.thomas.service.RouterHub;
6+
7+
/**
8+
* @author Thomas
9+
* @describe 跳转到分享的Action
10+
* @date 2019/10/24
11+
* @updatelog
12+
* @since
13+
*/
14+
public class SharedAction implements Action {
15+
@Override
16+
public void call() {
17+
ARouterHelper.startActivity(RouterHub.ROUTER_ARTICLE_SHARE);
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.thomas.andfun.article.adapter;
2+
3+
import android.graphics.Color;
4+
5+
import androidx.annotation.NonNull;
6+
import androidx.annotation.Nullable;
7+
import androidx.appcompat.widget.AppCompatTextView;
8+
9+
import com.chad.library.adapter.base.BaseQuickAdapter;
10+
import com.chad.library.adapter.base.BaseViewHolder;
11+
import com.thomas.andfun.article.R;
12+
import com.thomas.andfun.article.bean.HotKeyBean;
13+
14+
import java.util.List;
15+
import java.util.Random;
16+
17+
/**
18+
* @author Thomas
19+
* @describe
20+
* @date 2019/12/11
21+
* @updatelog
22+
* @since
23+
*/
24+
public class HotKeyAdapter extends BaseQuickAdapter<HotKeyBean, BaseViewHolder> {
25+
public HotKeyAdapter(@Nullable List<HotKeyBean> data) {
26+
super(R.layout.item_hot_key, data);
27+
}
28+
29+
@Override
30+
protected void convert(@NonNull BaseViewHolder helper, HotKeyBean item) {
31+
AppCompatTextView tvKey = helper.getView(R.id.tv_key);
32+
tvKey.setText(item.getName());
33+
Random random = new Random();
34+
int r = random.nextInt(256);
35+
int g = random.nextInt(256);
36+
int b = random.nextInt(256);
37+
tvKey.setTextColor(Color.rgb(r, g, b));
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.thomas.andfun.article.adapter;
2+
3+
import android.text.TextUtils;
4+
5+
import androidx.annotation.NonNull;
6+
import androidx.annotation.Nullable;
7+
import androidx.core.text.HtmlCompat;
8+
9+
import com.chad.library.adapter.base.BaseQuickAdapter;
10+
import com.chad.library.adapter.base.BaseViewHolder;
11+
import com.thomas.andfun.article.R;
12+
import com.thomas.andfun.article.bean.ResultBean;
13+
import com.thomas.sdk.helper.ImageHelper;
14+
15+
import java.util.List;
16+
17+
/**
18+
* @author Thomas
19+
* @describe
20+
* @date 2019/12/12
21+
* @updatelog
22+
* @since
23+
*/
24+
public class ResultAdapter extends BaseQuickAdapter<ResultBean.DatasBean, BaseViewHolder> {
25+
public ResultAdapter(@Nullable List<ResultBean.DatasBean> data) {
26+
super(R.layout.item_square, data);
27+
}
28+
29+
@Override
30+
protected void convert(@NonNull BaseViewHolder helper, ResultBean.DatasBean item) {
31+
helper.setText(R.id.tv_title, HtmlCompat.fromHtml(item.getTitle(), HtmlCompat.FROM_HTML_MODE_COMPACT));
32+
33+
if (TextUtils.isEmpty(item.getAuthor())) {
34+
helper.setText(R.id.tv_author, "分享人:" + item.getShareUser());
35+
helper.setText(R.id.tv_date, item.getNiceShareDate());
36+
} else {
37+
helper.setText(R.id.tv_author, "作者:" + item.getAuthor());
38+
helper.setText(R.id.tv_date, item.getNiceDate());
39+
}
40+
if (item.getLink().contains("jianshu")) {
41+
ImageHelper.showSimpleSquare(helper.itemView.findViewById(R.id.iv_from), R.mipmap.ic_jianshu);
42+
} else if (item.getLink().contains("juejin")) {
43+
ImageHelper.showSimpleSquare(helper.itemView.findViewById(R.id.iv_from), R.mipmap.ic_juejin);
44+
} else if (item.getLink().contains("csdn")) {
45+
ImageHelper.showSimpleSquare(helper.itemView.findViewById(R.id.iv_from), R.mipmap.ic_csdn);
46+
} else if (item.getLink().contains("weixin")) {
47+
ImageHelper.showSimpleSquare(helper.itemView.findViewById(R.id.iv_from), R.mipmap.ic_weixin);
48+
} else {
49+
ImageHelper.showSimpleSquare(helper.itemView.findViewById(R.id.iv_from), R.mipmap.ic_launcher_round);
50+
}
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.thomas.andfun.article.bean;
2+
3+
/**
4+
* @author Thomas
5+
* @describe
6+
* @date 2019/12/11
7+
* @updatelog
8+
* @since
9+
*/
10+
public class HotKeyBean {
11+
12+
/**
13+
* id : 6
14+
* link :
15+
* name : 面试
16+
* order : 1
17+
* visible : 1
18+
*/
19+
20+
private int id;
21+
private String link;
22+
private String name;
23+
private int order;
24+
private int visible;
25+
26+
public int getId() {
27+
return id;
28+
}
29+
30+
public void setId(int id) {
31+
this.id = id;
32+
}
33+
34+
public String getLink() {
35+
return link;
36+
}
37+
38+
public void setLink(String link) {
39+
this.link = link;
40+
}
41+
42+
public String getName() {
43+
return name;
44+
}
45+
46+
public void setName(String name) {
47+
this.name = name;
48+
}
49+
50+
public int getOrder() {
51+
return order;
52+
}
53+
54+
public void setOrder(int order) {
55+
this.order = order;
56+
}
57+
58+
public int getVisible() {
59+
return visible;
60+
}
61+
62+
public void setVisible(int visible) {
63+
this.visible = visible;
64+
}
65+
}

0 commit comments

Comments
 (0)