[Adaptive][Side Sheet] Fixed issue where sheet would jump to the far edge of the screen in RTL without temporary fix.

PiperOrigin-RevId: 495687169
This commit is contained in:
afohrman 2022-12-15 21:47:47 +00:00 committed by Naomi Koo
parent d4c16e8486
commit 2fd2d66b43
4 changed files with 2 additions and 11 deletions

View File

@ -83,7 +83,6 @@
style="@style/Widget.Material3.SideSheet"
android:layout_width="256dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical"
app:layout_behavior="@string/side_sheet_behavior"
tools:targetApi="lollipop">
@ -95,7 +94,6 @@
style="@style/Widget.Material3.SideSheet"
android:layout_width="256dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical"
app:layout_behavior="@string/side_sheet_behavior"
tools:targetApi="lollipop">
@ -107,7 +105,6 @@
style="@style/Widget.Material3.SideSheet"
android:layout_width="256dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical"
app:coplanarSiblingViewId="@id/nested_scroll_view"
app:layout_behavior="@string/side_sheet_behavior"

View File

@ -50,7 +50,6 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.Accessibilit
import androidx.core.view.accessibility.AccessibilityViewCommand;
import androidx.customview.view.AbsSavedState;
import androidx.customview.widget.ViewDragHelper;
import com.google.android.material.internal.ViewUtils;
import com.google.android.material.resources.MaterialResources;
import com.google.android.material.shape.MaterialShapeDrawable;
import com.google.android.material.shape.ShapeAppearanceModel;
@ -343,11 +342,7 @@ public class SideSheetBehavior<V extends View> extends CoordinatorLayout.Behavio
switch (state) {
case STATE_EXPANDED:
// TODO (b/261619910): This is a workaround for a bug where the expanded offset was getting
// recalculated if onLayoutChild() was called while the sheet was in the process of
// expanding/offsetting. Revisit this and refactor if necessary when adding left based
// sheets.
currentOffset = ViewUtils.isLayoutRtl(child) ? getExpandedOffset() : 0;
currentOffset = 0;
break;
case STATE_DRAGGING:
case STATE_SETTLING:

View File

@ -43,7 +43,6 @@
style="?attr/sideSheetModalStyle"
android:layout_width="@dimen/m3_side_sheet_width"
android:layout_height="match_parent"
android:layout_gravity="end"
app:layout_behavior="@string/side_sheet_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -24,7 +24,7 @@
set layout_* attributes from this style, because this style always
needs to be explicitly set on the behavior's associated View in the
layout. -->
<item name="android:layout_gravity">end</item>
<item name="android:layout_gravity">right</item>
<item name="android:elevation" tools:ignore="NewApi">@dimen/m3_side_sheet_standard_elevation</item>
</style>