![]() ![]() It could lead to spam, security issues, and a less than ideal chatting experience for the users. Here's the layout I'll be using: Īllowing users to anonymously post messages to the chat room would be a very bad idea. The layout must have TextView widgets to display the chat message's text, the time it was sent, and its author. Start by creating a new layout XML file called message.xml, whose root element is RelativeLayout. Now that the layout of the home screen is ready, we can move on to creating a layout for the chat messages, which will be items inside the ListView. Doing so adds a floating label to the EditText, which is important if you want to adhere to the guidelines of material design. Note that I've placed the EditText widget inside a TextInputLayout widget. After placing them all inside a RelativeLayout widget, your layout XML should look like this: Therefore, activity_main.xml must have a ListView, an EditText, and a FloatingActionButton. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |