Easy to use ListView with pinned sections for Android.

Overview

Easy to use ListView with pinned sections for Android 2.1 and higher. Pinned section is a header view which sticks to the top of the list until at least one item of that section is visible.

Screenshot 1  Screenshot 2  Screenshot 3

Features

This list properly implements many features which are missing from other implementations. These are

  • Fast scroll
  • Headers and footers
  • Clickable pinned sections

Besides this it doesn't create any unnecessary views, layouts etc. It's really lean.

Watch this video to see PinnedSectionListView in action.

Usage example

  1. Replace standard ListView with de.halfbit.pinnedsection.PinnedSectionListView in your layout.xml file.
  <de.halfbit.pinnedsection.PinnedSectionListView
      android:id="@android:id/list"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" 
      />
  1. Extend your ListAdapter in a way that it implements PinnedSectionListAdapter interface, in addition to what it already implements. Basically you need to add a single isItemViewTypePinned(int viewType) method. This method must return true for all view types which have to be pinned.
  // Our adapter class implements 'PinnedSectionListAdapter' interface
  class MyPinnedSectionListAdapter extends BaseAdapter 
          implements PinnedSectionListAdapter {
  
      ...
    
      // We implement this method to return 'true' for all view types we want to pin
      @Override
      public boolean isItemViewTypePinned(int viewType) {
          return viewType == <type to be pinned>;
      }
  }

That's all. You are done! A working example can also be found in example folder.

Use with Gradle

Add this to your module-level build.gradle:

dependencies {
    compile "de.halfbit:pinned-section-listview:1.0.0"
}

Used by

Let us know if you use this library in your application and we will mention it here.

Grocery Sum

Slack

License

Copyright 2013-2016 Sergej Shafarenka, halfbit.de

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Issues
  • IndexOutOfBoundsException after NotifyDataSetChanged()

    IndexOutOfBoundsException after NotifyDataSetChanged()

    After called NotifyDataSetChanged(), when recreating pinned shadow:

    void recreatePinnedShadow() {
            destroyPinnedShadow();
            ListAdapter adapter = getAdapter();
            if (adapter != null && adapter.getCount() > 0) {
                int firstVisiblePosition = getFirstVisiblePosition(); // here the visible position is of the old dataset
                int sectionPosition = findCurrentSectionPosition(firstVisiblePosition);
                if (sectionPosition == -1) return; // no views to pin, exit
                ensureShadowForPosition(sectionPosition,
                        firstVisiblePosition, getLastVisiblePosition() - firstVisiblePosition);
            }
    }
    

    Looks like getFirstVisiblePosition () will return the visible position of the old dataset.

    opened by bladeFury 7
  • NullPointer getting layoutParams

    NullPointer getting layoutParams

    Seems I get LayoutParams to null, but pinnedView is not null. Can we add a default layoutparams to the listview?

    This is the stacktrace:

    java.lang.NullPointerException at com.hb.views.PinnedSectionListView.createPinnedShadow(PinnedSectionListView.java:164) at com.hb.views.PinnedSectionListView.access$400(PinnedSectionListView.java:34) at com.hb.views.PinnedSectionListView$1.onScroll(PinnedSectionListView.java:106) at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:1340) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4949) at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3087) at android.widget.AbsListView.startScrollIfNeeded(AbsListView.java:3032) at android.widget.AbsListView.onTouchEvent(AbsListView.java:3357) at android.view.View.dispatchTouchEvent(View.java:7246) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2168) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1903) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405) at android.app.Activity.dispatchTouchEvent(Activity.java:2410) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901) at android.view.View.dispatchPointerEvent(View.java:7426) at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179) at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171) at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342) at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:530) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.m

    bug 
    opened by PaNaVTEC 6
  • null pointer at

    null pointer at "pinnedView.measure(ws, hs);"

    I had a null pointer at "pinnedView.measure(ws, hs);" (217) when using the listview in a fragment of a 2 panel version of the layout.

    I fixed it by adding "pinnedView.setLayoutParams(layoutParams);" at line 203 after you created a new layoutparam when it previously returned a null layoutparam...

    opened by ghost 5
  • IndexOutOfBoundsException on deletion

    IndexOutOfBoundsException on deletion

    When I try to delete items from the adapter, I sometimes get an IndexOutOfBoundsException, using the latest revision from github.

    Here is what I had last time:

    • A class derived from ArrayListAdapter and implementing PinnedSectionListView.PinnedSectionListAdapter
    • 1 section and 3 items (section first then items)
    • a for loop that loops through all the selected items, sorted in reverse order (highest positions first as the ArrayList items get re-indexed when you remove an item)

    ArrayList example:

    | Position | Type | | --- | --- | | 0 | Section | | 1 | Item 1 | | 2 | Item 2 | | 3 | Item 3 |

    Simplified for loop:

    for(int i = selectedIds.size() - 1; 0 <= i; i--){
        item = (Item)this.getItem(selectedIds.keyAt(i));
        Log.v("AlarmsListAdapter", String.format("Trying to delete item at position %d.Adapter size = %d", selectedIds.keyAt(i), this.getCount()));
        this.remove(item);
    }
    

    Logcat output:

    06-09 11:24:04.740  24140-24140/com.zion.htf V/AlarmsListAdapter﹕ Trying to delete item at position 3.Adapter size = 4
    06-09 11:24:04.740  24140-24140/com.zion.htf V/AlarmsListAdapter﹕ Trying to delete item at position 2.Adapter size = 3
    06-09 11:24:05.030  24140-24140/com.zion.htf E/AndroidRuntime﹕ FATAL EXCEPTION: main
        Process: com.zion.htf, PID: 24140
        java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
                at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
                at java.util.ArrayList.get(ArrayList.java:308)
                at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
                at com.zion.htf.adapter.AlarmsListAdapter.getItemViewType(AlarmsListAdapter.java:131)
                at com.hb.views.PinnedSectionListView.findFirstVisibleSectionPosition(PinnedSectionListView.java:282)
                at com.hb.views.PinnedSectionListView.ensureShadowForPosition(PinnedSectionListView.java:256)
                at com.hb.views.PinnedSectionListView.recreatePinnedShadow(PinnedSectionListView.java:317)
                at com.hb.views.PinnedSectionListView$2.onChanged(PinnedSectionListView.java:134)
                at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
                at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
                at android.widget.ArrayAdapter.notifyDataSetChanged(ArrayAdapter.java:286)
                at android.widget.ArrayAdapter.remove(ArrayAdapter.java:247)
                at com.zion.htf.adapter.AlarmsListAdapter.removeSelected(AlarmsListAdapter.java:248)
                at com.zion.htf.ui.AlarmManagerActivity$1.onActionItemClicked(AlarmManagerActivity.java:70)
                at android.support.v7.internal.view.ActionModeWrapper$CallbackWrapper.onActionItemClicked(ActionModeWrapper.java:138)
                at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onActionItemClicked(PhoneWindow.java:3029)
                at com.android.internal.app.ActionBarImpl$ActionModeImpl.onMenuItemSelected(ActionBarImpl.java:969)
                at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
                at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
                at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
                at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:546)
                at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
                at android.view.View.performClick(View.java:4438)
                at android.view.View$PerformClick.run(View.java:18439)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5118)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
                at dalvik.system.NativeStart.main(Native Method)
    

    When I use a ListView instead of a PinnedSectionListView, it works just fine.

    opened by nstCactus 5
  • Broken painted title for the first visible pinned item

    Broken painted title for the first visible pinned item

    To reproduce bug just simply fast scroll down-up-down.

    http://screencast.com/t/1xIMxbk4Hh

    opened by alexkazakov 5
  • NullPointer when scrolling down

    NullPointer when scrolling down

    Hi I get this when scrolling down, I dont know why:

    05-13 09:36:32.138: E/AndroidRuntime(5014): FATAL EXCEPTION: main 05-13 09:36:32.138: E/AndroidRuntime(5014): java.lang.NullPointerException 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.hb.views.PinnedSectionListView$1.onScroll(PinnedSectionListView.java:96) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:1326) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5055) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3193) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.widget.AbsListView.onTouchEvent(AbsListView.java:3467) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.View.dispatchTouchEvent(View.java:7127) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2170) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1905) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919) 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925) 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.app.Activity.dispatchTouchEvent(Activity.java:2396) 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.View.dispatchPointerEvent(View.java:7307) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3172) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3117) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4153) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4132) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4224) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4203) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4243) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.Choreographer.doCallbacks(Choreographer.java:555) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.Choreographer.doFrame(Choreographer.java:523) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.os.Handler.handleCallback(Handler.java:615) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.os.Handler.dispatchMessage(Handler.java:92) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.os.Looper.loop(Looper.java:137) 05-13 09:36:32.138: E/AndroidRuntime(5014): at android.app.ActivityThread.main(ActivityThread.java:4745) 05-13 09:36:32.138: E/AndroidRuntime(5014): at java.lang.reflect.Method.invokeNative(Native Method) 05-13 09:36:32.138: E/AndroidRuntime(5014): at java.lang.reflect.Method.invoke(Method.java:511) 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 05-13 09:36:32.138: E/AndroidRuntime(5014): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 05-13 09:36:32.138: E/AndroidRuntime(5014): at dalvik.system.NativeStart.main(Native Method)

    bug 
    opened by PaNaVTEC 5
  • Custom adapter

    Custom adapter

    Hi, i have a problem when implementing custom listview adapter. I get nullPointerException and even if i manage it to work i get Exception on scroll.

    duplicate 
    opened by ghost 4
  • java.lang.ClassCastException

    java.lang.ClassCastException

    My app got some java.lang.ClassCastException on some devices. I don't altered the code of the lib. Errors from Google Play:

    java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
    at PinnedSectionListView.createPinnedShadow(PinnedSectionListView.java:201)
    at  PinnedSectionListView.ensureShadowForPosition(PinnedSectionListView.java:251)
    at  PinnedSectionListView$1.onScroll(PinnedSectionListView.java:116)
    

    Errors on: Android 4.0.3 - 4.0.4, Xperia Tipo (ST21i), Xperia U (ST25i)

    opened by josluimg 4
  • Update PinnedSectionListView.java

    Update PinnedSectionListView.java

    fix bugs: in fast scroll mode, fs to top or bottom, the pinned shadow view get incollect section top; in onScroll's some edge situation, we missed deal with the pinned shadow view.

    opened by hqwang 4
  • Filter doesn't work

    Filter doesn't work

    I tried to implement Filterable and add a custom Filter, but the list doesn't seem to respond to the filter.

    opened by Bubumuk 3
  • `onClick` from pinned sections can't be called

    `onClick` from pinned sections can't be called

    In your sample, PinnedSectionListView is set OnItemClickListener through overridding onListItemClick. But if we don't add OnItemClickListener, when children of section is set OnClickListener and section is pinned, onClick of children of section won't be called.

    Can somebody fixed this?

    opened by bytebeats 0
  • Bug: Fixes Item not staying pinned

    Bug: Fixes Item not staying pinned

    Also ensures that the pinned section is drawn even if there are less than two items. Updated example app to demonstrate fix.

    Closes #39

    opened by justingrayston 0
  • How to use/adapt this with RecyclerView

    How to use/adapt this with RecyclerView

    Hi is it possiblew to use this with RecyclerView.Adapter, I tried like this but I get an error public class MemoAdapter extends RecyclerView.Adapter<MemoAdapter.MyViewHolder> implements PinnedSectionListView.PinnedSectionListAdapter{

    error is here ` @Override public View getView(int position, View convertView, ViewGroup parent) { TextView view = (TextView) super.getView(position, convertView, parent); <--- ERROR view.setTextColor(Color.DKGRAY); view.setTag("" + position);

        Main2Activity.Item item = getItem(position);
    
        if (item.type == PinnedSectionListActivity.Item.SECTION) {
            //view.setOnClickListener(PinnedSectionListActivity.this);
            view.setBackgroundColor(parent.getResources().getColor(COLORS[item.sectionPosition % COLORS.length]));
        }
    
        return view;
    }`
    
    opened by aresares 1
  • add padding,click on a pinned item,not accurate, sometimes

    add padding,click on a pinned item,not accurate, sometimes

    add padding, when click on a pinned item next to the right edge, it calls the click on the item behind it

    the method private boolean isPinnedViewTouched(View view, float x, float y), caculate the mTouchRect.right has some problem; it should be mTouchRect.right += getPaddingLeft();

    opened by LLL-Luo 0
  • Not working for nested listviews

    Not working for nested listviews

    I have a nested list view with PinnedListView as outermost layout and NormalList as the item of pinnedList. I have disabled the scroll action of Normal List.

    Header is not pinned on scrolling list view.

    opened by garg-ketki 0
  • Use other view instead of TextView may cause problem

    Use other view instead of TextView may cause problem "Changes made to Items affect other Items"

    I used a RelativeLayout View contains two TextViews: t1 and t2.When click on one item its t2 will change, however, other items' t2 changed either. I found one solution in "http://stackoverflow.com/questions/36099052/android-listview-changes-made-to-items-affect-other-items" but it didn't work, then I found that it was caused by the function getItemViewType(), so I changed every getItemViewType(XXX) into Item item = (MainActivity.Item)(adapter.getItem(XXX)); int viewType = item.type; and it worked well.

    opened by spdv123 0
  • Overscroll effect under the pinned header

    Overscroll effect under the pinned header

    Is it possible to show the RecyclerView overscroll effect over your pinned header? At the moment the effect is weird, because it's under the pinned header, which looks not correct.

    opened by mars3142 0
  • section can't reserve its status

    section can't reserve its status

    I set a textview in section , then set a clicklistener of it so it can change its background when I click it. But after I scroll the list, I found that the section can't reserve its status. After the section get to the top of the list, or scroll down when section was on the top of the list, it turned to be the orign background color, pls help check this issue

    opened by AndyGu 3
  • combine with other kind of list view

    combine with other kind of list view

    hi, just wondering how to combine this list view with another kind of list view, ex: index list view like ios, or multi-layer expandable list view.

    thanks, good job BTW

    opened by yfsx 1
  • Cannot click to session header

    Cannot click to session header

    When I scroll to session header override body session, i click to header session pinned, body item have been received action click.

    opened by mdtuyen 0
Releases(1.0.0)
Owner
Sergej Shafarenka
Android Expert and Software Architect
Sergej Shafarenka
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.

Android 'Pull to Refresh' ListView library Demo video: http://www.youtube.com/watch?v=VjmdELnm3GI Project A generic, customizable, open source Android

Erik Wallentinsen 644 May 1, 2021
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jul 22, 2021
A ListView with pinned section headers for Android

PinnedHeaderListView This library provides a sectioned ListView with pinned headers. It looks and feels much like the default contacts app does on And

James Smith 675 Feb 18, 2021
Awesome Listview filter functionality in Android.

About Awesome Listview filter functionality in Android. See it in Action: https://www.youtube.com/watch?v=RO54U1ES5CA Listview with beautiful transpar

Bhavya  Mehta 447 Jan 28, 2021
Android ListView that implements the QuickReturn UI pattern. Written from scratch with focus on performance.

QuickReturn Android ListView that implements the QuickReturn UI pattern. Written from scratch with focus on performance. Demo Usage In your build.grad

Felipe Lima 195 Apr 13, 2021
android custom listview,with interaction pattern load more and pull to refresh to load data dinamically

The first thing that i have to say is render thanks to johannilsson because all the part of pull to refresh listview is based in the code of his repos

Fabian Leon 450 Jul 26, 2021
An easy to use Drag & Drop List for Android. Direct replacement of the android ListView.

DragNDropListView DragNDropListView is a direct replacement for the stock Android ListView. If you know how to use ListView, you already know how to u

null 186 Dec 14, 2020
[] A swipe menu for ListView.

SwipeMenuListView A swipe menu for ListView. Demo Usage Add dependency dependencies { compile 'com.baoyz.swipemenulistview:library:1.3.0' } Step 1

星一 3.5k Aug 1, 2021
Parallax ScrollView and ListView for Android

Parallax Scrolls Parallax ListView and ScrollView for Android This project includes ScrollView with one or more parallaxed views ListView with paralla

Nir Hartmann 855 Jul 22, 2021
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.

CommonPullToRefresh Android widget with pull to refresh for all the views,and support loadMore for ListView,RecyclerView,GridView and SwipeRefreshLayo

null 1.1k Jul 30, 2021
Horizontal list view for Android which allows variable items widths

Deprecated This widget is now deprecated and it won't be updated anymore. Use RecyclerView instead Horizontal Variable ListView Horizontal ListView fo

Alessandro Crugnola 859 Jul 14, 2021
Bringing extended scrolling features to Android's native ListView and ExpandableListView.

About QuickScroll QuickScroll is a library aimed at creating similar scrolling experiences to the native Contacts app's People view. It has the same s

Andras Kindler 461 Apr 20, 2021
A better ExpandableListView, with animated expandable views for each list item

SlideExpandableListView for Android Not happy with the Android ExpandableListView android offers? Want something like the Spotify app. This library al

Tjerk Wolterink 2k Jul 29, 2021
Android ListView with sticky headers

DEPRECATED HeaderListView is deprecated. No new development will be taking place. Quickstart Import the HeaderListView module in your Android Studio p

Applidium 314 May 30, 2021