forked from melod1n/fast-messenger
Refactor: Extract RootScreen from MainActivity and fix reply message user
This commit refactors the UI composition logic by extracting it from `MainActivity` into a new, dedicated `RootScreen` composable. This improves the separation of concerns and simplifies `MainActivity`. Additionally, a bug has been fixed where a replied-to message would incorrectly display the author of the parent message instead of its own author. Key changes: - Moved theme setup, permission handling, Long-Poll/Online service management, and navigation graph hosting into the new `RootScreen.kt`. - `MainActivity` is now significantly simplified, delegating its UI composition to `RootScreen`. - Corrected the user and group assignment for `replyMessage` in `MessagesRepositoryImpl` to ensure the correct author is displayed. - Introduced `OnlineFriendsViewModel` to the `FriendsRoute` to separate the logic for online friends. - Replaced `List` with a custom `ImmutableList` for `photoViewerInfo` state to improve Compose stability.
This commit is contained in:
+3
@@ -1,5 +1,6 @@
|
||||
package dev.meloda.fast.messageshistory.model
|
||||
|
||||
import androidx.compose.runtime.Stable
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import dev.meloda.fast.common.model.UiImage
|
||||
import dev.meloda.fast.model.api.domain.VkAttachment
|
||||
@@ -9,6 +10,7 @@ sealed class UiItem(
|
||||
open val cmId: Long
|
||||
) {
|
||||
|
||||
@Stable
|
||||
data class Message(
|
||||
override val id: Long,
|
||||
override val cmId: Long,
|
||||
@@ -35,6 +37,7 @@ sealed class UiItem(
|
||||
val replySummary: String?
|
||||
) : UiItem(id, cmId)
|
||||
|
||||
@Stable
|
||||
data class ActionMessage(
|
||||
override val id: Long,
|
||||
override val cmId: Long,
|
||||
|
||||
Reference in New Issue
Block a user