John
John

Reputation: 5206

Implement custom launcher Folder class

I'm trying to figure out (if it's even possible) to override the behavior of the built in ICS launcher folders.

I have a specific and small change I'd like to add (simply add a button on the top to sort alphabetically to start with). From looking at the source for Launcher2 add the behavior should be easy enough, but I can't seem to figure out way to hook into the launcher and override specific bits.

I would hazard to guess that the correct approach is that you have to implement a full custom launcher (by altering the class I'm interested in changing and recompiling Launcher2) and that what I'm hoping to do isn't possible. Android/Java is not my day job so I'm hoping there might be a way that I'm not seeing that a more experienced developer is aware of.

In short is/how can I implement a custom subclass of com.android.Launcher2.Folder and have that used instead? Preferably with just a drop in app rather than having to completely override the normal ICS launcher app.

Upvotes: 0

Views: 313

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006809

I'm trying to figure out (if it's even possible) to override the behavior of the built in ICS launcher folders.

No, sorry.

I would hazard to guess that the correct approach is that you have to implement a full custom launcher (by altering the class I'm interested in changing and recompiling Launcher2) and that what I'm hoping to do isn't possible.

Correct. Beyond that, you cannot simply reuse their code, as packages have to be unique in Android devices.

how can I implement a custom subclass of com.android.Launcher2.Folder and have that used instead?

Completely rebuild the firmware that contains the modified class, then use that modified firmware on your device. Or, refactor the entire home screen app into your own package, get it building as a standalone app (which may not be easy), and then add in your change.

Far simpler would be for you to make your own app widget that implements some sort of folder construct. That would not "override the behavior of the built in ICS launcher folders", but it could give you the functionality you seek.

Upvotes: 1

Related Questions