use of de.pixart.messenger.ui.interfaces.OnConversationSelected in project Pix-Art-Messenger by kriztan.
the class ConversationsOverviewFragment method onCreateView.
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Log.d(Config.LOGTAG, "onCreateView");
this.binding = DataBindingUtil.inflate(inflater, R.layout.fragment_conversations_overview, container, false);
this.binding.fab.setOnClickListener((view) -> StartConversationActivity.launch(getActivity()));
this.conversationsAdapter = new ConversationAdapter(this.activity, this.conversations);
this.binding.list.setAdapter(this.conversationsAdapter);
this.binding.list.setOnItemClickListener((parent, view, position, id) -> {
Conversation conversation = this.conversations.get(position);
if (activity instanceof OnConversationSelected) {
((OnConversationSelected) activity).onConversationSelected(conversation);
} else {
Log.w(ConversationsOverviewFragment.class.getCanonicalName(), "Activity does not implement OnConversationSelected");
}
});
return binding.getRoot();
}
Aggregations