forked from upstream-mirrors/quik
create custom view for avatarview, add to conversation layout
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
package com.moez.QKSMS.ui.view
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.widget.ImageView
|
||||||
|
|
||||||
|
class AvatarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : ImageView(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
|
||||||
|
constructor(context: Context) : this(context, null, 0)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,28 +1,45 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp">
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
<TextView
|
<com.moez.QKSMS.ui.view.AvatarView
|
||||||
android:id="@+id/title"
|
android:id="@+id/avatar"
|
||||||
style="@style/TextPrimary"
|
android:layout_width="48dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="48dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="top"
|
||||||
tools:text="Moez Bhatti" />
|
android:background="@color/textSecondary" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/snippet"
|
android:layout_width="0dp"
|
||||||
style="@style/TextSecondary"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_weight="1"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
android:orientation="vertical">
|
||||||
tools:text="Hey! How's it going?" />
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
style="@style/TextPrimary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
tools:text="Moez Bhatti" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/snippet"
|
||||||
|
style="@style/TextSecondary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
tools:text="Hey! How's it going?" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user