Remove Iconify from NavListAdapter (#6578)

This commit is contained in:
caoilTe O'Connor 2023-09-16 11:34:30 +01:00 committed by GitHub
parent 955fca6e38
commit 705aae44ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 18 deletions

View File

@ -14,6 +14,7 @@ import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.bumptech.glide.load.resource.bitmap.FitCenter; import com.bumptech.glide.load.resource.bitmap.FitCenter;
@ -22,7 +23,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.joanzapata.iconify.Iconify;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.activity.PreferenceActivity;
import de.danoeh.antennapod.fragment.AllEpisodesFragment; import de.danoeh.antennapod.fragment.AllEpisodesFragment;
@ -260,10 +260,8 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
// don't count episodes that can be reclaimed // don't count episodes that can be reclaimed
int spaceUsed = itemAccess.getNumberOfDownloadedItems() int spaceUsed = itemAccess.getNumberOfDownloadedItems()
- itemAccess.getReclaimableItems(); - itemAccess.getReclaimableItems();
if (epCacheSize > 0 && spaceUsed >= epCacheSize) { if (epCacheSize > 0 && spaceUsed >= epCacheSize) {
holder.count.setText("{md-disc-full 150%}"); holder.count.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.ic_disc_full, 0);
Iconify.addIcons(holder.count);
holder.count.setVisibility(View.VISIBLE); holder.count.setVisibility(View.VISIBLE);
holder.count.setOnClickListener(v -> holder.count.setOnClickListener(v ->
new MaterialAlertDialogBuilder(context) new MaterialAlertDialogBuilder(context)
@ -291,9 +289,6 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
if (UserPreferences.getSubscriptionsFilter().isEnabled() && showSubscriptionList) { if (UserPreferences.getSubscriptionsFilter().isEnabled() && showSubscriptionList) {
holder.itemView.setEnabled(true); holder.itemView.setEnabled(true);
holder.feedsFilteredMsg.setText("{md-info-outline} "
+ context.getString(R.string.subscriptions_are_filtered));
Iconify.addIcons(holder.feedsFilteredMsg);
holder.feedsFilteredMsg.setVisibility(View.VISIBLE); holder.feedsFilteredMsg.setVisibility(View.VISIBLE);
} else { } else {
holder.itemView.setEnabled(false); holder.itemView.setEnabled(false);
@ -361,7 +356,7 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
} }
static class DividerHolder extends Holder { static class DividerHolder extends Holder {
final TextView feedsFilteredMsg; final LinearLayout feedsFilteredMsg;
public DividerHolder(@NonNull View itemView) { public DividerHolder(@NonNull View itemView) {
super(itemView); super(itemView);

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:orientation="vertical"
android:importantForAccessibility="no" android:importantForAccessibility="no"
android:orientation="vertical"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingBottom="8dp"> android:paddingBottom="8dp">
@ -13,16 +14,33 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="?android:attr/listDivider" android:background="?android:attr/listDivider"
tools:background="@android:color/holo_red_dark"/> tools:background="@android:color/holo_red_dark" />
<TextView <LinearLayout
android:id="@+id/nav_feeds_filtered_message" android:id="@+id/nav_feeds_filtered_message"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start" android:importantForAccessibility="no"
android:paddingStart="@dimen/listitem_icon_leftpadding" android:orientation="horizontal">
android:paddingTop="4dp"
android:paddingEnd="@dimen/listitem_icon_leftpadding" <ImageView
android:textColor="?android:attr/textColorSecondary" android:layout_width="20dp"
android:textSize="@dimen/text_size_small" /> android:layout_height="20dp"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_info" />
<TextView
android:id="@+id/nav_feeds_filtered_message_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:gravity="start"
android:paddingTop="4dp"
android:text="@string/subscriptions_are_filtered"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/text_size_small" />
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="16dp"
android:viewportWidth="20"
android:viewportHeight="16">
<path
android:pathData="M17.1 11.5s0-1.7 0-1.7s1.8 0 1.8 0s0 1.7 0 1.7s-1.8 0-1.8 0zm0-8s1.8 0 1.8 0s0 4.5 0 4.5s-1.8 0-1.8 0s0-4.5 0-4.5zm-8.9-2.6c2 0 3.6 0.7 5 2.1s2.1 3 2.1 5s-0.7 3.7-2.1 5s-3 2.1-5 2.1c-1.9 0-3.6-0.7-5-2.1s-2.1-3-2.1-5s0.7-3.6 2.1-5s3.1-2.1 5-2.1zm0 8.9c0.5 0 0.9-0.2 1.3-0.5s0.5-0.8 0.5-1.3s-0.2-0.9-0.5-1.3s-0.8-0.5-1.3-0.5s-0.9 0.2-1.2 0.5s-0.6 0.8-0.6 1.3s0.2 0.9 0.6 1.3s0.7 0.5 1.2 0.5z"
android:fillColor="?android:attr/textColorPrimary" />
</vector>