Add clipToOutline to the background views in people tile layouts
Also, add missing theme values to the dnd suppressed layouts For the resize handles to use the different corner radius, android.R.id.background needs to be used for the clipped background View. Bug: 180580427 Test: verified locally Change-Id: I466003d1b5b37226f28ef146a62ce5fd5102188c
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
|
||||
<LinearLayout
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:clipToOutline="true"
|
||||
android:id="@android:id/background"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="top"
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
|
||||
<LinearLayout
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:clipToOutline="true"
|
||||
android:id="@android:id/background"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:clipToOutline="true"
|
||||
android:id="@android:id/background"
|
||||
android:orientation="vertical"
|
||||
android:padding="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<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:background="@drawable/people_tile_empty_background"
|
||||
android:clipToOutline="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<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:clipToOutline="true"
|
||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/people_space_content_background"
|
||||
android:clipToOutline="true"
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:id="@android:id/background"
|
||||
android:clipToOutline="true"
|
||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:id="@android:id/background"
|
||||
android:clipToOutline="true"
|
||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:id="@+id/item"
|
||||
android:clipToOutline="true"
|
||||
android:id="@android:id/background"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
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:clipToOutline="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -83,6 +84,7 @@
|
||||
android:id="@+id/image"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/people_space_content_background"
|
||||
android:clipToOutline="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
android:id="@android:id/background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/people_space_tile_view_card"
|
||||
android:clipToOutline="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingTop="6dp"
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<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:background="@drawable/people_tile_suppressed_background"
|
||||
android:clipToOutline="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/item"
|
||||
android:id="@android:id/background"
|
||||
android:background="@drawable/people_tile_suppressed_background"
|
||||
android:clipToOutline="true"
|
||||
android:padding="8dp"
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:theme="@android:style/Theme.DeviceDefault.DayNight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/item"
|
||||
android:id="@android:id/background"
|
||||
android:background="@drawable/people_tile_suppressed_background"
|
||||
android:clipToOutline="true"
|
||||
android:padding="8dp"
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
-->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/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:background="@drawable/people_tile_suppressed_background"
|
||||
android:clipToOutline="true"
|
||||
android:layout_width="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
|
||||
// than the activity's background.
|
||||
LinearLayout item = findViewById(R.id.item);
|
||||
LinearLayout item = findViewById(android.R.id.background);
|
||||
GradientDrawable shape = (GradientDrawable) item.getBackground();
|
||||
final TypedArray ta = mContext.getTheme().obtainStyledAttributes(
|
||||
new int[]{com.android.internal.R.attr.colorSurface});
|
||||
|
||||
@@ -453,7 +453,6 @@ public class PeopleTileViewHelper {
|
||||
views.setViewVisibility(R.id.availability, View.GONE);
|
||||
}
|
||||
|
||||
views.setBoolean(R.id.image, "setClipToOutline", true);
|
||||
views.setImageViewBitmap(R.id.person_icon,
|
||||
getPersonIconBitmap(mContext, mTile, maxAvatarSize));
|
||||
return views;
|
||||
@@ -481,7 +480,7 @@ public class PeopleTileViewHelper {
|
||||
PeopleSpaceWidgetProvider.EXTRA_NOTIFICATION_KEY,
|
||||
mTile.getNotificationKey());
|
||||
}
|
||||
views.setOnClickPendingIntent(R.id.item, PendingIntent.getActivity(
|
||||
views.setOnClickPendingIntent(android.R.id.background, PendingIntent.getActivity(
|
||||
mContext,
|
||||
mAppWidgetId,
|
||||
activityIntent,
|
||||
@@ -504,7 +503,7 @@ public class PeopleTileViewHelper {
|
||||
int outerPadding = mLayoutSize == LAYOUT_LARGE ? 16 : 8;
|
||||
int outerPaddingPx = dpToPx(outerPadding);
|
||||
views.setViewPadding(
|
||||
R.id.item,
|
||||
android.R.id.background,
|
||||
outerPaddingPx,
|
||||
outerPaddingPx,
|
||||
outerPaddingPx,
|
||||
|
||||
Reference in New Issue
Block a user