Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
update gradle, add ability to have only one listener at time (set sin…
Browse files Browse the repository at this point in the history
…gleListener to true in expandableLayout)
  • Loading branch information
P1NG2WIN committed Apr 14, 2020
1 parent 8325204 commit 407a096
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 35 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
134 changes: 109 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'

implementation project(path: ':expansionpanel')
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.6.2'

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1+'
Expand Down
4 changes: 2 additions & 2 deletions expansionpanel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
}

ext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ExpansionLayout extends NestedScrollView {

private final List<IndicatorListener> indicatorListeners = new ArrayList<>();
private final List<Listener> listeners = new ArrayList<>();
public Boolean singleListener = false;
private boolean expanded = false;
private Animator animator;

Expand Down Expand Up @@ -53,8 +54,12 @@ private void init(@NonNull Context context, @Nullable AttributeSet attrs) {
}

public void addListener(Listener listener) {
if (listener != null && !listeners.contains(listener))
if (singleListener) {
listeners.clear();
listeners.add(listener);
} else if (listener != null && !listeners.contains(listener)) {
listeners.add(listener);
}
}

public void removeListener(Listener listener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class HorizontalExpansionLayout extends HorizontalScrollView {

private final List<IndicatorListener> indicatorListeners = new ArrayList<>();
private final List<Listener> listeners = new ArrayList<>();
public Boolean singleListener = false;
private boolean expanded = false;
private Animator animator;

Expand Down Expand Up @@ -52,8 +53,12 @@ private void init(@NonNull Context context, @Nullable AttributeSet attrs) {
}

public void addListener(Listener listener) {
if (listener != null && !listeners.contains(listener))
if (singleListener) {
listeners.clear();
listeners.add(listener);
} else if (listener != null && !listeners.contains(listener)) {
listeners.add(listener);
}
}

public void removeListener(Listener listener) {
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 @@
#Thu Sep 06 16:26:15 PDT 2018
#Wed Apr 15 00:19:09 EET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

0 comments on commit 407a096

Please sign in to comment.