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

Commit 5eef62ae authored by Thore Goebel's avatar Thore Goebel Committed by Niedermann IT-Dienstleistungen
Browse files

Improve navdrawer items design

- make them rounded (like in the files app)
- add touch states
parent 64b4a92c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -111,12 +111,13 @@ public class NavigationAdapter extends RecyclerView.Adapter<NavigationAdapter.Vi
            } else {
                icon.setVisibility(View.GONE);
            }
            view.setBackgroundColor(isSelected ? view.getResources().getColor(R.color.bg_highlighted) : Color.TRANSPARENT);
            int textColor = isSelected ? mainColor : view.getResources().getColor(R.color.fg_default);

            name.setTextColor(textColor);
            count.setTextColor(textColor);
            icon.setColorFilter(isSelected ? textColor : 0);

            view.setSelected(isSelected);
        }
    }

+41 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?colorControlHighlight">

    <item
        android:id="@android:id/mask"
        android:left="@dimen/spacer_1x"
        android:right="@dimen/spacer_1x"
        android:top="@dimen/spacer_1hx"
        android:bottom="@dimen/spacer_1hx">

        <shape android:shape="rectangle">
            <!-- value of color is irrelevant, but solid needs to be defined for mask to work -->
            <solid android:color="@color/bg_highlighted" />
            <corners android:radius="@dimen/spacer_1hx" />
        </shape>
    </item>

    <item
        android:left="@dimen/spacer_1x"
        android:right="@dimen/spacer_1x"
        android:top="@dimen/spacer_1hx"
        android:bottom="@dimen/spacer_1hx">

        <selector>
            <item android:state_selected="true">
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/spacer_1hx" />
                    <solid android:color="@color/bg_highlighted" />
                </shape>
            </item>

            <item>
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/spacer_1hx" />
                </shape>
            </item>
        </selector>
    </item>

</ripple>
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:left="@dimen/spacer_1x"
    android:right="@dimen/spacer_1x"
    android:top="@dimen/spacer_1hx"
    android:bottom="@dimen/spacer_1hx">

    <item android:state_selected="true">
        <shape android:shape="rectangle">
            <solid android:color="@color/bg_highlighted" />
        </shape>
    </item>

    <item>
        <shape android:shape="rectangle"/>
    </item>

</selector>
 No newline at end of file
+4 −1
Original line number Diff line number Diff line
@@ -3,9 +3,12 @@
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg_navdrawer_item"
    android:gravity="center_vertical"
    android:paddingTop="@dimen/spacer_1hx"
    android:paddingBottom="@dimen/spacer_1hx"
    android:paddingStart="@dimen/spacer_1x"
    android:paddingEnd="@dimen/spacer_1x">
    android:paddingEnd="@dimen/spacer_2x">

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/navigationItemIcon"