Import translations. DO NOT MERGE am: 16891d4831 -s ours
am: da5e54048d -s ours
Change-Id: Ia75acde5e26cc4c597079397d77f03fc74c077c9
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 21f6812..e92b69c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,8 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.contacts"
- android:versionCode="10417"
- android:versionName="1.4.17">
+ android:versionCode="10421"
+ android:versionName="1.4.21">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="24" />
<original-package android:name="com.android.contacts" />
diff --git a/res/drawable-hdpi/ic_message_24dp.png b/res/drawable-hdpi/ic_message_24dp.png
deleted file mode 100644
index 48f008a..0000000
--- a/res/drawable-hdpi/ic_message_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_message_24dp.png b/res/drawable-mdpi/ic_message_24dp.png
deleted file mode 100644
index c18f225..0000000
--- a/res/drawable-mdpi/ic_message_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_message_24dp.png b/res/drawable-xhdpi/ic_message_24dp.png
deleted file mode 100644
index ee5021c..0000000
--- a/res/drawable-xhdpi/ic_message_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_message_24dp.png b/res/drawable-xxhdpi/ic_message_24dp.png
deleted file mode 100644
index e7ca6bd..0000000
--- a/res/drawable-xxhdpi/ic_message_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_message_24dp.png b/res/drawable-xxxhdpi/ic_message_24dp.png
deleted file mode 100644
index f917193..0000000
--- a/res/drawable-xxxhdpi/ic_message_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/layout-land/quickcontact_activity.xml b/res/layout-w500dp-land/quickcontact_activity.xml
similarity index 92%
rename from res/layout-land/quickcontact_activity.xml
rename to res/layout-w500dp-land/quickcontact_activity.xml
index af622dc..63cab3c 100644
--- a/res/layout-land/quickcontact_activity.xml
+++ b/res/layout-w500dp-land/quickcontact_activity.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
+<!-- Copyright (C) 2016 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.
diff --git a/res/layout/expanding_entry_card_item.xml b/res/layout/expanding_entry_card_item.xml
index 7c7337e..99f9174 100644
--- a/res/layout/expanding_entry_card_item.xml
+++ b/res/layout/expanding_entry_card_item.xml
@@ -43,7 +43,7 @@
android:layout_alignParentTop="true"
android:paddingTop="5dp"
android:layout_toEndOf="@+id/icon"
- android:layout_toStartOf="@+id/icon_alternate"
+ android:layout_toStartOf="@+id/third_icon"
android:textColor="@color/quickcontact_entry_header_text_color"
android:textAlignment="viewStart"
android:layout_marginBottom="@dimen/expanding_entry_card_header_margin_bottom" />
@@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/header"
android:layout_toEndOf="@+id/icon_sub_header"
- android:layout_toStartOf="@+id/icon_alternate"
+ android:layout_toStartOf="@+id/third_icon"
android:textAlignment="viewStart"
android:textColor="@color/quickcontact_entry_sub_header_text_color" />
@@ -73,7 +73,7 @@
android:id="@+id/text"
android:layout_below="@+id/sub_header"
android:layout_toEndOf="@+id/icon_text"
- android:layout_toStartOf="@+id/icon_alternate"
+ android:layout_toStartOf="@+id/third_icon"
android:textAlignment="viewStart"
android:textColor="@color/quickcontact_entry_sub_header_text_color" />
diff --git a/res/values-land/bools.xml b/res/values-land/bools.xml
index bd0650f..beaa960 100644
--- a/res/values-land/bools.xml
+++ b/res/values-land/bools.xml
@@ -15,6 +15,7 @@
-->
<resources>
- <bool name="quickcontact_two_panel">true</bool>
+ <bool name="quickcontact_two_panel">false</bool>
+ <bool name="contacteditor_two_panel">true</bool>
</resources>
diff --git a/res/layout-land/quickcontact_activity.xml b/res/values-w500dp-land/bools.xml
similarity index 81%
copy from res/layout-land/quickcontact_activity.xml
copy to res/values-w500dp-land/bools.xml
index af622dc..65174ba 100644
--- a/res/layout-land/quickcontact_activity.xml
+++ b/res/values-w500dp-land/bools.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
+<!-- Copyright (C) 2016 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.
@@ -13,6 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<merge>
- <include layout="@layout/quickcontact_activity_landscape" />
-</merge>
\ No newline at end of file
+<resources>
+
+ <bool name="quickcontact_two_panel">true</bool>
+
+</resources>
diff --git a/res/values/bools.xml b/res/values/bools.xml
index b94cc85..eef3808 100644
--- a/res/values/bools.xml
+++ b/res/values/bools.xml
@@ -17,5 +17,6 @@
<bool name="quickcontact_two_panel">false</bool>
<bool name="contact_all_list_show_card_frame">false</bool>
+ <bool name="contacteditor_two_panel">false</bool>
</resources>
diff --git a/src/com/android/contacts/editor/CompactPhotoEditorView.java b/src/com/android/contacts/editor/CompactPhotoEditorView.java
index 1696a12..899e22a 100644
--- a/src/com/android/contacts/editor/CompactPhotoEditorView.java
+++ b/src/com/android/contacts/editor/CompactPhotoEditorView.java
@@ -78,7 +78,7 @@
mLandscapePhotoRatio = getTypedFloat(R.dimen.quickcontact_landscape_photo_ratio);
mPortraitPhotoRatio = getTypedFloat(R.dimen.editor_portrait_photo_ratio);
- mIsTwoPanel = getResources().getBoolean(R.bool.quickcontact_two_panel);
+ mIsTwoPanel = getResources().getBoolean(R.bool.contacteditor_two_panel);
final TypedArray styledAttributes = getContext().getTheme().obtainStyledAttributes(
new int[] { android.R.attr.actionBarSize });
diff --git a/src/com/android/contacts/interactions/SmsInteraction.java b/src/com/android/contacts/interactions/SmsInteraction.java
index 7d26401..ba0070c 100644
--- a/src/com/android/contacts/interactions/SmsInteraction.java
+++ b/src/com/android/contacts/interactions/SmsInteraction.java
@@ -35,7 +35,7 @@
public class SmsInteraction implements ContactInteraction {
private static final String URI_TARGET_PREFIX = "smsto:";
- private static final int SMS_ICON_RES = R.drawable.ic_message_24dp;
+ private static final int SMS_ICON_RES = R.drawable.ic_message_24dp_mirrored;
private static BidiFormatter sBidiFormatter = BidiFormatter.getInstance();
private ContentValues mValues;
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 5469c2e..c63c989 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -32,6 +32,7 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -113,6 +114,7 @@
import com.android.contacts.common.activity.RequestPermissionsActivity;
import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.compat.EventCompat;
+import com.android.contacts.common.compat.MultiWindowCompat;
import com.android.contacts.common.dialog.CallSubjectDialog;
import com.android.contacts.common.editor.SelectAccountDialogFragment;
import com.android.contacts.common.interactions.TouchPointManager;
@@ -1039,7 +1041,9 @@
mWindowScrim.setAlpha(0);
getWindow().setBackgroundDrawable(mWindowScrim);
- mScroller.initialize(mMultiShrinkScrollerListener, mExtraMode == MODE_FULLY_EXPANDED);
+ mScroller.initialize(mMultiShrinkScrollerListener, mExtraMode == MODE_FULLY_EXPANDED,
+ /* maximumHeaderTextSize */ -1,
+ /* shouldUpdateNameViewHeight */ true);
// mScroller needs to perform asynchronous measurements after initalize(), therefore
// we can't mark this as GONE.
mScroller.setVisibility(View.INVISIBLE);
@@ -1152,7 +1156,11 @@
ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId));
}
mExtraMode = getIntent().getIntExtra(QuickContact.EXTRA_MODE, QuickContact.MODE_LARGE);
- mExtraPrioritizedMimeType = getIntent().getStringExtra(QuickContact.EXTRA_PRIORITIZED_MIMETYPE);
+ if (isMultiWindowOnPhone()) {
+ mExtraMode = QuickContact.MODE_LARGE;
+ }
+ mExtraPrioritizedMimeType =
+ getIntent().getStringExtra(QuickContact.EXTRA_PRIORITIZED_MIMETYPE);
final Uri oldLookupUri = mLookupUri;
if (lookupUri == null) {
@@ -1189,7 +1197,12 @@
return;
}
mHasAlreadyBeenOpened = true;
- mScroller.scrollUpForEntranceAnimation(mExtraMode != MODE_FULLY_EXPANDED);
+ mScroller.scrollUpForEntranceAnimation(/* scrollToCurrentPosition */ !isMultiWindowOnPhone()
+ && (mExtraMode != MODE_FULLY_EXPANDED));
+ }
+
+ private boolean isMultiWindowOnPhone() {
+ return MultiWindowCompat.isInMultiWindowMode(this) && PhoneCapabilityTester.isPhone(this);
}
/** Assign this string to the view if it is not empty. */
@@ -1868,7 +1881,7 @@
alternateIntent = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts(ContactsUtils.SCHEME_SMSTO, phone.getNumber(), null));
- alternateIcon = res.getDrawable(R.drawable.ic_message_24dp);
+ alternateIcon = res.getDrawable(R.drawable.ic_message_24dp_mirrored);
alternateContentDescription.append(res.getString(R.string.sms_custom, header));
smsContentDescription = com.android.contacts.common.util.ContactDisplayUtils
.getTelephoneTtsSpannable(alternateContentDescription.toString(), header);
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index eb3283f..b1deb90 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -66,7 +66,7 @@
public class MultiShrinkScroller extends FrameLayout {
/**
- * 1000 pixels per millisecond. Ie, 1 pixel per second.
+ * 1000 pixels per second. Ie, 1 pixel per millisecond.
*/
private static final int PIXELS_PER_SECOND = 1000;
@@ -135,6 +135,8 @@
*/
private boolean mIsOpenContactSquare;
private int mMaximumHeaderTextSize;
+ private int mMaximumPhoneticNameViewHeight;
+ private int mMaximumFullNameViewHeight;
private int mCollapsedTitleBottomMargin;
private int mCollapsedTitleStartMargin;
private int mMinimumPortraitHeaderHeight;
@@ -287,7 +289,8 @@
/**
* This method must be called inside the Activity's OnCreate.
*/
- public void initialize(MultiShrinkScrollerListener listener, boolean isOpenContactSquare) {
+ public void initialize(MultiShrinkScrollerListener listener, boolean isOpenContactSquare,
+ final int maximumHeaderTextSize, final boolean shouldUpdateNameViewHeight) {
mScrollView = (ScrollView) findViewById(R.id.content_scroller);
mScrollViewChild = findViewById(R.id.card_container);
mToolbar = findViewById(R.id.toolbar_parent);
@@ -346,7 +349,20 @@
mMaximumPortraitHeaderHeight = mIsTwoPanel ? getHeight()
: mPhotoViewContainer.getWidth();
setHeaderHeight(getMaximumScrollableHeaderHeight());
- mMaximumHeaderTextSize = mTitleAndPhoneticNameView.getHeight();
+ if (shouldUpdateNameViewHeight) {
+ mMaximumHeaderTextSize = mTitleAndPhoneticNameView.getHeight();
+ mMaximumFullNameViewHeight = mLargeTextView.getHeight();
+ // We cannot rely on mPhoneticNameView.getHeight() since it could be 0
+ final int phoneticNameSize = getResources().getDimensionPixelSize(
+ R.dimen.quickcontact_maximum_phonetic_name_size);
+ final int fullNameSize = getResources().getDimensionPixelSize(
+ R.dimen.quickcontact_maximum_title_size);
+ mMaximumPhoneticNameViewHeight =
+ mMaximumFullNameViewHeight * phoneticNameSize / fullNameSize;
+ }
+ if (maximumHeaderTextSize > 0) {
+ mMaximumHeaderTextSize = maximumHeaderTextSize;
+ }
if (mIsTwoPanel) {
mMaximumHeaderHeight = getHeight();
mMinimumHeaderHeight = mMaximumHeaderHeight;
@@ -393,7 +409,7 @@
final float TITLE_GRADIENT_SIZE_COEFFICIENT = 1.25f;
final FrameLayout.LayoutParams largeTextLayoutParms
= (FrameLayout.LayoutParams) mTitleAndPhoneticNameView.getLayoutParams();
- titleGradientLayoutParams.height = (int) ((mTitleAndPhoneticNameView.getHeight()
+ titleGradientLayoutParams.height = (int) ((mMaximumHeaderTextSize
+ largeTextLayoutParms.bottomMargin) * TITLE_GRADIENT_SIZE_COEFFICIENT);
mTitleGradientView.setLayoutParams(titleGradientLayoutParams);
}
@@ -418,7 +434,9 @@
// in case it just changed from Visibility=GONE.
mPhoneticNameView.setVisibility(View.VISIBLE);
// TODO try not using initialize() to refresh phonetic name view: b/27410518
- initialize(mListener, mIsOpenContactSquare);
+ initialize(mListener, mIsOpenContactSquare, /* maximumHeaderTextSize */
+ (mMaximumFullNameViewHeight + mMaximumPhoneticNameViewHeight),
+ /* shouldUpdateNameViewHeight */ false);
}
public void setPhoneticNameGone() {
@@ -429,7 +447,9 @@
mPhoneticNameView.setVisibility(View.GONE);
// Initialize to make Visibility work.
// TODO try not using initialize() to refresh phonetic name view: b/27410518
- initialize(mListener, mIsOpenContactSquare);
+ initialize(mListener, mIsOpenContactSquare,
+ /* maximumHeaderTextSize */ mMaximumFullNameViewHeight,
+ /* shouldUpdateNameViewHeight */ false);
}
@Override
@@ -1039,7 +1059,7 @@
} else {
mTitleAndPhoneticNameView.setPivotX(0);
}
- mTitleAndPhoneticNameView.setPivotY(mTitleAndPhoneticNameView.getHeight() / 2);
+ mTitleAndPhoneticNameView.setPivotY(mMaximumHeaderTextSize / 2);
final int toolbarHeight = mToolbar.getLayoutParams().height;
mPhotoTouchInterceptOverlay.setClickable(toolbarHeight != mMaximumHeaderHeight);
@@ -1085,7 +1105,7 @@
// Padding needed on the mTitleAndPhoneticNameView so that it has the same amount of
// padding as the target rectangle.
mCollapsedTitleBottomMargin =
- desiredTopToCenter - mTitleAndPhoneticNameView.getHeight() / 2;
+ desiredTopToCenter - mMaximumHeaderTextSize / 2;
}
/**