use of com.farmerbb.taskbar.activity.AbstractSelectAppActivity in project Taskbar by farmerbb.
the class DesktopIconAppListAdapter method getView.
@Override
public View getView(int position, View convertView, final ViewGroup parent) {
// Check if an existing view is being reused, otherwise inflate the view
if (convertView == null)
convertView = LayoutInflater.from(getContext()).inflate(R.layout.tb_desktop_icon_row, parent, false);
final AppEntry entry = getItem(position);
assert entry != null;
TextView textView = convertView.findViewById(R.id.name);
textView.setText(entry.getLabel());
ImageView imageView = convertView.findViewById(R.id.icon);
imageView.setImageDrawable(entry.getIcon(getContext()));
LinearLayout layout = convertView.findViewById(R.id.entry);
layout.setOnClickListener(view -> {
AbstractSelectAppActivity activity = (AbstractSelectAppActivity) getContext();
activity.selectApp(entry);
});
return convertView;
}
Aggregations