Search in sources :

Example 1 with SwipeListView

use of com.marshalchen.ultimaterecyclerview.swipelistview.SwipeListView in project UltimateRecyclerView by cymcsg.

the class SwipeableUltimateRecyclerview method initViews.

@Override
protected void initViews() {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.swipeable_ultimate_recycler_view_layout, this);
    mRecyclerView = (SwipeListView) view.findViewById(R.id.ultimate_list);
    mSwipeRefreshLayout = (VerticalSwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_layout);
    setScrollbars();
    mSwipeRefreshLayout.setEnabled(false);
    if (mRecyclerView != null) {
        mRecyclerView.setClipToPadding(mClipToPadding);
        if (mPadding != -1.1f) {
            mRecyclerView.setPadding(mPadding, mPadding, mPadding, mPadding);
        } else {
            mRecyclerView.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
        }
    }
    defaultFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.defaultFloatingActionButton);
    setDefaultScrollListener();
    mEmpty = (ViewStub) view.findViewById(R.id.emptyview);
    mFloatingButtonViewStub = (ViewStub) view.findViewById(R.id.floatingActionViewStub);
    mEmpty.setLayoutResource(mEmptyId);
    mFloatingButtonViewStub.setLayoutResource(mFloatingButtonId);
    if (mEmptyId != 0)
        mEmptyView = mEmpty.inflate();
    mEmpty.setVisibility(View.GONE);
    if (mFloatingButtonId != 0) {
        mFloatingButtonView = mFloatingButtonViewStub.inflate();
        mFloatingButtonView.setVisibility(View.VISIBLE);
    }
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) SwipeListView(com.marshalchen.ultimaterecyclerview.swipelistview.SwipeListView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 SwipeListView (com.marshalchen.ultimaterecyclerview.swipelistview.SwipeListView)1