From 5dd30438fd3e4384b57cef3c7606ec20fad9b50d Mon Sep 17 00:00:00 2001 From: zachh Date: Thu, 11 Jan 2018 13:43:45 -0800 Subject: Minor polish and bugfixes for new call log. -Reuse the adapter in NewCallLogFragment to maintain position in call log when returning from call details -Convert empty values to null when invoking ContactPhotoManager to make photos appear correctly in new call log bottom sheets -Added CallLogContactTypes to be shared between proper call log and bottom sheets -Fixed vertical alignment in bottom sheet when there was no secondary text -Added some verbose logging Test: unit and manual PiperOrigin-RevId: 181655715 Change-Id: I9c1a42ad8d529ee2327e15fcc1d32b7b83982014 --- .../dialer/calllogutils/CallLogContactTypes.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 java/com/android/dialer/calllogutils/CallLogContactTypes.java (limited to 'java/com/android/dialer/calllogutils') diff --git a/java/com/android/dialer/calllogutils/CallLogContactTypes.java b/java/com/android/dialer/calllogutils/CallLogContactTypes.java new file mode 100644 index 000000000..01ae653b4 --- /dev/null +++ b/java/com/android/dialer/calllogutils/CallLogContactTypes.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.calllogutils; + +import com.android.dialer.calllog.model.CoalescedRow; +import com.android.dialer.lettertile.LetterTileDrawable; + +/** Determines the {@link LetterTileDrawable.ContactType} for a {@link CoalescedRow}. */ +public class CallLogContactTypes { + + /** Determines the {@link LetterTileDrawable.ContactType} for a {@link CoalescedRow}. */ + @LetterTileDrawable.ContactType + public static int getContactType(CoalescedRow row) { + // TODO(zachh): Set these fields correctly. + boolean isVoicemail = false; + boolean isSpam = false; + boolean isBusiness = false; + int numberPresentation = 0; + boolean isConference = false; + + return LetterTileDrawable.getContactTypeFromPrimitives( + isVoicemail, isSpam, isBusiness, numberPresentation, isConference); + } +} -- cgit v1.2.3