Coder Social home page Coder Social logo

listviewvariants's Introduction

ListViewVariants

Provides special ways to handle ListViews, including PinnedHeaderListView in Lollipop's Contacts-app style

Screenshot

Here's a screenshot of how it shows the contacts of the device, very similar to how Lollipop's Contacts-app shows it , except for the blur, which I've added myself ... :)

animated demo

enter image description here

Requirements

The min API level is 8.

Also, in case you wish to use any class that causes the headers to be ordered, you must sort the items accordingly.

In case the headers should all be in uppercase, the sorting should make sure that items that start with each letter (uppercase or not) will be together (for example "Dan" and "duke" should be together on the same chunk that belongs to "D").

Known Issues

  1. Missing some documentations and also some samples. Hope to work on this when I get the time. :)
  2. RTL alignment on the headers (of the sample) isn't supported yet. Maybe it's a simple matter to fix. However, this doesn't mean that it won't work on RTL locale of the device. Just not that the UI components will get mirrored (meaning it will look exactly like for English locale, for example) ...

Note

There is another nice alternative library for RecyclerView, here: https://github.com/TonicArtos/SuperSLiM

listviewvariants's People

Contributors

androiddeveloperlb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

listviewvariants's Issues

Sticky Header Issue on Nexus 4

Hi!

I'm having issues with the sticky headers when the app is deployed and running on a Nexus 4 device (Android OS version 4.0 - 4.3; still testing on later versions). The first sticky header doesn't move/slide which covers other section headers. But this issue doesn't occur in Nexus 4, Android 4.4 and on Samsung Galaxy S3, Android OS version 4.2.

Would you have an idea why this occurs? Hoping to hear from you.
Thank you.

Add cursor adapter supporting

Thank you for great work!

I have a large database and I want to fill ListViewVariants using Cursor. How to implement it?

change PreferenceActivity to PreferenceFragmentCompat in old project

Hi,

I need very much your help, even if it is small

I stay taking PreferenceActivity of project links below and I put PreferenceFragmentCompat

http://ryanfx.blogspot.com/2013/06/raspberry-pi-powered-android-controlled.html

https://github.com/ryanfx/GarageAndroid/blob/master/src/com/blogspot/ryanfx/activity/ConfigurationActivity.java

I have issue of the picture below and this is my project (with issue):

https://github.com/neuberfran/AlarmController/blob/master/app/src/main/java/com/blogspot/neuberfran/activity/ConfigurationActivity.java

What about context of the PreferenceFragmentCompat? getActivity() in line 62 in my ConfigurationActivity.java is correct?

What I need do to solve my issue?

issue111

Can we have gradle compile path for this library ?

It is pretty small library to achieve both FastScroll as well as Sticky header too.If It would be compiled path in build.gradle. It would be more easy to integrate with any project rather than adding complete (:libary) src code.

Anything like,
compile 'com.github.AndroidDeveloperLB:ListViewVariants:V1.0'

Problem in Scrolling while my listViewVariant is in fragment

My ListViewVariants is in fragment and fragment is the part of Activity with 3 tab. In my activity i'm using collapsing toolbar. My tab with listViewVariant, when i scroll my list to up it doesn't collapse and show the list improperly while on another tab i have recyclerview which is scrolling and collapsing correctly. Please help me in figuring this out.

header view should be invisible for top item (when the pinned header goes from an invisible to visible state)

Hi, great little library btw, we've had some issues with the default android listviews and different height cells (some cells are header sections) with, which has caused bugs on some devices when using fastscroll (with certain datasets in the list). Your little POC library is great because its fits in with the new android design and also works great as all the cells are the same heights.

I've been trying to integrate your code into an application I am working on, however I noticed that there are a few small tweaks that are needed. The main one being that if you were to set the backgroundColor of the header views to transparent/null (comment out
'mAdapter.setPinnedHeaderBackgroundColor(pinnedHeaderBackgroundColor);' in MainActivity), you'll notice that when you scroll up so that the first item of an alphabetical section becomes 'pinned' (i.e. the pinned header view becomes visible in that locked position on the screen), you'll see the header view for the cell behind it still. Your sample app doesn't show this normally as you explicitly set the background colour for the header views, however if you have an app with a common background (which has a gradient for example), you'd want to allow the background of the header view to be transparent.

I suspect that all we would need to do is in PinnedHeaderListView.configureHeaderView(int position) in the PINNED_HEADER_VISIBLE state is find the first visible element of the list and make the header view in that invisible. Oppositely when the pinned header goes into the PINNED_HEADER_GONE state (which seems to only happen when scrolling up between the beginning of a section and the end of the previous section) we should then find the first visible element of the list and make the header view visible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.