Fix deprecation and format code

This commit is contained in:
Naveen Singh 2025-01-04 03:25:04 +05:30
parent f343085703
commit cfa96a3a53
No known key found for this signature in database
GPG key ID: AF5D43C216778C0B

View file

@ -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
) )
} }
} }