com.marshalchen.ultimaterecyclerview.UltimateRecyclerView Java Examples

The following examples show how to use com.marshalchen.ultimaterecyclerview.UltimateRecyclerView. 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: TestExpandableRV.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_loadmore);
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    ultimateRecyclerView = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
    ultimateRecyclerView.setHasFixedSize(false);
    /**
     * this is the adapter for the expanx
     */
    simpleRecyclerViewAdapter = new ExpCustomAdapter(this);
    simpleRecyclerViewAdapter.addAll(ExpCustomAdapter.getPreCodeMenu(sampledatagroup1, sampledatagroup2, sampledatagroup3), 0);

    linearLayoutManager = new LinearLayoutManager(this);
    ultimateRecyclerView.setLayoutManager(linearLayoutManager);
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ffffff"));
    addExpandableFeatures();
}
 
Example #2
Source File: BasicFunctions.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
protected void enableLoadMore() {
    // StickyRecyclerHeadersDecoration headersDecor = new StickyRecyclerHeadersDecoration(simpleRecyclerViewAdapter);
    // ultimateRecyclerView.addItemDecoration(headersDecor);
    ultimateRecyclerView.setLoadMoreView(R.layout.custom_bottom_progressbar);

    ultimateRecyclerView.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(int itemsCount, final int maxLastVisiblePosition) {
            status_progress = true;
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                public void run() {

                    onLoadmore();
                    status_progress = false;
                }
            }, 500);
        }
    });

}
 
Example #3
Source File: SliderHeader.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView urv) {
    ultimateRecyclerView.setHasFixedSize(false);
    simpleRecyclerViewAdapter = new sectionZeroAdapter(new ArrayList<String>());
    configLinearLayoutManager(ultimateRecyclerView);
    enableParallaxHeader();
    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ffff66ff"));
    enableRefresh();
    // enableScrollControl();
    // enableSwipe();
    // enableItemClick();
    ultimateRecyclerView.setItemViewCacheSize(simpleRecyclerViewAdapter.getAdditionalItems());
    ultimateRecyclerView.setNormalHeader(initSlider(ultimateRecyclerView));
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #4
Source File: DebugLoadMoreActivity.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView ultimateRecyclerView) {
    ultimateRecyclerView.setHasFixedSize(false);
    simpleRecyclerViewAdapter = new sectionZeroAdapter(new ArrayList<String>());
    configLinearLayoutManager(ultimateRecyclerView);
    enableParallaxHeader();
    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ffff66ff"));
    enableRefresh();
    // enableScrollControl();
    // enableSwipe();
    // enableItemClick();
    //ultimateRecyclerView.setItemViewCacheSize(simpleRecyclerViewAdapter.getAdditionalItems());
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #5
Source File: DebugNoHeaderLoadMoreActivity.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView ultimateRecyclerView) {
    //  ultimateRecyclerView.setInflater(LayoutInflater.from(getApplicationContext()));
    ultimateRecyclerView.setHasFixedSize(false);
    ArrayList<String> list = new ArrayList<>();
    list.add("o2fn31");
    list.add("of2n32");
    list.add("of3n36");
    simpleRecyclerViewAdapter = new sectionZeroAdapter(list);
    configLinearLayoutManager(ultimateRecyclerView);
    //enableParallaxHeader();
    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ff4fcccf"));
    enableRefresh();
    // enableScrollControl();
    // enableSwipe();
    // enableItemClick();
    ultimateRecyclerView.setItemViewCacheSize(simpleRecyclerViewAdapter.getAdditionalItems());


    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #6
Source File: ViewPagerFragmentListSingle.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.listurv, container, false);

    final UltimateRecyclerView recyclerView = (UltimateRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setHasFixedSize(false);
    recyclerView.setRefreshing(false);
    setDummyData(recyclerView);
    ViewPagerTabFragmentParentFragment parentFragment = (ViewPagerTabFragmentParentFragment) getParentFragment();
    ViewGroup parentFView = (ViewGroup) parentFragment.getView();
    if (parentFragment != null) {
        recyclerView.setTouchInterceptionViewGroup((ViewGroup) parentFView.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            recyclerView.setScrollViewCallbacks(parentFragment);
            Log.d(TAG, "this is ObservableScrollViewCallbacks");
        }
    }

    return view;
}
 
