mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Merge "Fix setState with the current state" into mnc-ub-dev
am: c5f5f85 * commit 'c5f5f85c1323787b2dc692af2dbd3efc804d5034': Fix setState with the current state Change-Id: Ifbbadcb2f888adcfe29b776a3ab363e88fbe6885 GitOrigin-RevId=4f0c8201b8c02def322843f180b86e0ea466e650 PiperOrigin-RevId: 140560466
This commit is contained in:
parent
d26cc78b39
commit
dce18cd5dc
@ -441,6 +441,9 @@ public class BottomSheetBehavior<V extends View> extends CoordinatorLayout.Behav
|
||||
* {@link #STATE_HIDDEN}.
|
||||
*/
|
||||
public final void setState(@State int state) {
|
||||
if (state == mState) {
|
||||
return;
|
||||
}
|
||||
if (mViewRef == null) {
|
||||
// The view is not laid out yet; modify mState and let onLayoutChild handle it later
|
||||
if (state == STATE_COLLAPSED || state == STATE_EXPANDED ||
|
||||
|
||||
@ -126,6 +126,12 @@ public class BottomSheetBehaviorTest extends
|
||||
checkSetState(BottomSheetBehavior.STATE_COLLAPSED, ViewMatchers.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@MediumTest
|
||||
public void testSetStateCollapsedToCollapsed() {
|
||||
checkSetState(BottomSheetBehavior.STATE_COLLAPSED, ViewMatchers.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@MediumTest
|
||||
public void testSwipeDownToCollapse() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user