Fix deprecation and format code
This commit is contained in:
parent
f343085703
commit
cfa96a3a53
1 changed files with 15 additions and 10 deletions
|
|
@ -32,11 +32,11 @@ abstract class BaseConversationsAdapter(
|
||||||
onRefresh: () -> Unit,
|
onRefresh: () -> Unit,
|
||||||
itemClick: (Any) -> Unit
|
itemClick: (Any) -> Unit
|
||||||
) : MyRecyclerViewListAdapter<Conversation>(
|
) : MyRecyclerViewListAdapter<Conversation>(
|
||||||
activity,
|
activity = activity,
|
||||||
recyclerView,
|
recyclerView = recyclerView,
|
||||||
ConversationDiffCallback(),
|
diffUtil = ConversationDiffCallback(),
|
||||||
itemClick,
|
itemClick = itemClick,
|
||||||
onRefresh
|
onRefresh = onRefresh
|
||||||
),
|
),
|
||||||
RecyclerViewFastScroller.OnPopupTextUpdate {
|
RecyclerViewFastScroller.OnPopupTextUpdate {
|
||||||
private var fontSize = activity.getTextSize()
|
private var fontSize = activity.getTextSize()
|
||||||
|
|
@ -161,7 +161,12 @@ abstract class BaseConversationsAdapter(
|
||||||
}
|
}
|
||||||
|
|
||||||
conversationDate.apply {
|
conversationDate.apply {
|
||||||
text = conversation.date.formatDateOrTime(context, true, false)
|
text = (conversation.date * 1000L).formatDateOrTime(
|
||||||
|
context = context,
|
||||||
|
hideTimeOnOtherDays = true,
|
||||||
|
showCurrentYear = false
|
||||||
|
)
|
||||||
|
|
||||||
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize * 0.8f)
|
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize * 0.8f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,10 +193,10 @@ abstract class BaseConversationsAdapter(
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleContactsHelper(activity).loadContactImage(
|
SimpleContactsHelper(activity).loadContactImage(
|
||||||
conversation.photoUri,
|
path = conversation.photoUri,
|
||||||
conversationImage,
|
imageView = conversationImage,
|
||||||
conversation.title,
|
placeholderName = conversation.title,
|
||||||
placeholder
|
placeholderImage = placeholder
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue