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 introduces the ability to see how many people have read an outgoing message in a group chat. A "views" count is now displayed in the message options dialog for relevant messages.
- **API & Data Layer:**
- Added `getMessageReadPeers` to `MessagesService` and `MessagesRepository` to fetch users who have read a specific message.
- Introduced `MessagesGetReadPeersResponse` to handle the API response.
- A new URL constant `GET_MESSAGE_READ_PEERS` was added.
- **Domain Layer:**
- A new `GetMessageReadPeersUseCase` is created to provide the view count to the ViewModel.
- The use case is registered in the `DomainModule`.
- **ViewModel:**
- `MessagesHistoryViewModel` now includes `loadMessageReadPeers` to asynchronously fetch and return the view count for a message.
- **UI (Compose):**
- The `MessageOptionsDialog` now displays a "views" count for outgoing chat messages.
- It uses a `LaunchedEffect` to call `loadMessageReadPeers` when the dialog is shown.
- The `visibility` icon has been updated and its XML file renamed to `round_visibility_24px.xml` to follow a consistent naming convention.
- **Refactoring & Minor Fixes:**
- Simplified several `derivedStateOf` usages to direct calculations or property delegates in `MessageBubble.kt` and `MessagesList.kt` for minor performance improvements.
- Renamed `IncomingMessageBubble.kt` and `OutgoingMessageBubble.kt` to `MessageBubbleIncoming.kt` and `MessageBubbleOutgoing.kt` respectively for consistency.
- Removed an unnecessary log statement in `MessagesList.kt`.
This commit introduces the ability to reply to a message by swiping it to the right. The message input bar and related components have been redesigned and refactored for a cleaner look and better user experience.
Key changes:
- Added a swipe-to-reply gesture on message bubbles.
- Redesigned the message `InputBar` with updated styling, animations, and rounded corners that adapt to the reply state.
- Renamed `MessagesHistoryInputBar` to a more generic `InputBar`.
- Introduced `FastTextField`, a customized `BasicTextField`, for better performance and control.
- Replaced `IconButton` with `FastIconButton` and `RippledClickContainer` in several places for consistent click handling.
- Refactored `PinnedMessageContainer` and `ReplyContainer` with improved UI.
- Updated the Compose BOM to `2025.12.00`.
Moves the `RippledClickContainer` composable from the `messageshistory` feature module to the `core/ui` module to allow for reuse across different features.
Additionally, this change introduces text truncation with an ellipsis for the title and text within the `ReplyContainer` to prevent long content from breaking the layout.
This commit introduces the ability to reply to messages.
- **API & Data Layer:**
- Replaced `replyTo` parameter with `forward` in `sendMessage` calls across the data, domain, and repository layers to support the new reply mechanism.
- **ViewModel:**
- Added logic to handle the reply state, including storing the replied message's ID (`replyToCmId`).
- When a message is sent, it now correctly constructs a `forward` JSON object if it is a reply.
- The UI state (`MessagesHistoryScreenState`) is updated to show and hide the reply preview.
- Added a `onReplyCloseClicked` handler to cancel a reply.
- The ViewModel interface was removed, and the implementation class `MessagesHistoryViewModelImpl` is used directly.
- **UI (Compose):**
- A new `ReplyContainer` is displayed above the message input bar when a reply is active.
- The input bar's corner radius animates to integrate with the reply container.
- Added a `FocusRequester` to automatically focus the input field when the reply action is selected.
- Added spacing in the message list to prevent the reply preview from overlapping messages.
- The message options dialog now passes the `messageId` and `cmId` when an option is picked.
This commit introduces the ability to reply to messages.
- **API & Data Layer:**
- Replaced `replyTo` parameter with `forward` in `sendMessage` calls across the data, domain, and repository layers to support the new reply mechanism.
- **ViewModel:**
- Added logic to handle the reply state, including storing the replied message's ID (`replyToCmId`).
- When a message is sent, it now correctly constructs a `forward` JSON object if it is a reply.
- The UI state (`MessagesHistoryScreenState`) is updated to show and hide the reply preview.
- Added a `onReplyCloseClicked` handler to cancel a reply.
- The ViewModel interface was removed, and the implementation class `MessagesHistoryViewModelImpl` is used directly.
- **UI (Compose):**
- A new `ReplyContainer` is displayed above the message input bar when a reply is active.
- The input bar's corner radius animates to integrate with the reply container.
- Added a `FocusRequester` to automatically focus the input field when the reply action is selected.
- Added spacing in the message list to prevent the reply preview from overlapping messages.
- The message options dialog now passes the `messageId` and `cmId` when an option is picked.
This commit introduces a confirmation dialog before creating a new chat. The dialog displays the final chat title, which is now dynamically generated based on the user's input or the names of the selected participants.
Key changes:
- Added a confirmation dialog that appears when the user clicks the "create chat" button.
- Implemented logic to generate a provisional chat title from participants' names if no title is explicitly set.
- Refactored `CreateChatViewModel` by removing the interface and simplifying the implementation.
- Added new string resources for the confirmation dialog.
This commit refactors the `ActionMode` sealed class into an enum and adds a new `RECORD_VIDEO` state. This allows for distinct actions for recording audio and video messages.
Specifically, the following changes were made:
- Converted `ActionMode` from a sealed class to an enum.
- Added `RECORD_VIDEO` to `ActionMode`.
- Updated `MessagesHistoryInputBar` to:
- Animate the action button icon change between record modes.
- Remove the shake animation from emoji, attachment, and mic buttons.
- Updated `MessagesHistoryViewModel` to toggle between `RECORD_AUDIO` and `RECORD_VIDEO` when the action button is clicked in a record mode.
- Added support for displaying `VIDEO_MESSAGE` attachments in `Attachments.kt`, including an animated circular preview.
- Updated `MessageBubble` to render video messages without a background, similar to stickers.
- Added `image` property to `VkVideoMessageDomain` to hold the URL for the video message preview.
- Added a new drawable `rounded_photo_camera_24` for the video record button.
- Updated `VkVideoMessageData` to parse and provide the square preview image URL to the domain model.
This commit introduces a dismiss functionality to the `FullScreenDialog`.
The `FullScreenDialog` now accepts an `onDismiss` lambda parameter.
This `onDismiss` lambda is invoked when a dismiss request is made for the dialog.
In `PhotoViewScreen`, the `onDismiss` lambda passed to `FullScreenDialog` is now the `onDismiss` lambda received by the `PhotoViewScreen` itself.
This commit refactors the PhotoViewScreen to be displayed as a Dialog instead of a separate navigation destination.
Key changes:
- Introduced `PhotoViewDialog` composable that wraps `PhotoViewRoute` in a `FullScreenDialog`.
- Modified `RootScreen` to use `PhotoViewDialog` for displaying images.
- Updated `PhotoViewViewModelImpl` to handle loading state and display a loader while downloading images.
- Made `Loader` and `ContainedLoader` colors configurable.
- Adjusted `PhotoViewScreen` UI:
- Set background to translucent black.
- Updated TopAppBar background color and icon tints.
- Improved vertical drag gesture for dismissing the viewer.
- Made `VkUserData.LastSeen.platform` nullable.
- Removed unused navigation functions related to the old PhotoViewScreen.
This commit introduces "Share" and "Open in..." actions to the `PhotoViewScreen`, allowing users to share images via other apps or open them in external viewers.
**Key changes:**
- **PhotoViewer:**
- Added "Share" and "Open in..." options to the `PhotoViewScreen` dropdown menu.
- `PhotoViewViewModel`:
- Implemented `onShareClicked()` and `onOpenInClicked()` to handle these new actions.
- Added `shareRequest` StateFlow to manage image sharing intents.
- Introduced `downloadAndStoreImageToCache()` to download and cache images for sharing.
- `onImageShared()` resets `shareRequest` after sharing.
- Updated `TopBar` to include the new menu items.
- Added string resources for "Open in…" and "Share".
- **Reply UI:**
- `Reply.kt`: Title and summary text now use `TextOverflow.Ellipsis` to prevent long text from breaking the layout.
- **API Model:**
- `MessagesResponse.kt`: Added `MessagesMarkAsImportantResponse` data class to handle the response for marking messages as important.
- **Data Layer:**
- `MessagesRepositoryImpl`: Updated `markAsImportant` to correctly map the API response using `MessagesMarkAsImportantResponse`.
- **Minor:**
- `README.md`: Updated feature checklist for external viewer.
- `ApplicationModule.kt`: Added experimental Coil API opt-in.
This commit introduces the ability to display stickers within message bubbles.
Key changes:
- `Attachments.kt`: Added handling for `AttachmentType.STICKER`. If an attachment type is unsupported, a placeholder text is now displayed.
- `Sticker.kt`: New composable created to render `VkStickerDomain` using `AsyncImage`.
- `MessageBubble.kt`:
- Adjusted background alpha for sticker messages to make the bubble transparent.
- Minor refactoring of `minDateContainerWidth` and `dateContainerWidth` initialization.
- `VkStickerDomain.kt`: Added `getUrl()` function to construct sticker image URLs, with options for specifying width and background.
This commit introduces `FullScreenContainedLoader` and replaces usages of `FullScreenLoader` where appropriate.
It also updates several composables to use `rememberUpdatedState` for lambda parameters to ensure the latest versions are used.
Additionally, the following changes are included:
- Add a setting to show/hide the attachment button in the chat input bar.
- Implement navigation to `PhotoViewScreen` when a photo attachment is clicked in a message.
- Add "Copy link" and "Copy image" actions to `PhotoViewScreen`.
- Remove unused settings and their corresponding logic from `SettingsViewModel` and `UserSettings`.
* Bump haze version to 1.6.0.
* Blur now works on android 11 and older
* Add "Sign up" and "Forgot password?" links to the auth screen.
* Add logic to toggle dynamic colors on logo click in the auth screen (Android 12+).
* new attachments in messages history - photo, video, audio, file, link
* improve attachments in messages history and adjusted font size for logo's text in auth screen
* audio duration, file preview and url preview are now visible in attachments in messages history screen
* make MessageBubble width adapt to attachments container width
* topbar back icon crossfade animation
* implement rich text for message input
* handle click and long click on attachments
* added click and long click handlers for attachments in message bubbles
* enabled opening photos, files, and links when clicked.
* implemented basic long-click logging for photos.
* handled back press to return to Conversations from other tabs.
* corrected the logic for filtering and selecting video images.
* updated string resources for attachments, including a new "Clip" string.
* make MessageBubble mention text underline on out messages
* Bump VK Api version to 5.238
* Implemented new authorization flow (at the moment, without auto re-requesting token)
* Add support for sticker pack preview attachments
* Bump LongPoll to version 19
* Improved messages handling
* Fixed coloring issues
* Cache improvements
* Archive screen with full functionality
* Recomposition fixes
* Markdown support for messages bubbles
* Adjust app name font size based on screen width
* Navigation related improvements
* Add logout functionality
* pagination in chat fixed
* other fixes and improvements
* fixed visual bug in progress bar in chat history
* Refactor: Enhance conversations and friends features
- In `ConversationsScreen`, removed `isNeedToScrollToTop` and `onScrolledToTop`, and refactored toolbar container color logic. Added `NoItemsView` for empty conversation lists.
- In `MainGraph`, added `onMessageClicked` for navigation to message history.
- In `ApiEvent`, introduced `parseOrNull` for handling unknown event types.
- In `ConversationsViewModel`, removed `scrollToTop` logic and refactored error handling.
- In `FriendsViewModel`, refactored error handling and introduced `onErrorConsumed` and `handleError`.
- In `FriendItem`, added an icon button to initiate sending a message to a friend.
- In `strings.xml`, added or updated strings for session expiration, log out, refreshing, and empty friend lists.
- In `RootScreen`, added `onMessageClicked` for navigating to messages.
- In `FriendsList`, added `onMessageClicked` for handling message clicks.
- In `MainScreen`, removed unused `MutableSharedFlow`.
- In `FriendsScreen`, added support for showing errors, added `onMessageClicked`, and replaced `hazeChild` with `hazeEffect` and `hazeSource`.
- In `FriendsNavigation`, added `onMessageClicked` for handling message clicks.
- In `ConversationsNavigation`, removed the unused `scrollToTopFlow` parameter.
- In `ErrorView`, added text alignment.
- In `NoItemsView`, added support for a button and custom text.
- In `LongPollUpdatesParser`, replaced try-catch with `parseOrNull`.
* Chat creation feature (#138)
* - read indicator, edit status and time for message in messages history
* message sending status
* Bump haze from 1.1.1 to 1.2.0 (#105)
* Bump org.jetbrains.kotlinx:kotlinx-serialization-json from 1.7.3 to 1.8.0 (#104)
* update gradle wrapper
* Bump agp from 8.7.3 to 8.8.0 (#106)
* Bump com.jraska.module.graph.assertion from 2.7.1 to 2.7.3 (#109)
* Bump haze from 1.2.0 to 1.2.2 (#111)
* Bump koin from 4.0.1 to 4.0.2 (#112)
* little improvement
* Bump kotlin from 2.1.0 to 2.1.10 (#113)
* Bump androidx.compose:compose-bom from 2024.12.01 to 2025.02.00 (#115)
* Bump androidx.navigation:navigation-compose from 2.8.5 to 2.8.7 (#119)
* Bump haze from 1.2.2 to 1.3.1 (#118)
* Bump ksp from 2.1.0-1.0.29 to 2.1.10-1.0.30 (#116)
* Bump agp from 8.8.0 to 8.8.1 (#117)
* Bump com.google.accompanist:accompanist-permissions (#121)
* Rename the app's namespace and applicationId to `dev.meloda.fastvk`, and update the package name in `ACTION_MANAGE_UNKNOWN_APP_SOURCES` intent. Remove unnecessary `onLowMemory` method in the `OnlineService`.
* Bump com.jraska.module.graph.assertion from 2.7.3 to 2.8.0 (#126)
* Bump ksp from 2.1.10-1.0.30 to 2.1.10-1.0.31 (#125)
* Bump haze from 1.3.1 to 1.4.0 (#124)
* Bump agp from 8.8.1 to 8.8.2 (#123)
* Bump androidx.navigation:navigation-compose from 2.8.7 to 2.8.8 (#122)
* Bump haze from 1.4.0 to 1.5.0 (#128)
* Bump agp from 8.8.2 to 8.9.0 (#127)
* Bump androidx.navigation:navigation-compose from 2.8.8 to 2.8.9 (#130)
* Bump androidx.compose:compose-bom from 2025.02.00 to 2025.03.00 (#129)
* revert agp version to 8.8.2
* fix issues with package names
* Bump haze from 1.5.0 to 1.5.1 (#133)
* Bump com.google.guava:guava from 33.4.0-jre to 33.4.5-jre (#132)
* russian translations
* fixes and improvements
---------
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump com.google.guava:guava from 33.3.1-jre to 33.4.0-jre (#97)
* Bump coroutines from 1.9.0 to 1.10.1 (#100)
* some improvements + loading conversation on new message if it is not already in the list
* Bump koin from 4.0.0 to 4.0.1 (#101)
* minor update
---------
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* settings reorganization;
implement long press on emoji button for fast text;
some deprecations fixed;
some typos fixed;
etc
* ability to use more animations (experimental);
fix online friends loading;
conversation avatar in messages history screen;
test second tap on conversations item in bottom bar to scroll to top;
etc
* version up