Last active
November 18, 2019 03:12
-
-
Save john-lorrenz/23af230b320cf13f128dbb02b75be8d7 to your computer and use it in GitHub Desktop.
Simple Chat Layout Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation 'com.google.android.material:material:1.0.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<!-- | |
// Add this property to set alignment | |
android:layout_alignParentRight="true" | |
--> | |
<com.google.android.material.card.MaterialCardView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:cardElevation="0dp" | |
app:cardBackgroundColor="@android:color/black" | |
app:cardCornerRadius="10dp" | |
app:contentPadding="10dp"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Hi man what's up?" | |
android:textColor="@android:color/white"/> | |
</com.google.android.material.card.MaterialCardView> | |
</RelativeLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<!-- | |
// Add this property to set alignment | |
android:layout_alignParentRight="true" | |
--> | |
<com.google.android.material.card.MaterialCardView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:cardElevation="0dp" | |
app:cardBackgroundColor="@android:color/black" | |
app:cardCornerRadius="10dp" | |
app:contentPadding="10dp" | |
app:strokeColor="@android:color/darker_gray" | |
app:strokeWidth="1dp"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Hi man what's up?" | |
android:textColor="@android:color/white"/> | |
</com.google.android.material.card.MaterialCardView> | |
</RelativeLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment