File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/src/main/java/com/addev/listaspam/calllog Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,17 @@ import androidx.core.content.ContextCompat
1212import androidx.recyclerview.widget.RecyclerView
1313import com.addev.listaspam.R
1414import com.addev.listaspam.utils.SpamUtils
15+ import java.text.SimpleDateFormat
16+ import java.time.format.DateTimeFormatter
1517
1618class CallLogAdapter (
1719 private val context : Context ,
1820 private val callLogs : List <CallLogEntry >,
1921 private val blockedNumbers : Set <String >
2022) : RecyclerView.Adapter<CallLogAdapter.CallLogViewHolder>() {
2123
24+ val formatter = SimpleDateFormat (" dd/MM/yyyy" )
25+
2226 override fun onCreateViewHolder (parent : ViewGroup , viewType : Int ): CallLogViewHolder {
2327 val view = LayoutInflater .from(context).inflate(R .layout.item_call_log, parent, false )
2428 return CallLogViewHolder (view)
@@ -39,7 +43,7 @@ class CallLogAdapter(
3943
4044 fun bind (callLog : CallLogEntry , isBlocked : Boolean ) {
4145 numberTextView.text = " ${callLog.number}${if (isBlocked) " (blocked)" else " " } "
42- dateTextView.text = callLog.date.toString( )
46+ dateTextView.text = formatter.format( callLog.date)
4347 durationTextView.text = " Duration: ${callLog.duration} seconds"
4448
4549 if (isBlocked) {
You can’t perform that action at this time.
0 commit comments