Skip to content

Commit 67789f3

Browse files
author
Blankj
committed
see 11/28 log
2 parents ef8236d + b01e17e commit 67789f3

37 files changed

Lines changed: 518 additions & 105 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
* `19/11/28` [add] Publish v1.26.0.
2+
* `19/11/27` [add] Shadow demo.
3+
* `19/11/26` [add] MVP demo.
14
* `19/11/22` [fix] Adapt the project for Gradle version of 6.0.
25
* `19/10/30` [add] Publish bus plugin v2.3. Publish api plugin v1.1.
36
* `19/10/24` [upd] Demo's UI.
4-
* `19/10/22` [add] NotificationUtils.
7+
* `19/10/22` [add] NotificationUtils and demo.
58
* `19/10/20` [add] UiMessageUtils.
69
* `19/09/20` [add] ShadowUtils.
710
* `19/08/27` [add] DebugUtils.

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
[frame]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame_cn.png
5353

54-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.9-brightgreen.svg
54+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.26.0-brightgreen.svg
5555
[auc]: https://github.com/Blankj/AndroidUtilCode
5656

5757
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If this project helps you a lot and you want to support the project's developmen
5151

5252
[frame]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
5353

54-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.9-brightgreen.svg
54+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.26.0-brightgreen.svg
5555
[auc]: https://github.com/Blankj/AndroidUtilCode
5656

5757
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

buildSrc/src/main/groovy/Config.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Config {
4545
lib_utildebug : new DepConfig(true, true, ":lib:utildebug", "com.blankj:utildebug:1.25.10-alpha5"),
4646
lib_utildebug_no_op : new DepConfig(true, true, ":lib:utildebug-no-op", "com.blankj:utildebug-no-op:1.25.10-alpha5"),
4747
/*Never delete this line*/
48-
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:3.5.2"),
48+
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:3.4.2"),
4949
plugin_kotlin : new DepConfig(pluginPath: "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"),
5050
plugin_maven : new DepConfig(pluginPath: "com.github.dcendents:android-maven-gradle-plugin:2.1", pluginId: "com.github.dcendents.android-maven"),// 上传到 maven
5151
plugin_bintray : new DepConfig(pluginPath: "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4", pluginId: "com.jfrog.bintray"),// 上传到 bintray

feature/utilcode/pkg/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@
183183
android:name="activity_meta_data"
184184
android:value="ActivityMetaData" />
185185
</activity>
186+
<activity
187+
android:name=".feature.mvp.MvpActivity"
188+
android:configChanges="orientation|keyboardHidden|screenSize"
189+
android:launchMode="singleTop" />
186190
<activity
187191
android:name=".feature.network.NetworkActivity"
188192
android:configChanges="orientation|keyboardHidden|screenSize"

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/UtilCodeApiImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ public void testCallback(Callback callback) {
2828
callback.call();
2929
}
3030
}
31-
3231
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/CoreUtilActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.blankj.utilcode.pkg.feature.language.LanguageActivity
2424
import com.blankj.utilcode.pkg.feature.log.LogActivity
2525
import com.blankj.utilcode.pkg.feature.messenger.MessengerActivity
2626
import com.blankj.utilcode.pkg.feature.metaData.MetaDataActivity
27+
import com.blankj.utilcode.pkg.feature.mvp.MvpActivity
2728
import com.blankj.utilcode.pkg.feature.network.NetworkActivity
2829
import com.blankj.utilcode.pkg.feature.notification.NotificationActivity
2930
import com.blankj.utilcode.pkg.feature.path.PathActivity
@@ -123,6 +124,9 @@ class CoreUtilActivity : CommonActivity() {
123124
CommonItemClick(R.string.demo_meta_data, true) {
124125
MetaDataActivity.start(this)
125126
},
127+
CommonItemClick(R.string.demo_mvp, true) {
128+
MvpActivity.start(this)
129+
},
126130
CommonItemClick(R.string.demo_network, true) {
127131
NetworkActivity.start(this)
128132
},
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.blankj.utilcode.pkg.feature.mvp;
2+
3+
import com.blankj.utilcode.util.Utils;
4+
5+
/**
6+
* <pre>
7+
* author: blankj
8+
* blog : http://blankj.com
9+
* time : 2019/11/26
10+
* desc :
11+
* </pre>
12+
*/
13+
public interface IMvp {
14+
15+
interface View {
16+
void setLoadingVisible(boolean visible);
17+
18+
void showMsg(CharSequence msg);
19+
}
20+
21+
interface Presenter {
22+
void updateMsg();
23+
}
24+
25+
interface Model {
26+
void requestUpdateMsg(final Utils.Func1<Void, String> func1);
27+
}
28+
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/mvp/MvpActivity.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package com.blankj.utilcode.pkg.feature.mvp;
22

3+
import android.content.Context;
4+
import android.content.Intent;
5+
import android.os.Bundle;
6+
import android.view.View;
7+
38
import com.blankj.common.activity.CommonActivity;
49
import com.blankj.utilcode.pkg.R;
510

11+
import androidx.annotation.Nullable;
12+
613
/**
714
* <pre>
815
* author: blankj
@@ -13,8 +20,24 @@
1320
*/
1421
public class MvpActivity extends CommonActivity {
1522

23+
public static void start(Context context) {
24+
Intent starter = new Intent(context, MvpActivity.class);
25+
context.startActivity(starter);
26+
}
27+
1628
@Override
1729
public int bindTitleRes() {
1830
return R.string.demo_mvp;
1931
}
32+
33+
@Override
34+
public int bindLayout() {
35+
return R.layout.mvp_activity;
36+
}
37+
38+
@Override
39+
public void initView(@Nullable Bundle savedInstanceState, @Nullable View contentView) {
40+
super.initView(savedInstanceState, contentView);
41+
new MvpView(this).addPresenter(new MvpPresenter());
42+
}
2043
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.blankj.utilcode.pkg.feature.mvp;
2+
3+
import com.blankj.base.mvp.BaseModel;
4+
import com.blankj.utilcode.util.ThreadUtils;
5+
import com.blankj.utilcode.util.Utils;
6+
7+
/**
8+
* <pre>
9+
* author: blankj
10+
* blog : http://blankj.com
11+
* time : 2019/11/26
12+
* desc :
13+
* </pre>
14+
*/
15+
public class MvpModel extends BaseModel implements IMvp.Model {
16+
17+
private int index;
18+
19+
@Override
20+
public void onCreateModel() {
21+
index = 0;
22+
}
23+
24+
@Override
25+
public void onDestroyModel() {
26+
27+
}
28+
29+
@Override
30+
public void requestUpdateMsg(final Utils.Func1<Void, String> func1) {
31+
ThreadUtils.executeByCached(addAutoDestroyTask(new ThreadUtils.SimpleTask<String>() {
32+
@Override
33+
public String doInBackground() throws Throwable {
34+
Thread.sleep(1000);
35+
return "msg: " + index++;
36+
}
37+
38+
@Override
39+
public void onSuccess(String result) {
40+
func1.call(result);
41+
}
42+
}));
43+
}
44+
}

0 commit comments

Comments
 (0)