Created
May 20, 2019 06:41
-
-
Save DevAhamed/a62316c8423661b0c249425a414a3a4f to your computer and use it in GitHub Desktop.
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
// NewsPaperSources | |
ListSection<NewsSource> newsPaperSources = new ListSection(); | |
ItemSection<NewsSource> newsPaperNoneItem = new ItemSection(new NewsSource(NewsSource.NONE)); | |
// Create a nested section for NewsPaperSources | |
NestedSection nestedNewsPaperSection = new NestedSection(); | |
nestedNewsPaperSection.addSection(newsPaperSources); | |
nestedNewsPaperSection.addSection(newsPaperNoneItem); | |
// NewsChannelSources | |
ListSection<NewsSource> newsChannelSources = new ListSection(); | |
ItemSection<NewsSource> newsChannelNoneItem = new ItemSection(new NewsSource(NewsSource.NONE)); | |
// Create a nested section for NewsChannelSources | |
NestedSection nestedNewsChannelSection = new NestedSection(); | |
nestedNewsChannelSection.addSection(newsChannelSources); | |
nestedNewsChannelSection.addSection(newsChannelNoneItem); | |
// Add sections to adapter | |
adapter.addSection(nestedNewsPaperSection); | |
adapter.addSection(nestedNewsChannelSection); | |
// Set the selection modes | |
adapter.setSelectionMode(Mode.MULTIPLE); | |
newsPaperSources.setSelectionMode(Mode.MULTIPLE); | |
nestedNewsPaperSection.setSelectionMode(Mode.SINGLE); | |
newsChannelSources.setSelectionMode(Mode.MULTIPLE); | |
nestedNewsChannelSection.setSelectionMode(Mode.SINGLE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment