Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将target容器与touchView分离 #146

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dd6d3b3
prepare nested scroll support
Aspsine Aug 11, 2016
fbdacee
update gradle & sdk version
Nov 7, 2016
3ac2024
遗留问题_touchView为外层容器时,内部滑动被屏蔽
tangzejin921 May 8, 2018
977a21b
1.指定touchView,不指定情况下target
tangzejin921 May 9, 2018
c86c721
_
May 9, 2018
0f3a675
删除_
tangzejin921 Aug 31, 2018
6fc8e29
Merge pull request #1 from jkwyandroid/master
tangzejin921 Aug 31, 2018
6a1aab4
删除旧版本的支持
tangzejin921 Aug 31, 2018
9097b15
Merge branch 'dev' of https://github.com/tangzejin921/SwipeToLoadLayout
tangzejin921 Aug 31, 2018
72e189f
Merge branch 'dev' of https://github.com/tangzejin921/SwipeToLoadLayout
tangzejin921 Aug 31, 2018
8b8c4fd
Merge branch 'dev' of https://github.com/tangzejin921/SwipeToLoadLayout
tangzejin921 Aug 31, 2018
016b68f
版本升级
tangzejin921 Sep 5, 2018
51e5dbf
版本升级,固定gif头,Glide_4.7.1引入
Sep 16, 2018
c84b159
版本升级,固定gif头,Glide_4.7.1引入
Sep 16, 2018
40e834d
版本升级
tangzejin921 Sep 17, 2018
afb279e
JitPack_发布不了
tangzejin921 Sep 18, 2018
1b33f0b
NestedScrolling 会崩溃
tangzejin921 Sep 21, 2018
7675f07
加个id/loadLayout
Sep 24, 2018
847d974
SwipeRefreshLayout 复制为 CpSwipeRefreshLayout
tangzejin921 Sep 28, 2018
6a046ea
CpSwipeRefreshLayout_去除mProgress
tangzejin921 Sep 28, 2018
4702345
CpSwipeRefreshLayout_去除mProgress
tangzejin921 Sep 28, 2018
61fd936
NestedScrolling_还有问题
tangzejin921 Sep 28, 2018
66384bc
加个demo
tangzejin921 Sep 28, 2018
b4d57c6
CpSwipeRefreshLayout
tangzejin921 Sep 28, 2018
0cbcc19
弃用
tangzejin921 Sep 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SwipeToLoadLayout-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2812)
# SwipeToLoadLayout
**作者不维护了,并且不支持 CoordinatorLayout 所以弃用**

SwipeToLoadLayout is a reusable pull-to-refresh and pull-to-load-more widget.

## Supported View
Expand Down
30 changes: 14 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion _compileSdkVersion
buildToolsVersion _buildToolsVersion

defaultConfig {
applicationId "com.aspsine.swipetoloadlayout"
minSdkVersion 10
targetSdkVersion 25
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
versionCode 4
versionName "1.0.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles 'proguard-rules.pro'
}
}

Expand All @@ -24,15 +24,13 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':library')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.mcxiaoke.volley:library-aar:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
compile 'com.github.Aspsine:FragmentNavigator:1.0.2'
implementation project(':library')
implementation "com.android.support:appcompat-v7:$_supportVersion"
implementation "com.android.support:recyclerview-v7:$_supportVersion"
implementation "com.android.support:design:$_supportVersion"
implementation 'com.google.code.gson:gson:2.4'
implementation 'com.mcxiaoke.volley:library-aar:1.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation 'com.github.Aspsine:FragmentNavigator:1.0.2'
}

This file was deleted.

This file was deleted.

17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' // Add this line

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -14,10 +17,20 @@ buildscript {

allprojects {
repositories {
mavenCentral()
jcenter()
google()
maven { url 'https://www.jitpack.io' }
}
}

project.ext {
ext._compileSdkVersion = 27
ext._buildToolsVersion = '27.0.3'
ext._minSdkVersion = 16
ext._targetSdkVersion = 27
ext._supportVersion = "27.1.1"
javaVersion = JavaVersion.VERSION_1_8
}
task clean(type: Delete) {
delete rootProject.buildDir
}
1 change: 1 addition & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
32 changes: 32 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion _compileSdkVersion
buildToolsVersion _buildToolsVersion

defaultConfig {
applicationId "com.tzj.swipetoloadlayout.demo"
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation project(':library')
implementation "com.android.support:appcompat-v7:$_supportVersion"
implementation "com.android.support:recyclerview-v7:$_supportVersion"
implementation "com.android.support:design:$_supportVersion"
}
22 changes: 22 additions & 0 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tzj.swipetoloadlayout.demo" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light">
<activity
android:name="com.tzj.swipetoloadlayout.demo.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
103 changes: 103 additions & 0 deletions demo/src/main/java/com/tzj/swipetoloadlayout/demo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package com.tzj.swipetoloadlayout.demo;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.CpSwipeRefreshLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.aspsine.swipetoloadlayout.OnLoadMoreListener;
import com.aspsine.swipetoloadlayout.OnRefreshListener;
import com.aspsine.swipetoloadlayout.SwipeToLoadLayout;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends Activity implements View.OnClickListener{

private SwipeToLoadLayout loadLayout;
private RecyclerView recyclerView;
private MyAdapter adapter = new MyAdapter();
private List<String> list = new ArrayList<>();

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

for (int i = 0; i < 50; i++) {
list.add(""+i);
}
loadLayout = findViewById(R.id.loadLayout);
loadLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
loadLayout.postDelayed(new Runnable() {
@Override
public void run() {
loadLayout.setRefreshing(false);
// loadLayout.setLoadingMore(false);
}
},3000);
}
});
// loadLayout.setRefreshing(true);
// loadLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
// @Override
// public void onLoadMore() {
// loadLayout.postDelayed(new Runnable() {
// @Override
// public void run() {
// loadLayout.setRefreshing(false);
// loadLayout.setLoadingMore(false);
// }
// },3000);
// }
// });

recyclerView = findViewById(R.id.swipe_target);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);


}

@Override
public void onClick(View v) {
loadLayout.setRefreshing(true);
}


class MyAdapter extends RecyclerView.Adapter<Holder>{

@NonNull
@Override
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main, parent, false);
return new Holder(inflate);
}

@Override
public void onBindViewHolder(@NonNull Holder holder, int position) {
}

@Override
public int getItemCount() {
return list.size();
}
}
class Holder extends RecyclerView.ViewHolder{

public Holder(View itemView) {
super(itemView);
}
}

}
41 changes: 41 additions & 0 deletions demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#000"
android:onClick="onClick"
android:text="sfsdfsdfsfdsf"
app:layout_scrollFlags="scroll" />

</android.support.design.widget.AppBarLayout>

<com.aspsine.swipetoloadlayout.SwipeToLoadLayout
android:id="@+id/loadLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<android.support.v7.widget.RecyclerView
android:id="@+id/swipe_target"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</com.aspsine.swipetoloadlayout.SwipeToLoadLayout>

</android.support.design.widget.CoordinatorLayout>

</LinearLayout>
13 changes: 13 additions & 0 deletions demo/src/main/res/layout/item_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="sdfj 都是法师"/>

</LinearLayout>
3 changes: 3 additions & 0 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">demo</string>
</resources>
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 04 00:31:07 CST 2017
#Sun Sep 16 16:17:49 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Loading