Loading packages/SystemUI/res/drawable/bubble_expanded_header_bg.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="?android:attr/colorBackgroundFloating"/> <corners android:topLeftRadius="@dimen/corner_size" android:topRightRadius="@dimen/corner_size"/> </shape> </item> </layer-list> No newline at end of file packages/SystemUI/res/layout/bubble_expanded_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -29,10 +29,9 @@ <FrameLayout android:id="@+id/header_permission_wrapper" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:animateLayoutChanges="true" android:background="@drawable/bubble_expanded_header_bg"> android:animateLayoutChanges="true"> <LinearLayout android:id="@+id/header_layout" Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +26 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.graphics.Color; import android.graphics.Insets; import android.graphics.Point; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.ShapeDrawable; import android.os.RemoteException; import android.os.ServiceManager; Loading Loading @@ -188,6 +189,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList mPointerView.setBackground(triangleDrawable); FrameLayout viewWrapper = findViewById(R.id.header_permission_wrapper); viewWrapper.setBackground(createHeaderPermissionBackground(bgColor)); LayoutTransition transition = new LayoutTransition(); transition.setDuration(200); Loading @@ -203,6 +206,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList viewWrapper.setLayoutTransition(transition); viewWrapper.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); mHeaderHeight = getContext().getResources().getDimensionPixelSize( R.dimen.bubble_expanded_header_height); mPermissionHeight = getContext().getResources().getDimensionPixelSize( Loading Loading @@ -242,13 +246,35 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList if (!mShowOnTop) { removeView(mPointerView); if (mUseFooter) { View divider = findViewById(R.id.divider); viewWrapper.removeView(divider); removeView(viewWrapper); addView(divider); addView(viewWrapper); } addView(mPointerView); } } /** * Creates a background with corners rounded based on how the view is configured to display */ private Drawable createHeaderPermissionBackground(int bgColor) { TypedArray ta2 = getContext().obtainStyledAttributes( new int[] {android.R.attr.dialogCornerRadius}); final float cr = ta2.getDimension(0, 0f); ta2.recycle(); float[] radii = mUseFooter ? new float[] {0, 0, 0, 0, cr, cr, cr, cr} : new float[] {cr, cr, cr, cr, 0, 0, 0, 0}; GradientDrawable chromeBackground = new GradientDrawable(); chromeBackground.setShape(GradientDrawable.RECTANGLE); chromeBackground.setCornerRadii(radii); chromeBackground.setColor(bgColor); return chromeBackground; } /** * Sets the listener to notify when a bubble has been blocked. */ Loading Loading
packages/SystemUI/res/drawable/bubble_expanded_header_bg.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="?android:attr/colorBackgroundFloating"/> <corners android:topLeftRadius="@dimen/corner_size" android:topRightRadius="@dimen/corner_size"/> </shape> </item> </layer-list> No newline at end of file
packages/SystemUI/res/layout/bubble_expanded_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -29,10 +29,9 @@ <FrameLayout android:id="@+id/header_permission_wrapper" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:animateLayoutChanges="true" android:background="@drawable/bubble_expanded_header_bg"> android:animateLayoutChanges="true"> <LinearLayout android:id="@+id/header_layout" Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +26 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.graphics.Color; import android.graphics.Insets; import android.graphics.Point; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.ShapeDrawable; import android.os.RemoteException; import android.os.ServiceManager; Loading Loading @@ -188,6 +189,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList mPointerView.setBackground(triangleDrawable); FrameLayout viewWrapper = findViewById(R.id.header_permission_wrapper); viewWrapper.setBackground(createHeaderPermissionBackground(bgColor)); LayoutTransition transition = new LayoutTransition(); transition.setDuration(200); Loading @@ -203,6 +206,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList viewWrapper.setLayoutTransition(transition); viewWrapper.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); mHeaderHeight = getContext().getResources().getDimensionPixelSize( R.dimen.bubble_expanded_header_height); mPermissionHeight = getContext().getResources().getDimensionPixelSize( Loading Loading @@ -242,13 +246,35 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList if (!mShowOnTop) { removeView(mPointerView); if (mUseFooter) { View divider = findViewById(R.id.divider); viewWrapper.removeView(divider); removeView(viewWrapper); addView(divider); addView(viewWrapper); } addView(mPointerView); } } /** * Creates a background with corners rounded based on how the view is configured to display */ private Drawable createHeaderPermissionBackground(int bgColor) { TypedArray ta2 = getContext().obtainStyledAttributes( new int[] {android.R.attr.dialogCornerRadius}); final float cr = ta2.getDimension(0, 0f); ta2.recycle(); float[] radii = mUseFooter ? new float[] {0, 0, 0, 0, cr, cr, cr, cr} : new float[] {cr, cr, cr, cr, 0, 0, 0, 0}; GradientDrawable chromeBackground = new GradientDrawable(); chromeBackground.setShape(GradientDrawable.RECTANGLE); chromeBackground.setCornerRadii(radii); chromeBackground.setColor(bgColor); return chromeBackground; } /** * Sets the listener to notify when a bubble has been blocked. */ Loading