Skip to content

Commit

Permalink
ch?t or ch?t
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobodemann committed Oct 22, 2021
1 parent f08e9eb commit 6c74187
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
41 changes: 37 additions & 4 deletions app/src/main/java/berlindroid/zethree/MessagesActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ??" />


<Button
Expand Down

0 comments on commit 6c74187

Please sign in to comment.