Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65a87cd9 authored by Fahim's avatar Fahim
Browse files

Remove extra left & right paddings from drawer item

issue: https://gitlab.e.foundation/e/backlog/-/issues/4723/

Add negative left & right padding in sliderView.recylerView to remove
extra background for items. Also add left margin for item's icon &
left padding for headerView to fix regration.
parent 3ae80e57
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -115,6 +115,9 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K

        drawer.addDrawerListener(parent.createDrawerListener())
        sliderView.tintStatusBar = true
        val drawerPadding = parent.resources.getDimension(R.dimen.material_drawer_vertical_padding).toInt()
        sliderView.recyclerView.setPadding((-1) * drawerPadding, 0, (-1) * drawerPadding, sliderView.recyclerView.paddingBottom)
        sliderView.headerView?.setPadding(drawerPadding, 0, drawerPadding, 0)
        sliderView.onDrawerItemClickListener = { _, item, _ ->
            handleItemClickListener(item)
            false
@@ -372,7 +375,7 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K
            val wrappedSelectedDrawable = DrawableCompat.wrap(unwrappedDrawable!!)
            DrawableCompat.setTint(wrappedSelectedDrawable, ContextCompat.getColor(parent.applicationContext, R.color.color_default_accent))

            val unifiedInboxItem = PrimaryDrawerItem().apply {
            val unifiedInboxItem = FolderDrawerItem().apply {
                iconRes = R.drawable.ic_inbox_multiple //getResId(R.attr.iconUnifiedInbox)
                selectedIcon = ImageHolder(wrappedSelectedDrawable)
                identifier = DRAWER_ID_UNIFIED_INBOX
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
        android:paddingTop="@dimen/material_drawer_item_primary_icon_padding"
        android:paddingEnd="@dimen/material_drawer_item_primary_icon_padding_right"
        android:paddingBottom="@dimen/material_drawer_item_primary_icon_padding"
        android:layout_marginStart="@dimen/material_drawer_vertical_padding"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
@@ -68,7 +69,7 @@
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/material_drawer_padding"
        android:layout_marginEnd="0dp"
        android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
        android:fontFamily="sans-serif"
        android:gravity="center"
        android:lines="1"