Obey new m3 drawer design token
This commit is contained in:
1 parent
0eda9b109f
commit
175f75c3a2
2 files changed
+4
-8
No files matched your search
@@ -21,12 +21,8 @@ import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.hippo.yorozuya.LayoutUtils;
|
||||
|
||||
public class DrawerView extends FrameLayout {
|
||||
|
||||
private static final int DEFAULT_MAX_WIDTH = 280;
|
||||
|
||||
private static final int[] SIZE_ATTRS = new int[]{
|
||||
android.R.attr.maxWidth
|
||||
};
|
||||
@@ -50,7 +46,7 @@ public class DrawerView extends FrameLayout {
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, SIZE_ATTRS);
|
||||
mMaxWidth = a.getDimensionPixelOffset(0, LayoutUtils.dp2pix(context, DEFAULT_MAX_WIDTH));
|
||||
mMaxWidth = a.getDimensionPixelOffset(0, 0);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/draw_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -47,8 +48,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:maxWidth="@dimen/drawer_max_width"
|
||||
app:fitsSystemWindowsInsets="start|end"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/nav_drawer_main" />
|
||||
|
||||
@@ -58,6 +57,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:fitsSystemWindows="true"
|
||||
android:maxWidth="@dimen/drawer_max_width" />
|
||||
android:maxWidth="@dimen/m3_comp_navigation_drawer_container_width"
|
||||
tools:ignore="PrivateResource" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
Reference in new issue
Block a user