highlight unread messages a bit more

This commit is contained in:
tibbi 2020-04-03 13:15:58 +02:00
parent 1c81202231
commit 6cd1dcfbde
2 changed files with 18 additions and 5 deletions

View File

@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.formatDate
import com.simplemobiletools.commons.views.FastScroller
import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.smsmessenger.R
@ -62,13 +63,16 @@ class MessagesAdapter(
view.apply {
message_address.text = message.address
message_body_short.text = message.body
message_date.text = message.date.formatDate(context)
if (!message.read) {
message_address.setTypeface(null, Typeface.BOLD)
message_body_short.setTypeface(null, Typeface.BOLD)
} else {
if (message.read) {
message_address.setTypeface(null, Typeface.NORMAL)
message_body_short.setTypeface(null, Typeface.NORMAL)
message_body_short.alpha = 0.7f
} else {
message_address.setTypeface(null, Typeface.BOLD)
message_body_short.setTypeface(null, Typeface.BOLD)
message_body_short.alpha = 1f
}
arrayListOf<TextView>(message_address, message_body_short).forEach {

View File

@ -29,11 +29,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/message_address"
android:alpha="0.6"
android:ellipsize="end"
android:maxLines="1"
android:textSize="@dimen/normal_text_size"
tools:text="Hey buddy!" />
<TextView
android:id="@+id/message_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/message_body_short"
android:layout_marginTop="@dimen/tiny_margin"
android:alpha="0.4"
android:textSize="@dimen/smaller_text_size"
tools:text="13:30" />
</RelativeLayout>
</FrameLayout>