parent
f118088161
commit
5764efa5d4
|
@ -36,6 +36,7 @@ const val DIRECT = "Direct"
|
||||||
const val TRENDING_TAGS = "TrendingTags"
|
const val TRENDING_TAGS = "TrendingTags"
|
||||||
const val HASHTAG = "Hashtag"
|
const val HASHTAG = "Hashtag"
|
||||||
const val LIST = "List"
|
const val LIST = "List"
|
||||||
|
const val BOOKMARKS = "Bookmarks"
|
||||||
|
|
||||||
data class TabData(
|
data class TabData(
|
||||||
val id: String,
|
val id: String,
|
||||||
|
@ -114,6 +115,12 @@ fun createTabDataFromId(id: String, arguments: List<String> = emptyList()): TabD
|
||||||
arguments = arguments,
|
arguments = arguments,
|
||||||
title = { arguments.getOrNull(1).orEmpty() }
|
title = { arguments.getOrNull(1).orEmpty() }
|
||||||
)
|
)
|
||||||
|
BOOKMARKS -> TabData(
|
||||||
|
id = BOOKMARKS,
|
||||||
|
text = R.string.title_bookmarks,
|
||||||
|
icon = R.drawable.ic_bookmark_active_24dp,
|
||||||
|
fragment = { TimelineFragment.newInstance(TimelineViewModel.Kind.BOOKMARKS) }
|
||||||
|
)
|
||||||
else -> throw IllegalArgumentException("unknown tab type")
|
else -> throw IllegalArgumentException("unknown tab type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,6 +382,10 @@ class TabPreferenceActivity : BaseActivity(), Injectable, ItemInteractionListene
|
||||||
if (!currentTabs.contains(trendingTagsTab)) {
|
if (!currentTabs.contains(trendingTagsTab)) {
|
||||||
addableTabs.add(trendingTagsTab)
|
addableTabs.add(trendingTagsTab)
|
||||||
}
|
}
|
||||||
|
val bookmarksTab = createTabDataFromId(BOOKMARKS)
|
||||||
|
if (!currentTabs.contains(trendingTagsTab)) {
|
||||||
|
addableTabs.add(bookmarksTab)
|
||||||
|
}
|
||||||
|
|
||||||
addableTabs.add(createTabDataFromId(HASHTAG))
|
addableTabs.add(createTabDataFromId(HASHTAG))
|
||||||
addableTabs.add(createTabDataFromId(LIST))
|
addableTabs.add(createTabDataFromId(LIST))
|
||||||
|
|
Loading…
Reference in New Issue