summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2022-08-06 16:55:29 +0200
committerByteHamster <info@bytehamster.com>2022-09-18 19:12:41 +0200
commite5d2d1b6ef6eec995e2ef7e714653567e349e59e (patch)
tree048d2ac7cbe88b6066281a234c4e4f80f1560abc /app
parentcbfa0181f48e601a18d87f9f699f48460dd61acd (diff)
downloadAntennaPod-e5d2d1b6ef6eec995e2ef7e714653567e349e59e.zip
Migrate navigation drawer to Material3
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java8
-rw-r--r--app/src/main/res/layout/nav_listitem.xml9
2 files changed, 6 insertions, 11 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
index 5b3562997..286da1e20 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
@@ -10,7 +10,6 @@ import android.view.LayoutInflater;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
-import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -208,12 +207,7 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
holder.itemView.setOnCreateContextMenuListener(itemAccess);
}
if (viewType != VIEW_TYPE_SECTION_DIVIDER) {
- TypedValue typedValue = new TypedValue();
-
- activity.get().getTheme().resolveAttribute(itemAccess.isSelected(position)
- ? R.attr.drawer_activated_color : android.R.attr.windowBackground, typedValue, true);
- holder.itemView.setBackgroundResource(typedValue.resourceId);
-
+ holder.itemView.setSelected(itemAccess.isSelected(position));
holder.itemView.setOnClickListener(v -> itemAccess.onItemClick(position));
holder.itemView.setOnLongClickListener(v -> itemAccess.onItemLongClick(position));
holder.itemView.setOnTouchListener((v, e) -> {
diff --git a/app/src/main/res/layout/nav_listitem.xml b/app/src/main/res/layout/nav_listitem.xml
index 37b629abb..0aca5eb7d 100644
--- a/app/src/main/res/layout/nav_listitem.xml
+++ b/app/src/main/res/layout/nav_listitem.xml
@@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/listitem_iconwithtext_height"
- android:foreground="?attr/selectableItemBackground"
- android:orientation="vertical">
+ android:orientation="vertical"
+ android:layout_marginHorizontal="8dp"
+ android:background="@drawable/drawer_item_background">
<ImageView
android:id="@+id/imgvCover"
android:layout_width="@dimen/thumbnail_length_navlist"
android:layout_height="@dimen/thumbnail_length_navlist"
+ android:importantForAccessibility="no"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
@@ -21,7 +23,6 @@
android:layout_marginBottom="4dp"
android:adjustViewBounds="true"
android:cropToPadding="true"
- android:importantForAccessibility="no"
android:scaleType="centerInside"
tools:src="@drawable/ic_download_black" />