Skip to content

Commit 0541ff3

Browse files
committed
First commit
0 parents  commit 0541ff3

File tree

72 files changed

+6490
-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.

72 files changed

+6490
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

.idea/compiler.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/dkzwm1.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.3"
6+
defaultConfig {
7+
applicationId "me.dkzwm.smoothrefreshlayout.sample"
8+
minSdkVersion 11
9+
targetSdkVersion 25
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(dir: 'libs', include: ['*.jar'])
23+
compile project(':library')
24+
compile 'com.android.support:appcompat-v7:25.3.1'
25+
compile 'com.android.support:recyclerview-v7:25.3.1'
26+
}

app/proguard-rules.pro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/dkzwm1/Documents/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+
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest package="me.dkzwm.smoothrefreshlayout.sample"
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN"/>
15+
16+
<category android:name="android.intent.category.LAUNCHER"/>
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package me.dkzwm.smoothrefreshlayout.sample;
2+
3+
import android.os.Bundle;
4+
import android.os.Handler;
5+
import android.support.v7.app.AppCompatActivity;
6+
7+
import me.dkzwm.smoothrefreshlayout.SmoothRefreshLayout;
8+
9+
public class MainActivity extends AppCompatActivity {
10+
private Handler mHandler = new Handler();
11+
private SmoothRefreshLayout mRefreshLayout;
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_main);
17+
mRefreshLayout = (SmoothRefreshLayout) findViewById(R.id.smoothRefreshLayout_main);
18+
mRefreshLayout.setEnableOverScroll(true);
19+
mRefreshLayout.setMode(SmoothRefreshLayout.MODE_REFRESH);
20+
mRefreshLayout.setEnablePinContentView(true);
21+
mRefreshLayout.setEnableKeepExtraView(true);
22+
//设置刷新时黏贴属性
23+
mRefreshLayout.setEnablePinExtraViewWhileLoading(true);
24+
mRefreshLayout.setOnRefreshListener(new SmoothRefreshLayout.OnRefreshListener() {
25+
@Override
26+
public void onRefreshBegin(boolean isRefresh) {
27+
mHandler.postDelayed(new Runnable() {
28+
@Override
29+
public void run() {
30+
mRefreshLayout.refreshComplete();
31+
}
32+
}, 4000);
33+
}
34+
35+
@Override
36+
public void onRefreshComplete() {
37+
38+
}
39+
});
40+
mRefreshLayout.autoRefresh();
41+
}
42+
43+
@Override
44+
protected void onDestroy() {
45+
super.onDestroy();
46+
mHandler.removeCallbacksAndMessages(null);
47+
}
48+
}
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<me.dkzwm.smoothrefreshlayout.MaterialSmoothRefreshLayout
3+
android:id="@+id/smoothRefreshLayout_main"
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent">
7+
8+
<ScrollView
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent">
11+
12+
<LinearLayout
13+
android:layout_width="match_parent"
14+
android:layout_height="wrap_content"
15+
android:orientation="vertical">
16+
17+
<Button
18+
android:id="@+id/button_main_with_frameLayout"
19+
style="@style/MainButtonStyle"
20+
android:paddingLeft="6dp"
21+
android:paddingRight="6dp"
22+
android:text="@string/with_frameLayout"/>
23+
24+
<Button
25+
android:id="@+id/button_main_with_textView"
26+
style="@style/MainButtonStyle"
27+
android:paddingLeft="6dp"
28+
android:paddingRight="6dp"
29+
android:text="@string/with_textView"/>
30+
31+
<Button
32+
android:id="@+id/button_main_with_listView"
33+
style="@style/MainButtonStyle"
34+
android:paddingLeft="6dp"
35+
android:paddingRight="6dp"
36+
android:text="@string/with_listView"/>
37+
38+
<Button
39+
android:id="@+id/button_main_with_recyclerView"
40+
style="@style/MainButtonStyle"
41+
android:paddingLeft="6dp"
42+
android:paddingRight="6dp"
43+
android:text="@string/with_recyclerView"/>
44+
45+
<Button
46+
android:id="@+id/button_main_with_gridView"
47+
style="@style/MainButtonStyle"
48+
android:paddingLeft="6dp"
49+
android:paddingRight="6dp"
50+
android:text="@string/with_gridView"/>
51+
52+
<Button
53+
android:id="@+id/button_main_with_webView"
54+
style="@style/MainButtonStyle"
55+
android:paddingLeft="6dp"
56+
android:paddingRight="6dp"
57+
android:text="@string/with_webView"/>
58+
59+
<Button
60+
android:id="@+id/button_main_with_viewPager"
61+
style="@style/MainButtonStyle"
62+
android:paddingLeft="6dp"
63+
android:paddingRight="6dp"
64+
android:text="@string/with_viewPager"/>
65+
<Button
66+
android:id="@+id/button_main_with_recyclerView_in_coordinatorLayout"
67+
style="@style/MainButtonStyle"
68+
android:paddingLeft="6dp"
69+
android:paddingRight="6dp"
70+
android:text="@string/in_coordinatorLayout_with_recyclerView"/>
71+
72+
73+
<Button
74+
android:id="@+id/button_main_test_nested"
75+
style="@style/MainButtonStyle"
76+
android:paddingLeft="6dp"
77+
android:paddingRight="6dp"
78+
android:text="@string/test_nested"/>
79+
80+
<Button
81+
android:id="@+id/button_main_test_fixed_extra_view"
82+
style="@style/MainButtonStyle"
83+
android:paddingLeft="6dp"
84+
android:paddingRight="6dp"
85+
android:text="@string/refreshing_fixed_extra_view"/>
86+
87+
</LinearLayout>
88+
</ScrollView>
89+
90+
</me.dkzwm.smoothrefreshlayout.MaterialSmoothRefreshLayout>
3.34 KB
Loading
Loading
2.15 KB
Loading
Loading
4.73 KB
Loading
Loading
7.54 KB
Loading
Loading
10.2 KB
Loading
Loading
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="with_frameLayout">包含FrameLayout</string>
4+
<string name="with_textView">包含TextView</string>
5+
<string name="with_listView">包含ListView</string>
6+
<string name="with_recyclerView">包含RecyclerView</string>
7+
<string name="with_gridView">包含GridView</string>
8+
<string name="with_webView">包含WebView</string>
9+
<string name="with_viewPager">包含ViewPager</string>
10+
<string name="refreshing_fixed_extra_view">刷新时保持头部</string>
11+
<string name="in_coordinatorLayout_with_recyclerView">在CoordinatorLayout内部包含RecyclerView</string>
12+
<string name="test_nested">测试嵌套滑动</string>
13+
</resources>

app/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

0 commit comments

Comments
 (0)