Example #7
Source File: TestAdMobClassicActivity.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
private void enableLoadMore() {
    ultimateRecyclerView.setLoadMoreView(R.layout.custom_bottom_progressbar);
    ultimateRecyclerView.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(final int itemsCount, final int maxLastVisiblePosition) {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                public void run() {
                    ArrayList<String> li = new ArrayList<String>();
                    li.add("No. ====" + itemsCount + "=======");
                    SampleDataboxset.genItems(10, li);
                    simpleRecyclerViewAdapter.insert(li);
                }
            }, 1000);
        }
    });
}
 
Example #8
Source File: LineNodeActivity.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView urv) {
    ArrayList<TimeLineModel> list = new ArrayList<>();
    TimeLineModel time = new TimeLineModel();
    time.setAge(139);
    time.setName("England");
    list.add(time);
    TimeLineModel time2 = new TimeLineModel();
    time2.setAge(359);
    time2.setName("Japan");
    list.add(time2);
    TimeLineModel time3 = new TimeLineModel();
    time3.setAge(339);
    time3.setName("HK");
    list.add(time3);
    addAmount(29, list);
    ultimateRecyclerView.setHasFixedSize(true);
    simpleRecyclerViewAdapter = new TimeLineAdapter(list);
    //currently we only support linearlayout option but we have tested anything for the grid layout yet
    configLinearLayoutManager(ultimateRecyclerView);
    enableEmptyViewPolicy();
    // enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ff6f36cf"));
    //enableRefresh();
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #9
Source File: MenuFragment.java    From KickAssSlidingMenu with Apache License 2.0 6 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ultimateRecyclerView = (UltimateRecyclerView) view.findViewById(R.id.ultimate_recycler_view_menu);
    ultimateRecyclerView.setHasFixedSize(false);
    /**
     * this is the adapter for the expanx
     */
    simpleRecyclerViewAdapter = new expCustomAdapter(getActivity());
    simpleRecyclerViewAdapter.addAll(expCustomAdapter.getPreCodeMenu(
                    sampledatagroup1,
                    sampledatagroup2,
                    sampledatagroup3),
            0);

    linearLayoutManager = new LinearLayoutManager(getActivity());
    ultimateRecyclerView.setLayoutManager(linearLayoutManager);
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ffffff"));
    addExpandableFeatures();

}
 
Example #10
Source File: MaterialListSection.java    From KickAssSlidingMenu with Apache License 2.0 6 votes vote down vote up
@SuppressLint("WrongViewCast")
@Override
public View init(View view) {
    indicator = (ImageView) view.findViewById(R.id.indicatorIcon);
    text = (CustomTextView) view.findViewById(R.id.section_text);
    notificationtext = (CustomTextView) view.findViewById(R.id.section_notification);
    listview = (UltimateRecyclerView) view.findViewById(R.id.ultimate_recycler_view);
    // listview.disableLoadmore();
    listview.setSaveEnabled(false);
    CustomLinearLayoutManager mlayout = new CustomLinearLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false);
    listview.setLayoutManager(mlayout);
    listview.setHasFixedSize(false);
    listview.setAdapter(renderer);
    mContainer = view;

    submenu_item_height = view.getContext().getResources().getDimensionPixelSize(R.dimen.sectionNormalHeight);

    animate_indicator = true;

    final Resources resources = view.getContext().getResources();
    int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
    if (resourceId > 0) {
        bottomNavigationHeight = resources.getDimensionPixelSize(resourceId);
    }
    return view;
}
 
Example #11
Source File: StaggerLoadMoreActivity.java    From UltimateRecyclerView with Apache License 2.0 6 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView urv) {
    ultimateRecyclerView.setHasFixedSize(false);
    simpleRecyclerViewAdapter = new staggerAdapter(new ArrayList<String>());
    //configLinearLayoutManager(ultimateRecyclerView);
    configStaggerLayoutManager(ultimateRecyclerView, simpleRecyclerViewAdapter);
    // enableParallaxHeader();
    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ff4fcccf"));
    enableRefresh();
    // enableScrollControl();
    // enableSwipe();
    // enableItemClick();
    ultimateRecyclerView.setItemViewCacheSize(simpleRecyclerViewAdapter.getAdditionalItems());


    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #12
Source File: BasicFunctions.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_loadmore);
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    ultimateRecyclerView = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
    doURV(ultimateRecyclerView);
    bButtons();
    ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1);
    setupSpinnerSelection((Spinner) findViewById(R.id.spinner), spinnerAdapter);
}
 
