diff --git a/app/src/main/java/berlindroid/zethree/MessagesActivity.kt b/app/src/main/java/berlindroid/zethree/MessagesActivity.kt index 1928caa..0031bf0 100644 --- a/app/src/main/java/berlindroid/zethree/MessagesActivity.kt +++ b/app/src/main/java/berlindroid/zethree/MessagesActivity.kt @@ -3,6 +3,17 @@ package berlindroid.zethree import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import androidx.activity.compose.setContent +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import coil.compose.rememberImagePainter import io.getstream.chat.android.compose.ui.messages.MessagesScreen import io.getstream.chat.android.compose.ui.theme.ChatTheme @@ -11,12 +22,34 @@ class MessagesActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContent { + + val shouldChet by remember { mutableStateOf(shouldShowChet()) } + ChatTheme { - MessagesScreen( - channelId = "messaging:zethree-app-channel-0", - onBackPressed = ::finish - ) + if(shouldChet){ + ChetFaceScreen() + }else { + MessagesScreen( + channelId = "messaging:zethree-app-channel-0", + onBackPressed = ::finish + ) + } } } } + + private fun shouldShowChet(): Boolean{ + return (1..2).random() == 1 + } + +} + + + +@Composable +fun ChetFaceScreen() { + Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center){ + //CHET IMGE + Image(painter = painterResource(id = R.drawable.chet), contentDescription = "Practice practice practice. Chet is king #ChetBoi4Lyf") + } } \ No newline at end of file diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml index aa5477f..d9eab52 100644 --- a/app/src/main/res/layout/main_activity.xml +++ b/app/src/main/res/layout/main_activity.xml @@ -101,7 +101,7 @@ android:id="@+id/chat_button" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="Chat, not Chet" /> + android:text="Ch*t ??" />