Search in sources :

Example 1 with StickyHeaderDecoration

use of org.thoughtcrime.securesms.util.StickyHeaderDecoration in project Signal-Android by signalapp.

the class ConversationFragment method setInlineDateDecoration.

public void setInlineDateDecoration(@NonNull ConversationAdapter adapter) {
    if (inlineDateDecoration != null) {
        list.removeItemDecoration(inlineDateDecoration);
    }
    inlineDateDecoration = new StickyHeaderDecoration(adapter, false, false, ConversationAdapter.HEADER_TYPE_INLINE_DATE);
    list.addItemDecoration(inlineDateDecoration, 0);
}
Also used : StickyHeaderDecoration(org.thoughtcrime.securesms.util.StickyHeaderDecoration)

Example 2 with StickyHeaderDecoration

use of org.thoughtcrime.securesms.util.StickyHeaderDecoration in project Signal-Android by WhisperSystems.

the class ConversationFragment method initializeListAdapter.

private void initializeListAdapter() {
    if (this.recipients != null && this.threadId != -1) {
        ConversationAdapter adapter = new ConversationAdapter(getActivity(), masterSecret, locale, selectionClickListener, null, this.recipients);
        list.setAdapter(adapter);
        list.addItemDecoration(new StickyHeaderDecoration(adapter, false, false));
        setLastSeen(lastSeen);
        getLoaderManager().restartLoader(0, Bundle.EMPTY, this);
    }
}
Also used : StickyHeaderDecoration(org.thoughtcrime.securesms.util.StickyHeaderDecoration)

Example 3 with StickyHeaderDecoration

use of org.thoughtcrime.securesms.util.StickyHeaderDecoration in project Signal-Android by signalapp.

the class ConversationFragment method initializeListAdapter.

private void initializeListAdapter() {
    if (this.recipient != null && this.threadId != -1) {
        ConversationAdapter adapter = new ConversationAdapter(getActivity(), GlideApp.with(this), locale, selectionClickListener, null, this.recipient);
        list.setAdapter(adapter);
        list.addItemDecoration(new StickyHeaderDecoration(adapter, false, false));
        setLastSeen(lastSeen);
        getLoaderManager().restartLoader(0, Bundle.EMPTY, this);
    }
}
Also used : StickyHeaderDecoration(org.thoughtcrime.securesms.util.StickyHeaderDecoration)

Example 4 with StickyHeaderDecoration

use of org.thoughtcrime.securesms.util.StickyHeaderDecoration in project Signal-Android by WhisperSystems.

the class ConversationListFragment method initializeListAdapters.

private void initializeListAdapters() {
    defaultAdapter = new ConversationListAdapter(GlideApp.with(this), this);
    searchAdapter = new ConversationListSearchAdapter(GlideApp.with(this), this, Locale.getDefault());
    searchAdapterDecoration = new StickyHeaderDecoration(searchAdapter, false, false, 0);
    setAdapter(defaultAdapter);
    defaultAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {

        @Override
        public void onItemRangeInserted(int positionStart, int itemCount) {
            startupStopwatch.split("data-set");
            SignalLocalMetrics.ColdStart.onConversationListDataLoaded();
            defaultAdapter.unregisterAdapterDataObserver(this);
            list.post(() -> {
                AppStartup.getInstance().onCriticalRenderEventEnd();
                startupStopwatch.split("first-render");
                startupStopwatch.stop(TAG);
            });
        }
    });
}
Also used : StickyHeaderDecoration(org.thoughtcrime.securesms.util.StickyHeaderDecoration) RecyclerView(androidx.recyclerview.widget.RecyclerView) SuppressLint(android.annotation.SuppressLint)

Example 5 with StickyHeaderDecoration

use of org.thoughtcrime.securesms.util.StickyHeaderDecoration in project Signal-Android by WhisperSystems.

the class ConversationFragment method setInlineDateDecoration.

public void setInlineDateDecoration(@NonNull ConversationAdapter adapter) {
    if (inlineDateDecoration != null) {
        list.removeItemDecoration(inlineDateDecoration);
    }
    inlineDateDecoration = new StickyHeaderDecoration(adapter, false, false, ConversationAdapter.HEADER_TYPE_INLINE_DATE);
    list.addItemDecoration(inlineDateDecoration, 0);
}
Also used : StickyHeaderDecoration(org.thoughtcrime.securesms.util.StickyHeaderDecoration)

Aggregations

StickyHeaderDecoration (org.thoughtcrime.securesms.util.StickyHeaderDecoration)6 SuppressLint (android.annotation.SuppressLint)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2