mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-02-14 18:40:46 +01:00
lets show more info at the Recents tab
This commit is contained in:
parent
73c939b435
commit
d5e34f7dc9
@ -1,10 +1,14 @@
|
||||
package com.simplemobiletools.dialer.adapters
|
||||
|
||||
import android.provider.CallLog.Calls
|
||||
import android.view.Menu
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.bumptech.glide.Glide
|
||||
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.formatDateOrTime
|
||||
import com.simplemobiletools.commons.extensions.getFormattedDuration
|
||||
import com.simplemobiletools.commons.helpers.ContactsHelper
|
||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||
import com.simplemobiletools.dialer.R
|
||||
@ -56,8 +60,12 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList<Re
|
||||
private fun setupView(view: View, call: RecentCall) {
|
||||
view.apply {
|
||||
item_recents_name.text = call.name
|
||||
item_recents_date_time.text = call.startTS.formatDateOrTime(context, true)
|
||||
|
||||
ContactsHelper(context).loadContactImage(call.photoUri, findViewById(R.id.item_recents_image), call.name)
|
||||
item_recents_duration.beVisibleIf(call.type != Calls.MISSED_TYPE && call.type != Calls.REJECTED_TYPE && call.duration > 0)
|
||||
item_recents_duration.text = call.duration.getFormattedDuration()
|
||||
|
||||
ContactsHelper(context).loadContactImage(call.photoUri, item_recents_image, call.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,6 @@
|
||||
android:id="@+id/item_recents_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/min_row_height"
|
||||
android:paddingStart="@dimen/tiny_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:paddingBottom="@dimen/medium_margin">
|
||||
@ -25,22 +23,42 @@
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:padding="@dimen/tiny_margin"
|
||||
android:layout_marginEnd="@dimen/small_margin"
|
||||
android:padding="@dimen/small_margin"
|
||||
android:src="@drawable/ic_person_vector" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_recents_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@+id/item_recents_image"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
tools:text="John Doe" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_recents_date_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/item_recents_name"
|
||||
android:layout_alignStart="@+id/item_recents_name"
|
||||
android:layout_toStartOf="@+id/item_recents_duration"
|
||||
android:layout_toEndOf="@+id/item_recents_image"
|
||||
android:alpha="0.6"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
tools:text="0123 456 789" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_recents_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/item_recents_name"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:alpha="0.6"
|
||||
android:textSize="@dimen/normal_text_size"
|
||||
tools:text="00:10" />
|
||||
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user