Example #13
Source File: SliderHeader.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
private View initSlider(UltimateRecyclerView listview) {
    final View view = LayoutInflater.from(getApplication()).inflate(R.layout.list_item_header, null, false);
    final ViewTreeObserver vto = listview.getViewTreeObserver();
    vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
        @Override
        public void onGlobalLayout() {
            view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            //Log.d("vto", "globallayout");
            final SliderLayout sl = (SliderLayout) view.findViewById(R.id.header_slider);
            try {
                sl.setOffscreenPageLimit(1);
                sl.setSliderTransformDuration(500, new LinearOutSlowInInterpolator());
                sl.setPresetTransformer(TransformerL.Default);
                sl.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
                sl.getPagerIndicator().setDefaultIndicatorColor(R.color.accent, R.color.primaryDark);
                sl.getPagerIndicator().setVisibility(View.GONE);
                setup_double_faces(sl);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });


    return view;
}
 
Example #14
Source File: catelogLinear.java    From KickAssSlidingMenu with Apache License 2.0 5 votes vote down vote up
protected void renderviewlayout(View view) throws Exception {
    listview_layout = (UltimateRecyclerView) view.findViewById(getUltimate_recycler_viewResId());
    listview_layout.setHasFixedSize(true);
    listview_layout.setSaveEnabled(true);
    listview_layout.setAdapter(madapter = getAdatperWithdata());
    if (mLayoutManager == null) {
        mLayoutManager = new ScrollSmoothLineaerLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false, getSmoothDuration());
    }
    listview_layout.setLayoutManager(mLayoutManager);
    getProgressbar(view, R.id.urv_main_progress_bar);
    setUltimateRecyclerViewExtra(listview_layout, madapter);
}
 
Example #15
Source File: SwipeListViewExampleActivity.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
    protected void doURV(UltimateRecyclerView urv) {
        data = new ArrayList<String>();

        data.add("aa");
        data.add("bb");
        data.add("cc");
        data.add("dd");
        data.add("aa");
        data.add("bb");
        data.add("cc");
        data.add("dd");
        data.add("aa");
        data.add("bb");
        data.add("cc");
        data.add("dd");

        enableEmptyViewPolicy();
        enableLoadMore();
        enableRefresh();
        adapter = new SwipeAdapter(data);
        adapter.setMode(SwipeItemManagerInterface.Mode.Single);
        mLayoutManager = new ScrollSmoothLineaerLayoutManager(this, LinearLayoutManager.VERTICAL, false, 500);
        ultimateRecyclerView.setHasFixedSize(false);
        ultimateRecyclerView.setLayoutManager(mLayoutManager);
//        swipeListView.addOnItemTouchListener(new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
//            @Override
//            public void onItemClick(View view, int position) {
//                URLogs.d("click");
//            }
//        }));


        ultimateRecyclerView.setAdapter(adapter);
    }
 
Example #16
Source File: DebugNoHeaderLoadMoreActivity.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void enableEmptyViewPolicy() {
    ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_KEEP_HEADER_AND_LOARMORE);
    //    ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_KEEP_HEADER);
    //   ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_KEEP_HEADER_AND_LOARMORE);


}
 
Example #17
Source File: ViewPagerTabFragmentParentFragment.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
private void propagateToolbarState(boolean isShown) {
    final int toolbarHeight = headerBanner.getHeight();
    // Set scrollY for the fragments that are not created yet
    mPagerAdapter.setScrollY(isShown ? 0 : toolbarHeight);

    // Set scrollY for the active fragments
    for (int i = 0; i < mPagerAdapter.getCount(); i++) {
        // Skip current item
        if (i == mPager.getCurrentItem()) {
            continue;
        }
        // Skip destroyed or not created item
        Fragment f = mPagerAdapter.getItemAt(i);
        if (f == null) {
            continue;
        }
        View view = f.getView();
        if (view == null) {
            continue;
        }

        if (view.findViewById(R.id.scroll) instanceof UltimateRecyclerView) {
            UltimateRecyclerView listView = (UltimateRecyclerView) viewscrollable(view);
            if (isShown) {
                // Scroll up
                if (0 < listView.getCurrentScrollY()) {
                    // listView.setSelection(0);
                    Log.d(FRAGMENT_TAG, "up");
                }
            } else {
                // Scroll down (to hide padding)
                if (listView.getCurrentScrollY() < toolbarHeight) {
                    //listView.setSelection(1);
                    Log.d(FRAGMENT_TAG, "down");
                }
            }
        }

    }
}
 
