Skip to content

Commit 3b20fe0

Browse files
Bugfix + update library + new version
1 parent a9662fc commit 3b20fe0

5 files changed

Lines changed: 34 additions & 30 deletions

File tree

app/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion androidCompileSdkVersion
5-
buildToolsVersion androidBuildToolVersion
65

76
defaultConfig {
87
applicationId "com.xiaofeng.androidlibs"
98
minSdkVersion androidMinSdkVersion
109
targetSdkVersion androidTargetSdkVersion
11-
versionCode 1
12-
versionName "1.0"
10+
versionCode 15
11+
versionName "1.5.0"
1312
vectorDrawables.useSupportLibrary = true
1413
}
1514
buildTypes {
@@ -22,21 +21,22 @@ android {
2221
sourceCompatibility JavaVersion.VERSION_1_7
2322
targetCompatibility JavaVersion.VERSION_1_7
2423
}
24+
buildToolsVersion '27.0.3'
2525
}
2626

2727
dependencies {
28-
implementation 'com.android.support:design:26.1.0'
29-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
30-
implementation 'com.android.support:support-vector-drawable:26.1.0'
28+
implementation 'com.android.support:design:27.1.1'
29+
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
30+
implementation 'com.android.support:support-vector-drawable:27.1.1'
3131
compile fileTree(include: ['*.jar'], dir: 'libs')
3232
testCompile 'junit:junit:4.12'
33-
compile(group: 'com.android.support', name: 'design', version: supportLibVersion)
34-
compile(group: 'com.android.support', name: 'appcompat-v7', version: supportLibVersion)
35-
compile(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
36-
compile(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
33+
implementation(group: 'com.android.support', name: 'design', version: supportLibVersion)
34+
implementation(group: 'com.android.support', name: 'appcompat-v7', version: supportLibVersion)
35+
implementation(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
36+
implementation(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
3737

38-
compile project(":flowlayoutmanager")
38+
implementation project(":flowlayoutmanager")
3939

40-
compile 'us.feras.mdv:markdownview:1.1.0'
41-
compile 'com.android.support:support-v4:26.1.0'
40+
implementation 'us.feras.mdv:markdownview:1.1.0'
41+
implementation 'com.android.support:support-v4:27.1.1'
4242
}

app/src/main/java/com/xiaofeng/androidlibs/DemoAdapter.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,22 @@ public void onBindViewHolder(final DemoViewHolder holder, final int position) {
3939
@Override
4040
public void onClick(View v) {
4141
int adapterPosition = holder.getAdapterPosition();
42-
items.remove(adapterPosition);
43-
notifyItemRemoved(adapterPosition);
42+
if(adapterPosition >= 0 && adapterPosition < items.size()) {
43+
items.remove(adapterPosition);
44+
notifyItemRemoved(adapterPosition);
45+
}
4446
}
4547
});
4648
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
4749
@Override
4850
public boolean onLongClick(View v) {
4951
int adapterPosition = holder.getAdapterPosition();
50-
List<String> newItems = DemoUtil.listWords();
51-
items.addAll(adapterPosition, newItems);
52-
notifyItemRangeInserted(adapterPosition, newItems.size());
53-
return true;
52+
if(adapterPosition >= 0 && adapterPosition < items.size()) {
53+
List<String> newItems = DemoUtil.listWords();
54+
items.addAll(adapterPosition, newItems);
55+
notifyItemRangeInserted(adapterPosition, newItems.size());
56+
return true;
57+
} else return false;
5458
}
5559
});
5660
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.0.1'
9+
classpath 'com.android.tools.build:gradle:3.1.3'
1010
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1212
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'

flowlayoutmanager/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ apply plugin: 'com.android.library'
44
apply plugin: 'com.jfrog.bintray'
55

66
project.ext {
7-
libVersion = '1.4.0'
8-
libVersionCode = 7
7+
libVersion = '1.5.0'
8+
libVersionCode = 15
99
libGroupId = 'com.xiaofeng.android'
1010
libArtifactId = 'flowlayoutmanager'
1111
gitUrl = 'git@github.com:xiaofeng-han/AndroidLibs.git'
@@ -46,12 +46,12 @@ android {
4646
}
4747

4848
dependencies {
49-
compile fileTree(include: ['*.jar'], dir: 'libs')
50-
androidTestCompile 'junit:junit:4.12'
51-
compile(group: 'com.android.support', name: 'appcompat-v7', version: supportLibVersion)
52-
compile(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
53-
androidTestCompile 'com.android.support:support-annotations:26.1.0'
54-
androidTestCompile 'com.android.support.test:runner:1.0.1'
49+
implementation fileTree(include: ['*.jar'], dir: 'libs')
50+
androidTestImplementation 'junit:junit:4.12'
51+
implementation(group: 'com.android.support', name: 'appcompat-v7', version: supportLibVersion)
52+
implementation(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
53+
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
54+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
5555

5656
}
5757

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Oct 21 11:34:03 PDT 2015
1+
#Fri Jul 13 14:38:04 CEST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 commit comments

Comments
 (0)