mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
[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:
parent
d4c16e8486
commit
2fd2d66b43
@ -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"
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user