paramvir-b / androidgridviewcompatlib Goto Github PK
View Code? Open in Web Editor NEWMulti-select grid view for android api level 4 and above
Multi-select grid view for android api level 4 and above
Many thanks for the efforts, all seems to work well as far as supporting multi-selection and single selection as it were, but unable to get items to appear selected, which forces you to use a manual drawing approach, which pretty much forces you to write it from scratch anyway, If I'm missing something I'd appreciate knowing what needs to be done as far as the selector to show a checked item.
Many thanks.
I added a check for mCheckStatesC being not null for that whole block, hopefully to prevent the crash.
boolean newValue = !mCheckStatesC.get(position, false);
java.lang.NullPointerException at com.rokoder.android.lib.support.v4.widget.GridViewCompat.performItemClick(GridViewCom at.java:1062)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:1877)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3835)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
If your item views implements Checkable, in the framework version of the class, it will be automatically checked/unchecked.
With this compat version this needs to be done manually in the Adapter (as is shown in your sample).
I think unfortunately this cannot be fixed as the code to do that is in private methods.
However you should indicate this in the Caveats section of the readme because this may come as a surprise :) (I just spent an hour understanding what the problem was).
Thanks a lot for this lib!
First off, great work on this lib. Seems to work just as I need it to.
Just curious though, if I don't want to use checkboxes in each grid, but rather would like the entire box to highlight (just like it would in the modal_multi_select), how would I go about doing so?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.