summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-05-04 19:31:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-05-04 19:31:59 +0000
commit95c2775dd2b77f9fce454d655d2b23ed700d7f22 (patch)
tree153afb6bbe51ce60e917137aef7105818209e2e4 /java
parent6d3dc51922aab8d3dd541a73fdc678c3a618531d (diff)
parentb3bd5f5c9687feaa795dc630a88790ccf6e7e99e (diff)
Merge "Tuned Speed Dial UI according to red lines."
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/speeddial/DisambigDialog.java32
-rw-r--r--java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml23
-rw-r--r--java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml12
-rw-r--r--java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml26
-rw-r--r--java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml2
-rw-r--r--java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml16
-rw-r--r--java/com/android/dialer/speeddial/res/layout/speed_dial_header_layout.xml6
-rw-r--r--java/com/android/dialer/speeddial/res/values/dimens.xml1
-rw-r--r--java/com/android/dialer/speeddial/res/values/strings.xml9
-rw-r--r--java/com/android/dialer/theme/res/values/styles.xml6
-rw-r--r--java/com/android/dialer/widget/ContactPhotoView.java10
11 files changed, 100 insertions, 43 deletions
diff --git a/java/com/android/dialer/speeddial/DisambigDialog.java b/java/com/android/dialer/speeddial/DisambigDialog.java
index a76f648ab..98fc992f8 100644
--- a/java/com/android/dialer/speeddial/DisambigDialog.java
+++ b/java/com/android/dialer/speeddial/DisambigDialog.java
@@ -25,12 +25,14 @@ import android.support.annotation.WorkerThread;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
+import android.text.TextUtils;
import android.util.ArraySet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.android.dialer.callintent.CallInitiationType;
import com.android.dialer.callintent.CallIntentBuilder;
@@ -85,6 +87,16 @@ public class DisambigDialog extends DialogFragment {
}
@Override
+ public void onResume() {
+ super.onResume();
+ getDialog()
+ .getWindow()
+ .setLayout(
+ getContext().getResources().getDimensionPixelSize(R.dimen.disambig_dialog_width),
+ LayoutParams.WRAP_CONTENT);
+ }
+
+ @Override
public void onPause() {
super.onPause();
// TODO(calderwoodra): for simplicity, just dismiss the dialog on configuration change and
@@ -105,19 +117,33 @@ public class DisambigDialog extends DialogFragment {
for (Channel channel : channels) {
// TODO(calderwoodra): use fuzzy number matcher
if (phoneNumbers.add(channel.number())) {
+ if (phoneNumbers.size() != 1) {
+ insertDivider(container);
+ }
insertHeader(container, channel.number(), channel.label());
}
insertOption(container, channel);
}
}
- private void insertHeader(LinearLayout container, String number, String phoneType) {
+ private void insertDivider(LinearLayout container) {
+ View view =
+ getActivity()
+ .getLayoutInflater()
+ .inflate(R.layout.disambig_dialog_divider, container, false);
+ container.addView(view);
+ }
+
+ private void insertHeader(LinearLayout container, String number, String label) {
View view =
getActivity()
.getLayoutInflater()
.inflate(R.layout.disambig_option_header_layout, container, false);
- ((TextView) view.findViewById(R.id.disambig_header_phone_type)).setText(phoneType);
- ((TextView) view.findViewById(R.id.disambig_header_phone_number)).setText(number);
+ String secondaryInfo =
+ TextUtils.isEmpty(label)
+ ? number
+ : getContext().getString(R.string.call_subject_type_and_number, label, number);
+ ((TextView) view.findViewById(R.id.disambig_header_phone_label)).setText(secondaryInfo);
container.addView(view);
}
diff --git a/java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml b/java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml
new file mode 100644
index 000000000..a743cccff
--- /dev/null
+++ b/java/com/android/dialer/speeddial/res/layout/disambig_dialog_divider.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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
+ -->
+<View
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:background="#12000000"/> \ No newline at end of file
diff --git a/java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml b/java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml
index 0272176ab..aec081385 100644
--- a/java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/disambig_dialog_layout.xml
@@ -26,7 +26,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
- android:minHeight="64dp"
+ android:minHeight="56dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:elevation="1dp"
@@ -40,7 +40,8 @@
android:id="@+id/disambig_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:maxHeight="240dp">
+ android:minHeight="168dp"
+ app:maxHeight="256dp">
<LinearLayout
android:id="@+id/communication_avenue_container"
@@ -54,8 +55,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:minHeight="56dp"
- android:padding="12dp"
+ android:minHeight="64dp"
android:elevation="4dp"
android:background="@android:color/white">
@@ -63,6 +63,8 @@
android:id="@+id/remember_this_choice_checkbox"
android:layout_width="match_parent"
android:layout_height="48dp"
- android:text="@string/speed_dial_remember_this_choice"/>
+ android:textSize="14sp"
+ android:text="@string/speed_dial_remember_this_choice"
+ style="@style/DialerCheckboxStyle"/>
</FrameLayout>
</LinearLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml b/java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml
index d331a0a6e..22a5d1b52 100644
--- a/java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/disambig_option_header_layout.xml
@@ -14,27 +14,15 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<LinearLayout
+<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/disambig_header_container"
- android:orientation="vertical"
+ android:id="@+id/disambig_header_phone_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
- android:minHeight="56dp"
android:gravity="center_vertical"
+ android:minHeight="48dp"
android:paddingStart="24dp"
- android:paddingEnd="24dp">
-
- <TextView
- android:id="@+id/disambig_header_phone_type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="@style/PrimaryText"/>
-
- <TextView
- android:id="@+id/disambig_header_phone_number"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="@style/SecondaryText"/>
-</LinearLayout>
+ android:paddingEnd="24dp"
+ android:textSize="14sp"
+ android:textColor="#757575"
+ style="@style/PrimaryText"/>
diff --git a/java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml b/java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml
index 62f6ab5e1..a1a5b2941 100644
--- a/java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/disambig_option_layout.xml
@@ -35,7 +35,7 @@
android:id="@+id/disambig_option_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="12dp"
+ android:layout_marginStart="16dp"
android:layout_gravity="center_vertical"
style="@style/PrimaryText"/>
</LinearLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml b/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
index d4fa07d90..134196da7 100644
--- a/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
@@ -24,21 +24,24 @@
<FrameLayout
android:id="@+id/avatar_container"
- android:layout_width="104dp"
+ android:layout_width="wrap_content"
android:layout_height="104dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp">
<com.android.dialer.speeddial.SquareImageView
android:id="@+id/avatar"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ android:layout_width="104dp"
+ android:layout_height="104dp"
+ android:layout_marginStart="12dp"
+ android:layout_marginEnd="12dp"/>
<FrameLayout
android:id="@+id/video_call_container"
android:layout_width="36dp"
android:layout_height="36dp"
- android:layout_gravity="bottom|end">
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="12dp">
<ImageView
android:layout_width="match_parent"
@@ -60,6 +63,10 @@
android:layout_gravity="center_horizontal"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="1dp"
+ android:fontFamily="sans-serif-medium"
+ android:textSize="14sp"
style="@style/PrimaryText"/>
<TextView
@@ -69,5 +76,6 @@
android:layout_gravity="center_horizontal"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
+ android:layout_marginBottom="17dp"
style="@style/SecondaryText"/>
</LinearLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/speeddial/res/layout/speed_dial_header_layout.xml b/java/com/android/dialer/speeddial/res/layout/speed_dial_header_layout.xml
index 15c00e45b..1605e8c98 100644
--- a/java/com/android/dialer/speeddial/res/layout/speed_dial_header_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/speed_dial_header_layout.xml
@@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
- android:minHeight="@dimen/dialer_list_item_min_height">
+ android:minHeight="48dp">
<TextView
android:id="@+id/speed_dial_header_text"
@@ -36,7 +36,9 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:minHeight="@dimen/dialer_touch_target_min_size"
- android:minWidth="@dimen/dialer_button_min_width"
+ android:minWidth="48dp"
+ android:paddingStart="8dp"
+ android:paddingEnd="8dp"
android:text="@string/speed_dial_add_button_text"
android:textColor="@color/dialer_theme_color"
style="@style/Widget.AppCompat.Button.Borderless"/>
diff --git a/java/com/android/dialer/speeddial/res/values/dimens.xml b/java/com/android/dialer/speeddial/res/values/dimens.xml
index ce2de9dcc..a4cf16c17 100644
--- a/java/com/android/dialer/speeddial/res/values/dimens.xml
+++ b/java/com/android/dialer/speeddial/res/values/dimens.xml
@@ -31,4 +31,5 @@
-->
<dimen name="speed_dial_context_menu_x_offset">-24dp</dimen>
<dimen name="speed_dial_context_menu_corner_radius">16dp</dimen>
+ <dimen name="disambig_dialog_width">280dp</dimen>
</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/speeddial/res/values/strings.xml b/java/com/android/dialer/speeddial/res/values/strings.xml
index d2f5371b8..0053074b2 100644
--- a/java/com/android/dialer/speeddial/res/values/strings.xml
+++ b/java/com/android/dialer/speeddial/res/values/strings.xml
@@ -18,8 +18,9 @@
<!-- header for a list of contacts that are the users favorites. [CHAR LIMIT=30] -->
<string name="favorites_header">Favorites</string>
- <!-- header for a list of contacts that are suggestions for the user to place calls to. [CHAR LIMIT=30] -->
- <string name="suggestions_header">Suggestions</string>
+ <!-- header for a list of contacts that are suggestions for the user to place calls to based on
+ their frequently contacted contacts. [CHAR LIMIT=30] -->
+ <string name="suggestions_header">Frequents</string>
<!-- text for a button that prompts the user to add a contact to their favorites. [CHAR LIMIT=12] -->
<string name="speed_dial_add_button_text">Add</string>
@@ -28,9 +29,9 @@
If the user checks this box, we will remember their selection and never ask for it again. [CHAR LIMIT=NONE]-->
<string name="speed_dial_remember_this_choice">Remember this choice</string>
- <!-- Title of a dialog asking the user to choose their favorite mode of communication for a
+ <!-- Title of a dialog asking the user to choose their the mode/type of communication for a
specific contact where communication modes are video calling and voice calling. [CHAR LIMIT=NONE]-->
- <string name="speed_dial_disambig_dialog_title">Choose a Favorite mode</string>
+ <string name="speed_dial_disambig_dialog_title">Choose call type</string>
<!-- Text for a button that places a video call [CHAR LIMIT=15]-->
<string name="disambig_option_video_call">Video call</string>
diff --git a/java/com/android/dialer/theme/res/values/styles.xml b/java/com/android/dialer/theme/res/values/styles.xml
index d65d2af9c..8412aaadf 100644
--- a/java/com/android/dialer/theme/res/values/styles.xml
+++ b/java/com/android/dialer/theme/res/values/styles.xml
@@ -53,4 +53,10 @@
<item name="android:background">@color/actionbar_background_color</item>
<item name="background">@color/actionbar_background_color</item>
</style>
+
+ <!-- This Checkbox style helps align checkboxes with the common list element layout(Image + text) -->
+ <style name="DialerCheckboxStyle" parent="Widget.AppCompat.CompoundButton.CheckBox">
+ <item name="android:layout_marginStart">20dp</item>
+ <item name="android:paddingLeft">12dp</item>
+ </style>
</resources>
diff --git a/java/com/android/dialer/widget/ContactPhotoView.java b/java/com/android/dialer/widget/ContactPhotoView.java
index 03d25de7d..a84111f95 100644
--- a/java/com/android/dialer/widget/ContactPhotoView.java
+++ b/java/com/android/dialer/widget/ContactPhotoView.java
@@ -75,9 +75,9 @@ public final class ContactPhotoView extends FrameLayout {
}
private void hideBadge() {
- contactBadgeContainer.setVisibility(View.INVISIBLE);
- videoCallBadge.setVisibility(View.INVISIBLE);
- rttCallBadge.setVisibility(View.INVISIBLE);
+ contactBadgeContainer.setVisibility(View.GONE);
+ videoCallBadge.setVisibility(View.GONE);
+ rttCallBadge.setVisibility(View.GONE);
}
/** Sets the contact photo and its badge to be displayed. */
@@ -100,10 +100,10 @@ public final class ContactPhotoView extends FrameLayout {
// (a bug): In theory a video call could be downgraded to voice and upgraded to RTT call
// again, this might end up a call with video and RTT features both set. Update logic here if
// that could happen. Also update {@link Coalescer#meetsCallFeatureCriteria}.
- rttCallBadge.setVisibility(INVISIBLE);
+ rttCallBadge.setVisibility(View.GONE);
} else if (photoInfo.getIsRtt()) {
contactBadgeContainer.setVisibility(View.VISIBLE);
- videoCallBadge.setVisibility(INVISIBLE);
+ videoCallBadge.setVisibility(View.GONE);
rttCallBadge.setVisibility(View.VISIBLE);
} else {
hideBadge();