LabelPlus - Additional methods for the Label component

on Companion error Kodular/

Font not found /storage/emulated/0/AppInventor/assets/font.TTF

in apk, android 7:

Need AdndroidX ?

The extension's path for the companion is set of AppInventor.
This can be solved by checking the platform the user is using in. Else you should try using the full exact path of the typeface file.

Exactly as @Kumaraswamy wrote. I haven't tested it in Kodular, and I don't include codular paths. I will look at it and add it to recognize Kodular.

3 Likes

Could you tell me how to check the platform in the extension? I know path, I know how to detect companion mode, unfortunately I can't find information on how to detect platform.

You can check for classes if they are present for example inbuilt notification component's class name which is there on Kodular and not in Ai2.

14.07.2021_21.44.17_REC 14.07.2021_21.43.08_REC

 public boolean IsAppInventor() {
        try{
            Class.forName("com.google.appinventor.components.runtime.MakeroidNotification");
            return false;
        } catch (ClassNotFoundException e) {
            // do nothing
        }
        return true;
    }
com.google.appinventor.components.runtime.MakeroidNotification is one of the component class package name present in kodular

There maybe other ways which I'm not aware of.

4 Likes

Oh, that is, I check if there is a class that is only in kodular. Clever. Ok, I'm implementing.

5 Likes

New update. New methods for text scroll, and compatibility with absolute and Kodular paths.

4 Likes

awesome :heart_eyes:
if possible please add GotFocus and LostFocus blocks..

1 Like

Why would the label take focus?

In my project the label is implemented like a button in which data is sent continuously in long click, I want that the data is not sent after the release of the label.

You will need a textbox (or other label that can take focus) to send the focus to.....

Added focus for labels. Anyone else need something :slight_smile: ?

2 Likes

@Patryk_F thanks u
i am very glad :boom::boom:
added focus of labels.

1 Like

Thank you for this extension :+1:

1 Like

Another seventh update. New methods added and "SetCustomFontInRange" method fixed, which did not work on android older than 9.

4 Likes

Hello i get this error on android 5.0 if use setQuote
Mitt app companion

apk

Thanks for pointing out the error. "Quote" is available from API1 level, but "Quote" with specified widths only from API28. So I'll make a fix that for legacy devices will not take into account the width and padding parameters.

1 Like

Thank you :+1::+1:

New version released.

  • new method for setting line spacing
  • fixed SetJustify and SetQuote, also available on older android versions
3 Likes

Thank you :+1::+1: