Search in sources :

Example 1 with EmptyFolderDescriptorUiAdapter

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);
}
Also used : AppDescriptorUiAdapter(com.italankin.lnch.feature.home.adapter.AppDescriptorUiAdapter) WindowInsets(android.view.WindowInsets) DeepShortcutDescriptorUiAdapter(com.italankin.lnch.feature.home.adapter.DeepShortcutDescriptorUiAdapter) FlexboxLayoutManager(com.google.android.flexbox.FlexboxLayoutManager) PinnedShortcutDescriptorUiAdapter(com.italankin.lnch.feature.home.adapter.PinnedShortcutDescriptorUiAdapter) EmptyFolderDescriptorUiAdapter(com.italankin.lnch.feature.home.apps.folder.empty.EmptyFolderDescriptorUiAdapter) IntentDescriptorUiAdapter(com.italankin.lnch.feature.home.adapter.IntentDescriptorUiAdapter) Point(android.graphics.Point) DisplayMetrics(android.util.DisplayMetrics)

Aggregations

Point (android.graphics.Point)1 DisplayMetrics (android.util.DisplayMetrics)1 WindowInsets (android.view.WindowInsets)1 FlexboxLayoutManager (com.google.android.flexbox.FlexboxLayoutManager)1 AppDescriptorUiAdapter (com.italankin.lnch.feature.home.adapter.AppDescriptorUiAdapter)1 DeepShortcutDescriptorUiAdapter (com.italankin.lnch.feature.home.adapter.DeepShortcutDescriptorUiAdapter)1 IntentDescriptorUiAdapter (com.italankin.lnch.feature.home.adapter.IntentDescriptorUiAdapter)1 PinnedShortcutDescriptorUiAdapter (com.italankin.lnch.feature.home.adapter.PinnedShortcutDescriptorUiAdapter)1 EmptyFolderDescriptorUiAdapter (com.italankin.lnch.feature.home.apps.folder.empty.EmptyFolderDescriptorUiAdapter)1