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);
}
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);
}
}
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);
}
}
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);
});
}
});
}
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);
}
Aggregations