cymcsg/UltimateRecyclerView

A new way to use the header view moving to API 23.2.1

Open

#342 geöffnet am 18. März 2016

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (1.446 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (7.224 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Sometime if you adding ur custom view as the header view and it will not be recycled because it is not the same view type as the other normal views in the recycler view. I have read about the implementation today and hopefully i can adding this into the library so that there we will have TWO ways to implement header for different situation.

  1. The simple way. Using the old traditional way.
listview.setNormalHeader(View your_initialized_custom_view);

But this will cause exception issue from the recycler view.

  1. The more complex Views.

Here is my work in progress

Now I am current looking for the implementation of ignoreView because i still trying to understand more of when to use this call.


  /**
         * Flags a view so that it will not be scrapped or recycled.
         * <p>
         * Scope of ignoring a child is strictly restricted to position tracking, scrapping and
         * recyling. Methods like {@link #removeAndRecycleAllViews(Recycler)} will ignore the child
         * whereas {@link #removeAllViews()} or {@link #offsetChildrenHorizontal(int)} will not
         * ignore the child.
         * <p>
         * Before this child can be recycled again, you have to call
         * {@link #stopIgnoringView(View)}.
         * <p>
         * You can call this method only if your LayoutManger is in onLayout or onScroll callback.
         *
         * @param view View to ignore.
         * @see #stopIgnoringView(View)
         */

As I read from the currently status it is not gonna solve the header issue. This is commented from the dev team in google.

Contributor Guide