Android-Drawerlayout: 在同一背景下滑动打开抽屉布局时,背景也滑动到一定距离

Android-Drawerlayout: when you swipe to open the drawer layout on the same background, the background also swipe to some distance

如果抽屉布局手动更新边距以增加其默认大小(即屏幕的 80%),则会出现不稳定的行为。我们将如何平滑它? 我使用的代码是

RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) mRDrawerLayout.getLayoutParams();
params1.setMargins((int) (UnitConversionUtils.dipToPixels(getApplicationContext(), reset ? 0 : -64)), 0, 0, 0);
mRDrawerLayout.setLayoutParams(params1);

在关闭抽屉时发生抽屉滑动事件,您应该将其重置为默认边距。这将重置您的抽屉布局边距 我希望你明白我的意思