Example #18
Source File: TestAdMobClassicActivity.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_loadmore);
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    ultimateRecyclerView = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
    ultimateRecyclerView.setHasFixedSize(false);

    /**
     * wokring example 1 implementation of Admob banner with static Adview
     */
    //  simpleRecyclerViewAdapter = new admobdfpadapter(createadmob(), 5, stringList);
    /**
     * working example 2 with multiple called Adviews
     */
    simpleRecyclerViewAdapter = new ZeroStickyAdvertistmentAdapter(createadmob(), SampleDataboxset.newListFromGen());
    linearLayoutManager = new LinearLayoutManager(this);
    ultimateRecyclerView.setLayoutManager(linearLayoutManager);
    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
    ultimateRecyclerView.setItemViewCacheSize(3);
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#f5f5ff"));
    enableEmptyView();
    enableRefresh();
    enableLoadMore();
    enableClick();
    impleAddDrop();
}
 
Example #19
Source File: catelogLinear.java    From KickAssSlidingMenu with Apache License 2.0 5 votes vote down vote up
protected void renderviewlayout(View view) throws Exception {
    listview_layout = (UltimateRecyclerView) view.findViewById(getUltimate_recycler_viewResId());
    listview_layout.setHasFixedSize(true);
    listview_layout.setSaveEnabled(true);

    if (mLayoutManager == null) {
        mLayoutManager = new ScrollSmoothLineaerLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false, getSmoothDuration());
    }
    listview_layout.setLayoutManager(mLayoutManager);
    listview_layout.setAdapter(madapter = getAdatperWithdata());
    setUltimateRecyclerViewExtra(listview_layout, madapter);
}
 
Example #20
Source File: TestAdvancedAdmobActivity.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
/**
 * example 1 implementation of the switch view
 */
private BiAdAdapterSwitcher imple_switch_view(final UltimateRecyclerView rv) {
    final adap adp1 = new adap(createadmob(), new ArrayList<String>());
    final regular adp2 = new regular(new ArrayList<String>());
    final BiAdAdapterSwitcher switchable = new BiAdAdapterSwitcher(rv, adp2, adp1);
    return switchable;
}
 
Example #21
Source File: FirstPageCancelLoadMore.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView urv) {
    ultimateRecyclerView.setHasFixedSize(false);
    simpleRecyclerViewAdapter = new sectionZeroAdapter(new ArrayList<String>());
    configLinearLayoutManager(ultimateRecyclerView);

    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ff4fcccf"));
    enableRefresh();


    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #22
Source File: AdmobAdapter.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void notifyAfterRemoveAllData(int data_size_before_remove, int display_size_before_remove) {
    try {

        final int n_start = hasHeaderView() ? 1 : 0;

        final int n_end = hasHeaderView() ? display_size_before_remove - 1 : display_size_before_remove;

        if (detectDispatchLoadMoreDisplay(data_size_before_remove, display_size_before_remove))
            return;

        if (data_size_before_remove == 0) return;

        if (mEmptyViewPolicy == UltimateRecyclerView.EMPTY_KEEP_HEADER_AND_LOARMORE) {
            notifyItemRangeRemoved(n_start, n_end);
        } else if (mEmptyViewPolicy == UltimateRecyclerView.EMPTY_KEEP_HEADER) {
            notifyItemRangeRemoved(n_start, n_end);
            removeDispatchLoadMoreView();
        } else if (mEmptyViewPolicy == UltimateRecyclerView.EMPTY_CLEAR_ALL) {
            notifyItemRangeRemoved(0, display_size_before_remove);
            removeDispatchLoadMoreView();
        } else {
            notifyItemRangeRemoved(0, display_size_before_remove);
        }

    } catch (Exception e) {
        String o = e.fillInStackTrace().getCause().getMessage().toString();
        Log.d("fillInStackTrace", o + " : ");
    }
}
 
Example #23
Source File: catelogLinear.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
protected void renderviewlayout(View view) throws Exception {
    listview_layout = (UltimateRecyclerView) view.findViewById(getUltimate_recycler_viewResId());
    listview_layout.setHasFixedSize(true);
    listview_layout.setSaveEnabled(true);
    if (mLayoutManager == null) {
        mLayoutManager = new ScrollSmoothLineaerLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false, getSmoothDuration());
    }
    listview_layout.setLayoutManager(mLayoutManager);
    listview_layout.setAdapter(madapter = getAdatperWithdata());
    getProgressbar(view);
    setUltimateRecyclerViewExtra(listview_layout, madapter);
}
 
