sections;
+ private Boolean singleMode;
+
private ExpandCollapseListener.ExpandListener expandListener;
private ExpandCollapseListener.CollapseListener collapseListener;
@@ -86,6 +88,7 @@ private void init(Context context, AttributeSet attributeSet) {
typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.ExpandableLayout);
parentLayout = typedArray.getResourceId(R.styleable.ExpandableLayout_parentLayout, NO_RES);
childLayout = typedArray.getResourceId(R.styleable.ExpandableLayout_childLayout, NO_RES);
+ singleMode = typedArray.getBoolean(R.styleable.ExpandableLayout_singleMode, false);
layoutInflater = LayoutInflater.from(context);
} finally {
if (typedArray != null) {
@@ -257,8 +260,8 @@ private void expand(@NonNull P parent) {
sections.get(i).expanded = true;
if (expandListener != null)
expandListener.onExpanded(i, sections.get(i).parent, sectionView.getChildAt(0));
- break;
- }
+ }else if (singleMode)
+ collapse(sections.get(i).parent);
}
}
diff --git a/expandablelib/src/main/res/values/attrs.xml b/expandablelib/src/main/res/values/attrs.xml
index f08f4ca..912f8e7 100644
--- a/expandablelib/src/main/res/values/attrs.xml
+++ b/expandablelib/src/main/res/values/attrs.xml
@@ -4,6 +4,7 @@
+
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 6d9dbc2..c81e7b2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu Aug 23 14:26:53 CDT 2018
+#Thu Sep 05 15:20:37 EET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-rc-1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip