-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/chat/channel message screen #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
1444623
feat: implement ChannelActivity and adapt MainActivity.kt
taghizadlaura 2af41b9
feat: implement first working version of messages and channels betwee…
taghizadlaura a9f361f
feat: trying to extract channel creation
francelu 9649773
fix: remove separators and dashes in generateChannelId()
taghizadlaura 021c82a
feat: implement navigation to MessageScreen upon accepting an alert
taghizadlaura 986bd4b
Merge branch 'refs/heads/feat/chat/client-setup' into feat/chat/chann…
taghizadlaura 0b2f239
feat: update channel names to be "palName1 & palName2"
taghizadlaura 69a878d
test: add ChatViewModel tests and adapt AlertListsScreenTest
taghizadlaura 759710b
Merge branch 'refs/heads/main' into feat/chat/channel-message-screen
taghizadlaura 62d8d12
feat: implement our own ChannelsScreen top app bar
francelu 10fccd4
test: add runTest
francelu 1aaa860
refactor: rename `ChannelsScreen.kt` to `ChannelsScreenContainer.kt`
francelu 650ede3
test: implement tests for `ChannelsScreenContainer`
francelu c5b6b6e
fix: use try catch in `createChannel()`
francelu 4e2b541
test: success createChannel test
francelu 8511119
style: clean up code
taghizadlaura 8e0ca69
Merge branch 'refs/heads/main' into feat/chat/channel-message-screen
taghizadlaura 25405f2
feat: handle failure of generateCid in createChannel
taghizadlaura 3f4a3eb
feat: adapt failure of createChannel in AlertLists
taghizadlaura c1c4ec5
test: add test for generateCid failure case in createChannel for Chat VM
taghizadlaura 5d6c675
test: verify createChannel on accept pal's alert in AlertLists
taghizadlaura 4e053b7
ci: add chat secrets to general worklfow
9630084
ci: update all secrets that were forgotten
7ca778f
Merge remote-tracking branch 'refs/remotes/origin/main' into feat/cha…
taghizadlaura e66d6dd
fix: add `com.android.periodpals.` prefix to Push Notifications in An…
taghizadlaura 2364bf4
Merge remote-tracking branch 'refs/remotes/origin/main' into feat/cha…
taghizadlaura acff574
fix: implement nitpick from Bruno's review
taghizadlaura 6abd522
Merge remote-tracking branch 'refs/remotes/origin/main' into feat/cha…
taghizadlaura File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/android/periodpals/ChannelActivity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.android.periodpals | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import io.getstream.chat.android.compose.ui.messages.MessagesScreen | ||
import io.getstream.chat.android.compose.ui.theme.ChatTheme | ||
import io.getstream.chat.android.compose.viewmodel.messages.MessagesViewModelFactory | ||
|
||
/** | ||
* Activity that displays a chat channel. It uses the [MessagesScreen] to display the messages of a | ||
* channel. | ||
*/ | ||
class ChannelActivity : ComponentActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
// Load the ID of the selected channel | ||
val channelId = intent.getStringExtra(KEY_CHANNEL_ID)!! | ||
|
||
// Add the MessagesScreen to your UI | ||
setContent { | ||
ChatTheme { | ||
MessagesScreen( | ||
viewModelFactory = | ||
MessagesViewModelFactory(context = this, channelId = channelId, messageLimit = 30), | ||
lazarinibruno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onBackPressed = { finish() }) | ||
} | ||
} | ||
} | ||
|
||
// Create an intent to start this Activity, with a given channelId | ||
companion object { | ||
private const val KEY_CHANNEL_ID = "channelId" | ||
|
||
fun getIntent(context: Context, channelId: String): Intent { | ||
return Intent(context, ChannelActivity::class.java).apply { | ||
putExtra(KEY_CHANNEL_ID, channelId) | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.