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.
Comments
  • 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
  • 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
  • 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
  • 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
  • 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
  • Listview when scroll with shadow?

    Listview when scroll with shadow?

    Hi everybody,I found a problem that when listview swipe down,there always with shadow,but I have set listview.setOverScrollview "never",but it doesn't work...

    opened by MIkeeJY 3
  • Section loses OnClickListener when pinned

    Section loses OnClickListener when pinned

    The Section that I want to pin has an OnClickListener.

    When it is not pinned at the top, the listener works. However, when it is pinned, the listener doesn't work and responds to the Listeners of the view behind the Pinned Section instead.

    bug 
    opened by dannyroa 3
  • Added android maven plugin

    Added android maven plugin

    So that it installs into local maven repository with gradle install command.

    Additionally now the library can be installed as a Maven Dependency from JitPack.io! Here's an example fork with this change: https://jitpack.io/#jitpack-io/pinned-section-listview/1.6

    opened by jitpack-io 2
  • Attempt to fix the overlapping section headers when the list view reach ...

    Attempt to fix the overlapping section headers when the list view reach ...

    I noticed that findFirstVisibleSectionPosition() returns -1 when the listview is about reach the end. firstVisibleItem+visibleItemCount >= adapter.getCount()

    This is just a quick fix until I can investigate further into the root cause of the problem.

    opened by ptwoms 2
  • `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
  • 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
Releases(1.0.0)
Owner
Sergej Shafarenka
Android Expert and Software Architect
Sergej Shafarenka
HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView which scrolls vertically).

HorizontalListView HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView w

MeetMe 722 Nov 10, 2022
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll.

FlabbyListView This library is not maintained anymore and there will be no further releases Android library to display a ListView which cells are not

JPARDOGO 762 Nov 23, 2022
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 187 Dec 22, 2022
An Android custom ListView and ScrollView with pull to zoom-in.

PullZoomView An Android custom ListView and ScrollView with pull to zoom-in. Features Set ZoomView enable Add HeaderView Custom ZoomView Parallax or N

Frank-Zhu 2.3k Dec 26, 2022
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 Nov 10, 2022
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 639 Nov 17, 2022
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 851 Dec 3, 2022
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 447 Nov 15, 2022
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 446 Nov 20, 2022
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 Nov 11, 2022
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 Nov 10, 2022
Simple ListView based Android AccordionView

Android Accordion View Example git pull import to eclipse properties->android uncheck is library run as android application See main.xml. Screenshot L

Maciej Lopacinski 164 Nov 28, 2022
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 191 Nov 25, 2022
AssignmentListView is an Android ListView widget which calculate image loading times.

AssignmentListView is an Android ListView widget which calculate image loading times.

null 5 Sep 9, 2022
[] 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 Dec 16, 2022
Android library to achieve in an easy way, the behaviour of the home page in the Expedia app, with a pair of auto-scroll circular parallax ListViews.

ListBuddies This library is not maintained anymore and there will be no further releases Android library of a pair of auto-scroll circular parallax Li

JPARDOGO 970 Dec 29, 2022
Expandable Recyclerview makes it easy to integrate nested recycler view...🔨 📝

SSExpandableRecyclerView Expandable Recyclerview make it easy to integrate nested recyclerview Features Simple and easy to use ( no complex adapter re

Simform Solutions 52 Nov 1, 2022
Android library to observe scroll events on scrollable views.

Android-ObservableScrollView Android library to observe scroll events on scrollable views. It's easy to interact with the Toolbar introduced in Androi

Soichiro Kashima 9.6k Dec 30, 2022
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 Jan 5, 2023