diff options
| author | Rohit Yengisetty <rohit@cyngn.com> | 2016-05-10 15:01:13 -0700 |
|---|---|---|
| committer | Rohit Yengisetty <rohit@cyngn.com> | 2016-05-10 17:12:33 -0700 |
| commit | b74e5870b4829ac115a19cfd7ee704871c2c1bc6 (patch) | |
| tree | afeead9bdc9fb15ddea2330e243592f487eec77d | |
| parent | 2ec525eda1705179aec2e33b99c57ca212dfd4e9 (diff) | |
| download | android_packages_apps_InCallUI-b74e5870b4829ac115a19cfd7ee704871c2c1bc6.tar.gz android_packages_apps_InCallUI-b74e5870b4829ac115a19cfd7ee704871c2c1bc6.tar.bz2 android_packages_apps_InCallUI-b74e5870b4829ac115a19cfd7ee704871c2c1bc6.zip | |
Fix glitches in the rendering of contact-info Provider's logo
There are instances where the size of the drawable abruptly changes
while navigating into and out of InCallActivity. This resizing leads
to the login being partically drawn or clipped. Eliminating this
inconsistency by moving the logo drawable into an ImageView.
Change-Id: Icdcc3100ac9e28cfd5749d04ca935fbea396bbd2
(cherry picked from commit 9d93c75ba103247e69e4df2666126125952a7b70)
| -rw-r--r-- | res/layout-land/call_card_fragment.xml | 28 | ||||
| -rw-r--r-- | res/layout/call_card_fragment.xml | 20 | ||||
| -rw-r--r-- | src/com/android/incallui/CallCardFragment.java | 16 |
3 files changed, 47 insertions, 17 deletions
diff --git a/res/layout-land/call_card_fragment.xml b/res/layout-land/call_card_fragment.xml index 8109c33f..76d4964a 100644 --- a/res/layout-land/call_card_fragment.xml +++ b/res/layout-land/call_card_fragment.xml @@ -187,14 +187,30 @@ android:layout_gravity="start|top" android:orientation="vertical"> - <TextView - android:id="@+id/contactInfoAttribution" + <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" - android:gravity="center" - android:textSize="@dimen/contact_info_attribution_text_size" - android:textColor="@color/contact_info_attribution_text_color" - android:text="@string/powered_by_provider" /> + android:orientation="horizontal" + android:gravity="center_vertical"> + + <ImageView + android:id="@+id/contactInfoAttributionLogo" + android:scaleType="centerCrop" + android:layout_height="@dimen/contact_info_attribution_logo_size" + android:layout_width="@dimen/contact_info_attribution_logo_size" + android:layout_marginStart="@dimen/contact_info_attribution_logo_padding" + android:layout_marginEnd="@dimen/contact_info_attribution_logo_padding" /> + + <TextView + android:id="@+id/contactInfoAttributionText" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:gravity="center" + android:textSize="@dimen/contact_info_attribution_text_size" + android:textColor="@color/contact_info_attribution_text_color" + android:text="@string/powered_by_provider" /> + + </LinearLayout> <TextView android:id="@+id/spamInfo" diff --git a/res/layout/call_card_fragment.xml b/res/layout/call_card_fragment.xml index d5d6e421..838120c9 100644 --- a/res/layout/call_card_fragment.xml +++ b/res/layout/call_card_fragment.xml @@ -215,8 +215,22 @@ android:layout_gravity="start|top" android:orientation="vertical"> - <TextView - android:id="@+id/contactInfoAttribution" + <LinearLayout + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + + <ImageView + android:id="@+id/contactInfoAttributionLogo" + android:scaleType="centerCrop" + android:layout_height="@dimen/contact_info_attribution_logo_size" + android:layout_width="@dimen/contact_info_attribution_logo_size" + android:layout_marginStart="@dimen/contact_info_attribution_logo_padding" + android:layout_marginEnd="@dimen/contact_info_attribution_logo_padding" /> + + <TextView + android:id="@+id/contactInfoAttributionText" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" @@ -224,6 +238,8 @@ android:textColor="@color/contact_info_attribution_text_color" android:text="@string/powered_by_provider" /> + </LinearLayout> + <TextView android:id="@+id/spamInfo" android:layout_height="wrap_content" diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java index c64f200b..b24bf427 100644 --- a/src/com/android/incallui/CallCardFragment.java +++ b/src/com/android/incallui/CallCardFragment.java @@ -149,7 +149,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private View mPhotoContainer; private TextView mLookupStatusMessage; - private TextView mContactInfoAttribution; + private TextView mContactInfoAttributionText; + private ImageView mContactInfoAttributionLogo; private TextView mSpamInfoView; // Dark number info bar @@ -333,7 +334,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mCallSubject = (TextView) view.findViewById(R.id.callSubject); mLookupStatusMessage = (TextView) view.findViewById(R.id.lookupStatusMessage); - mContactInfoAttribution = (TextView) view.findViewById(R.id.contactInfoAttribution); + mContactInfoAttributionText = (TextView) view.findViewById(R.id.contactInfoAttributionText); + mContactInfoAttributionLogo = (ImageView) view.findViewById(R.id.contactInfoAttributionLogo); mSpamInfoView = (TextView) view.findViewById(R.id.spamInfo); mPhotoContainer = view.findViewById(R.id.call_card_content); @@ -1331,13 +1333,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } else { switch (lookupStatus) { case SUCCESS: - mContactInfoAttribution.setText( + mContactInfoAttributionText.setText( res.getString(R.string.powered_by_provider, providerName)); - int logoSize = res.getDimensionPixelSize(R.dimen.contact_info_attribution_logo_size); - int logoPadding = res.getDimensionPixelSize(R.dimen.contact_info_attribution_logo_padding); - providerLogo.setBounds(0, 0, logoSize, logoSize); - mContactInfoAttribution.setCompoundDrawablesRelative(providerLogo, null, null, null); - mContactInfoAttribution.setCompoundDrawablePadding(logoPadding); + mContactInfoAttributionLogo.setImageDrawable(providerLogo); showContactAttribution = true; showLookupStatus = false; break; @@ -1365,7 +1363,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } } mLookupStatusMessage.setVisibility(showLookupStatus ? View.VISIBLE : View.GONE); - mContactInfoAttribution.setVisibility(showContactAttribution ? View.VISIBLE : View.GONE); + mContactInfoAttributionText.setVisibility(showContactAttribution ? View.VISIBLE : View.GONE); } public void onDialpadVisibilityChange(boolean isShown) { |
