Search in sources :

Example 1 with OnDismissListener

use of org.thoughtcrime.securesms.components.reminder.ReminderView.OnDismissListener in project Signal-Android by WhisperSystems.

the class ConversationListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
    final View view = inflater.inflate(R.layout.conversation_list_fragment, container, false);
    reminderView = ViewUtil.findById(view, R.id.reminder);
    list = ViewUtil.findById(view, R.id.list);
    fab = ViewUtil.findById(view, R.id.fab);
    if (archive)
        fab.setVisibility(View.GONE);
    else
        fab.setVisibility(View.VISIBLE);
    reminderView.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss() {
            updateReminders();
        }
    });
    list.setHasFixedSize(true);
    list.setLayoutManager(new LinearLayoutManager(getActivity()));
    list.setItemAnimator(new DeleteItemAnimator());
    new ItemTouchHelper(new ArchiveListenerCallback()).attachToRecyclerView(list);
    return view;
}
Also used : ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) OnDismissListener(org.thoughtcrime.securesms.components.reminder.ReminderView.OnDismissListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) View(android.view.View) ReminderView(org.thoughtcrime.securesms.components.reminder.ReminderView) RecyclerView(android.support.v7.widget.RecyclerView) DeleteItemAnimator(org.thoughtcrime.securesms.components.recyclerview.DeleteItemAnimator)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 View (android.view.View)1 DeleteItemAnimator (org.thoughtcrime.securesms.components.recyclerview.DeleteItemAnimator)1 ReminderView (org.thoughtcrime.securesms.components.reminder.ReminderView)1 OnDismissListener (org.thoughtcrime.securesms.components.reminder.ReminderView.OnDismissListener)1