-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to use section indexing together with expandable section headers
- Loading branch information
1 parent
7ef4793
commit 7d5dd61
Showing
9 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...se/emilsjolander/stickylistheaders/SectionIndexingExpandableStickyListHeadersAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package se.emilsjolander.stickylistheaders; | ||
|
||
import android.widget.SectionIndexer; | ||
|
||
public class SectionIndexingExpandableStickyListHeadersAdapter extends ExpandableStickyListHeadersAdapter implements SectionIndexer { | ||
|
||
SectionIndexingExpandableStickyListHeadersAdapter(StickyListHeadersAdapter innerAdapter) { | ||
super(innerAdapter); | ||
if (!(innerAdapter instanceof SectionIndexer)) throw new IllegalArgumentException("Wrapped adapter must implement SectionIndexer"); | ||
} | ||
|
||
@Override | ||
public Object[] getSections() { | ||
return ((SectionIndexer) mInnerAdapter).getSections(); | ||
} | ||
|
||
@Override | ||
public int getPositionForSection(int sectionIndex) { | ||
return ((SectionIndexer) mInnerAdapter).getPositionForSection(sectionIndex); | ||
} | ||
|
||
@Override | ||
public int getSectionForPosition(int position) { | ||
return ((SectionIndexer) mInnerAdapter).getSectionForPosition(position); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters