- More work on avatars.
This commit is contained in:
@@ -2,6 +2,8 @@ package com.tutpro.baresip
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
|
import android.support.v4.content.ContextCompat
|
||||||
|
import android.support.v7.widget.CardView
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -19,18 +21,27 @@ class CallListAdapter(private val cxt: Context, private val rows: ArrayList<Call
|
|||||||
val callRow = rows[position]
|
val callRow = rows[position]
|
||||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||||
val rowView = inflater.inflate(R.layout.call_row, parent, false)
|
val rowView = inflater.inflate(R.layout.call_row, parent, false)
|
||||||
val avatarView = rowView.findViewById(R.id.avatar) as TextView
|
val textAvatarView = rowView.findViewById(R.id.TextAvatar) as TextView
|
||||||
val avatarBackground = avatarView.background as GradientDrawable
|
val cardAvatarView = rowView.findViewById(R.id.CardAvatar) as CardView
|
||||||
|
val cardImageAvatarView = rowView.findViewById(R.id.CardImageAvatar) as ImageView
|
||||||
val contact = ContactsActivity.findContact(callRow.peerUri)
|
val contact = ContactsActivity.findContact(callRow.peerUri)
|
||||||
val peer: String
|
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
peer = contact.name
|
val avatarImage = contact.avatarImage
|
||||||
avatarBackground.setColor(contact.color)
|
if (avatarImage != null) {
|
||||||
|
textAvatarView.visibility = View.GONE
|
||||||
|
cardAvatarView.visibility = View.VISIBLE
|
||||||
|
cardImageAvatarView.setImageBitmap(avatarImage)
|
||||||
|
} else {
|
||||||
|
textAvatarView.visibility = View.VISIBLE
|
||||||
|
cardAvatarView.visibility = View.GONE
|
||||||
|
(textAvatarView.background as GradientDrawable).setColor(contact.color)
|
||||||
|
textAvatarView.text = "${contact.name[0]}"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
peer = Utils.friendlyUri(callRow.peerUri, callRow.aor)
|
textAvatarView.visibility = View.VISIBLE
|
||||||
avatarBackground.setColor(Utils.randomColor())
|
cardAvatarView.visibility = View.GONE
|
||||||
|
textAvatarView.setBackgroundResource(R.drawable.person_image)
|
||||||
}
|
}
|
||||||
avatarView.text = "${peer[0]}"
|
|
||||||
val directions = rowView.findViewById(R.id.directions) as LinearLayout
|
val directions = rowView.findViewById(R.id.directions) as LinearLayout
|
||||||
var count = 1
|
var count = 1
|
||||||
for (d in callRow.directions) {
|
for (d in callRow.directions) {
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
package com.tutpro.baresip
|
package com.tutpro.baresip
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.support.v4.content.ContextCompat
|
import android.support.v4.content.ContextCompat
|
||||||
|
import android.support.v7.widget.CardView
|
||||||
import android.text.format.DateUtils.isToday
|
import android.text.format.DateUtils.isToday
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.*
|
||||||
import android.widget.LinearLayout
|
|
||||||
import android.widget.RelativeLayout
|
|
||||||
import android.widget.TextView
|
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.text.DateFormat
|
import java.text.DateFormat
|
||||||
@@ -24,21 +21,31 @@ class ChatListAdapter(private val cxt: Context, private var rows: ArrayList<Mess
|
|||||||
val message = rows[position]
|
val message = rows[position]
|
||||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||||
val rowView = inflater.inflate(R.layout.chat_row, parent, false)
|
val rowView = inflater.inflate(R.layout.chat_row, parent, false)
|
||||||
val avatarView = rowView.findViewById(R.id.avatar) as TextView
|
val textAvatarView = rowView.findViewById(R.id.TextAvatar) as TextView
|
||||||
val avatarBackground = avatarView.background as GradientDrawable
|
val cardAvatarView = rowView.findViewById(R.id.CardAvatar) as CardView
|
||||||
|
val cardImageAvatarView = rowView.findViewById(R.id.ImageAvatar) as ImageView
|
||||||
val layout = rowView.findViewById(R.id.chat) as LinearLayout
|
val layout = rowView.findViewById(R.id.chat) as LinearLayout
|
||||||
val lp = layout.layoutParams as RelativeLayout.LayoutParams
|
|
||||||
lp.setMargins(10, 10, 10, 10)
|
|
||||||
val peer: String
|
|
||||||
val contact = ContactsActivity.findContact(message.peerUri)
|
val contact = ContactsActivity.findContact(message.peerUri)
|
||||||
|
val peer: String
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
peer = contact.name
|
peer = contact.name
|
||||||
avatarBackground.setColor(contact.color)
|
val avatarImage = contact.avatarImage
|
||||||
|
if (avatarImage != null) {
|
||||||
|
textAvatarView.visibility = View.GONE
|
||||||
|
cardAvatarView.visibility = View.VISIBLE
|
||||||
|
cardImageAvatarView.setImageBitmap(avatarImage)
|
||||||
|
} else {
|
||||||
|
textAvatarView.visibility = View.VISIBLE
|
||||||
|
cardAvatarView.visibility = View.GONE
|
||||||
|
(textAvatarView.background as GradientDrawable).setColor(contact.color)
|
||||||
|
textAvatarView.text = "${peer[0]}"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
peer = Utils.friendlyUri(message.peerUri, message.aor)
|
peer = Utils.friendlyUri(message.peerUri, message.aor)
|
||||||
avatarBackground.setColor(Utils.randomColor())
|
textAvatarView.visibility = View.VISIBLE
|
||||||
|
cardAvatarView.visibility = View.GONE
|
||||||
|
textAvatarView.setBackgroundResource(R.drawable.person_image)
|
||||||
}
|
}
|
||||||
avatarView.text = "${peer[0]}"
|
|
||||||
if (message.direction == R.drawable.arrow_down_green) {
|
if (message.direction == R.drawable.arrow_down_green) {
|
||||||
layout.setBackgroundResource(R.drawable.message_in_bg)
|
layout.setBackgroundResource(R.drawable.message_in_bg)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
lateinit var textAvatarView: TextView
|
lateinit var textAvatarView: TextView
|
||||||
lateinit var cardAvatarView: CardView
|
lateinit var cardAvatarView: CardView
|
||||||
lateinit var imageAvatarView: ImageView
|
lateinit var cardImageAvatarView: ImageView
|
||||||
lateinit var nameView: EditText
|
lateinit var nameView: EditText
|
||||||
lateinit var uriView: EditText
|
lateinit var uriView: EditText
|
||||||
|
|
||||||
@@ -38,9 +38,9 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_contact)
|
setContentView(R.layout.activity_contact)
|
||||||
|
|
||||||
textAvatarView = findViewById(R.id.Avatar) as TextView
|
textAvatarView = findViewById(R.id.TextAvatar) as TextView
|
||||||
cardAvatarView = findViewById(R.id.CardAvatar) as CardView
|
cardAvatarView = findViewById(R.id.CardAvatar) as CardView
|
||||||
imageAvatarView = findViewById(R.id.ImageAvatar) as ImageView
|
cardImageAvatarView = findViewById(R.id.ImageAvatar) as ImageView
|
||||||
nameView = findViewById(R.id.Name) as EditText
|
nameView = findViewById(R.id.Name) as EditText
|
||||||
uriView = findViewById(R.id.Uri) as EditText
|
uriView = findViewById(R.id.Uri) as EditText
|
||||||
|
|
||||||
@@ -82,42 +82,38 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
textAvatarView.setOnClickListener { _ ->
|
textAvatarView.setOnClickListener { _ ->
|
||||||
|
|
||||||
color = Utils.randomColor()
|
val intent = Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||||
showTextAvatar(textAvatarView.text.toString(), color)
|
addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
newAvatar = "text"
|
type = "image/*"
|
||||||
|
}
|
||||||
|
startActivityForResult(intent, READ_REQUEST_CODE)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textAvatarView.setOnLongClickListener { _ ->
|
textAvatarView.setOnLongClickListener { _ ->
|
||||||
|
|
||||||
val intent = Intent(Intent.ACTION_GET_CONTENT).apply {
|
color = Utils.randomColor()
|
||||||
addCategory(Intent.CATEGORY_OPENABLE)
|
showTextAvatar(textAvatarView.text.toString(), color)
|
||||||
type = "image/*"
|
newAvatar = "text"
|
||||||
}
|
|
||||||
|
|
||||||
startActivityForResult(intent, READ_REQUEST_CODE)
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cardAvatarView.setOnClickListener { _ ->
|
cardAvatarView.setOnClickListener { _ ->
|
||||||
|
|
||||||
color = Utils.randomColor()
|
val intent = Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||||
showTextAvatar(nameView.text.toString(), color)
|
addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
newAvatar = "text"
|
type = "image/*"
|
||||||
|
}
|
||||||
|
startActivityForResult(intent, READ_REQUEST_CODE)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cardAvatarView.setOnLongClickListener { _ ->
|
cardAvatarView.setOnLongClickListener { _ ->
|
||||||
|
|
||||||
val intent = Intent(Intent.ACTION_GET_CONTENT).apply {
|
color = Utils.randomColor()
|
||||||
addCategory(Intent.CATEGORY_OPENABLE)
|
showTextAvatar(nameView.text.toString(), color)
|
||||||
type = "image/*"
|
newAvatar = "text"
|
||||||
}
|
|
||||||
|
|
||||||
startActivityForResult(intent, READ_REQUEST_CODE)
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -225,7 +221,7 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"image" -> {
|
"image" -> {
|
||||||
contact.avatarImage = (imageAvatarView.drawable as BitmapDrawable).bitmap
|
contact.avatarImage = (cardImageAvatarView.drawable as BitmapDrawable).bitmap
|
||||||
Utils.deleteFile(File(BaresipService.filesPath, "${contact.id}.png"))
|
Utils.deleteFile(File(BaresipService.filesPath, "${contact.id}.png"))
|
||||||
File(BaresipService.filesPath, "tmp.png")
|
File(BaresipService.filesPath, "tmp.png")
|
||||||
.renameTo(File(BaresipService.filesPath, "${contact.id}.png"))
|
.renameTo(File(BaresipService.filesPath, "${contact.id}.png"))
|
||||||
@@ -264,18 +260,13 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
private fun showTextAvatar(name: String, color: Int) {
|
private fun showTextAvatar(name: String, color: Int) {
|
||||||
textAvatarView.visibility = View.VISIBLE
|
textAvatarView.visibility = View.VISIBLE
|
||||||
cardAvatarView.visibility = View.GONE
|
cardAvatarView.visibility = View.GONE
|
||||||
imageAvatarView.visibility = View.GONE
|
|
||||||
(textAvatarView.background as GradientDrawable).setColor(color)
|
(textAvatarView.background as GradientDrawable).setColor(color)
|
||||||
if (name.isNotEmpty())
|
textAvatarView.text = "${name[0]}"
|
||||||
textAvatarView.text = "${name[0]}"
|
|
||||||
else
|
|
||||||
textAvatarView.text = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showImageAvatar(image: Bitmap) {
|
private fun showImageAvatar(image: Bitmap) {
|
||||||
textAvatarView.visibility = View.GONE
|
textAvatarView.visibility = View.GONE
|
||||||
cardAvatarView.visibility = View.VISIBLE
|
cardAvatarView.visibility = View.VISIBLE
|
||||||
imageAvatarView.visibility = View.VISIBLE
|
cardImageAvatarView.setImageBitmap(image)
|
||||||
imageAvatarView.setImageBitmap(image)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,16 +7,17 @@ import android.content.Intent
|
|||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v7.app.AlertDialog
|
import android.support.v7.app.AlertDialog
|
||||||
|
import android.support.v7.widget.CardView
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class ContactListAdapter(private val cxt: Context, private val rows: ArrayList<Contact>,
|
class ContactListAdapter(private val cxt: Context, private val rows: ArrayList<Contact>,
|
||||||
@@ -24,16 +25,30 @@ class ContactListAdapter(private val cxt: Context, private val rows: ArrayList<C
|
|||||||
ArrayAdapter<Contact>(cxt, R.layout.contact_row, rows) {
|
ArrayAdapter<Contact>(cxt, R.layout.contact_row, rows) {
|
||||||
|
|
||||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||||
val row = rows[position]
|
val contact = rows[position]
|
||||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||||
val rowView = inflater.inflate(R.layout.contact_row, parent, false)
|
val rowView = inflater.inflate(R.layout.contact_row, parent, false)
|
||||||
val avatarView = rowView.findViewById(R.id.avatar) as TextView
|
val textAvatarView = rowView.findViewById(R.id.TextAvatar) as TextView
|
||||||
val background = avatarView.background as GradientDrawable
|
val cardAvatarView = rowView.findViewById(R.id.CardAvatar) as CardView
|
||||||
background.setColor(row.color)
|
val imageAvatarView = rowView.findViewById(R.id.ImageAvatar) as ImageView
|
||||||
if (row.name.length > 0)
|
val avatarImage = contact.avatarImage
|
||||||
avatarView.text = "${row.name[0]}"
|
if (avatarImage != null) {
|
||||||
|
textAvatarView.visibility = View.GONE
|
||||||
|
cardAvatarView.visibility = View.VISIBLE
|
||||||
|
imageAvatarView.visibility = View.VISIBLE
|
||||||
|
imageAvatarView.setImageBitmap(avatarImage)
|
||||||
|
} else {
|
||||||
|
textAvatarView.visibility = View.VISIBLE
|
||||||
|
cardAvatarView.visibility = View.GONE
|
||||||
|
imageAvatarView.visibility = View.GONE
|
||||||
|
(textAvatarView.background as GradientDrawable).setColor(contact.color)
|
||||||
|
if (contact.name.isNotEmpty())
|
||||||
|
textAvatarView.text = "${contact.name[0]}"
|
||||||
|
else
|
||||||
|
textAvatarView.text = ""
|
||||||
|
}
|
||||||
val nameView = rowView.findViewById(R.id.contactName) as TextView
|
val nameView = rowView.findViewById(R.id.contactName) as TextView
|
||||||
nameView.text = row.name
|
nameView.text = contact.name
|
||||||
nameView.textSize = 20f
|
nameView.textSize = 20f
|
||||||
nameView.setPadding(6, 6, 0, 6)
|
nameView.setPadding(6, 6, 0, 6)
|
||||||
if (aor != "") {
|
if (aor != "") {
|
||||||
@@ -75,7 +90,6 @@ class ContactListAdapter(private val cxt: Context, private val rows: ArrayList<C
|
|||||||
val dialogClickListener = DialogInterface.OnClickListener { _, which ->
|
val dialogClickListener = DialogInterface.OnClickListener { _, which ->
|
||||||
when (which) {
|
when (which) {
|
||||||
DialogInterface.BUTTON_POSITIVE -> {
|
DialogInterface.BUTTON_POSITIVE -> {
|
||||||
val contact = Contact.contacts()[position]
|
|
||||||
val id = contact.id
|
val id = contact.id
|
||||||
val avatarFile = File(BaresipService.filesPath, "$id.img")
|
val avatarFile = File(BaresipService.filesPath, "$id.img")
|
||||||
if (avatarFile.exists()) {
|
if (avatarFile.exists()) {
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -13,6 +13,7 @@
|
|||||||
android:id="@+id/account"
|
android:id="@+id/account"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:gravity="center_horizontal" >
|
android:gravity="center_horizontal" >
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,13 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/Avatar"
|
android:id="@+id/TextAvatar"
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:background="@drawable/circle"
|
android:background="@drawable/circle"
|
||||||
android:textSize="72sp"
|
android:textSize="72sp"
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ImageAvatar"
|
android:id="@+id/ImageAvatar"
|
||||||
android:layout_height="90dp"
|
android:layout_height="96dp"
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop" >
|
android:scaleType="centerCrop" >
|
||||||
|
|||||||
@@ -1,34 +1,50 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/historyRow"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginBottom="0dp"
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:descendantFocusability="blocksDescendants" >
|
android:descendantFocusability="blocksDescendants" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/TextAvatar"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:background="@drawable/circle"
|
android:background="@drawable/circle"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/CardAvatar"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:elevation="12dp"
|
||||||
|
app:cardCornerRadius="18dp" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/CardImageAvatar"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop" >
|
||||||
|
</ImageView>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/directions"
|
android:id="@+id/directions"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@id/avatar"
|
android:layout_marginStart="41dp"
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_centerVertical="true" >
|
android:layout_centerVertical="true" >
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,48 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/chats_row"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/TextAvatar"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_marginTop="10dp"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:background="@drawable/circle"
|
android:background="@drawable/circle"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/CardAvatar"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:elevation="12dp"
|
||||||
|
app:cardCornerRadius="18dp" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ImageAvatar"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop" >
|
||||||
|
</ImageView>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/chat"
|
android:id="@+id/chat"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@id/avatar" >
|
android:layout_marginStart="42dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
@@ -1,31 +1,47 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/contactRow"
|
android:id="@+id/contactRow"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/TextAvatar"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:background="@drawable/circle"
|
android:background="@drawable/circle"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:gravity="center" >
|
android:gravity="center" >
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/CardAvatar"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:elevation="12dp"
|
||||||
|
app:cardCornerRadius="18dp" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ImageAvatar"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop" >
|
||||||
|
</ImageView>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/contactName"
|
android:id="@+id/contactName"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_toEndOf="@id/avatar"
|
android:layout_marginStart="41dp"
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:layout_marginBottom="6dp">
|
android:layout_marginBottom="6dp">
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|||||||
@@ -10,4 +10,5 @@
|
|||||||
<color name="colorGrayLight">#e0e0e0</color>
|
<color name="colorGrayLight">#e0e0e0</color>
|
||||||
<color name="colorAccent">#b00020</color>
|
<color name="colorAccent">#b00020</color>
|
||||||
<color name="colorBaresip">#0ca1fd</color>
|
<color name="colorBaresip">#0ca1fd</color>
|
||||||
|
<color name="colorWhite">#ffffff</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user