mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-22 16:01:37 -04:00
Remove need for setTag and (String) getTag()
Can use the argument passed to addLinkItemView() instead. Requires making it final so that the anonymous inner class can read it.
This commit is contained in:
@@ -697,16 +697,15 @@ public class AppDetailsRecyclerViewAdapter
|
||||
}
|
||||
}
|
||||
|
||||
private void addLinkItemView(ViewGroup parent, int resIdText, int resIdDrawable, String url) {
|
||||
private void addLinkItemView(ViewGroup parent, int resIdText, int resIdDrawable, final String url) {
|
||||
TextView view = (TextView) LayoutInflater.from(parent.getContext()).inflate(R.layout.app_details2_link_item, parent, false);
|
||||
view.setTag(url);
|
||||
view.setText(resIdText);
|
||||
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(view, resIdDrawable, 0, 0, 0);
|
||||
parent.addView(view);
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onLinkClicked((String) v.getTag());
|
||||
onLinkClicked(url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user