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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -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"
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -17,26 +17,26 @@
|
|||||||
<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" />
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
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,25 +59,26 @@
|
|||||||
|
|
||||||
<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"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
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"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
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" />
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -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