Skip to content

Commit 1246743

Browse files
author
linuxjava
committed
添加项目
0 parents commit 1246743

File tree

73 files changed

+3725
-0
lines changed

Some content is hidden

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

73 files changed

+3725
-0
lines changed

‎app/build.gradle‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.application'
2+
3+
android{
4+
compileSdkVersion 23
5+
buildToolsVersion "25.0.2"
6+
defaultConfig{
7+
applicationId "xiao.free.refreshlayout"
8+
minSdkVersion 14
9+
targetSdkVersion 23
10+
versionCode 1
11+
versionName "1.0"
12+
}
13+
buildTypes{
14+
release{
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies{
22+
compile fileTree(include: ['*.jar'], dir: 'libs')
23+
compile 'com.android.support:appcompat-v7:23.4.0'
24+
compile 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
25+
compile project(':refreshlayoutlib')
26+
}

‎app/proguard-rules.pro‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\android-sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview{
16+
# public *;
17+
#}

‎app/src/main/AndroidManifest.xml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
3+
package="xiao.free.refreshlayout">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:name=".MainActivity"
13+
android:screenOrientation="portrait">
14+
<intent-filter>
15+
<actionandroid:name="android.intent.action.MAIN" />
16+
17+
<categoryandroid:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
21+
<activity
22+
android:name=".ClassicActivity"
23+
android:screenOrientation="portrait" />
24+
25+
<activity
26+
android:name=".GoogleHookActivity"
27+
android:screenOrientation="portrait" />
28+
29+
<activity
30+
android:name=".GoogleActivity"
31+
android:screenOrientation="portrait" />
32+
33+
<activity
34+
android:name=".JindongActivity"
35+
android:screenOrientation="portrait" />
36+
</application>
37+
38+
</manifest>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
packagexiao.free.refreshlayout;
2+
3+
importandroid.os.Bundle;
4+
importandroid.support.v7.app.AppCompatActivity;
5+
importandroid.widget.ArrayAdapter;
6+
importandroid.widget.ListView;
7+
8+
importjava.util.ArrayList;
9+
10+
importxiao.free.refreshlayoutlib.SwipeRefreshLayout;
11+
importxiao.free.refreshlayoutlib.base.OnLoadMoreListener;
12+
importxiao.free.refreshlayoutlib.base.OnRefreshListener;
13+
14+
/**
15+
* Created by robincxiao on 2017/2/24.
16+
*/
17+
18+
publicclassClassicActivityextendsAppCompatActivityimplementsOnRefreshListener, OnLoadMoreListener{
19+
privateSwipeRefreshLayoutmSwipeRefreshLayout;
20+
privateListViewmListView;
21+
privateArrayList<String> mArrayList = newArrayList<>();
22+
23+
@Override
24+
protectedvoidonCreate(BundlesavedInstanceState){
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_classic);
27+
28+
mListView = (ListView) findViewById(R.id.swipe_target);
29+
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
30+
mSwipeRefreshLayout.setOnRefreshListener(this);
31+
mSwipeRefreshLayout.setOnLoadMoreListener(this);
32+
33+
mListView.setAdapter(newArrayAdapter<>(this, android.R.layout.simple_list_item_1, getData()));
34+
}
35+
36+
privateArrayList<String> getData(){
37+
for (inti=0; i<50; i++){
38+
mArrayList.add("测试数据" + i);
39+
}
40+
returnmArrayList;
41+
}
42+
43+
@Override
44+
publicvoidonRefresh(){
45+
mSwipeRefreshLayout.postDelayed(newRunnable(){
46+
@Override
47+
publicvoidrun(){
48+
mSwipeRefreshLayout.setRefreshing(false);
49+
}
50+
}, 3000);
51+
}
52+
53+
@Override
54+
publicvoidonLoadMore(){
55+
mSwipeRefreshLayout.postDelayed(newRunnable(){
56+
@Override
57+
publicvoidrun(){
58+
mSwipeRefreshLayout.setLoadingMore(false);
59+
}
60+
}, 3000);
61+
}
62+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
packagexiao.free.refreshlayout;
2+
3+
importandroid.os.Bundle;
4+
importandroid.support.v7.app.AppCompatActivity;
5+
importandroid.widget.ArrayAdapter;
6+
importandroid.widget.ListView;
7+
8+
importjava.util.ArrayList;
9+
10+
importxiao.free.refreshlayoutlib.SwipeRefreshLayout;
11+
importxiao.free.refreshlayoutlib.base.OnLoadMoreListener;
12+
importxiao.free.refreshlayoutlib.base.OnRefreshListener;
13+
14+
/**
15+
* Created by robincxiao on 2017/2/24.
16+
*/
17+
18+
publicclassGoogleActivityextendsAppCompatActivityimplementsOnRefreshListener, OnLoadMoreListener{
19+
privateSwipeRefreshLayoutmSwipeRefreshLayout;
20+
privateListViewmListView;
21+
privateArrayList<String> mArrayList = newArrayList<>();
22+
23+
@Override
24+
protectedvoidonCreate(BundlesavedInstanceState){
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_google);
27+
28+
mListView = (ListView) findViewById(R.id.swipe_target);
29+
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
30+
mSwipeRefreshLayout.setSwipeStyle(SwipeRefreshLayout.STYLE.ABOVE);
31+
mSwipeRefreshLayout.setOnRefreshListener(this);
32+
mSwipeRefreshLayout.setOnLoadMoreListener(this);
33+
34+
mListView.setAdapter(newArrayAdapter<>(this, android.R.layout.simple_list_item_1, getData()));
35+
}
36+
37+
privateArrayList<String> getData(){
38+
for (inti=0; i<50; i++){
39+
mArrayList.add("测试数据" + i);
40+
}
41+
returnmArrayList;
42+
}
43+
44+
@Override
45+
publicvoidonRefresh(){
46+
mSwipeRefreshLayout.postDelayed(newRunnable(){
47+
@Override
48+
publicvoidrun(){
49+
mSwipeRefreshLayout.setRefreshing(false);
50+
}
51+
}, 3000);
52+
}
53+
54+
@Override
55+
publicvoidonLoadMore(){
56+
mSwipeRefreshLayout.postDelayed(newRunnable(){
57+
@Override
58+
publicvoidrun(){
59+
mSwipeRefreshLayout.setLoadingMore(false);
60+
}
61+
}, 3000);
62+
}
63+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
packagexiao.free.refreshlayout;
2+
3+
importandroid.os.Bundle;
4+
importandroid.support.v7.app.AppCompatActivity;
5+
importandroid.widget.ArrayAdapter;
6+
importandroid.widget.ListView;
7+
8+
importjava.util.ArrayList;
9+
10+
importxiao.free.refreshlayoutlib.SwipeRefreshLayout;
11+
importxiao.free.refreshlayoutlib.base.OnLoadMoreListener;
12+
importxiao.free.refreshlayoutlib.base.OnRefreshListener;
13+
14+
/**
15+
* Created by robincxiao on 2017/2/24.
16+
*/
17+
18+
publicclassGoogleHookActivityextendsAppCompatActivityimplementsOnRefreshListener, OnLoadMoreListener{
19+
privateSwipeRefreshLayoutmSwipeRefreshLayout;
20+
privateListViewmListView;
21+
privateArrayList<String> mArrayList = newArrayList<>();
22+
23+
@Override
24+
protectedvoidonCreate(BundlesavedInstanceState){
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_google_hook);
27+
28+
mListView = (ListView) findViewById(R.id.swipe_target);
29+
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
30+
mSwipeRefreshLayout.setSwipeStyle(SwipeRefreshLayout.STYLE.ABOVE);
31+
mSwipeRefreshLayout.setOnRefreshListener(this);
32+
mSwipeRefreshLayout.setOnLoadMoreListener(this);
33+
34+
mListView.setAdapter(newArrayAdapter<>(this, android.R.layout.simple_list_item_1, getData()));
35+
}
36+
37+
privateArrayList<String> getData(){
38+
for (inti=0; i<50; i++){
39+
mArrayList.add("测试数据" + i);
40+
}
41+
returnmArrayList;
42+
}
43+
44+
@Override
45+
publicvoidonRefresh(){
46+
mSwipeRefreshLayout.postDelayed(newRunnable(){
47+
@Override
48+
publicvoidrun(){
49+
mSwipeRefreshLayout.setRefreshing(false);
50+
}
51+
}, 3000);
52+
}
53+
54+
@Override
55+
publicvoidonLoadMore(){
56+
mSwipeRefreshLayout.postDelayed(newRunnable(){
57+
@Override
58+
publicvoidrun(){
59+
mSwipeRefreshLayout.setLoadingMore(false);
60+
}
61+
}, 3000);
62+
}
63+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
packagexiao.free.refreshlayout;
2+
3+
importandroid.os.Bundle;
4+
importandroid.support.v7.app.AppCompatActivity;
5+
importandroid.widget.ArrayAdapter;
6+
importandroid.widget.ListView;
7+
8+
importjava.util.ArrayList;
9+
10+
importxiao.free.refreshlayoutlib.SwipeRefreshLayout;
11+
importxiao.free.refreshlayoutlib.base.OnLoadMoreListener;
12+
importxiao.free.refreshlayoutlib.base.OnRefreshListener;
13+
14+
/**
15+
* Created by robincxiao on 2017/2/24.
16+
*/
17+
18+
publicclassJindongActivityextendsAppCompatActivityimplementsOnRefreshListener, OnLoadMoreListener{
19+
privateSwipeRefreshLayoutmSwipeRefreshLayout;
20+
privateListViewmListView;
21+
privateArrayList<String> mArrayList = newArrayList<>();
22+
23+
@Override
24+
protectedvoidonCreate(BundlesavedInstanceState){
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_jindong);
27+
28+
mListView = (ListView) findViewById(R.id.swipe_target);
29+
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout);
30+
mSwipeRefreshLayout.setSwipeStyle(SwipeRefreshLayout.STYLE.SCALE);
31+
mSwipeRefreshLayout.setOnRefreshListener(this);
32+
mSwipeRefreshLayout.setOnLoadMoreListener(this);
33+
34+
mListView.setAdapter(newArrayAdapter<>(this, android.R.layout.simple_list_item_1, getData()));
35+
}
36+
37+
privateArrayList<String> getData(){
38+
for (inti=0; i<50; i++){
39+
mArrayList.add("测试数据" + i);
40+
}
41+
returnmArrayList;
42+
}
43+
44+
@Override
45+
publicvoidonRefresh(){
46+
mSwipeRefreshLayout.postDelayed(newRunnable(){
47+
@Override
48+
publicvoidrun(){
49+
mSwipeRefreshLayout.setRefreshing(false);
50+
}
51+
}, 3000);
52+
}
53+
54+
@Override
55+
publicvoidonLoadMore(){
56+
mSwipeRefreshLayout.postDelayed(newRunnable(){
57+
@Override
58+
publicvoidrun(){
59+
mSwipeRefreshLayout.setLoadingMore(false);
60+
}
61+
}, 3000);
62+
}
63+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
packagexiao.free.refreshlayout;
2+
3+
importandroid.content.Intent;
4+
importandroid.os.Bundle;
5+
importandroid.support.v7.app.AppCompatActivity;
6+
importandroid.view.View;
7+
importandroid.widget.ArrayAdapter;
8+
importandroid.widget.ListView;
9+
10+
importjava.util.ArrayList;
11+
12+
importxiao.free.refreshlayoutlib.SwipeRefreshLayout;
13+
importxiao.free.refreshlayoutlib.base.OnLoadMoreListener;
14+
importxiao.free.refreshlayoutlib.base.OnRefreshListener;
15+
16+
publicclassMainActivityextendsAppCompatActivityimplementsView.OnClickListener{
17+
privateSwipeRefreshLayoutmSwipeRefreshLayout;
18+
privateListViewmListView;
19+
privateArrayList<String> mArrayList = newArrayList<>();
20+
21+
@Override
22+
protectedvoidonCreate(BundlesavedInstanceState){
23+
super.onCreate(savedInstanceState);
24+
setContentView(R.layout.activity_main);
25+
26+
findViewById(R.id.btn_classic).setOnClickListener(this);
27+
findViewById(R.id.btn_google_hook).setOnClickListener(this);
28+
findViewById(R.id.btn_google).setOnClickListener(this);
29+
findViewById(R.id.btn_jindong).setOnClickListener(this);
30+
31+
}
32+
33+
@Override
34+
publicvoidonClick(Viewv){
35+
switch (v.getId()){
36+
caseR.id.btn_classic:
37+
startActivity(newIntent(this, ClassicActivity.class));
38+
break;
39+
caseR.id.btn_google_hook:
40+
startActivity(newIntent(this, GoogleHookActivity.class));
41+
break;
42+
caseR.id.btn_google:
43+
startActivity(newIntent(this, GoogleActivity.class));
44+
break;
45+
caseR.id.btn_jindong:
46+
startActivity(newIntent(this, JindongActivity.class));
47+
break;
48+
}
49+
}
50+
}

0 commit comments

Comments
(0)