use of com.italankin.lnch.feature.home.apps.folder.empty.EmptyFolderDescriptorUiAdapter 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