Example #24
Source File: FinalEmptyViewDisplayActivity.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
protected void doURV(UltimateRecyclerView urv) {
    ultimateRecyclerView.setHasFixedSize(false);
    simpleRecyclerViewAdapter = new sectionZeroAdapter(new ArrayList<String>());
    configLinearLayoutManager(ultimateRecyclerView);

    enableEmptyViewPolicy();
    enableLoadMore();
    ultimateRecyclerView.setRecylerViewBackgroundColor(Color.parseColor("#ff4fcccf"));
    enableRefresh();


    ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);
}
 
Example #25
Source File: catelogLinear.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
protected void renderviewlayout(View view) throws Exception {
    listview_layout = (UltimateRecyclerView) view.findViewById(getUltimate_recycler_viewResId());
    listview_layout.setHasFixedSize(true);
    listview_layout.setSaveEnabled(true);
    if (mLayoutManager == null) {
        mLayoutManager = new ScrollSmoothLineaerLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false, getSmoothDuration());
    }
    listview_layout.setLayoutManager(mLayoutManager);
    listview_layout.setAdapter(madapter = getAdatperWithdata());
    getProgressbar(view);
    setUltimateRecyclerViewExtra(listview_layout, madapter);
}
 
Example #26
Source File: BasicFunctions.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
protected void enableParallaxHeader() {
    ultimateRecyclerView.setParallaxHeader(getLayoutInflater().inflate(R.layout.parallax_recyclerview_header, ultimateRecyclerView.mRecyclerView, false));
    ultimateRecyclerView.setOnParallaxScroll(new UltimateRecyclerView.OnParallaxScroll() {
        @Override
        public void onParallaxScroll(float percentage, float offset, View parallax) {
            Drawable c = toolbar.getBackground();
            c.setAlpha(Math.round(127 + percentage * 128));
            toolbar.setBackgroundDrawable(c);
        }
    });
}
 
Example #27
Source File: GridLayoutRVTest.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(getMainLayout());
    mToolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(true);
    listuv = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
    mGridAdapter = new GridJRAdapter(getJRList());
    mGridAdapter.setSpanColumns(columns);
    mGridLayoutManager = new BasicGridLayoutManager(this, columns, mGridAdapter);
    listuv.setLayoutManager(mGridLayoutManager);
    listuv.setHasFixedSize(true);
    listuv.setSaveEnabled(true);
    listuv.setClipToPadding(false);


    // mGridAdapter.setCustomLoadMoreView(LayoutInflater.from(this).inflate(R.layout.custom_bottom_progressbar, null));
    listuv.setNormalHeader(setupHeaderView());
    final Handler f = new Handler();
    listuv.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(int itemsCount, int maxLastVisiblePosition) {
            //   Log.d(TAG, itemsCount + " :: " + itemsCount);
            f.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mGridAdapter.insert(SampleDataboxset.genJRList(5));
                    afterAdd();
                }
            }, 2000);
        }
    });

    // listuv.enableLoadmore();
    //    listuv.disableLoadmore();
    listuv.setLoadMoreView(R.layout.custom_bottom_progressbar);

    listuv.setAdapter(mGridAdapter);
    listuv.setItemAnimator(new DefaultItemAnimator());

    harness_control();
}
 
Example #28
Source File: DebugLoadMoreActivity.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
@Override
protected void enableEmptyViewPolicy() {
    //  ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_KEEP_HEADER_AND_LOARMORE);
    //    ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_KEEP_HEADER);
    ultimateRecyclerView.setEmptyView(R.layout.empty_view, UltimateRecyclerView.EMPTY_SHOW_LOADMORE_ONLY);
}
 
Example #29
Source File: BasicFunctions.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
protected final void configStaggerLayoutManager(UltimateRecyclerView rv, easyRegularAdapter ad) {
    StaggeredGridLayoutManager gaggeredGridLayoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);
    rv.setLayoutManager(gaggeredGridLayoutManager);
}
 
Example #30
Source File: BasicFunctions.java    From UltimateRecyclerView with Apache License 2.0 4 votes vote down vote up
protected final void configGridLayoutManager(UltimateRecyclerView rv, easyRegularAdapter ad) {
    final ClassicSpanGridLayoutManager mgm = new ClassicSpanGridLayoutManager(this, 2, ad);
    rv.setLayoutManager(mgm);
}