diff --git a/app/src/main/java/com/keylesspalace/tusky/TabData.kt b/app/src/main/java/com/keylesspalace/tusky/TabData.kt index 5ae9d9ec..bca0f3ad 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TabData.kt +++ b/app/src/main/java/com/keylesspalace/tusky/TabData.kt @@ -129,13 +129,17 @@ fun createTabDataFromId(id: String, arguments: List = emptyList()): TabD icon = R.drawable.ic_bookmark_active_24dp, fragment = { TimelineFragment.newInstance(TimelineViewModel.Kind.BOOKMARKS) } ) + LOCAL -> TabData( + id = LOCAL, + text = R.string.title_public_local, + icon = R.drawable.ic_local_24dp, + fragment = { TimelineFragment.newInstance(TimelineViewModel.Kind.PUBLIC_LOCAL) } + ) AUTOGESTIONE -> TabData( id = AUTOGESTIONE, text = R.string.autogestione, icon = R.drawable.ic_bullhorn_24dp, - fragment = { args -> TimelineFragment.newInstance(TimelineViewModel.Kind.AUTOGESTIONE, args.getOrNull(0).orEmpty()) }, - arguments = arguments, - title = { arguments.getOrNull(1).orEmpty() } + fragment = { TimelineFragment.newInstance(TimelineViewModel.Kind.AUTOGESTIONE) } ) else -> throw IllegalArgumentException("unknown tab type") } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/NetworkTimelineViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/NetworkTimelineViewModel.kt index 6a1aa2c3..455057ca 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/NetworkTimelineViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/timeline/viewmodel/NetworkTimelineViewModel.kt @@ -291,7 +291,7 @@ class NetworkTimelineViewModel @Inject constructor( Kind.BOOKMARKS -> api.bookmarks(fromId, uptoId, limit) Kind.LIST -> api.listTimeline(id!!, fromId, uptoId, limit) Kind.PUBLIC_TRENDING_STATUSES -> api.trendingStatuses(limit = limit, offset = fromId) - Kind.AUTOGESTIONE -> api.autogestione(remote = false, only_media = false) + Kind.AUTOGESTIONE -> api.autogestione(remote = false, only_media = false,maxId = fromId, sinceId = uptoId, limit = limit) } } diff --git a/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt b/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt index bd278ad8..9168be2f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt +++ b/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt @@ -864,6 +864,10 @@ interface MastodonApi { @GET("/api/v1/timelines/autogestione?remote=false&only_media=false") suspend fun autogestione( @Query("remote") remote: Boolean? = false, - @Query("only_media") only_media: Boolean? = false + @Query("only_media") only_media: Boolean? = false, + @Query("local") local: Boolean? = null, + @Query("max_id") maxId: String? = null, + @Query("since_id") sinceId: String? = null, + @Query("limit") limit: Int? = null, ): Response> }