summaryrefslogtreecommitdiffstats
path: root/java/com/android/contacts/common
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-20 08:50:25 -0700
committerEric Erfanian <erfanian@google.com>2017-03-20 09:03:10 -0700
commit06b6b56e9eaa91ebf757ea641e38a9c885fa40bd (patch)
tree6a0f9f0809cc02004f4be6ef9d20cbced397c3d1 /java/com/android/contacts/common
parent9a090c89e7a0c43a668bd6e2ac5e5e680f323aed (diff)
downloadandroid_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.tar.gz
android_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.tar.bz2
android_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.zip
Update AOSP Dialer source from internal google3 repository at
cl/150622237 Test: make, treehugger, on device testing. This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150392808 (3/16/2017) to cl/150622237 (3/20/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: Id53e0e580a4ef73760a8afb7bb8c265ee27ad535
Diffstat (limited to 'java/com/android/contacts/common')
-rw-r--r--java/com/android/contacts/common/res/drawable-hdpi/ic_person_add_24dp.pngbin289 -> 0 bytes
-rw-r--r--java/com/android/contacts/common/res/drawable-mdpi/ic_person_add_24dp.pngbin204 -> 0 bytes
-rw-r--r--java/com/android/contacts/common/res/drawable-xhdpi/ic_person_add_24dp.pngbin329 -> 0 bytes
-rw-r--r--java/com/android/contacts/common/res/drawable-xxhdpi/ic_person_add_24dp.pngbin464 -> 0 bytes
-rw-r--r--java/com/android/contacts/common/res/drawable-xxxhdpi/ic_person_add_24dp.pngbin610 -> 0 bytes
-rw-r--r--java/com/android/contacts/common/res/drawable/ic_person_add_tinted_24dp.xml2
-rw-r--r--java/com/android/contacts/common/res/drawable/ic_search_add_contact.xml2
-rw-r--r--java/com/android/contacts/common/res/values-ky/strings.xml2
-rw-r--r--java/com/android/contacts/common/util/FabUtil.java71
-rw-r--r--java/com/android/contacts/common/widget/FloatingActionButtonController.java79
10 files changed, 28 insertions, 128 deletions
diff --git a/java/com/android/contacts/common/res/drawable-hdpi/ic_person_add_24dp.png b/java/com/android/contacts/common/res/drawable-hdpi/ic_person_add_24dp.png
deleted file mode 100644
index 10ae5a70c..000000000
--- a/java/com/android/contacts/common/res/drawable-hdpi/ic_person_add_24dp.png
+++ /dev/null
Binary files differ
diff --git a/java/com/android/contacts/common/res/drawable-mdpi/ic_person_add_24dp.png b/java/com/android/contacts/common/res/drawable-mdpi/ic_person_add_24dp.png
deleted file mode 100644
index 38e0a2882..000000000
--- a/java/com/android/contacts/common/res/drawable-mdpi/ic_person_add_24dp.png
+++ /dev/null
Binary files differ
diff --git a/java/com/android/contacts/common/res/drawable-xhdpi/ic_person_add_24dp.png b/java/com/android/contacts/common/res/drawable-xhdpi/ic_person_add_24dp.png
deleted file mode 100644
index 7e7c289d4..000000000
--- a/java/com/android/contacts/common/res/drawable-xhdpi/ic_person_add_24dp.png
+++ /dev/null
Binary files differ
diff --git a/java/com/android/contacts/common/res/drawable-xxhdpi/ic_person_add_24dp.png b/java/com/android/contacts/common/res/drawable-xxhdpi/ic_person_add_24dp.png
deleted file mode 100644
index 8f744f039..000000000
--- a/java/com/android/contacts/common/res/drawable-xxhdpi/ic_person_add_24dp.png
+++ /dev/null
Binary files differ
diff --git a/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_person_add_24dp.png b/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_person_add_24dp.png
deleted file mode 100644
index 2fa2cca80..000000000
--- a/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_person_add_24dp.png
+++ /dev/null
Binary files differ
diff --git a/java/com/android/contacts/common/res/drawable/ic_person_add_tinted_24dp.xml b/java/com/android/contacts/common/res/drawable/ic_person_add_tinted_24dp.xml
index 0af90edb3..c2538cfd1 100644
--- a/java/com/android/contacts/common/res/drawable/ic_person_add_tinted_24dp.xml
+++ b/java/com/android/contacts/common/res/drawable/ic_person_add_tinted_24dp.xml
@@ -16,5 +16,5 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:autoMirrored="true"
- android:src="@drawable/ic_person_add_24dp"
+ android:src="@drawable/quantum_ic_person_add_white_24"
android:tint="@color/actionbar_icon_color"/>
diff --git a/java/com/android/contacts/common/res/drawable/ic_search_add_contact.xml b/java/com/android/contacts/common/res/drawable/ic_search_add_contact.xml
index 801806044..476212d24 100644
--- a/java/com/android/contacts/common/res/drawable/ic_search_add_contact.xml
+++ b/java/com/android/contacts/common/res/drawable/ic_search_add_contact.xml
@@ -17,4 +17,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:autoMirrored="true"
- android:src="@drawable/ic_person_add_24dp"/>
+ android:src="@drawable/quantum_ic_person_add_white_24"/>
diff --git a/java/com/android/contacts/common/res/values-ky/strings.xml b/java/com/android/contacts/common/res/values-ky/strings.xml
index 55a210a0b..ed081ec60 100644
--- a/java/com/android/contacts/common/res/values-ky/strings.xml
+++ b/java/com/android/contacts/common/res/values-ky/strings.xml
@@ -122,7 +122,7 @@
<string name="email_mobile" msgid="4487686436743741150">"Мобилге эмейлдөө"</string>
<string name="email_work" msgid="4223487303344613528">"Жумушка эмейлдөө"</string>
<string name="email_other" msgid="4246411900126012062">"Электрондук кат жазуу"</string>
- <string name="email_custom" msgid="7246580894327511013">"<xliff:g id="CUSTOM">%s</xliff:g> эмейл жөнөтүү"</string>
+ <string name="email_custom" msgid="7246580894327511013">"Кат жазуу (<xliff:g id="CUSTOM">%s</xliff:g>)"</string>
<string name="email" msgid="2807318537887091606">"Электрондук кат жазуу"</string>
<string name="postal_street" msgid="6918171741240802474">"Көчөсү"</string>
<string name="postal_pobox" msgid="2962203483168878561">"Абонент кутусу"</string>
diff --git a/java/com/android/contacts/common/util/FabUtil.java b/java/com/android/contacts/common/util/FabUtil.java
deleted file mode 100644
index b1bb2e653..000000000
--- a/java/com/android/contacts/common/util/FabUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2012 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.contacts.common.util;
-
-import android.content.res.Resources;
-import android.graphics.Outline;
-import android.view.View;
-import android.view.ViewOutlineProvider;
-import android.widget.ListView;
-import com.android.contacts.common.R;
-import com.android.dialer.compat.CompatUtils;
-
-/** Provides static functions to work with views */
-public class FabUtil {
-
- private static final ViewOutlineProvider OVAL_OUTLINE_PROVIDER =
- new ViewOutlineProvider() {
- @Override
- public void getOutline(View view, Outline outline) {
- outline.setOval(0, 0, view.getWidth(), view.getHeight());
- }
- };
-
- private FabUtil() {}
-
- /**
- * Configures the floating action button, clipping it to a circle and setting its translation z
- *
- * @param fabView the float action button's view
- * @param res the resources file
- */
- public static void setupFloatingActionButton(View fabView, Resources res) {
- if (CompatUtils.isLollipopCompatible()) {
- fabView.setOutlineProvider(OVAL_OUTLINE_PROVIDER);
- fabView.setTranslationZ(
- res.getDimensionPixelSize(R.dimen.floating_action_button_translation_z));
- }
- }
-
- /**
- * Adds padding to the bottom of the given {@link ListView} so that the floating action button
- * does not obscure any content.
- *
- * @param listView to add the padding to
- * @param res valid resources object
- */
- public static void addBottomPaddingToListViewForFab(ListView listView, Resources res) {
- final int fabPadding =
- res.getDimensionPixelSize(R.dimen.floating_action_button_list_bottom_padding);
- listView.setPaddingRelative(
- listView.getPaddingStart(),
- listView.getPaddingTop(),
- listView.getPaddingEnd(),
- listView.getPaddingBottom() + fabPadding);
- listView.setClipToPadding(false);
- }
-}
diff --git a/java/com/android/contacts/common/widget/FloatingActionButtonController.java b/java/com/android/contacts/common/widget/FloatingActionButtonController.java
index f03129779..368d09207 100644
--- a/java/com/android/contacts/common/widget/FloatingActionButtonController.java
+++ b/java/com/android/contacts/common/widget/FloatingActionButtonController.java
@@ -19,13 +19,13 @@ package com.android.contacts.common.widget;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
+import android.support.design.widget.FloatingActionButton;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
-import android.widget.ImageButton;
import com.android.contacts.common.R;
-import com.android.contacts.common.util.FabUtil;
import com.android.dialer.animation.AnimUtils;
+import com.android.dialer.common.Assert;
/** Controls the movement and appearance of the FAB (Floating Action Button). */
public class FloatingActionButtonController {
@@ -41,12 +41,11 @@ public class FloatingActionButtonController {
private final int mAnimationDuration;
private final int mFloatingActionButtonWidth;
private final int mFloatingActionButtonMarginRight;
- private final View mFloatingActionButtonContainer;
- private final ImageButton mFloatingActionButton;
+ private final FloatingActionButton mFab;
private final Interpolator mFabInterpolator;
private int mScreenWidth;
- public FloatingActionButtonController(Activity activity, View container, ImageButton button) {
+ public FloatingActionButtonController(Activity activity, FloatingActionButton fab) {
Resources resources = activity.getResources();
mFabInterpolator =
AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in);
@@ -55,9 +54,7 @@ public class FloatingActionButtonController {
mFloatingActionButtonMarginRight =
resources.getDimensionPixelOffset(R.dimen.floating_action_button_margin_right);
mAnimationDuration = resources.getInteger(R.integer.floating_action_button_animation_duration);
- mFloatingActionButtonContainer = container;
- mFloatingActionButton = button;
- FabUtil.setupFloatingActionButton(mFloatingActionButtonContainer, resources);
+ mFab = fab;
}
/**
@@ -71,7 +68,7 @@ public class FloatingActionButtonController {
}
public boolean isVisible() {
- return mFloatingActionButtonContainer.getVisibility() == View.VISIBLE;
+ return mFab.getVisibility() == View.VISIBLE;
}
/**
@@ -80,14 +77,13 @@ public class FloatingActionButtonController {
* @param visible Whether or not to make the container visible.
*/
public void setVisible(boolean visible) {
- mFloatingActionButtonContainer.setVisibility(visible ? View.VISIBLE : View.GONE);
+ mFab.setVisibility(visible ? View.VISIBLE : View.GONE);
}
public void changeIcon(Drawable icon, String description) {
- if (mFloatingActionButton.getDrawable() != icon
- || !mFloatingActionButton.getContentDescription().equals(description)) {
- mFloatingActionButton.setImageDrawable(icon);
- mFloatingActionButton.setContentDescription(description);
+ if (mFab.getDrawable() != icon || !mFab.getContentDescription().equals(description)) {
+ mFab.setImageDrawable(icon);
+ mFab.setContentDescription(description);
}
}
@@ -99,8 +95,7 @@ public class FloatingActionButtonController {
public void onPageScrolled(float positionOffset) {
// As the page is scrolling, if we're on the first tab, update the FAB position so it
// moves along with it.
- mFloatingActionButtonContainer.setTranslationX(
- (int) (positionOffset * getTranslationXForAlignment(ALIGN_END)));
+ mFab.setTranslationX(positionOffset * getTranslationXForAlignment(ALIGN_END));
}
/**
@@ -121,7 +116,7 @@ public class FloatingActionButtonController {
* @param offsetY Additional offsetY to translate by.
* @param animate Whether or not to animate the transition.
*/
- public void align(int align, int offsetX, int offsetY, boolean animate) {
+ private void align(int align, int offsetX, int offsetY, boolean animate) {
if (mScreenWidth == 0) {
return;
}
@@ -129,33 +124,16 @@ public class FloatingActionButtonController {
int translationX = getTranslationXForAlignment(align);
// Skip animation if container is not shown; animation causes container to show again.
- if (animate && mFloatingActionButtonContainer.isShown()) {
- mFloatingActionButtonContainer
- .animate()
+ if (animate && mFab.isShown()) {
+ mFab.animate()
.translationX(translationX + offsetX)
.translationY(offsetY)
.setInterpolator(mFabInterpolator)
.setDuration(mAnimationDuration)
.start();
} else {
- mFloatingActionButtonContainer.setTranslationX(translationX + offsetX);
- mFloatingActionButtonContainer.setTranslationY(offsetY);
- }
- }
-
- /**
- * Resizes width and height of the floating action bar container.
- *
- * @param dimension The new dimensions for the width and height.
- * @param animate Whether to animate this change.
- */
- public void resize(int dimension, boolean animate) {
- if (animate) {
- AnimUtils.changeDimensions(mFloatingActionButtonContainer, dimension, dimension);
- } else {
- mFloatingActionButtonContainer.getLayoutParams().width = dimension;
- mFloatingActionButtonContainer.getLayoutParams().height = dimension;
- mFloatingActionButtonContainer.requestLayout();
+ mFab.setTranslationX(translationX + offsetX);
+ mFab.setTranslationY(offsetY);
}
}
@@ -167,17 +145,8 @@ public class FloatingActionButtonController {
*/
public void scaleIn(int delayMs) {
setVisible(true);
- AnimUtils.scaleIn(mFloatingActionButtonContainer, FAB_SCALE_IN_DURATION, delayMs);
- AnimUtils.fadeIn(
- mFloatingActionButton, FAB_SCALE_IN_DURATION, delayMs + FAB_SCALE_IN_FADE_IN_DELAY, null);
- }
-
- /** Immediately remove the affects of the last call to {@link #scaleOut}. */
- public void resetIn() {
- mFloatingActionButton.setAlpha(1f);
- mFloatingActionButton.setVisibility(View.VISIBLE);
- mFloatingActionButtonContainer.setScaleX(1);
- mFloatingActionButtonContainer.setScaleY(1);
+ AnimUtils.scaleIn(mFab, FAB_SCALE_IN_DURATION, delayMs);
+ AnimUtils.fadeIn(mFab, FAB_SCALE_IN_DURATION, delayMs + FAB_SCALE_IN_FADE_IN_DELAY, null);
}
/**
@@ -185,10 +154,10 @@ public class FloatingActionButtonController {
* animation for hiding the floating action button.
*/
public void scaleOut() {
- AnimUtils.scaleOut(mFloatingActionButtonContainer, mAnimationDuration);
+ AnimUtils.scaleOut(mFab, mAnimationDuration);
// Fade out the icon faster than the scale out animation, so that the icon scaling is less
// obvious. We don't want it to scale, but the resizing the container is not as performant.
- AnimUtils.fadeOut(mFloatingActionButton, FAB_ICON_FADE_OUT_DURATION, null);
+ AnimUtils.fadeOut(mFab, FAB_ICON_FADE_OUT_DURATION, null);
}
/**
@@ -198,8 +167,8 @@ public class FloatingActionButtonController {
* @param align One of ALIGN_MIDDLE, ALIGN_QUARTER_RIGHT, or ALIGN_RIGHT.
* @return The translationX for the given alignment.
*/
- public int getTranslationXForAlignment(int align) {
- int result = 0;
+ private int getTranslationXForAlignment(int align) {
+ int result;
switch (align) {
case ALIGN_MIDDLE:
// Moves the FAB to exactly center screen.
@@ -213,6 +182,8 @@ public class FloatingActionButtonController {
result =
mScreenWidth / 2 - mFloatingActionButtonWidth / 2 - mFloatingActionButtonMarginRight;
break;
+ default:
+ throw Assert.createIllegalStateFailException("Invalid alignment value: " + align);
}
if (isLayoutRtl()) {
result *= -1;
@@ -221,6 +192,6 @@ public class FloatingActionButtonController {
}
private boolean isLayoutRtl() {
- return mFloatingActionButtonContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
+ return mFab.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
}
}