summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/main/impl
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-06-29 01:14:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-06-29 01:14:29 +0000
commite479c7d417573ac142b336c904ce0643e010f7dd (patch)
treeda969d7848ed5e86dc55858778fa912219c4be74 /java/com/android/dialer/main/impl
parent2e3e5ff3f2dfd4106b22835c1bf68bf551dcc032 (diff)
parent70c045940de7ca1270cad559229ae3d5e9273301 (diff)
Merge changes I40cf6e7d,Iff515ae2,If8ca1f57,I1eec7a73,Iccb4e72c, ...
* changes: Removed line deemed incompatible with Dialer open source. Avoid updating system call log cache when the call log is being built Make sure we have a host for the search fragment before loading data. Fix scroll for new favorites UI refresh for bottom nav bar. UI refresh for FAB. Use ConcurrentMap to log Contacts Provider metrics in the old call log. Also ignore IllegalStateException thrown by SQLiteClosable when coalescing fails. UI refresh for search fragment. Add voicemail greeting setting screen to voicemail settings.
Diffstat (limited to 'java/com/android/dialer/main/impl')
-rw-r--r--java/com/android/dialer/main/impl/OldMainActivityPeer.java29
-rw-r--r--java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java22
-rw-r--r--java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml6
-rw-r--r--java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml62
-rw-r--r--java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml21
-rw-r--r--java/com/android/dialer/main/impl/res/layout/main_activity.xml16
-rw-r--r--java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml5
7 files changed, 65 insertions, 96 deletions
diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
index d790c6814..73bb4f81a 100644
--- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java
+++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
@@ -51,6 +51,7 @@ import android.text.method.LinkMovementMethod;
import android.view.ActionMode;
import android.view.DragEvent;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
@@ -334,7 +335,12 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
activity.findViewById(R.id.remove_view),
activity.findViewById(R.id.search_view_container),
toolbar);
- speedDialFragmentHost = new MainSpeedDialFragmentHost(toolbar);
+ speedDialFragmentHost =
+ new MainSpeedDialFragmentHost(
+ toolbar,
+ activity.findViewById(R.id.root_layout),
+ activity.findViewById(R.id.coordinator_layout),
+ activity.findViewById(R.id.fragment_container));
lastTabController = new LastTabController(activity, bottomNav, showVoicemailTab);
@@ -1255,15 +1261,32 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
private static final class MainSpeedDialFragmentHost implements SpeedDialFragment.HostInterface {
private final MainToolbar toolbar;
-
- MainSpeedDialFragmentHost(MainToolbar toolbar) {
+ private final ViewGroup rootLayout;
+ private final ViewGroup coordinatorLayout;
+ private final ViewGroup fragmentContainer;
+
+ MainSpeedDialFragmentHost(
+ MainToolbar toolbar,
+ ViewGroup rootLayout,
+ ViewGroup coordinatorLayout,
+ ViewGroup fragmentContainer) {
this.toolbar = toolbar;
+ this.rootLayout = rootLayout;
+ this.coordinatorLayout = coordinatorLayout;
+ this.fragmentContainer = fragmentContainer;
}
@Override
public void setHasFrequents(boolean hasFrequents) {
toolbar.showClearFrequents(hasFrequents);
}
+
+ @Override
+ public void dragFavorite(boolean start) {
+ rootLayout.setClipChildren(!start);
+ coordinatorLayout.setClipChildren(!start);
+ fragmentContainer.setClipChildren(!start);
+ }
}
/**
diff --git a/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java b/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java
index 4794b8823..48cfc8160 100644
--- a/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java
+++ b/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java
@@ -20,20 +20,18 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
-import android.support.annotation.Px;
import android.support.annotation.StringRes;
import android.util.AttributeSet;
import android.view.View;
-import android.widget.FrameLayout;
import android.widget.ImageView;
-import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.dialer.common.Assert;
import com.android.dialer.configprovider.ConfigProviderComponent;
import com.android.dialer.theme.base.ThemeComponent;
/** Navigation item in a bottom nav. */
-final class BottomNavItem extends LinearLayout {
+final class BottomNavItem extends RelativeLayout {
private ImageView image;
private TextView text;
@@ -57,7 +55,7 @@ final class BottomNavItem extends LinearLayout {
int colorId =
selected
? ThemeComponent.get(getContext()).theme().getColorPrimary()
- : ThemeComponent.get(getContext()).theme().getTextColorSecondary();
+ : ThemeComponent.get(getContext()).theme().getColorIcon();
image.setImageTintList(ColorStateList.valueOf(colorId));
text.setTextColor(colorId);
}
@@ -87,20 +85,6 @@ final class BottomNavItem extends LinearLayout {
}
notificationBadge.setVisibility(View.VISIBLE);
notificationBadge.setText(countString);
-
- @Px int margin;
- if (countString.length() == 1) {
- margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_1);
- } else if (countString.length() == 2) {
- margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_2);
- } else {
- margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_3);
- }
-
- FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) image.getLayoutParams();
- params.setMarginStart(margin);
- params.setMarginEnd(margin);
- image.setLayoutParams(params);
}
}
}
diff --git a/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml b/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml
index 65bc8f9b4..e02d7c441 100644
--- a/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml
+++ b/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml
@@ -16,8 +16,6 @@
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <solid android:color="?android:attr/colorPrimary"/>
- <corners android:radius="20dp"/>
- <stroke android:color="?android:attr/colorBackgroundFloating" android:width="2dp"/>
+ android:shape="oval">
+ <solid android:color="@color/dialer_red"/>
</shape> \ No newline at end of file
diff --git a/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml b/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml
index 02874a9d8..8c0705fe0 100644
--- a/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml
+++ b/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml
@@ -16,49 +16,41 @@
-->
<com.android.dialer.main.impl.bottomnav.BottomNavItem
xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minWidth="80dp"
+ android:background="?android:attr/selectableItemBackgroundBorderless"
android:minHeight="56dp"
- android:gravity="center"
- android:background="?android:attr/selectableItemBackgroundBorderless">
+ android:minWidth="80dp">
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/bottom_nav_item_image"
- android:layout_width="24dp"
- android:layout_height="24dp"
- android:layout_marginTop="8dp"/>
-
- <TextView
- android:id="@+id/notification_badge"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:layout_marginTop="2dp"
- android:paddingStart="6dp"
- android:paddingEnd="6dp"
- android:paddingBottom="1dp"
- android:minHeight="20dp"
- android:minWidth="20dp"
- android:gravity="center"
- android:textSize="12sp"
- android:textColor="?android:attr/textColorPrimaryInverse"
- android:background="@drawable/notification_badge"
- android:fontFamily="sans-serif-medium"
- android:visibility="invisible"/>
- </FrameLayout>
+ <ImageView
+ android:id="@+id/bottom_nav_item_image"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_marginTop="8dp"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"/>
<TextView
+ android:id="@+id/notification_badge"
+ style="@style/Dialer.TextAppearance.OVERLINE"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
+ android:layout_marginTop="2dp"
+ android:layout_marginStart="-8dp"
+ android:layout_alignParentTop="true"
+ android:layout_toEndOf="@id/bottom_nav_item_image"
+ android:background="@drawable/notification_badge"
+ android:gravity="center"
+ android:textColor="?android:attr/colorBackgroundFloating"
+ android:textSize="11dp"
+ android:visibility="invisible"/>
+ <TextView
android:id="@+id/bottom_nav_item_text"
+ style="@style/Dialer.TextAppearance.SubHeader2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
- android:gravity="center_horizontal"
- android:textSize="12sp"
- style="@style/Dialer.TextAppearance.Secondary"/>
+ android:layout_below="@id/bottom_nav_item_image"
+ android:layout_centerHorizontal="true"
+ android:gravity="center_horizontal"/>
</com.android.dialer.main.impl.bottomnav.BottomNavItem> \ No newline at end of file
diff --git a/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml b/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml
deleted file mode 100644
index 8fd376bda..000000000
--- a/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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
- -->
-<resources>
- <dimen name="badge_margin_length_1">10dp</dimen>
- <dimen name="badge_margin_length_2">14dp</dimen>
- <dimen name="badge_margin_length_3">22dp</dimen>
-</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/main/impl/res/layout/main_activity.xml b/java/com/android/dialer/main/impl/res/layout/main_activity.xml
index 5cb457ec9..5fd9bed7b 100644
--- a/java/com/android/dialer/main/impl/res/layout/main_activity.xml
+++ b/java/com/android/dialer/main/impl/res/layout/main_activity.xml
@@ -19,9 +19,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root_layout"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:clipChildren="false"
- android:clipToPadding="false">
+ android:layout_height="match_parent">
<!-- MainToolbar -->
<include
@@ -35,17 +33,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
- android:layout_above="@+id/bottom_nav_bar"
- android:clipChildren="false"
- android:clipToPadding="false">
+ android:layout_above="@+id/bottom_nav_bar">
<!-- Holds SpeedDial, Call Log, Contacts, Voicemail and Search fragments -->
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:clipChildren="false"
- android:clipToPadding="false"/>
+ android:layout_height="match_parent"/>
<FrameLayout
android:id="@+id/search_fragment_container"
@@ -64,7 +58,7 @@
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_margin="16dp"
+ android:layout_margin="24dp"
android:layout_gravity="end|bottom"
android:src="@drawable/quantum_ic_dialpad_white_24"
android:contentDescription="@string/dialpad_button_content_description"
@@ -102,4 +96,4 @@
android:importantForAccessibility="no"
android:visibility="gone"/>
</FrameLayout>
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml
index e5b72f233..9ae884d8b 100644
--- a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml
+++ b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml
@@ -29,7 +29,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/action_menu_back_from_search"
android:src="@drawable/quantum_ic_arrow_back_vd_theme_24"
- android:tint="?android:attr/colorPrimary"/>
+ android:tint="?colorIcon"/>
<EditText
android:id="@+id/search_view"
@@ -45,10 +45,9 @@
android:inputType="textFilter"
android:maxLines="1"
android:hint="@string/dialer_hint_find_contact"
- android:textColor="?android:attr/textColorSecondary"
android:textColorHint="?android:attr/textColorHint"
android:textCursorDrawable="@drawable/custom_cursor"
- android:textSize="16sp"/>
+ style="@style/Dialer.TextAppearance.Primary"/>
<ImageView
android:id="@+id/search_clear_button"