Java Code Examples for androidx.recyclerview.widget.RecyclerView#setAlpha()

The following examples show how to use androidx.recyclerview.widget.RecyclerView#setAlpha() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MaterialAboutFragment.java    From material-about-library with Apache License 2.0 6 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.mal_material_about_content, container, false);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.mal_recyclerview);
    adapter = new MaterialAboutListAdapter(getViewTypeManager());
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(adapter);

    RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
    if (animator instanceof SimpleItemAnimator) {
        ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
    }

    recyclerView.setAlpha(0f);
    recyclerView.setTranslationY(20);

    new ListTask(this).execute();

    return rootView;
}
 
Example 2
Source File: Utility.java    From PixImagePicker with Apache License 2.0 5 votes vote down vote up
public static void manipulateVisibility(AppCompatActivity activity, float slideOffset, View arrow_up,
                                        RecyclerView instantRecyclerView, RecyclerView recyclerView,
                                        View status_bar_bg, View topbar, View clickme, View sendButton, boolean longSelection) {
    instantRecyclerView.setAlpha(1 - slideOffset);
    arrow_up.setAlpha(1 - slideOffset);
    clickme.setAlpha(1 - slideOffset);
    if (longSelection) {
        sendButton.setAlpha(1 - slideOffset);
    }
    topbar.setAlpha(slideOffset);
    recyclerView.setAlpha(slideOffset);
    if ((1 - slideOffset) == 0 && instantRecyclerView.getVisibility() == View.VISIBLE) {
        instantRecyclerView.setVisibility(View.GONE);
        arrow_up.setVisibility(View.GONE);
        clickme.setVisibility(View.GONE);
    } else if (instantRecyclerView.getVisibility() == View.GONE && (1 - slideOffset) > 0) {
        instantRecyclerView.setVisibility(View.VISIBLE);
        arrow_up.setVisibility(View.VISIBLE);
        clickme.setVisibility(View.VISIBLE);
        if (longSelection) {
            sendButton.clearAnimation();
            sendButton.setVisibility(View.VISIBLE);
        }
    }
    if ((slideOffset) > 0 && recyclerView.getVisibility() == View.INVISIBLE) {
        recyclerView.setVisibility(View.VISIBLE);
        status_bar_bg.animate().translationY(0).setDuration(200).start();
        topbar.setVisibility(View.VISIBLE);
        Utility.showStatusBar(activity);
    } else if (recyclerView.getVisibility() == View.VISIBLE && (slideOffset) == 0) {
        Utility.hideStatusBar(activity);
        recyclerView.setVisibility(View.INVISIBLE);
        topbar.setVisibility(View.GONE);
        status_bar_bg.animate().translationY(-(status_bar_bg.getHeight())).setDuration(550).start();
    }
}
 
Example 3
Source File: MaterialAboutActivity.java    From material-about-library with Apache License 2.0 4 votes vote down vote up
private void assignViews() {
    recyclerView = (RecyclerView) findViewById(R.id.mal_recyclerview);
    recyclerView.setAlpha(0f);
    recyclerView.setTranslationY(20);
}