Search in sources :

Example 6 with SwipeBackCoordinatorLayout

use of us.koller.cameraroll.ui.widget.SwipeBackCoordinatorLayout in project Camera-Roll-Android-App by kollerlukas.

the class AlbumActivity method onSwipeProcess.

@Override
public void onSwipeProcess(float percent) {
    getWindow().getDecorView().setBackgroundColor(SwipeBackCoordinatorLayout.getBackgroundColor(percent));
    boolean selectorModeActive = recyclerViewAdapter.isSelectorModeActive();
    if (!theme.darkStatusBarIcons() && selectorModeActive) {
        SwipeBackCoordinatorLayout layout = findViewById(R.id.swipeBackView);
        Toolbar toolbar = findViewById(R.id.toolbar);
        View rootView = findViewById(R.id.root_view);
        int translationY = (int) layout.getTranslationY();
        int statusBarHeight = toolbar.getPaddingTop();
        if (translationY > statusBarHeight * 0.5) {
            Util.setLightStatusBarIcons(rootView);
        } else {
            Util.setDarkStatusBarIcons(rootView);
        }
    }
}
Also used : SwipeBackCoordinatorLayout(us.koller.cameraroll.ui.widget.SwipeBackCoordinatorLayout) View(android.view.View) FastScrollerRecyclerView(us.koller.cameraroll.ui.widget.FastScrollerRecyclerView) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)6 View (android.view.View)6 SwipeBackCoordinatorLayout (us.koller.cameraroll.ui.widget.SwipeBackCoordinatorLayout)6 RecyclerView (android.support.v7.widget.RecyclerView)4 TextView (android.widget.TextView)4 RequiresApi (android.support.annotation.RequiresApi)3 ActionBar (android.support.v7.app.ActionBar)3 Slide (android.transition.Slide)3 ViewGroup (android.view.ViewGroup)3 ViewTreeObserver (android.view.ViewTreeObserver)3 WindowInsets (android.view.WindowInsets)3 AnimatedVectorDrawable (android.graphics.drawable.AnimatedVectorDrawable)2 ColorDrawable (android.graphics.drawable.ColorDrawable)2 Drawable (android.graphics.drawable.Drawable)2 FloatingActionButton (android.support.design.widget.FloatingActionButton)2 NestedScrollView (android.support.v4.widget.NestedScrollView)2 Fade (android.transition.Fade)2 TransitionSet (android.transition.TransitionSet)2 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)2 ImageView (android.widget.ImageView)2