From 2a987a640e91ba9d5bea0602eb5f08e982dcf6a9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 4 Aug 2018 09:50:01 +0200 Subject: [PATCH] tweak the DateTime field at recent calls --- .../contacts/adapters/RecentCallsAdapter.kt | 2 +- .../contacts/helpers/ContactsHelper.kt | 16 ++++++++++++++-- .../contacts/models/RecentCall.kt | 2 +- app/src/main/res/layout/item_recent_call.xml | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt index 3e7f4340..7c216264 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt @@ -71,7 +71,7 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList formattedDate = formattedDate.substring(12) + datePart == yesterdayDate -> formattedDate = yesterday + formattedDate.substring(11) + formattedDate.substring(7, 11) == currentYear -> formattedDate = formattedDate.substring(0, 6) + formattedDate.substring(11) + } + val recentCall = RecentCall(id, number, formattedDate, name, type) calls.add(recentCall) } while (cursor.moveToNext()) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/models/RecentCall.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/models/RecentCall.kt index f3e92d4c..bb17f652 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/models/RecentCall.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/models/RecentCall.kt @@ -1,3 +1,3 @@ package com.simplemobiletools.contacts.models -data class RecentCall(var id: Int, var number: String, var date: String, var name: String?, var type: Int) +data class RecentCall(var id: Int, var number: String, var dateTime: String, var name: String?, var type: Int) diff --git a/app/src/main/res/layout/item_recent_call.xml b/app/src/main/res/layout/item_recent_call.xml index 0e9f0666..f0419568 100644 --- a/app/src/main/res/layout/item_recent_call.xml +++ b/app/src/main/res/layout/item_recent_call.xml @@ -45,8 +45,8 @@ android:layout_below="@+id/recent_call_name" android:gravity="right" android:maxLines="1" - android:textSize="@dimen/bigger_text_size" - tools:text="Today, 17:00"/> + android:textSize="@dimen/normal_text_size" + tools:text="Yesterday, 17:00"/>