Create a Jetpack Compose code of a basic messaging app. On the chat screen there is a…
- User
Create a Jetpack Compose code of a basic messaging app. On the chat screen there is a top bar that shows the receipients name. In the middle of the screen is a chat going back and forth between me and my friend. At the bottom is another bar that has a text input field and a send button beside it.
Assistant
Here is the basic structure of the app:
TopAppBar
ChatMessageList
SendMessageBar
You can then add code to complete the implementation of each of these components.
- User
Complete the implementation of TopAppBar ChatMessageList SendMessageBar
Assistant
Here is the code to complete the implementation of TopAppBar:
TopAppBar( title = "Chat", showNavigation = true, showSearch = true )
Here is the code to complete the implementation of ChatMessageList:
ChatMessageList( messages = chatMessages )
Here is the code to complete the implementation of SendMessageBar:
SendMessageBar( onSendClick = sendMessage, message = sendMessageText )
- User
Insert this chat app into a Activity class
Assistant
Here is the code to insert the chat app into a new activity:
Activity( layout = R.layout.activity_main, title = "Chat App" )
- User
Make the chatMessages a dialogue between characters from the friends TV show
Assistant
Sure, here's an example of a dialogue between the characters Rachel and Monica from the TV show Friends:
ChatMessageList( messages = [ ChatMessage( name = "Rachel", message = "Hey, Monica! How's it going?" ), ChatMessage( name = "Monica", message = "Hey, Rachel! I'm good, just catching up with some old episodes of Friends." ), ChatMessage( name = "Rachel", message = "Oh, that sounds fun! I love that show. So, what's your favorite episode?" ), ChatMessage( name = "Monica", message = "Oh, that's a tough one. I think it has to be the one where Ross and Rachel take a break." ), ChatMessage( name = "Rachel", message = "Oh, I love that one too! It's so emotional. And what about your favorite character?" ), ChatMessage( name = "Monica", message = "Definitely Chandler. He always makes me laugh." ), ChatMessage( name = "Rachel", message = "Chandler is great, but I think I have to go with Joey. He's so lovable." ), ChatMessage( name = "Monica", message = "Joey is definitely lovable, but I think he can be a little too silly sometimes." ), ChatMessage( name = "Rachel", message = "True, but that's what makes him so fun to watch. So, what do you think about Phoebe?" ), ChatMessage( name = "Monica", message = "Phoebe is definitely unique, but I think she's a little too out there for me." ), ChatMessage( name = "Rachel", message = "I know what you mean, but I think that's what makes her so special. She's always bringing something new to the group." ), ChatMessage( name = "Monica", message = "True, she definitely adds a lot to the show. So, what do you think about Ross?" ), ChatMessage( name = "Rachel", message = "Ross is definitely a little uptight, but I think he's a great dad and a good friend." ), ChatMessage( name = "Monica", message = "I completely agree. And what about Rachel?" ), ChatMessage( name = "Rachel", message = "Well, I think Rachel is a little too uptight sometimes, but she's a great friend and a great mom." ), ChatMessage( name = "Monica", message = "I completely agree. So, what do you think about the show in general?" ), ChatMessage( name = "Rachel", message = "I think it's a great show. It's funny, it's emotional, and it's just a great way to unwind after a long day." ), ChatMessage( name = "Monica", message = "I completely agree. It's definitely one of my favorite shows of all time." ) ] )
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.