use of com.genonbeta.TrebleShot.adapter.TextStreamListAdapter in project TrebleShot by genonbeta.
the class TextStreamListFragment method onAdapter.
@Override
public TextStreamListAdapter onAdapter() {
return new TextStreamListAdapter(getActivity()) {
@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
super.onBindViewHolder(holder, position);
holder.getView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!holder.isRepresentative() && !setItemSelected(holder)) {
TextStreamObject textStreamObject = getAdapter().getItem(holder);
startActivity(new Intent(getContext(), TextEditorActivity.class).setAction(TextEditorActivity.ACTION_EDIT_TEXT).putExtra(TextEditorActivity.EXTRA_CLIPBOARD_ID, textStreamObject.id).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
}
});
}
};
}
Aggregations