highlight unread messages a bit more
This commit is contained in:
parent
1c81202231
commit
6cd1dcfbde
|
@ -6,6 +6,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||||
|
import com.simplemobiletools.commons.extensions.formatDate
|
||||||
import com.simplemobiletools.commons.views.FastScroller
|
import com.simplemobiletools.commons.views.FastScroller
|
||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
import com.simplemobiletools.smsmessenger.R
|
import com.simplemobiletools.smsmessenger.R
|
||||||
|
@ -62,13 +63,16 @@ class MessagesAdapter(
|
||||||
view.apply {
|
view.apply {
|
||||||
message_address.text = message.address
|
message_address.text = message.address
|
||||||
message_body_short.text = message.body
|
message_body_short.text = message.body
|
||||||
|
message_date.text = message.date.formatDate(context)
|
||||||
|
|
||||||
if (!message.read) {
|
if (message.read) {
|
||||||
message_address.setTypeface(null, Typeface.BOLD)
|
|
||||||
message_body_short.setTypeface(null, Typeface.BOLD)
|
|
||||||
} else {
|
|
||||||
message_address.setTypeface(null, Typeface.NORMAL)
|
message_address.setTypeface(null, Typeface.NORMAL)
|
||||||
message_body_short.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 {
|
arrayListOf<TextView>(message_address, message_body_short).forEach {
|
||||||
|
|
|
@ -29,11 +29,20 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/message_address"
|
android:layout_below="@+id/message_address"
|
||||||
android:alpha="0.6"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/normal_text_size"
|
android:textSize="@dimen/normal_text_size"
|
||||||
tools:text="Hey buddy!" />
|
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>
|
</RelativeLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
Loading…
Reference in New Issue