Skip to main content

Posts

Introducing SuperSLiM

StickyGridHeaders is dead, long live SuperSLiM! GitHub Project Page After a road accident that prevented me from working for a while, I finally got around to rewriting StickyGridHeaders. However, this rewrite completely changed everything, so I have started a new project called SuperSLiM, and all development will be focused there. SuperSLiM SuperSLiM is a library that provides a layout manager for RecyclerView and allows you to create vertical lists with per section headers and layouts. Section Layouts     SuperSLiM also lets you lay out data sections in different ways. This is something that just wasn't possible with ListView or GridView. Anyway, with SuperSLiM you just create a factory that provides layouts for each section on demand. Put that in the layout manager and you are good to go. Headers   There are a number of different kinds of section headers you can use in SuperSLiM.   Sticky headers These always display when so...

Plans for StickyGridHeaders

There have been a number of outstanding issues with StickyGridHeaders. Of course, it is now doing a lot more than I ever required for myself. In the last couple of weeks, one of the most requested features has been implemented; widgets in headers are now fully interactive and compatible with header click and long listeners. Unfortunately, animations inside of headers is a major roadblock, and to solve it, I've decided the best method is to rewrite the library, directly addressing the entire hack-job that drawing the headers truly is. The main change will be in the use of a container layer which has two kinds of children; the GridView, which contains the content you want to display; and the headers. I'll attempt to make the top level view as much like a GridView as possible, however, the change in the view hierarchy will result in changes to any code directly accessing the child views of the gridView. As always, the public methods will be documented as clearly as possible, an...

Feature removal in StickyGridHeaders

As a part of performance improvements to  StickyGridHeaders  the adaptable-row-height feature has been removed. This means the vanilla GridView behaviour for row height determination has returned and you will have to extend or wrap your own item views in your adapter yourself to change it. The rationale behind this removal is that the adaptable-row-heights feature significantly impacts performance and isn't required in all use cases.

StickyGridHeaders - Future Plans

I am looking at making some major changes for StickyGridHeaders. Some problems I want to address are: Headers not being a part of the view hierarchy. Adapter complexity. Navigation issues, especially on the TV platform. At the moment the headers are a visual element only as they are merely drawn into the window after the underlying GridView has been drawn. I have a few ideas on how to fix this. Any fix made will include stickied headers too. I am not sure the navigation issues ('3') can be fixed without a complete reimplementation of GridView. It is possible a solution to the view hierarchy problem ('1') may coincidentally fix '3'. Addressing the adapter complexity ('2') will require some thought, I don't want to change things too much. At the least I'll go through the code and make sure the API is properly documented. Actually, that brings me to the final thing, documentation. At the moment the wiki is unused, once the programm...

StickyGridHeaders Reaches Version 1.0

I've been pretty happy with StickyGridHeaders for a while so, though there are a couple of outstanding issues, I have decided the current state is good enough for a stable release. Right now, in version 1.0, StickyGridHeaders provides a simple, easy to use, GridView with stickable section headers and a few configuration options. The next major release will include the headers in the view hierarchy, through some method, allowing for true interactive headers with buttons, check boxes, and things. I originally wanted to have this done now, but I am presently too busy working on Otago PsyAn Lab.

Interactive Headers for StickyGridHeaders

Tonight, I added touch events to the section headers for StickyGridHeadersGridView . Unfortunately, as the headers in the  StickyGridHeadersGridView  live outside the internal GridView list implementation, I had to implement my own touch event handling rather than simply wrapping around that which is provided by  GridView . Unfortunately, adding tap and long press actions in a ViewGroup is moderately complicated and in this case it is made considerable more complicated as  StickyGridHeadersGridView  is a subclass of AbsListView . AbsListView  takes over the touch events at various stages and has an internal state tracker for determining the current user action, be it flinging , scrolling , long pressing , or tapping, there are some other internal states too. Anyway, the solution to correctly implementing interactive headers for  StickyGridHeaders'  was to read the events before the underlying GridView  receives them and block (con...

Custom XML Attributes in Libraries

Today I added a custom attribute to StickyGridHeaders to set whether headers are sticky or not. In order to use XML attributes from third party libraries in Android you need to add the a namespace URI to your XML layout. xmlns:app="http://schemas.android.com/apk/res-auto" The choice of what to call the namespace is up to you, just as long as it is not android. Anyway, the layout file for using StickyGridHeaders in the example is now. <?xml version="1.0" encoding="utf-8"?> <com.tonicartos.widget.stickygridheaders.StickyGridHeadersGridView xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/asset_grid"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:clipToPadding="false"     android:padding="...