Skip to content

Commit d01b8db

Browse files
author
xialei
committed
Initial commit
0 parents  commit d01b8db

106 files changed

Lines changed: 8398 additions & 0 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
buildToolsVersion "29.0.1"
6+
defaultConfig {
7+
applicationId "com.seeyou.fastbuild"
8+
minSdkVersion 21
9+
targetSdkVersion 28
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
compileOptions {
21+
sourceCompatibility JavaVersion.VERSION_1_8
22+
targetCompatibility JavaVersion.VERSION_1_8
23+
}
24+
25+
}
26+
27+
dependencies {
28+
implementation fileTree(dir: 'libs', include: ['*.jar'])
29+
implementation 'androidx.appcompat:appcompat:1.0.2'
30+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
31+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
32+
testImplementation 'junit:junit:4.12'
33+
androidTestImplementation 'androidx.test:runner:1.1.1'
34+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
35+
implementation project(path: ':toolkit')
36+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.seeyou.fastbuild;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
25+
assertEquals("com.seeyou.fastbuild", appContext.getPackageName());
26+
}
27+
}

app/src/main/AndroidManifest.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.seeyou.fastbuild">
5+
<!-- 请求网络 -->
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
8+
<application
9+
android:name=".MyApplication"
10+
android:allowBackup="true"
11+
android:icon="@mipmap/ic_launcher"
12+
android:label="@string/app_name"
13+
android:roundIcon="@mipmap/ic_launcher_round"
14+
android:supportsRtl="true"
15+
android:theme="@style/BaseTheme"
16+
tools:ignore="GoogleAppIndexingWarning">
17+
<activity android:name=".TabActivity">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
<activity android:name=".MainActivity">
25+
26+
</activity>
27+
</application>
28+
29+
</manifest>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.seeyou.fastbuild;
2+
3+
4+
import android.os.Bundle;
5+
6+
import androidx.fragment.app.Fragment;
7+
8+
import android.view.LayoutInflater;
9+
import android.view.View;
10+
import android.view.ViewGroup;
11+
12+
13+
/**
14+
* A simple {@link Fragment} subclass.
15+
*/
16+
public class BlankFragment extends Fragment {
17+
18+
19+
public BlankFragment() {
20+
// Required empty public constructor
21+
}
22+
23+
24+
@Override
25+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
26+
Bundle savedInstanceState) {
27+
// Inflate the layout for this fragment
28+
return inflater.inflate(R.layout.fragment_blank, container, false);
29+
}
30+
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.seeyou.fastbuild;
2+
3+
import android.os.Bundle;
4+
5+
import androidx.appcompat.app.AppCompatActivity;
6+
7+
import com.seeyou.toolkit.base.ListProcessFactory;
8+
import com.seeyou.toolkit.network.NetworkUtils;
9+
import com.seeyou.toolkit.view.Options;
10+
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
14+
public class MainActivity extends AppCompatActivity {
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_main);
19+
MessageAdapter messageAdapter = new MessageAdapter(null);
20+
new ListProcessFactory<Message>()
21+
.bind(this.getWindow().getDecorView()).adapter(messageAdapter)
22+
.empty(new Options("无数据"))
23+
.loadCallback(messageListProcessFactory -> {
24+
Map<String, String> map = new HashMap<>();
25+
map.put("name", "测试");
26+
NetworkUtils.getInstance().doGet("getAllMessage", map, Message.class, messageListProcessFactory.callBack());
27+
}).autoLoad();
28+
}
29+
30+
31+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package com.seeyou.fastbuild;
2+
3+
import com.seeyou.toolkit.base.BaseModel;
4+
5+
import java.util.List;
6+
7+
/**
8+
* @author sumn
9+
* date 2019/10/21
10+
*/
11+
public class Message extends BaseModel<List<Message>> {
12+
13+
private String gmtCreate;
14+
private Object gmtModified;
15+
private String nid;
16+
private String ncontent;
17+
private String ntitle;
18+
19+
public String getGmtCreate() {
20+
return gmtCreate;
21+
}
22+
23+
public void setGmtCreate(String gmtCreate) {
24+
this.gmtCreate = gmtCreate;
25+
}
26+
27+
public Object getGmtModified() {
28+
return gmtModified;
29+
}
30+
31+
public void setGmtModified(Object gmtModified) {
32+
this.gmtModified = gmtModified;
33+
}
34+
35+
public String getNid() {
36+
return nid;
37+
}
38+
39+
public void setNid(String nid) {
40+
this.nid = nid;
41+
}
42+
43+
public String getNcontent() {
44+
return ncontent;
45+
}
46+
47+
public void setNcontent(String ncontent) {
48+
this.ncontent = ncontent;
49+
}
50+
51+
public String getNtitle() {
52+
return ntitle;
53+
}
54+
55+
public void setNtitle(String ntitle) {
56+
this.ntitle = ntitle;
57+
}
58+
59+
@Override
60+
public String toString() {
61+
return "Message{" +
62+
"gmtCreate='" + gmtCreate + '\'' +
63+
", gmtModified=" + gmtModified +
64+
", nid='" + nid + '\'' +
65+
", ncontent='" + ncontent + '\'' +
66+
", ntitle='" + ntitle + '\'' +
67+
'}';
68+
}
69+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.seeyou.fastbuild;
2+
3+
import androidx.annotation.Nullable;
4+
5+
import com.seeyou.toolkit.thirdparty.baserecyclerview.BaseQuickAdapter;
6+
import com.seeyou.toolkit.thirdparty.baserecyclerview.BaseViewHolder;
7+
8+
import java.util.List;
9+
10+
/**
11+
* @author sumn
12+
* date 2019/10/22
13+
*/
14+
public class MessageAdapter extends BaseQuickAdapter<Message, BaseViewHolder> {
15+
public MessageAdapter(@Nullable List<Message> data) {
16+
super(R.layout.item_message, data);
17+
}
18+
19+
@Override
20+
protected void convert(BaseViewHolder helper, Message item) {
21+
helper.setText(R.id.name, item.getNcontent());
22+
}
23+
}

0 commit comments

Comments
 (0)