Skip to content

Commit

Permalink
version: 1.7.0, support load failed view #17
Browse files Browse the repository at this point in the history
  • Loading branch information
nukc committed Jan 13, 2018
2 parents 1ae294c + 6238429 commit 1aec2b2
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 27 deletions.
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,29 @@ sudo: false
android:
components:
- tools
- build-tools-25.0.2
- android-25
- platform-tools
- tools
- build-tools-27.0.1
- android-27
- android-21
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
- sys-img-armeabi-v7a-android-27
- sys-img-armeabi-v7a-android-21
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

env:
global:
# install timeout in minutes (2 minutes by default)
- ADB_INSTALL_TIMEOUT=8
- GRADLE_OPTS="-Xms128m"
- ADB_INSTALL_TIMEOUT=10
- GRADLE_OPTS="-Xms512m"
# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a --skin WVGA800
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 27
buildToolsVersion '27.0.1'

defaultConfig {
applicationId "com.github.nukc.loadmorewrapper.sample"
minSdkVersion 9
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -20,7 +20,7 @@ android {
}

ext {
supportLibVersion = '25.3.0'
supportLibVersion = '27.0.1'
}

dependencies {
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LoadMoreWrapper</string>

<string-array name="tab_main">
<item>Default</item>
<item>Item not covered</item>
<item>GridLayoutManager</item>
<item>StaggeredGridLayoutManager</item>
</string-array>
<string name="default_usage">常见姿势</string>
<string name="another_usage">另一种姿势</string>
<string name="issues">用于重现 Issues</string>
Expand Down
2 changes: 1 addition & 1 deletion bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def siteUrl = 'https://github.com/nukc/LoadMoreWrapper'
def gitUrl = 'https://github.com/nukc/LoadMoreWrapper.git'

group = "com.github.nukc"
version = "1.6.2"
version = "1.6.3"

install {
repositories.mavenInstaller {
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -15,6 +16,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
}
}
Expand Down
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 Mar 29 12:42:56 CST 2017
#Mon Nov 20 11:21:05 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
19 changes: 12 additions & 7 deletions loadmorewrapper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 27
buildToolsVersion '27.0.1'

defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 21
versionName "1.6.2"
minSdkVersion 14
targetSdkVersion 27
versionCode 22
versionName "1.6.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
checkReleaseBuilds false
abortOnError false
}
}

ext {
supportLibVersion = '25.3.0'
supportLibVersion = '27.0.1'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

/**
* 在不改动 RecyclerView 原有 adapter 的情况下,使其拥有加载更多功能和自定义底部视图。
*
* @author Nukc
*/
public class LoadMoreAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
Expand Down Expand Up @@ -104,8 +103,7 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType
}

@Override
public final void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
}
public final void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {}

@SuppressWarnings("unchecked")
@Override
Expand Down Expand Up @@ -193,23 +191,23 @@ public View getLoadFailedView() {
return mLoadFailedView;
}

static class FooterHolder extends RecyclerView.ViewHolder {
public static class FooterHolder extends RecyclerView.ViewHolder {

public FooterHolder(View itemView) {
super(itemView);
LoadMoreHelper.setItemViewFullSpan(itemView);
}
}

static class NoMoreHolder extends RecyclerView.ViewHolder {
public static class NoMoreHolder extends RecyclerView.ViewHolder {

public NoMoreHolder(View itemView) {
super(itemView);
LoadMoreHelper.setItemViewFullSpan(itemView);
}
}

static class LoadFailedHolder extends RecyclerView.ViewHolder {
public static class LoadFailedHolder extends RecyclerView.ViewHolder {

public LoadFailedHolder(View itemView, final Enabled enabled, final OnLoadMoreListener listener) {
super(itemView);
Expand Down

0 comments on commit 1aec2b2

Please sign in to comment.