Expand import/export options by default when subscriptions list is empty
This commit is contained in:
parent
8b87893248
commit
f05b8c9542
1 changed files with 9 additions and 2 deletions
|
@ -57,7 +57,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
|
|
||||||
@State @JvmField var itemsListState: Parcelable? = null
|
@State @JvmField var itemsListState: Parcelable? = null
|
||||||
@State @JvmField var feedGroupsListState: Parcelable? = null
|
@State @JvmField var feedGroupsListState: Parcelable? = null
|
||||||
@State @JvmField var importExportItemExpandedState: Boolean = false
|
@State @JvmField var importExportItemExpandedState: Boolean? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
|
@ -221,7 +221,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
{ onImportPreviousSelected() },
|
{ onImportPreviousSelected() },
|
||||||
{ onImportFromServiceSelected(it) },
|
{ onImportFromServiceSelected(it) },
|
||||||
{ onExportSelected() },
|
{ onExportSelected() },
|
||||||
importExportItemExpandedState)
|
importExportItemExpandedState ?: false)
|
||||||
groupAdapter.add(Section(importExportItem, listOf(subscriptionsSection)))
|
groupAdapter.add(Section(importExportItem, listOf(subscriptionsSection)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -307,6 +307,13 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||||
subscriptionsSection.update(result.subscriptions)
|
subscriptionsSection.update(result.subscriptions)
|
||||||
subscriptionsSection.setHideWhenEmpty(false)
|
subscriptionsSection.setHideWhenEmpty(false)
|
||||||
|
|
||||||
|
if (result.subscriptions.isEmpty() && importExportItemExpandedState == null) {
|
||||||
|
items_list.post {
|
||||||
|
importExportItem.isExpanded = true
|
||||||
|
importExportItem.notifyChanged(FeedImportExportItem.REFRESH_EXPANDED_STATUS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (itemsListState != null) {
|
if (itemsListState != null) {
|
||||||
items_list.layoutManager?.onRestoreInstanceState(itemsListState)
|
items_list.layoutManager?.onRestoreInstanceState(itemsListState)
|
||||||
itemsListState = null
|
itemsListState = null
|
||||||
|
|
Loading…
Reference in a new issue