diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-23 20:03:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-23 20:03:28 +0000 |
commit | 602563008ae1c0acc873fd183ce298e199949677 (patch) | |
tree | 4c8800807d19285806ab0bad55c8b788f1691e25 /java/com/android/newbubble | |
parent | 5feae4d9f7b3685be38b48c1806ceb03c6b2273c (diff) | |
parent | bf7e8854806ce55c7fd298940fca52d013a02e89 (diff) |
Merge changes I71e70d6f,I40955c6e,I70ed303b
* changes:
Bubble change when display size change.
Update Assisted Dialing references.
Pressing back button twice really quickly no longer crashes dialer.
Diffstat (limited to 'java/com/android/newbubble')
-rw-r--r-- | java/com/android/newbubble/NewBubble.java | 23 | ||||
-rw-r--r-- | java/com/android/newbubble/res/drawable/bubble_shape_circle.xml | 13 |
2 files changed, 27 insertions, 9 deletions
diff --git a/java/com/android/newbubble/NewBubble.java b/java/com/android/newbubble/NewBubble.java index c0f93e29e..8b188ba33 100644 --- a/java/com/android/newbubble/NewBubble.java +++ b/java/com/android/newbubble/NewBubble.java @@ -25,6 +25,7 @@ import android.annotation.SuppressLint; import android.app.PendingIntent.CanceledException; import android.content.Context; import android.content.Intent; +import android.graphics.Outline; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.drawable.Animatable; @@ -46,6 +47,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.View.AccessibilityDelegate; import android.view.ViewGroup; +import android.view.ViewOutlineProvider; import android.view.ViewTreeObserver.OnPreDrawListener; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; @@ -112,7 +114,7 @@ public class NewBubble { @VisibleForTesting AnimatorSet exitAnimatorSet; @VisibleForTesting AnimatorSet enterAnimatorSet; - private final int primaryIconMoveDistance; + private int primaryIconMoveDistance; private final int leftBoundary; private int savedYPosition = -1; @@ -663,6 +665,22 @@ public class NewBubble { } private void update() { + // The value may change on display size changed. + primaryIconMoveDistance = + context.getResources().getDimensionPixelSize(R.dimen.bubble_size) + - context.getResources().getDimensionPixelSize(R.dimen.bubble_small_icon_size); + // Set boundary for primary button to show elevation (background is transparent) + viewHolder + .getPrimaryButton() + .setOutlineProvider( + new ViewOutlineProvider() { + @Override + public void getOutline(View view, Outline outline) { + ViewOutlineProvider.BACKGROUND.getOutline(view, outline); + outline.setAlpha(1); + } + }); + // Small icon Drawable smallIconBackgroundCircle = context @@ -914,9 +932,10 @@ public class NewBubble { startCollapse(CollapseEnd.NOTHING, false /* shouldRecoverYPosition */); } // The values in the current MoveHandler may be stale, so replace it. Then ensure the - // Window is in bounds + // Window is in bounds, and redraw the changes moveHandler = new NewMoveHandler(primaryButton, NewBubble.this); moveHandler.snapToBounds(); + replaceViewHolder(); }); root.setOnTouchListener( (v, event) -> { diff --git a/java/com/android/newbubble/res/drawable/bubble_shape_circle.xml b/java/com/android/newbubble/res/drawable/bubble_shape_circle.xml index af9d8589b..b188e9d3f 100644 --- a/java/com/android/newbubble/res/drawable/bubble_shape_circle.xml +++ b/java/com/android/newbubble/res/drawable/bubble_shape_circle.xml @@ -15,11 +15,10 @@ ~ limitations under the License --> -<shape xmlns:android="http://schemas.android.com/apk/res/android"> - <corners - android:bottomRightRadius="@dimen/bubble_size" - android:topRightRadius="@dimen/bubble_size" - android:bottomLeftRadius="@dimen/bubble_size" - android:topLeftRadius="@dimen/bubble_size"/> - <solid android:color="@android:color/white"/> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="oval"> + <size + android:width="@dimen/bubble_size" + android:height="@dimen/bubble_size"/> + <solid android:color="@android:color/transparent"/> </shape> |