summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/contactgrid/ContactGridManager.java
diff options
context:
space:
mode:
authorerfanian <erfanian@google.com>2017-10-02 14:28:41 -0700
committerEric Erfanian <erfanian@google.com>2017-10-03 10:40:26 -0700
commitdf3893d3ea8206a2d21c2a271a7f2ea2da681775 (patch)
tree9160ceb0e2c255c8b4ab461392a0c2254b80b886 /java/com/android/incallui/contactgrid/ContactGridManager.java
parent259c569c371f6b24ab940a90a9a4c504f0b6fe3b (diff)
Fix issue that the connection icon is placed a little left from center
When status text is empty, VoWiFi icon is placed a bit left from center because the view of connection icon is containing margin between the tatus text. Fix to remove margin from the icon when the text is empty. Public-Origin-Change-Id: Ic302104d85fa9114bebb5688f3e8028d398d1921 Signed-off-by: Eric Erfanian <erfanian@google.com> Author: Kousuke Kitahara <kousuke.kitahara@sony.com> Bug: 66075997 Test: scuba tests PiperOrigin-RevId: 170753786 Change-Id: Ifde98a8c04ba3dc2233439957a74fc4f54b444fa
Diffstat (limited to 'java/com/android/incallui/contactgrid/ContactGridManager.java')
-rw-r--r--java/com/android/incallui/contactgrid/ContactGridManager.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java
index 18bab6ab3..c0ab9609f 100644
--- a/java/com/android/incallui/contactgrid/ContactGridManager.java
+++ b/java/com/android/incallui/contactgrid/ContactGridManager.java
@@ -27,6 +27,7 @@ import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.widget.Chronometer;
import android.widget.ImageView;
+import android.widget.Space;
import android.widget.TextView;
import android.widget.ViewAnimator;
import com.android.contacts.common.compat.PhoneNumberUtilsCompat;
@@ -74,6 +75,7 @@ public class ContactGridManager {
private final ViewAnimator bottomTextSwitcher;
private final TextView bottomTextView;
private final Chronometer bottomTimerView;
+ private final Space topRowSpace;
private int avatarSize;
private boolean hideAvatar;
private boolean showAnonymousAvatar;
@@ -104,6 +106,7 @@ public class ContactGridManager {
bottomTextSwitcher = view.findViewById(R.id.contactgrid_bottom_text_switcher);
bottomTextView = view.findViewById(R.id.contactgrid_bottom_text);
bottomTimerView = view.findViewById(R.id.contactgrid_bottom_timer);
+ topRowSpace = view.findViewById(R.id.contactgrid_top_row_space);
contactGridLayout = (View) contactNameTextView.getParent();
letterTile = new LetterTileDrawable(context.getResources());
@@ -229,9 +232,16 @@ public class ContactGridManager {
if (info.icon == null) {
connectionIconImageView.setVisibility(View.GONE);
+ topRowSpace.setVisibility(View.GONE);
} else {
connectionIconImageView.setVisibility(View.VISIBLE);
connectionIconImageView.setImageDrawable(info.icon);
+ if (statusTextView.getVisibility() == View.VISIBLE
+ && !TextUtils.isEmpty(statusTextView.getText())) {
+ topRowSpace.setVisibility(View.VISIBLE);
+ } else {
+ topRowSpace.setVisibility(View.GONE);
+ }
}
}