Merge "Remove use of TextUtils.join()"
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 3748967..d925c13 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -33,9 +33,8 @@
android:fontFamily="sans-serif-medium"
android:textColor="?attr/call_log_secondary_text_color"
android:textSize="@dimen/call_log_secondary_text_size"
- android:paddingTop="@dimen/call_log_day_group_padding"
- android:paddingBottom="1dp"
- />
+ android:paddingTop="@dimen/call_log_day_group_padding_top"
+ android:paddingBottom="@dimen/call_log_day_group_padding_bottom" />
<!-- Linear layout to separate the primary area containing the contact badge and caller
information and the secondary action (call details / play voicemail). -->
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 5727d8a..aa4ce94 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -41,7 +41,6 @@
android:id="@+id/floating_action_button_container"
android:layout_width="@dimen/floating_action_button_width"
android:layout_height="@dimen/floating_action_button_height"
- android:layout_marginRight="@dimen/floating_action_button_margin_right"
android:layout_marginBottom="@dimen/floating_action_button_margin_bottom"
android:layout_gravity="center_horizontal|bottom" >
diff --git a/res/layout/empty_list_view.xml b/res/layout/empty_list_view.xml
index be4dbf5..40f58bd 100644
--- a/res/layout/empty_list_view.xml
+++ b/res/layout/empty_list_view.xml
@@ -20,15 +20,6 @@
android:layout_height="match_parent"
android:minHeight="?android:attr/listPreferredItemHeight">
- <include
- android:id="@+id/show_all_contact_button_in_nofav"
- layout="@layout/show_all_contact_button"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"/>
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/res/layout/show_all_contact_button.xml b/res/layout/show_all_contact_button.xml
deleted file mode 100644
index 30060d7..0000000
--- a/res/layout/show_all_contact_button.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 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.
--->
-
-<com.android.contacts.common.list.ContactListItemView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/show_all_contact_button"
- android:orientation="horizontal"
- android:clickable="true"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:gravity="center"
- android:focusable="true" />
\ No newline at end of file
diff --git a/res/layout/speeddial_fragment.xml b/res/layout/speed_dial_fragment.xml
similarity index 100%
rename from res/layout/speeddial_fragment.xml
rename to res/layout/speed_dial_fragment.xml
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index c6a8e9b..18f0694 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -78,21 +78,6 @@
<dimen name="dismiss_button_padding_start">20dip</dimen>
<dimen name="dismiss_button_padding_end">28dip</dimen>
- <!-- Padding above the favorites menu. -->
- <dimen name="favorites_menu_padding_top">6dp</dimen>
- <!-- Padding below the favorites menu.. -->
- <dimen name="favorites_menu_padding_bottom">3dp</dimen>
- <!-- Horizontal padding in the favorites menu. -->
- <dimen name="favorites_menu_padding_horizontal">8dp</dimen>
- <!-- Text size for the "speed dial" text in the favorites menu. -->
- <dimen name="favorites_menu_speed_dial_text_size">18sp</dimen>
- <!-- Height of the speed dial TextView in the favorites menu. -->
- <dimen name="favorites_menu_speed_dial_height">24dp</dimen>
- <!-- Text size for the "All Contacts" text in the favorites menu. -->
- <dimen name="favorites_menu_all_contacts_text_size">12sp</dimen>
- <!-- Height of the all contacts Button in the favorites menu. -->
- <dimen name="favorites_menu_all_contacts_height">24dp</dimen>
-
<!-- Height of the actionBar - this is 8dps bigger than the platform standard to give more
room to the search box-->
<dimen name="action_bar_height">64dp</dimen>
@@ -137,7 +122,8 @@
<dimen name="call_log_action_height">44dp</dimen>
<!-- Z Translation of expanded call log items. -->
<dimen name="call_log_expanded_translation_z">4dp</dimen>
- <dimen name="call_log_day_group_padding">15dp</dimen>
+ <dimen name="call_log_day_group_padding_top">15dp</dimen>
+ <dimen name="call_log_day_group_padding_bottom">9dp</dimen>
<!-- Size of icon for contacts number shortcuts -->
<dimen name="search_shortcut_radius">40dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6d9c77a..88e29e1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -66,8 +66,8 @@
<!-- Menu item used to share a voicemail. [CHAR LIMIT=30] -->
<string name="recentCalls_shareVoicemail">Share voicemail</string>
- <!-- Text displayed when the call log is empty -->
- <string name="recentCalls_empty">Call log is empty.</string>
+ <!-- Text displayed when the call log is empty. -->
+ <string name="recentCalls_empty">Your call log is empty.</string>
<!-- Title of the confirmation dialog for clearing the call log. [CHAR LIMIT=37] -->
<string name="clearCallLogConfirmation_title">Clear call log?</string>
@@ -547,10 +547,10 @@
<string name="view_full_call_history_font_family">sans-serif</string>
<!-- Text displayed when the list of missed calls is empty -->
- <string name="recentMissed_empty">No recent missed calls.</string>
+ <string name="recentMissed_empty">You have no recent missed calls.</string>
<!-- Text displayed when the list of voicemails is empty -->
- <string name="recentVoicemails_empty">No recent voicemails.</string>
+ <string name="recentVoicemails_empty">You have no recent voicemails.</string>
<!-- Menu option to show favorite contacts only -->
<string name="show_favorites_only">Show favorites only</string>
@@ -576,10 +576,6 @@
<string name="tab_all_contacts">Contacts</string>
- <!-- Title of fragment that displays all contacts -->
- <string name="show_all_contacts_title">All contacts</string>
- <!-- Title of show all contacts button -->
- <string name="show_all_contacts_button_text">All contacts</string>
<!-- Text displayed when user swipes out a favorite contact -->
<string name="favorite_hidden">Removed from favorites</string>
<!-- Text displayed for the undo button to undo removing a favorite contact -->
@@ -599,8 +595,11 @@
<!-- Number of missed calls shown on call card [CHAR LIMIT=40] -->
<string name="num_missed_calls"><xliff:g id="number">%s</xliff:g> new missed calls</string>
- <!-- Shows when there are no favorites. -->
- <string name="no_favorites">Favorites & contacts you\ncall often will show here.\nSo, start calling.</string>
+ <!-- Shown when there are no speed dial favorites. -->
+ <string name="speed_dial_empty">Speed dial is one touch dialing\nfor favorites and numbers\n you call frequently.</string>
+
+ <!-- Shown when there are no contacts in the all contacts list. -->
+ <string name="all_contacts_empty">You have no contacts.</string>
<!-- Shows up as a tooltip to provide a hint to the user that the profile pic in a contact
card can be tapped to bring up a list of all numbers, or long pressed to start reordering
@@ -614,24 +613,12 @@
<!-- Remove button that shows up when contact is long-pressed. [CHAR LIMIT=NONE] -->
<string name="remove_contact">Remove</string>
- <!-- Header text displayed on the main dialer screen above the list of favorite phone numbers.
- [CHAR LIMIT=21] -->
- <string name="favorites_menu_speed_dial">Speed Dial</string>
-
<!-- Button text for the "all contacts" button displayed on the main dialer screen above the
list of favorite phone numbers. Navigates the user to the "All Contacts" list.
This text represents the same action as the text in string "menu_allContacts".
[CHAR LIMIT=21] -->
<string name="favorites_menu_all_contacts">ALL CONTACTS</string>
- <!-- The font-family to use for the "speed dial" label on the favorites menu.
- Do not translate. -->
- <string name="favorites_menu_speed_dial_font_family">sans-serif-light</string>
-
- <!-- The font-family to use for the "all contacts" label on the favorites menu.
- Do not translate. -->
- <string name="favorites_menu_all_contacts_font_family">sans-serif</string>
-
<!-- Button text for the "call back" button displayed underneath an entry in the call log.
Tapping causes a call to be placed to the caller represented by the call log entry.
[CHAR LIMIT=30] -->
@@ -701,7 +688,7 @@
<!-- String used as a header in the call log above calls which occurred more than a week ago.
[CHAR LIMIT=65] -->
- <string name="call_log_header_other">Other</string>
+ <string name="call_log_header_other">Older</string>
<!-- String a header on the call details screen. Appears above the list calls to or from a
particular number.
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 4b1aeab..249c30c 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -1096,7 +1096,9 @@
values.put(Calls.CACHED_LOOKUP_URI, UriUtils.uriToString(updatedInfo.lookupUri));
needsUpdate = true;
}
- if (!TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) {
+ // Only replace the normalized number if the new updated normalized number isn't empty.
+ if (!TextUtils.isEmpty(updatedInfo.normalizedNumber) &&
+ !TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) {
values.put(Calls.CACHED_NORMALIZED_NUMBER, updatedInfo.normalizedNumber);
needsUpdate = true;
}
diff --git a/src/com/android/dialer/calllog/CallTypeIconsView.java b/src/com/android/dialer/calllog/CallTypeIconsView.java
index 7c8afee..afbced4 100644
--- a/src/com/android/dialer/calllog/CallTypeIconsView.java
+++ b/src/com/android/dialer/calllog/CallTypeIconsView.java
@@ -17,17 +17,15 @@
package com.android.dialer.calllog;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
-import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.provider.CallLog.Calls;
import android.util.AttributeSet;
import android.view.View;
import com.android.contacts.common.testing.NeededForTesting;
+import com.android.contacts.common.util.BitmapUtil;
import com.android.dialer.R;
import com.google.common.collect.Lists;
@@ -156,7 +154,7 @@
incoming.setColorFilter(r.getColor(R.color.answered_call), PorterDuff.Mode.MULTIPLY);
// Create a rotated instance of the call arrow for outgoing calls.
- outgoing = getRotatedDrawable(r, R.drawable.ic_call_arrow, 180f);
+ outgoing = BitmapUtil.getRotatedDrawable(r, R.drawable.ic_call_arrow, 180f);
outgoing.setColorFilter(r.getColor(R.color.answered_call), PorterDuff.Mode.MULTIPLY);
// Need to make a copy of the arrow drawable, otherwise the same instance colored
@@ -167,29 +165,5 @@
voicemail = r.getDrawable(R.drawable.ic_call_voicemail_holo_dark);
iconMargin = r.getDimensionPixelSize(R.dimen.call_log_icon_margin);
}
-
- /**
- * Retrieves a copy of the specified drawable resource, rotated by a specified angle.
- *
- * @param resources The current resources.
- * @param resourceId The resource ID of the drawable to rotate.
- * @param angle The angle of rotation.
- * @return Rotated drawable.
- */
- private Drawable getRotatedDrawable(
- android.content.res.Resources resources, int resourceId, float angle) {
-
- // Get the original drawable and make a copy which will be rotated.
- Bitmap original = BitmapFactory.decodeResource(resources, resourceId);
- Bitmap rotated = Bitmap.createBitmap(
- original.getWidth(), original.getHeight(), Bitmap.Config.ARGB_8888);
-
- // Perform the rotation.
- Canvas tempCanvas = new Canvas(rotated);
- tempCanvas.rotate(angle, original.getWidth()/2, original.getHeight()/2);
- tempCanvas.drawBitmap(original, 0, 0, null);
-
- return new BitmapDrawable(resources,rotated);
- }
}
}
diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java
index 5d99ef4..1bebfc4 100644
--- a/src/com/android/dialer/calllog/ContactInfoHelper.java
+++ b/src/com/android/dialer/calllog/ContactInfoHelper.java
@@ -101,6 +101,8 @@
updatedInfo = new ContactInfo();
updatedInfo.number = number;
updatedInfo.formattedNumber = formatPhoneNumber(number, null, countryIso);
+ updatedInfo.normalizedNumber = PhoneNumberUtils.formatNumberToE164(
+ number, countryIso);
updatedInfo.lookupUri = createTemporaryContactUri(updatedInfo.formattedNumber);
} else {
updatedInfo = info;
diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java
index ddcb15d..e4314db 100644
--- a/src/com/android/dialer/list/AllContactsFragment.java
+++ b/src/com/android/dialer/list/AllContactsFragment.java
@@ -52,7 +52,7 @@
View emptyListView = view.findViewById(R.id.empty_list_view);
DialerUtils.configureEmptyListView(emptyListView, R.drawable.empty_contacts,
- R.string.listFoundAllContactsZero, getResources());
+ R.string.all_contacts_empty, getResources());
getListView().setEmptyView(emptyListView);
ViewUtil.addBottomPaddingToListViewForFab(getListView(), getResources());
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index 862952d..5f2d2a9 100644
--- a/src/com/android/dialer/list/PhoneFavoriteTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java
@@ -141,4 +141,10 @@
mShadowOverlay.setVisibility(isDefaultImage ? View.GONE : View.VISIBLE);
}
}
+
+ @Override
+ protected boolean isContactPhotoCircular() {
+ // Unlike Contacts' tiles, the Dialer's favorites tiles are square.
+ return false;
+ }
}
diff --git a/src/com/android/dialer/list/SpeedDialFragment.java b/src/com/android/dialer/list/SpeedDialFragment.java
index c214492..a04d4cc 100644
--- a/src/com/android/dialer/list/SpeedDialFragment.java
+++ b/src/com/android/dialer/list/SpeedDialFragment.java
@@ -197,7 +197,7 @@
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- mParentView = inflater.inflate(R.layout.speeddial_fragment, container, false);
+ mParentView = inflater.inflate(R.layout.speed_dial_fragment, container, false);
mListView = (PhoneFavoriteListView) mParentView.findViewById(R.id.contact_tile_list);
mListView.setOnItemClickListener(this);
@@ -213,7 +213,7 @@
final Resources resources = getResources();
mEmptyView = mParentView.findViewById(R.id.empty_list_view);
DialerUtils.configureEmptyListView(
- mEmptyView, R.drawable.empty_speed_dial, R.string.no_favorites, getResources());
+ mEmptyView, R.drawable.empty_speed_dial, R.string.speed_dial_empty, getResources());
mContactTileFrame = mParentView.findViewById(R.id.contact_tile_frame);