Search in sources :

Example 16 with LinearOutSlowInInterpolator

use of androidx.interpolator.view.animation.LinearOutSlowInInterpolator in project Slide by ccrama.

the class SubredditListView method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), new ColorPreferences(inflater.getContext()).getThemeSubreddit(where));
    View v = LayoutInflater.from(contextThemeWrapper).inflate(R.layout.fragment_verticalcontent, container, false);
    rv = v.findViewById(R.id.vertical_content);
    final RecyclerView.LayoutManager mLayoutManager = new PreCachingLayoutManager(getActivity());
    rv.setLayoutManager(mLayoutManager);
    rv.setItemAnimator(new SlideUpAlphaAnimator().withInterpolator(new LinearOutSlowInInterpolator()));
    mSwipeRefreshLayout = v.findViewById(R.id.activity_main_swipe_refresh_layout);
    mSwipeRefreshLayout.setColorSchemeColors(Palette.getColors("no sub", getContext()));
    // If we use 'findViewById(R.id.header).getMeasuredHeight()', 0 is always returned.
    // So, we estimate the height of the header in dp
    mSwipeRefreshLayout.setProgressViewOffset(false, Constants.TAB_HEADER_VIEW_OFFSET - Constants.PTR_OFFSET_TOP, Constants.TAB_HEADER_VIEW_OFFSET + Constants.PTR_OFFSET_BOTTOM);
    v.findViewById(R.id.post_floating_action_button).setVisibility(View.GONE);
    doAdapter();
    return v;
}
Also used : Context(android.content.Context) LinearOutSlowInInterpolator(androidx.interpolator.view.animation.LinearOutSlowInInterpolator) ContextThemeWrapper(androidx.appcompat.view.ContextThemeWrapper) ColorPreferences(me.ccrama.redditslide.Visuals.ColorPreferences) RecyclerView(androidx.recyclerview.widget.RecyclerView) PreCachingLayoutManager(me.ccrama.redditslide.Views.PreCachingLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) SlideUpAlphaAnimator(com.mikepenz.itemanimators.SlideUpAlphaAnimator)

Aggregations

LinearOutSlowInInterpolator (androidx.interpolator.view.animation.LinearOutSlowInInterpolator)16 View (android.view.View)8 SlideUpAlphaAnimator (com.mikepenz.itemanimators.SlideUpAlphaAnimator)7 AlphaInAnimator (com.mikepenz.itemanimators.AlphaInAnimator)5 OfflineSubreddit (me.ccrama.redditslide.OfflineSubreddit)5 Submission (net.dean.jraw.models.Submission)5 ViewGroup (android.view.ViewGroup)4 RecyclerView (androidx.recyclerview.widget.RecyclerView)4 Context (android.content.Context)3 Intent (android.content.Intent)3 RelativeLayout (android.widget.RelativeLayout)3 AlertDialog (androidx.appcompat.app.AlertDialog)3 ContextThemeWrapper (androidx.appcompat.view.ContextThemeWrapper)3 ProgressView (carbon.widget.ProgressView)3 Snackbar (com.google.android.material.snackbar.Snackbar)3 Submit (me.ccrama.redditslide.Activities.Submit)3 ColorPreferences (me.ccrama.redditslide.Visuals.ColorPreferences)3 Animator (android.animation.Animator)2 ObjectAnimator (android.animation.ObjectAnimator)2 TargetApi (android.annotation.TargetApi)2