Skip to content

Commit b9b8faf

Browse files
committed
Add attribute to select initial expanded mode
1 parent 5ba4ca6 commit b9b8faf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

expandlayout-library/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<declare-styleable name="ExpandableLayout">
55
<attr name="canExpand" format="boolean" />
6+
<attr name="expanded" format="boolean" />
67
</declare-styleable>
78

89
</resources>

expandlayout-library/src/com/sherlock/expandlayout/ExpandableLayout.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ public LayoutParams(Context c, AttributeSet attrs) {
458458
R.styleable.ExpandableLayout);
459459
canExpand = a.getBoolean(R.styleable.ExpandableLayout_canExpand,
460460
false);
461+
isExpanded = a.getBoolean(R.styleable.ExpandableLayout_expanded,
462+
false);
461463
originalHeight = this.height;
462464
a.recycle();
463465
}

0 commit comments

Comments
 (0)