1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 19:12:45 +01:00

Remove unused SuggestionListAdapter.resolveResourceIdFromAttr

This commit is contained in:
krlvm 2021-03-28 15:02:38 +03:00
parent 01e8654fbd
commit 609d09a8e2
No known key found for this signature in database
GPG Key ID: B8552A91FD265536

View File

@ -1,14 +1,12 @@
package org.schabi.newpipe.fragments.list.search; package org.schabi.newpipe.fragments.list.search;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray;
import android.view.LayoutInflater; import android.view.LayoutInflater;
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.TextView; import android.widget.TextView;
import androidx.annotation.AttrRes;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
@ -121,14 +119,6 @@ public class SuggestionListAdapter
searchResId = R.drawable.ic_search; searchResId = R.drawable.ic_search;
} }
private static int resolveResourceIdFromAttr(final Context context,
@AttrRes final int attr) {
final TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
final int attributeResourceId = a.getResourceId(0, 0);
a.recycle();
return attributeResourceId;
}
private void updateFrom(final SuggestionItem item) { private void updateFrom(final SuggestionItem item) {
suggestionIcon.setImageResource(item.fromHistory ? historyResId : searchResId); suggestionIcon.setImageResource(item.fromHistory ? historyResId : searchResId);
itemSuggestionQuery.setText(item.query); itemSuggestionQuery.setText(item.query);