Fix "square corners" appearance of new Back Arrow

This fixes the appearance of the "ENTRY" state, by setting an explicit
corner radius that matches the corners of the "ACTIVE" state.

While doing this, it turned out that the "INACTIVE" and "CANCELLED"
states were reusing the corner radius of the "ENTRY" state, so that
had to be split off into a new constant: "cancelledEdgeCornerRadius"
(this is the radius when the Back Arrow is "squished" against the edge,
 and if let go, will cancel the current gesture)

Bug: 238445578
Test: Manual
Change-Id: Ie5e7df298565f87c4262d79fa6b7960bf8e07977
This commit is contained in:
Rahul Banerjee
2022-07-22 15:57:47 -07:00
parent 5e93561cb9
commit 009e2a0078
3 changed files with 8 additions and 3 deletions

View File

@@ -59,8 +59,8 @@
<dimen name="navigation_edge_entry_margin">4dp</dimen>
<dimen name="navigation_edge_entry_background_width">8dp</dimen>
<dimen name="navigation_edge_entry_background_height">60dp</dimen>
<dimen name="navigation_edge_entry_edge_corners">6dp</dimen>
<dimen name="navigation_edge_entry_far_corners">6dp</dimen>
<dimen name="navigation_edge_entry_edge_corners">30dp</dimen>
<dimen name="navigation_edge_entry_far_corners">30dp</dimen>
<dimen name="navigation_edge_entry_arrow_length">10dp</dimen>
<dimen name="navigation_edge_entry_arrow_height">7dp</dimen>
@@ -90,6 +90,7 @@
<dimen name="navigation_edge_cancelled_arrow_length">12dp</dimen>
<dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen>
<dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen>
<!-- Height of notification icons in the status bar -->
<dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>

View File

@@ -626,7 +626,7 @@ class BackPanelController private constructor(
if (currentState == GestureState.INACTIVE ||
currentState == GestureState.CANCELLED
)
params.entryIndicator.backgroundDimens.edgeCornerRadius
params.cancelledEdgeCornerRadius
else
params.activeIndicator.backgroundDimens.edgeCornerRadius
)

View File

@@ -33,6 +33,8 @@ data class EdgePanelParams(private var resources: Resources) {
private set
var fullyStretchedIndicator = BackIndicatorDimens()
private set
var cancelledEdgeCornerRadius: Float = 0f
private set
var cancelledArrowDimens = ArrowDimens()
// navigation bar edge constants
@@ -132,6 +134,8 @@ data class EdgePanelParams(private var resources: Resources) {
)
)
cancelledEdgeCornerRadius = getDimen(R.dimen.navigation_edge_cancelled_edge_corners)
cancelledArrowDimens = ArrowDimens(
length = getDimen(R.dimen.navigation_edge_cancelled_arrow_length),
height = getDimen(R.dimen.navigation_edge_cancelled_arrow_height)