Merge "Add clipToOutline to the background views in people tile layouts" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
52698a914e
@@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:clipToOutline="true"
|
||||||
|
android:id="@android:id/background"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:clipToOutline="true"
|
||||||
|
android:id="@android:id/background"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
|||||||
@@ -21,7 +21,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:clipToOutline="true"
|
||||||
|
android:id="@android:id/background"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
|
|||||||
@@ -14,9 +14,10 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:background="@drawable/people_tile_empty_background"
|
android:background="@drawable/people_tile_empty_background"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,9 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|||||||
@@ -126,6 +126,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/people_space_content_background"
|
android:background="@drawable/people_space_content_background"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
|||||||
@@ -21,7 +21,8 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
android:id="@+id/item"
|
android:clipToOutline="true"
|
||||||
|
android:id="@android:id/background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
@@ -18,8 +18,9 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -83,6 +84,7 @@
|
|||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/people_space_content_background"
|
android:background="@drawable/people_space_content_background"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|||||||
@@ -20,11 +20,12 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="@drawable/people_space_tile_view_card"
|
android:background="@drawable/people_space_tile_view_card"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingHorizontal="4dp"
|
android:paddingHorizontal="4dp"
|
||||||
android:paddingTop="6dp"
|
android:paddingTop="6dp"
|
||||||
|
|||||||
@@ -14,9 +14,10 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:background="@drawable/people_tile_suppressed_background"
|
android:background="@drawable/people_tile_suppressed_background"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,11 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:background="@drawable/people_tile_suppressed_background"
|
android:background="@drawable/people_tile_suppressed_background"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
|
|||||||
@@ -15,10 +15,11 @@
|
|||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:background="@drawable/people_tile_suppressed_background"
|
android:background="@drawable/people_tile_suppressed_background"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
|
|||||||
@@ -15,9 +15,10 @@
|
|||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||||
android:id="@+id/item"
|
android:id="@android:id/background"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||||
android:background="@drawable/people_tile_suppressed_background"
|
android:background="@drawable/people_tile_suppressed_background"
|
||||||
|
android:clipToOutline="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class PeopleSpaceActivity extends Activity {
|
|||||||
|
|
||||||
// The Tile preview has colorBackground as its background. Change it so it's different
|
// The Tile preview has colorBackground as its background. Change it so it's different
|
||||||
// than the activity's background.
|
// than the activity's background.
|
||||||
LinearLayout item = findViewById(R.id.item);
|
LinearLayout item = findViewById(android.R.id.background);
|
||||||
GradientDrawable shape = (GradientDrawable) item.getBackground();
|
GradientDrawable shape = (GradientDrawable) item.getBackground();
|
||||||
final TypedArray ta = mContext.getTheme().obtainStyledAttributes(
|
final TypedArray ta = mContext.getTheme().obtainStyledAttributes(
|
||||||
new int[]{com.android.internal.R.attr.colorSurface});
|
new int[]{com.android.internal.R.attr.colorSurface});
|
||||||
|
|||||||
@@ -453,7 +453,6 @@ public class PeopleTileViewHelper {
|
|||||||
views.setViewVisibility(R.id.availability, View.GONE);
|
views.setViewVisibility(R.id.availability, View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
views.setBoolean(R.id.image, "setClipToOutline", true);
|
|
||||||
views.setImageViewBitmap(R.id.person_icon,
|
views.setImageViewBitmap(R.id.person_icon,
|
||||||
getPersonIconBitmap(mContext, mTile, maxAvatarSize));
|
getPersonIconBitmap(mContext, mTile, maxAvatarSize));
|
||||||
return views;
|
return views;
|
||||||
@@ -481,7 +480,7 @@ public class PeopleTileViewHelper {
|
|||||||
PeopleSpaceWidgetProvider.EXTRA_NOTIFICATION_KEY,
|
PeopleSpaceWidgetProvider.EXTRA_NOTIFICATION_KEY,
|
||||||
mTile.getNotificationKey());
|
mTile.getNotificationKey());
|
||||||
}
|
}
|
||||||
views.setOnClickPendingIntent(R.id.item, PendingIntent.getActivity(
|
views.setOnClickPendingIntent(android.R.id.background, PendingIntent.getActivity(
|
||||||
mContext,
|
mContext,
|
||||||
mAppWidgetId,
|
mAppWidgetId,
|
||||||
activityIntent,
|
activityIntent,
|
||||||
@@ -504,7 +503,7 @@ public class PeopleTileViewHelper {
|
|||||||
int outerPadding = mLayoutSize == LAYOUT_LARGE ? 16 : 8;
|
int outerPadding = mLayoutSize == LAYOUT_LARGE ? 16 : 8;
|
||||||
int outerPaddingPx = dpToPx(outerPadding);
|
int outerPaddingPx = dpToPx(outerPadding);
|
||||||
views.setViewPadding(
|
views.setViewPadding(
|
||||||
R.id.item,
|
android.R.id.background,
|
||||||
outerPaddingPx,
|
outerPaddingPx,
|
||||||
outerPaddingPx,
|
outerPaddingPx,
|
||||||
outerPaddingPx,
|
outerPaddingPx,
|
||||||
|
|||||||
Reference in New Issue
Block a user