Skip to content

Commit

Permalink
Change Soga to soga for successful build gradle if we clone rep
Browse files Browse the repository at this point in the history
  • Loading branch information
saharulik committed Mar 30, 2024
1 parent df77ab9 commit f749920
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
34 changes: 25 additions & 9 deletions app/src/main/kotlin/ai/elimu/soga/feature/chat/ChatScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import ai.elimu.soga.GenerativeViewModelFactory
import ai.elimu.soga.R
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.ui.draw.clip
import kotlinx.coroutines.launch
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource

@Composable
internal fun ChatRoute(
Expand Down Expand Up @@ -118,14 +124,24 @@ fun ChatBubbleItem(
Column(
horizontalAlignment = horizontalAlignment,
modifier = Modifier
.padding(horizontal = 8.dp, vertical = 4.dp)
.padding(horizontal = 12.dp, vertical = 10.dp)
.fillMaxWidth()
) {
Text(
text = chatMessage.participant.name,
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(bottom = 4.dp)
)
// Text(
// text = chatMessage.participant.name,
// style = MaterialTheme.typography.bodySmall,
// modifier = Modifier.padding(bottom = 4.dp)
// )
if (isModelMessage) {
Image(
painter = painterResource(id = R.drawable.nya),
contentDescription = stringResource(id = R.string.nya_avatar_descritpion),
contentScale = ContentScale.Crop,
modifier = Modifier
.size(50.dp)
.clip(CircleShape)
)
}
Row {
if (chatMessage.isPending) {
CircularProgressIndicator(
Expand All @@ -138,11 +154,11 @@ fun ChatBubbleItem(
Card(
colors = CardDefaults.cardColors(containerColor = backgroundColor),
shape = bubbleShape,
modifier = Modifier.widthIn(0.dp, maxWidth * 0.9f)
modifier = Modifier.widthIn(0.dp, maxWidth * 2.9f)
) {
Text(
text = chatMessage.text,
modifier = Modifier.padding(16.dp)
modifier = Modifier.padding(20.dp)
)
}
}
Expand Down Expand Up @@ -192,7 +208,7 @@ fun MessageInput(
.fillMaxWidth()
.weight(0.15f)
) {
Icon(
Icon(
Icons.Default.Send,
contentDescription = stringResource(R.string.action_send),
modifier = Modifier
Expand Down
Binary file added app/src/main/res/drawable/nya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<!-- Chat sample strings -->
<string name="chat_label">Message</string>
<string name="action_send">Send</string>

<!-- Image description -->
<string name="nya_avatar_descritpion">Nya looking at something</string>
</resources>

0 comments on commit f749920

Please sign in to comment.