kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Expand import/export options by default when subscriptions list is empty
rodzic
8b87893248
commit
f05b8c9542
|
@ -57,7 +57,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||
|
||||
@State @JvmField var itemsListState: Parcelable? = null
|
||||
@State @JvmField var feedGroupsListState: Parcelable? = null
|
||||
@State @JvmField var importExportItemExpandedState: Boolean = false
|
||||
@State @JvmField var importExportItemExpandedState: Boolean? = null
|
||||
|
||||
init {
|
||||
setHasOptionsMenu(true)
|
||||
|
@ -221,7 +221,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||
{ onImportPreviousSelected() },
|
||||
{ onImportFromServiceSelected(it) },
|
||||
{ onExportSelected() },
|
||||
importExportItemExpandedState)
|
||||
importExportItemExpandedState ?: false)
|
||||
groupAdapter.add(Section(importExportItem, listOf(subscriptionsSection)))
|
||||
|
||||
}
|
||||
|
@ -307,6 +307,13 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||
subscriptionsSection.update(result.subscriptions)
|
||||
subscriptionsSection.setHideWhenEmpty(false)
|
||||
|
||||
if (result.subscriptions.isEmpty() && importExportItemExpandedState == null) {
|
||||
items_list.post {
|
||||
importExportItem.isExpanded = true
|
||||
importExportItem.notifyChanged(FeedImportExportItem.REFRESH_EXPANDED_STATUS)
|
||||
}
|
||||
}
|
||||
|
||||
if (itemsListState != null) {
|
||||
items_list.layoutManager?.onRestoreInstanceState(itemsListState)
|
||||
itemsListState = null
|
||||
|
|
Ładowanie…
Reference in New Issue