Search in sources :

Example 1 with ViewHidingBehaviourAnimation

use of com.nextcloud.talk.utils.animations.ViewHidingBehaviourAnimation in project talk-android by nextcloud.

the class BottomNavigationController method onViewBound.

@Override
protected void onViewBound(@NonNull View view) {
    super.onViewBound(view);
    /* Setup the BottomNavigationView with the constructor supplied Menu resource */
    bottomNavigationView.inflateMenu(getMenuResource());
    bottomNavigationView.setOnNavigationItemSelectedListener(item -> {
        navigateTo(item.getItemId(), getControllerFor(item.getItemId()));
        return true;
    });
    CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) bottomNavigationView.getLayoutParams();
    layoutParams.setBehavior(new ViewHidingBehaviourAnimation());
}
Also used : CoordinatorLayout(android.support.design.widget.CoordinatorLayout) ViewHidingBehaviourAnimation(com.nextcloud.talk.utils.animations.ViewHidingBehaviourAnimation)

Example 2 with ViewHidingBehaviourAnimation

use of com.nextcloud.talk.utils.animations.ViewHidingBehaviourAnimation in project talk-android by nextcloud.

the class ContactsController method prepareViews.

private void prepareViews() {
    layoutManager = new SmoothScrollLinearLayoutManager(getActivity());
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setHasFixedSize(true);
    recyclerView.setAdapter(adapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), layoutManager.getOrientation()));
    swipeRefreshLayout.setOnRefreshListener(this::fetchData);
    swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
    fastScroller.addOnScrollStateChangeListener(this);
    adapter.setFastScroller(fastScroller);
    fastScroller.setBubbleTextCreator(position -> {
        IFlexible abstractFlexibleItem = adapter.getItem(position);
        if (abstractFlexibleItem instanceof UserItem) {
            return ((UserItem) adapter.getItem(position)).getHeader().getModel();
        } else {
            return ((UserHeaderItem) adapter.getItem(position)).getModel();
        }
    });
    CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) bottomButtonsLinearLayout.getLayoutParams();
    layoutParams.setBehavior(new ViewHidingBehaviourAnimation());
}
Also used : CoordinatorLayout(android.support.design.widget.CoordinatorLayout) UserHeaderItem(com.nextcloud.talk.adapters.items.UserHeaderItem) ViewHidingBehaviourAnimation(com.nextcloud.talk.utils.animations.ViewHidingBehaviourAnimation) IFlexible(eu.davidea.flexibleadapter.items.IFlexible) SmoothScrollLinearLayoutManager(eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) UserItem(com.nextcloud.talk.adapters.items.UserItem)

Aggregations

CoordinatorLayout (android.support.design.widget.CoordinatorLayout)2 ViewHidingBehaviourAnimation (com.nextcloud.talk.utils.animations.ViewHidingBehaviourAnimation)2 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)1 UserHeaderItem (com.nextcloud.talk.adapters.items.UserHeaderItem)1 UserItem (com.nextcloud.talk.adapters.items.UserItem)1 SmoothScrollLinearLayoutManager (eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager)1 IFlexible (eu.davidea.flexibleadapter.items.IFlexible)1