Import translations. DO NOT MERGE
am: f3e86d8b90 -s ours
* commit 'f3e86d8b9018927f2b2665b39db2025d945444b7':
Import translations. DO NOT MERGE
Change-Id: Iee25aa430644c57664524b3b5e68bf2854077784
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d31f433..3af383d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,10 +16,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.contacts"
- android:versionCode="10416"
- android:versionName="1.4.16">
+ android:versionCode="10420"
+ android:versionName="1.4.20">
- <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="24" />
+ <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="23" />
<original-package android:name="com.android.contacts" />
<uses-permission android:name="android.permission.CALL_PHONE" />
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-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index 60ed960..3588a98 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -164,7 +164,7 @@
<string name="add_connection_button" msgid="4861308615789601727">"Dodaj vezu"</string>
<string name="recent" msgid="2659189233141493004">"Nedavno"</string>
<string name="recent_updates" msgid="4267258535615860710">"Nedavna ažuriranja"</string>
- <string name="account_type_format" msgid="718948015590343010">"<xliff:g id="SOURCE">%1$s</xliff:g>"</string>
+ <string name="account_type_format" msgid="718948015590343010">"<xliff:g id="SOURCE">%1$s</xliff:g> kontakt"</string>
<string name="google_account_type_format" msgid="5283997303922067997">"<xliff:g id="SOURCE">%1$s</xliff:g> nalog"</string>
<!-- no translation found for from_account_format (4469138575127580203) -->
<skip />
@@ -295,7 +295,7 @@
<string name="compact_editor_more_fields" msgid="5987638193568699600">"Još polja"</string>
<string name="compact_editor_change_photo_content_description" msgid="5495487714301211540">"Promenite sliku"</string>
<string name="compact_editor_failed_to_load" msgid="4557094426388044958">"Otvaranje uređivača nije uspelo."</string>
- <string name="compact_editor_account_selector_title" msgid="5119592614151786601">"Čuva se"</string>
+ <string name="compact_editor_account_selector_title" msgid="5119592614151786601">"Čuva se na"</string>
<string name="compact_editor_account_selector_description" msgid="2127184829759350507">"Trenutno se čuva na nalogu <xliff:g id="ACCOUNT_NAME">%s</xliff:g>. Dodirnite dvaput da biste izabrali drugi nalog."</string>
<plurals name="compact_editor_linked_contacts_selector_title" formatted="false" msgid="9156207930915878316">
<item quantity="one">Objedinjeni kontakti (<xliff:g id="COUNT">%d</xliff:g>)</item>
@@ -327,7 +327,7 @@
<string name="suggestion_card_help_message" msgid="4474061044387181093">"Izgleda da su ovi kontakti ista osoba. Možete da ih objedinite u jedan kontakt."</string>
<string name="compact_editor_linked_contacts_title" msgid="4417919183651782674">"Objedinjeni kontakti"</string>
<string name="from_your_accounts" msgid="1746293107836889912">"Sa vaših naloga"</string>
- <string name="take_a_photo_button" msgid="6268693854069113488">"Slikaj"</string>
+ <string name="take_a_photo_button" msgid="6268693854069113488">"Snimi sliku"</string>
<string name="all_photos_button" msgid="1943122929420111351">"Sve slike"</string>
<string name="photo_picker_title" msgid="5272832995550042801">"Izaberite sliku"</string>
<string name="contact_from_account_name" msgid="2078526819634079406">"Sa <xliff:g id="ACCOUNT_NAME">%s</xliff:g>"</string>
diff --git a/res/values-be-rBY/strings.xml b/res/values-be-rBY/strings.xml
index 4075152..1de993d 100644
--- a/res/values-be-rBY/strings.xml
+++ b/res/values-be-rBY/strings.xml
@@ -42,8 +42,8 @@
<string name="contactDetailUpdates" msgid="3780588624763446941">"Абнаўленні"</string>
<string name="searchHint" msgid="8482945356247760701">"Пошук кантактаў"</string>
<string name="menu_viewContact" msgid="2795575601596468581">"Прагледзець кантакт"</string>
- <string name="menu_addStar" msgid="2908478235715404876">"Дадаць у абраныя"</string>
- <string name="menu_removeStar" msgid="5844227078364227030">"Выдаліць з абраных"</string>
+ <string name="menu_addStar" msgid="2908478235715404876">"Дадаць да любімых"</string>
+ <string name="menu_removeStar" msgid="5844227078364227030">"Выдаліць з Выбранага"</string>
<string name="description_action_menu_remove_star" msgid="4699640108012265178">"Выдалена з упадабаных"</string>
<string name="description_action_menu_add_star" msgid="3327186327234177456">"Дададзена ва ўпадабаныя"</string>
<string name="menu_editContact" msgid="9042415603857662633">"Рэдагаваць"</string>
@@ -77,8 +77,8 @@
<item quantity="many">Кантакты выдалены</item>
<item quantity="other">Кантакты выдалены</item>
</plurals>
- <string name="menu_set_ring_tone" msgid="8728345772068064946">"Задаць рынгтон"</string>
- <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Усе выклікі на галасавую пошту"</string>
+ <string name="menu_set_ring_tone" msgid="8728345772068064946">"Устал. рынгтон"</string>
+ <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Усе выклікі на гал. пошту"</string>
<string name="readOnlyContactWarning" msgid="5526727661978307833">"Кантакты з уліковых запісаў, даступных толькі для чытання, нельга выдаліць, але іх можна схаваць."</string>
<string name="readOnlyContactWarning_positive_button" msgid="6541862607313811926">"Схаваць"</string>
<string name="readOnlyContactDeleteConfirmation" msgid="8782086424739664753">"Кантакт на выдаленне мае інфармацыю з некалькіх уліковых запісаў. Інфармацыя з уліковых запісаў, даступных толькі для чытання, будзе схавана, а не выдалена."</string>
@@ -144,7 +144,7 @@
<item quantity="other"><xliff:g id="COUNT">%d</xliff:g> знойдзена</item>
</plurals>
<string name="all_contacts_tab_label" msgid="5948889261993124839">"Усе"</string>
- <string name="favorites_tab_label" msgid="1524869648904016414">"Абраныя"</string>
+ <string name="favorites_tab_label" msgid="1524869648904016414">"Упадабаныя"</string>
<string name="callBack" msgid="5498224409038809224">"Зваротны выклік"</string>
<string name="callAgain" msgid="3197312117049874778">"Выклікаць зноў"</string>
<string name="returnCall" msgid="8171961914203617813">"Зваротны выклік"</string>
@@ -155,7 +155,7 @@
<string name="search_settings_description" msgid="2675223022992445813">"Імёны вашых кантактаў"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Не знойдзена прыкладанне для гэтага дзеяння."</string>
<string name="quickcontact_transparent_view_description" msgid="987959416759562455">"Націсніце, каб вярнуцца на папярэдні экран"</string>
- <string name="quickcontact_add_phone_number" msgid="731665835910658965">"Дадаць нумар тэлефона"</string>
+ <string name="quickcontact_add_phone_number" msgid="731665835910658965">"Дадаць тэлефонны нумар"</string>
<string name="quickcontact_add_email" msgid="739298028384348482">"Дадаць адрас электроннай пошты"</string>
<string name="missing_app" msgid="1466111003546611387">"Не знойдзена праграма для гэтага дзеяння."</string>
<string name="menu_share" msgid="943789700636542260">"Апублікаваць"</string>
@@ -166,7 +166,7 @@
<string name="video_chat" msgid="1872255818640336072">"Відэачат"</string>
<string name="connections" msgid="8098440723172028350">"Сувязi"</string>
<string name="add_connection_button" msgid="4861308615789601727">"Дадаць кантакт"</string>
- <string name="recent" msgid="2659189233141493004">"Нядаўнія"</string>
+ <string name="recent" msgid="2659189233141493004">"Апошнія"</string>
<string name="recent_updates" msgid="4267258535615860710">"Апошнія абнаўленні"</string>
<string name="account_type_format" msgid="718948015590343010">"Кантакт <xliff:g id="SOURCE">%1$s</xliff:g>"</string>
<string name="google_account_type_format" msgid="5283997303922067997">"Уліковы запіс <xliff:g id="SOURCE">%1$s</xliff:g>"</string>
@@ -201,7 +201,7 @@
<string name="activity_title_settings" msgid="5464130076132770781">"Налады"</string>
<string name="menu_settings" msgid="377929915873428211">"Налады"</string>
<string name="menu_help" msgid="1680178646764069976">"Даведка і водгукі"</string>
- <string name="preference_displayOptions" msgid="1341720270148252393">"Параметры адлюстравання"</string>
+ <string name="preference_displayOptions" msgid="1341720270148252393">"Паказаць параметры"</string>
<string name="organization_company_and_title" msgid="6718207751363732025">"<xliff:g id="COMPANY_0">%2$s</xliff:g>, <xliff:g id="COMPANY_1">%1$s</xliff:g>"</string>
<string name="non_phone_caption" msgid="1541655052330027380">"Нумар тэлефона"</string>
<string name="non_phone_add_to_contacts" msgid="6590985286250471169">"Дадаць у кантакты"</string>
@@ -265,7 +265,7 @@
<string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"Болей"</string>
<string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"Паказаць менш"</string>
<string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"Прагледзець усё"</string>
- <string name="recent_card_title" msgid="8982782042698001695">"Нядаўнія"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"Апошнія"</string>
<string name="about_card_title" msgid="2920942314212825637">"Інфармацыя"</string>
<string name="send_message" msgid="8938418965550543196">"Адправiць паведамленне"</string>
<string name="toast_making_personal_copy" msgid="6137651078366797938">"Стварэнне асабістай копіі…"</string>
@@ -302,7 +302,7 @@
<string name="compact_editor_more_fields" msgid="5987638193568699600">"Дадатковыя палі"</string>
<string name="compact_editor_change_photo_content_description" msgid="5495487714301211540">"Змяніць фота"</string>
<string name="compact_editor_failed_to_load" msgid="4557094426388044958">"Збой адкрыцця рэдактара."</string>
- <string name="compact_editor_account_selector_title" msgid="5119592614151786601">"Куды захоўваць:"</string>
+ <string name="compact_editor_account_selector_title" msgid="5119592614151786601">"Ідзе захаванне ў"</string>
<string name="compact_editor_account_selector_description" msgid="2127184829759350507">"Зараз ідзе захаванне ва ўліковы запіс <xliff:g id="ACCOUNT_NAME">%s</xliff:g>. Двойчы дакраніцеся, каб выбраць іншы ўліковы запіс."</string>
<plurals name="compact_editor_linked_contacts_selector_title" formatted="false" msgid="9156207930915878316">
<item quantity="one">Звязаны кантакт (<xliff:g id="COUNT">%d</xliff:g>)</item>
diff --git a/res/values-bs-rBA/strings.xml b/res/values-bs-rBA/strings.xml
index 09f5d7e..7584896 100644
--- a/res/values-bs-rBA/strings.xml
+++ b/res/values-bs-rBA/strings.xml
@@ -66,7 +66,7 @@
<string name="menu_joinAggregate" msgid="3599512127797513606">"Poveži"</string>
<string name="menu_save" msgid="1727844363591825909">"Sačuvaj"</string>
<string name="titleJoinContactDataWith" msgid="6825255752748313944">"Poveži kontakte"</string>
- <string name="blurbJoinContactDataWith" msgid="5864256698061641841">"Izaberite kontakt koji želite povezati s kontaktom <xliff:g id="NAME">%s</xliff:g>:"</string>
+ <string name="blurbJoinContactDataWith" msgid="5864256698061641841">"Izaberite kontakt koji želite povezati s imenom <xliff:g id="NAME">%s</xliff:g>:"</string>
<string name="showAllContactsJoinItem" msgid="2189695051430392383">"Prikaži sve kontakte"</string>
<string name="separatorJoinAggregateSuggestions" msgid="2831414448851313345">"Predloženi kontakti"</string>
<string name="separatorJoinAggregateAll" msgid="7939932265026181043">"Svi kontakti"</string>
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;
}
/**
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index e82cea8..adc62dc 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -19,7 +19,7 @@
<uses-sdk
android:minSdkVersion="21"
- android:targetSdkVersion="24" />
+ android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />