Enable marquee effect on Android label


#1

I’m wanting to implement the marquee effect on single line labels in Android.

Ideally, I would like to extend the core “Label” module and add the relevant API calls.

The API calls would be:

myLabel.android.setEllipsize(android.text.TextUtils.TruncateAt.MARQUEE);
myLabel.android.setMarqueeRepeatLimit(-1);
myLabel.android.setSelected(true);

My question:

Does anyone have example code of how I would extend a tns core module so that I can add additional properties and API calls?

The idea is to inherit all the functionality that already exists, but just add some extra Android-specific API calls. I would need to do the same for iOS.

If this is not possible, then I guess I’ll need to create a PR on the Label tns core module.


#2

Hi Steven, do you find any solution for the marquee effect?


#3

@indiana
This article might be of your interest
https://docs.nativescript.org/plugins/ui-plugin-custom

you can use the information in that article to learn how to extend existing components as a reusable plugin.

It’d be nice if you make that and share it with the community!
If you need help with it, let me know.

Cheers!