- more chat ui improvements

- new primary and accent colors
- use color names in most drawables
This commit is contained in:
Juha Heinanen
2019-03-12 07:00:55 +02:00
parent 5abcb98a67
commit 16521106a3
20 changed files with 47 additions and 33 deletions

View File

@ -1,7 +1,9 @@
package com.tutpro.baresip
import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.support.v4.content.ContextCompat
import android.text.format.DateUtils.isToday
import android.view.LayoutInflater
import android.view.View
@ -53,6 +55,10 @@ class ChatListAdapter(private val cxt: Context, private var rows: ArrayList<Mess
}
if (info.length < 6) info = "Today $info"
infoView.text = "$info - $sender"
if (message.direction == R.drawable.arrow_up_red) {
infoView.text = "${infoView.text} - Message Delivery Failed"
infoView.setTextColor(ContextCompat.getColor(cxt, R.color.colorAccent))
}
val textView = chatView.findViewById(R.id.text) as TextView
textView.text = message.message
if (message.new) {

View File

@ -2,6 +2,7 @@ package com.tutpro.baresip
import android.content.Context
import android.graphics.Typeface
import android.support.v4.content.ContextCompat
import android.text.format.DateUtils.isToday
import android.view.LayoutInflater
import android.view.View
@ -52,6 +53,10 @@ class MessageListAdapter(private val cxt: Context, private val rows: ArrayList<M
}
if (info.length < 6) info = "Today $info"
infoView.text = "$info - $peer"
if (message.direction == R.drawable.arrow_up_red) {
infoView.text = "${infoView.text} - Message Delivery Failed"
infoView.setTextColor(ContextCompat.getColor(cxt, R.color.colorAccent))
}
val textView = messageView.findViewById(R.id.text) as TextView
textView.text = message.message
if (message.new) textView.setTypeface(null, Typeface.BOLD)

View File

@ -1,5 +0,0 @@
<vector android:height="36dp" android:tint="#00ACC1"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z"/>
</vector>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#00ACC1"
<vector android:height="48dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#04B404"
<vector android:height="48dp" android:tint="@color/colorAccent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#00ACC1"
<vector android:height="48dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="40dp" android:tint="#00ACC1"
<vector android:height="40dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="40dp" android:tint="#04B404"
<vector android:height="40dp" android:tint="@color/colorAccent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="24dp" android:tint="#00ACC1"
<vector android:height="24dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="36dp" android:tint="#00ACC1"
<vector android:height="36dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="44dp" android:tint="#00ACC1"
<vector android:height="44dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="44dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM6,9h12v2L6,11L6,9zM14,14L6,14v-2h8v2zM18,8L6,8L6,6h12v2z"/>

View File

@ -3,7 +3,7 @@
<item>
<shape android:shape="rectangle">
<solid android:color="#E0E0E0"/>
<solid android:color="@color/colorSecondaryLight"/>
<corners android:radius="10dp"/>
</shape>
</item>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#00ACC1"
<vector android:height="48dp" android:tint="@color/colorAccent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="36dp" android:tint="#00ACC1"
<vector android:height="36dp" android:tint="@color/colorPrimary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#00ACC1"
<vector android:height="48dp" android:tint="@color/colorSecondary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M18.5,6C15.46,6 13,8.46 13,11.5c0,1.33 0.47,2.55 1.26,3.5L9.74,15c0.79,-0.95 1.26,-2.17 1.26,-3.5C11,8.46 8.54,6 5.5,6S0,8.46 0,11.5 2.46,17 5.5,17h13c3.04,0 5.5,-2.46 5.5,-5.5S21.54,6 18.5,6zM5.5,15C3.57,15 2,13.43 2,11.5S3.57,8 5.5,8 9,9.57 9,11.5 7.43,15 5.5,15zM18.5,15c-1.93,0 -3.5,-1.57 -3.5,-3.5S16.57,8 18.5,8 22,9.57 22,11.5 20.43,15 18.5,15z"/>

View File

@ -1,4 +1,4 @@
<vector android:height="48dp" android:tint="#04B404"
<vector android:height="48dp" android:tint="@color/colorAccent"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M18.5,6C15.46,6 13,8.46 13,11.5c0,1.33 0.47,2.55 1.26,3.5L9.74,15c0.79,-0.95 1.26,-2.17 1.26,-3.5C11,8.46 8.54,6 5.5,6S0,8.46 0,11.5 2.46,17 5.5,17h13c3.04,0 5.5,-2.46 5.5,-5.5S21.54,6 18.5,6zM5.5,15C3.57,15 2,13.43 2,11.5S3.57,8 5.5,8 9,9.57 9,11.5 7.43,15 5.5,15zM18.5,15c-1.93,0 -3.5,-1.57 -3.5,-3.5S16.57,8 18.5,8 22,9.57 22,11.5 20.43,15 18.5,15z"/>

View File

@ -3,7 +3,7 @@
<item>
<shape android:shape="rectangle">
<solid android:color="#B3E5FC"/>
<solid android:color="@color/colorPrimaryLight"/>
<corners android:radius="10dp"/>
</shape>
</item>

View File

@ -21,11 +21,11 @@
android:id="@+id/messages"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_below="@id/account"
android:transcriptMode="alwaysScroll"
android:stackFromBottom="true"
android:layout_below="@id/account"
android:divider="#00000000"
android:dividerHeight="15dp"
android:dividerHeight="10dp"
android:layout_above="@id/text" >
</ListView>
@ -38,7 +38,6 @@
android:scrollHorizontally="false"
android:importantForAutofill="no"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:layout_toStartOf="@id/sendButton"
android:hint="New message" >
</EditText>
@ -51,7 +50,6 @@
android:background="@null"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="2dp" >
</ImageButton>

View File

@ -20,8 +20,13 @@
<ListView
android:id="@+id/chats"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/account">
android:layout_height="match_parent"
android:layout_below="@+id/account"
android:layout_above="@id/peerUri"
android:transcriptMode="alwaysScroll"
android:stackFromBottom="true"
android:divider="#00000000"
android:dividerHeight="10dp" >
</ListView>
<AutoCompleteTextView
@ -29,23 +34,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textSize="18sp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginBottom="10dp"
android:layout_toStartOf="@+id/plusButton"
android:textSize="18sp"
android:inputType="textEmailAddress"
android:hint="Chat Peer" >
android:hint="New Chat Peer" >
</AutoCompleteTextView>
<ImageButton
android:id="@+id/plusButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/plus"
android:background="@null"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true" >
android:layout_alignParentBottom="true"
android:src="@drawable/plus"
android:background="@null" >
</ImageButton>
</RelativeLayout>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#0ca1fd</color>
<color name="colorPrimaryDark">#3f51b5</color>
<color name="colorPrimaryLight">#86d0fe</color>
<color name="colorSecondary">#26a69a</color>
<color name="colorSecondaryDark">#1c9588</color>
<color name="colorSecondaryLight">#93d3cd</color>
<color name="colorAccent">#B00020</color>
</resources>