From acf4b02a2542bd3e9a07c7e4e837456636946ee6 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Thu, 22 Oct 2020 14:41:50 +0530 Subject: [PATCH] Use TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(). --- .../NotificationsPlugin/NotificationFilterActivity.java | 5 +++-- .../kde/kdeconnect/UserInterface/CustomDevicesAdapter.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationFilterActivity.java b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationFilterActivity.java index f168419d..7e852aac 100644 --- a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationFilterActivity.java +++ b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationFilterActivity.java @@ -27,6 +27,7 @@ import android.widget.ListView; import org.kde.kdeconnect.UserInterface.ThemeUtil; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; import org.kde.kdeconnect_tp.R; import org.kde.kdeconnect_tp.databinding.ActivityNotificationFilterBinding; @@ -74,10 +75,10 @@ public class NotificationFilterActivity extends AppCompatActivity { CheckedTextView checkedTextView = (CheckedTextView) view; if (position == 0) { checkedTextView.setText(R.string.all); - checkedTextView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, null, null, null, null); } else { checkedTextView.setText(apps[position - 1].name); - checkedTextView.setCompoundDrawablesWithIntrinsicBounds(apps[position - 1].icon, null, null, null); + TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(checkedTextView, apps[position - 1].icon, null, null, null); checkedTextView.setCompoundDrawablePadding((int) (8 * getResources().getDisplayMetrics().density)); } diff --git a/src/org/kde/kdeconnect/UserInterface/CustomDevicesAdapter.java b/src/org/kde/kdeconnect/UserInterface/CustomDevicesAdapter.java index 668fd232..6ccf4d62 100644 --- a/src/org/kde/kdeconnect/UserInterface/CustomDevicesAdapter.java +++ b/src/org/kde/kdeconnect/UserInterface/CustomDevicesAdapter.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; +import androidx.core.widget.TextViewCompat; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; @@ -82,7 +83,7 @@ public class CustomDevicesAdapter extends RecyclerView.Adapter callback.onCustomDeviceClicked(customDevices.get(getAdapterPosition())));