cymcsg / cymcsg/UltimateRecyclerView

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

Open
#342 5 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Java
Stars
7.2k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/blipinsk/RecyclerViewHeader/issues) into the [library](https://github.com/cymcsg/UltimateRecyclerView/) so that there we will have TWO ways to implement header for different situation.
1. The simple way. Using the old traditional way.

``` java
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](https://github.com/HKMOpen/UltimateRecyclerView/tree/v23.1.1-upgrade)

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.
*


* 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.
*


* Before this child can be recycled again, you have to call
* {@link #stopIgnoringView(View)}.
*


* 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](http://stackoverflow.com/questions/30607684/recyclerview-with-linearlayoutmanager-with-header-view-that-doesnt-recycle/30813899#30813899). This is commented from the [dev team in google](https://code.google.com/p/android/issues/detail?id=176602&can=1&q=reporter%3ADudka&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the v23.1.1-upgrade branch and the linked RecyclerViewHeader implementation, then read the issue's cited RecyclerView documentation for ignoreView and stopIgnoringView. The work is complete when the library supports both described header approaches without the reported recycling exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.