Page 1 of 1

Support Library

Posted: Tue Feb 19, 2019 5:23 pm
by JayM
Is it possible to use a support library through script? im after the navigation drawer in the support design library.

Re: Support Library

Posted: Tue Feb 19, 2019 5:31 pm
by F43nd1r
I don't think lightning packages support libraries. Loading libraries into lightning at runtime is not impossible, but not easy either. Multitool does some classloader magic to load its own classes. I'm not sure if it is possible without another package on the device.

Re: Support Library

Posted: Tue Feb 19, 2019 5:59 pm
by JayM
ah I see sounds like more trouble than a moose on the interstate and probably not something I could do anyways. The script editor uses a nav drawer I remember pierre said we cant use the actionbar because it was a custom component and not a real actionbar but that he could make the real actionbar available. So if the nav drawer actually is a nav drawer and not a custom component maybe making that available would be possible.

Re: Support Library

Posted: Tue Feb 19, 2019 6:02 pm
by F43nd1r
It is a custom component.

Re: Support Library

Posted: Tue Feb 19, 2019 6:35 pm
by JayM
😞

Re: Support Library

Posted: Wed Feb 20, 2019 11:05 am
by Pierrot
Indeed the one used in the app drawer is a custom component. This is possible to display and configure the standard actionbar through script but not in the app drawer. In a normal desktop it should work.
Lightning don't use with the support library because it's big. It might be shipped as a independent package and dynamically load classes as F4Endir said though. To ease the process there could be some "import(SomeStuff)" javascript call.

Re: Support Library

Posted: Sun Feb 24, 2019 4:05 pm
by JayM
I was the 1 who asked for the Actionbar remember 😊 it works great.

"It might be shipped as a independent package and dynamically load classes as F4Endir said though. To ease the process there could be some "import(SomeStuff)" javascript call"

I don't think its available as an independent package but I think the import(SomeStuff) idea would be useful.

Re: Support Library

Posted: Sun Feb 24, 2019 6:14 pm
by Pierrot
I perfectly remember @JayM ;-)

In practice, a huge number of apps make use of parts of the support library. I wonder whether it could be possible to "link" with a well known app (say, Google Play...) to import those support classes. That would be dirty but the concept is interesting: code sharing. Wouldn't that be great?

Re: Support Library

Posted: Sun Feb 24, 2019 9:25 pm
by JayM
that sounds really great but I have a feeling it's not possible maybe for security reasons but if you get chance to look into it that would be cool.

Re: Support Library

Posted: Tue Feb 26, 2019 6:17 am
by Pierrot
Surprisingly you can access other app's package. For instance it is possible to read resources (graphics and other stuff), so maybe code too.

Re: Support Library

Posted: Sun Apr 28, 2019 11:02 pm
by F43nd1r
Pierrot wrote: ↑
Tue Feb 26, 2019 6:17 am
Surprisingly you can access other app's package. For instance it is possible to read resources (graphics and other stuff), so maybe code too.
It is pretty easy to access code from other packages, if the package wants to be accessed. Multitool does it for basically everyting. This script loads this class, which can be used to load e.g. the main multitool script class, which is compiled against proxies of lightnings classes (not technically necessary, and requires some magic to work, but makes great readable code).

The only limit this has is that it is impossible to add things which require entries in LLs AndroidManifest, like Activities, Services, NotificationListeners, or ContentProviders.

Re: Support Library

Posted: Mon Apr 29, 2019 9:13 am
by Pierrot
Lightning did that with widgets a long time ago, but this is easier as all packages share the same "user id" (and signature).