Support Library

The right place to talk JavaScript
Post Reply
User avatar
JayM
Posts: 50
Joined: Tue Jan 29, 2019 11:57 pm

Support Library

Post by JayM » Tue Feb 19, 2019 5:23 pm

Is it possible to use a support library through script? im after the navigation drawer in the support design library.

User avatar
F43nd1r
Posts: 32
Joined: Thu Jan 24, 2019 1:20 pm

Re: Support Library

Post by F43nd1r » Tue Feb 19, 2019 5:31 pm

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.

User avatar
JayM
Posts: 50
Joined: Tue Jan 29, 2019 11:57 pm

Re: Support Library

Post by JayM » Tue Feb 19, 2019 5:59 pm

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.

User avatar
F43nd1r
Posts: 32
Joined: Thu Jan 24, 2019 1:20 pm

Re: Support Library

Post by F43nd1r » Tue Feb 19, 2019 6:02 pm

It is a custom component.

User avatar
JayM
Posts: 50
Joined: Tue Jan 29, 2019 11:57 pm

Re: Support Library

Post by JayM » Tue Feb 19, 2019 6:35 pm

😞

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Support Library

Post by Pierrot » Wed Feb 20, 2019 11:05 am

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.

User avatar
JayM
Posts: 50
Joined: Tue Jan 29, 2019 11:57 pm

Re: Support Library

Post by JayM » Sun Feb 24, 2019 4:05 pm

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.

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Support Library

Post by Pierrot » Sun Feb 24, 2019 6:14 pm

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?

User avatar
JayM
Posts: 50
Joined: Tue Jan 29, 2019 11:57 pm

Re: Support Library

Post by JayM » Sun Feb 24, 2019 9:25 pm

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.

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Support Library

Post by Pierrot » 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.

User avatar
F43nd1r
Posts: 32
Joined: Thu Jan 24, 2019 1:20 pm

Re: Support Library

Post by F43nd1r » Sun Apr 28, 2019 11:02 pm

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.

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Support Library

Post by Pierrot » Mon Apr 29, 2019 9:13 am

Lightning did that with widgets a long time ago, but this is easier as all packages share the same "user id" (and signature).

Post Reply