Skip to content

Commit

Permalink
[WIP]add more profile tabs support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Dec 2, 2024
1 parent b7652ee commit a9e8714
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import dev.dimension.flare.ui.model.UiHashtag
import dev.dimension.flare.ui.model.UiProfile
import dev.dimension.flare.ui.model.UiTimeline
import dev.dimension.flare.ui.model.UiUserV2
import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow

Expand Down Expand Up @@ -74,4 +75,9 @@ interface MicroblogDataSource {
pageSize: Int = 20,
pagingKey: String = "fans_$userKey",
): Flow<PagingData<UiUserV2>>

fun profileTabs(
userKey: MicroBlogKey,
scope: CoroutineScope,
): ImmutableList<ProfileTab>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dev.dimension.flare.data.datasource.microblog

import androidx.compose.runtime.Immutable
import androidx.paging.PagingData
import dev.dimension.flare.ui.model.UiMedia
import dev.dimension.flare.ui.model.UiTimeline
import dev.dimension.flare.ui.presenter.profile.ProfileMedia
import kotlinx.coroutines.flow.Flow

sealed interface ProfileTab {
data class Timeline(
val type: Type,
val flow: Flow<PagingData<UiTimeline>>,
) : ProfileTab {
enum class Type {
Status,
StatusWithReplies,
}
}

data class Media(
val flow: Flow<PagingData<ProfileMedia>>,
) : ProfileTab
}

0 comments on commit a9e8714

Please sign in to comment.