use of com.italankin.lnch.feature.home.adapter.DeepShortcutDescriptorUiAdapter in project lnch by italankin.
the class AppsFragment method setItems.
private void setItems(Update update) {
if (adapter == null) {
adapter = new HomeAdapter.Builder(getContext()).add(new AppDescriptorUiAdapter(this)).add(new IgnorableDescriptorUiAdapter()).add(new FolderDescriptorUiAdapter(this)).add(new PinnedShortcutDescriptorUiAdapter(this)).add(new IntentDescriptorUiAdapter(this)).add(new DeepShortcutDescriptorUiAdapter(this)).recyclerView(list).setHasStableIds(true).create();
adapter.updateUserPrefs(update.userPrefs);
}
adapter.setDataset(update.items);
list.setVisibility(View.VISIBLE);
}
use of com.italankin.lnch.feature.home.adapter.DeepShortcutDescriptorUiAdapter in project lnch by italankin.
the class BaseFolderFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
alignFrameView = view.findViewById(R.id.folder_frame);
container = view.findViewById(R.id.folder_container);
container.setClipToOutline(true);
list = view.findViewById(R.id.folder_list);
title = view.findViewById(R.id.folder_title);
if (isFullscreen) {
DisplayMetrics dm = getResources().getDisplayMetrics();
container.setMinimumWidth((int) (dm.widthPixels * MIN_FULLSCREEN_WIDTH_FACTOR));
container.setMinimumHeight((int) (dm.heightPixels * MIN_FULLSCREEN_HEIGHT_FACTOR));
} else {
Point anchor = requireArguments().getParcelable(ARG_ANCHOR);
alignFrameView.setAnchorPoint(anchor.x, anchor.y);
}
alignFrameView.post(() -> {
WindowInsets insets = alignFrameView.getRootWindowInsets();
alignFrameView.setPaddingRelative(alignFrameView.getPaddingStart(), insets.getStableInsetTop(), alignFrameView.getPaddingEnd(), insets.getStableInsetBottom());
});
alignFrameView.setOnClickListener(v -> dismiss());
adapter = new HomeAdapter.Builder(requireContext()).add(new AppDescriptorUiAdapter(this, true)).add(new PinnedShortcutDescriptorUiAdapter(this, true)).add(new IntentDescriptorUiAdapter(this, true)).add(new DeepShortcutDescriptorUiAdapter(this, true)).add(new EmptyFolderDescriptorUiAdapter()).setHasStableIds(true).create();
list.setLayoutManager(new FlexboxLayoutManager(requireContext(), FlexDirection.ROW));
list.setAdapter(adapter);
initDelegates(requireContext());
getPresenter().loadFolder(folderId);
}
Aggregations