Center name when no status.
Also shows the status if exists (not actually hooked up yet though).
Bug: 2138736
This commit is contained in:
@@ -174,6 +174,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
|
|||||||
mPresenceView = (ImageView) findViewById(R.id.presence);
|
mPresenceView = (ImageView) findViewById(R.id.presence);
|
||||||
|
|
||||||
mStatusView = (TextView)findViewById(R.id.status);
|
mStatusView = (TextView)findViewById(R.id.status);
|
||||||
|
setSocialSnippet(null);
|
||||||
|
|
||||||
// Set the photo with a random "no contact" image
|
// Set the photo with a random "no contact" image
|
||||||
long now = SystemClock.elapsedRealtime();
|
long now = SystemClock.elapsedRealtime();
|
||||||
@@ -355,7 +356,12 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
|
|||||||
* Manually set the social snippet text to display in the header.
|
* Manually set the social snippet text to display in the header.
|
||||||
*/
|
*/
|
||||||
public void setSocialSnippet(CharSequence snippet) {
|
public void setSocialSnippet(CharSequence snippet) {
|
||||||
mStatusView.setText(snippet);
|
if (snippet == null) {
|
||||||
|
mStatusView.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
mStatusView.setText(snippet);
|
||||||
|
mStatusView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
<TextView android:id="@+id/name"
|
<TextView android:id="@+id/name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="fill_parent"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
|||||||
@@ -17,15 +17,14 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/banner"
|
android:id="@+id/banner"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="@drawable/title_bar_medium"
|
android:background="@drawable/title_bar_medium"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip">
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<android.widget.FasttrackBadgeWidget android:id="@+id/photo"
|
<android.widget.FasttrackBadgeWidget android:id="@+id/photo"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="10dip"
|
android:layout_marginRight="10dip"
|
||||||
android:layout_marginLeft="10dip"
|
android:layout_marginLeft="10dip"
|
||||||
style="@*android:style/Widget.FasttrackBadgeWidget.WindowSmall" />
|
style="@*android:style/Widget.FasttrackBadgeWidget.WindowSmall" />
|
||||||
@@ -35,8 +34,9 @@
|
|||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginTop="5dip"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center_vertical" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@@ -59,8 +59,7 @@
|
|||||||
|
|
||||||
<TextView android:id="@+id/status"
|
<TextView android:id="@+id/status"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:ellipsize="end"/>
|
android:ellipsize="end"/>
|
||||||
@@ -71,6 +70,7 @@
|
|||||||
android:id="@+id/presence"
|
android:id="@+id/presence"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:paddingLeft="3dip"
|
android:paddingLeft="3dip"
|
||||||
android:paddingRight="6dip"/>
|
android:paddingRight="6dip"/>
|
||||||
|
|
||||||
@@ -78,6 +78,7 @@
|
|||||||
android:id="@+id/star"
|
android:id="@+id/star"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
style="?android:attr/starStyle" />
|
style="?android:attr/starStyle" />
|
||||||
|
|
||||||
|
|||||||
@@ -23,4 +23,5 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user