[FREE] TextboxUtil - ⌨️ Additional Tools To The Built-In TextBox Component!

Click here for more information

Introduction

An extension that provides additional tools to TextBoxes All blocks in this extension work with multi-line textboxes.

NOTE: I am aware that there are other extensions that does the same thing, but has more options. I just want to share this extension in the community. You can choose to download any one of them.

:+1: BIG thanks to: @Ken, @Salman_Dev, @Android_Builder

:package: Current version: 11

:date: Release date: 2022-02-16T09:00:00Z

:date: Last updated date: 2022-03-22T03:30:00Z

Documentation

Events

OnTextChanged

image

This event is invoked when the text fo a registered TextBox has changed.

Parameters: textBox = component

Methods

AddTextChangedListener

image

Registers the component so that when the text of this TextBox has changed, it fires the OnTextChanged event.

Parameters: textBox = component

AlignText

image

Aligns the text of the TextBox. 1 is left/top, 2 is center and 3 is right/bottom.

Parameters: textBox = component, alignHorizontal = number (int), alignVertical = number (int)

DismissErrorMessage

image

Clears the error message shown on the tip of the given TextBox.

Parameters: textBox = component

GetOpacityValue

image

Returns the opacity of the TextBox. 0 is less opaque and 255 is most opaque.

Returns: number (float)

Parameters: textBox = component

GetSelectedText

image

Returns the selected text from the given text box.

Returns: text

Parameters: textBox = component

MoveCursorPosition

image

Moves the cursor to the specific position. Only works when the TextBox is focused.

Parameters: textBox = component, position = number (int)

RemoveFocus

image

Removes focus for both the textbox frame and the cursor of the textbox. This does not hide the keyboard of the textbox.

Parameters: textBox = component

SelectAll

image

Selects all of the text in the given TextBox. This function only works when the TextBox is focused.

Parameters: textBox = component

SelectPartial

image

Selects the text of the TextBox according to the start and the end position. Only works if the TextBox is focused.

Parameters: textBox = component, start = number (int), end = number (int)

SetCursorVisibility

image

Sets the visibility of the cursor.

Parameters: textBox = component, visible = boolean

SetElevation

image

Sets the elevation for the given TextBox in pixels.

Parameters: textBox = component, elevation = number (float)

SetFontTypeface

image

Sets the font typeface of the TextBox, including whether to bold, italicize, and the font of the TextBox. Use the blocks in the properties of this extension for the font parameter. If useCurrentFont is true, the font parameter will be ignored.

Parameters: textBox = component, bold = boolean, italic = boolean, font = text, useCurrentFont = boolean

SetHintColor

image

Sets the hint color for the given TextBox.

Parameters: textBox = component, color = color

SetInputType

image

Sets the input type for the TextBox. Use the blocks in the Properties to set the type parameter.

Parameters: textBox = component, type = number (int)

SetLinksColor

image

Sets the color of the links of your TextBox.

Parameters: textBox = component, color = color

  • Show the context menu for your TextBoxes!

image

SetMaxLength

image

Sets the maximum length for the textbox. If you set the textbox's text longer than the length before you call this, the text will still be there undeleted.

Parameters: textBox = component, length = number (int)

SetMaxLines

image

Sets the maximum lines the TextBox can contain. This block only works with TextBoxes with normal input type.

Parameters: textBox = component, lines = number (int)

SetOpacityValue

image

Sets the opacity of the TextBox. 0 is less opaque and 255 is most opaque.

Parameters: textBox = component, opacity = number (float)

SetPadding

image

Sets the padding of the given TextBox.

Parameters: textbox = component, left = number (int), top = number (int), right = number (int), bottom = number (int)

SetSelectAllOnFocus

image

Sets the TextBox so that when the user clicks any of the text in the TextBox, it automatically selects all of the text.

Parameters: textBox = component, setSelectOnFocus = boolean

SetShadow

image

Sets the shadow for the text with the specified blur radius and color, and the specified distance from text position.

Parameters: textBox = component, radius = number (float), dx = number (float), dy = number (float), color = color

ShowContextMenu

image

Show the context menu for the given TextBox. Returns true if the context menu was shown, else false.

Returns: boolean

Parameters: textBox = component

ShowCustomContextMenu

image

Show the context menu for this TextBox. If the context menu is shown, return true, else false.

Parameters: textBox = component, x = number (float), y = number (float)

SetRotation

image

Rotates the TextBox according to the rotation angle.

Parameters: textBox = component, rotation = number (float)

ShowErrorMessage

image

Shows an error message on the tip of the given TextBox.

Parameters: textBox = component, message = text

Properties

DefaultFont

image

A font block.

Returns: "DEFAULT"

Monospace

image

A font block.

Returns: "MONOSPACE"

SansSerif

image

A font block.

Returns: "SANS SERIF"

Serif

image

A font block.

Returns: "SERIF"

:inbox_tray: Downloads

AIX:
com.gordonlu.textboxutil.aix (15.6 KB)

:+1: Rate my extension! :-1:

  • Good extension!
  • Bad extension.

0 voters


Made with Niotron IDE.

Kindly :email: PM me if you have any questions! Also, if you like my extension, please :heart: like it! It takes some effort for me to make it...

Votes and likes tell me the general user feedback of my extension. If you read this extension, please take 20 seconds to drop by and give a vote / like!

HAPPY 2022!

If you have any features that you want to add and you know the code, PM me.

Added to my website on 2022-2-17.


Gordon Lu

:speech_balloon: Message :earth_africa: Website :e-mail: E-mail

14 Likes

Version 3 uploaded!

SelectAll

image

Selects all of the text in the given TextBox. This function only works when the TextBox is focused.

Parameters: textBox = component

1 Like

you can add a option to select a range of text?

2 Likes

I am looking for a way to do that. Thank you.

2 Likes

Maybe this one can help you

@SimpleFunction(description = "Test")
public void SelectText(int start, int end) {
textbox.setSelection(start - 1, end - 1);
}

2 Likes

Probably this would help.

@SimpleFunction(description = "Selects the text of the TextBox according to the start and the end position. Only works if the TextBox is focused.")
    public void SelectPartial(AndroidViewComponent textBox, int start, int end) {
    View view = textBox.getView();
    EditText edit = (EditText) view;
    edit.setSelection(start - 1, end);
}
1 Like

Version 4 updated!

New blocks:

AlignText

image

Aligns the text of the TextBox. 1 is left, 2 is center and 3 is right.

Parameters: textBox = component, position = number (int)

SelectPartial

image

Selects the text of the TextBox according to the start and the end position. Only works if the TextBox is focused.

Parameters: textBox = component, start = number (int), end = number (int)

1 Like

Oh! Yes,

A perfect gooseman that can make life easy. :stuck_out_tongue_winking_eye:

*Just for fun. Don't take it seriously. :sweat_smile:

2 Likes

Version 5 updated!

New blocks:

Methods

MoveCursorPosition

image

Moves the cursor to the specific position. Only works when the TextBox is focused.

Parameters: textBox = component, position = number (int)

SetFont

image

Sets the font type of the TextBox. Use the blocks in the properties of this extension for the font parameter.

Parameters: textBox = component, font = text

SetTypeface

image

Sets the font type of the TextBox. Use the blocks in the properties of this extension for the font parameter.

Parameters: textBox = component, bold = boolean, italic = boolean

Properties

DefaultFont

image

A font block.

Returns: "DEFAULT"

Monospace

image

A font block.

Returns: "MONOSPACE"

SansSerif

image

A font block.

Returns: "SANS SERIF"

Serif

image

A font block.

Returns: "SERIF"

1 Like

You can set textbox direct like view

I'll try. I never thought setSelection can apply to View.

Add one more properties

@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN,
defaultValue = "True")
@SimpleProperty(category = PropertyCategory.APPEARANCE)
public void CursorVisible(boolean enabled) {
if(enabled){
view.setCursorVisible(enabled);
view.invalidate();
}
}

3 Likes

You are Incredible. keep it up :wink: :+1:

2 Likes

Version 6 available!

Updated description of extension.

image

Combined SetFont and SetTypeface blocks to SetFontTypeface.

New blocks:

SetCursorVisibility

image

Sets the visibility of the cursor.

Parameters: textBox = component, visible = boolean

SetFontTypeface

image

Sets the font typeface of the TextBox, including whether to bold, italicize, and the font of the TextBox. Use the blocks in the properties of this extension for the font parameter. If useCurrentFont is true, the font parameter will be ignored.

Parameters: textBox = component, bold = boolean, italic = boolean, font = text, useCurrentFont = boolean

2 Likes

Version 7 available!

DismissErrorMessage

image

Clears the error message shown on the tip of the given TextBox.

Parameters: textBox = component

SetHintColor

image

Sets the hint color for the given TextBox.

Parameters: textBox = component, color = color

SetMaxLines

image

Sets the maximum lines the TextBox can contain. This block only works with TextBoxes with normal input type.

Parameters: textBox = component, lines = number (int)

ShowErrorMessage

image

Shows an error message on the tip of the given TextBox.

Parameters: textBox = component, message = text

P.S. All features except RemoveFocus are available with the aiStarter Android emulator.

2 Likes

Version 8!

SetElevation

image

Sets the elevation for the given TextBox in pixels.

Parameters: textBox = component, elevation = number (float)

SetInputType

image

Sets the input type for the TextBox. Use the blocks in the Properties to set the type parameter.

Parameters: textBox = component, type = number (int)

SetPadding

image

Sets the padding of the given TextBox.

Parameters: textbox = component, left = number (int), top = number (int), right = number (int), bottom = number (int)

SetRotation

image

Rotates the TextBox according to the rotation angle.

Parameters: textBox = component, rotation = number (float)

3 Likes

Oh yes

Now tell textbox component to leave his job. Because now no need of him. The extensions are the king now. :stuck_out_tongue_winking_eye:

2 Likes

We have more options to add in this lol :rofl:

3 Likes

我都不知道該用哪一版了 :joy:

I don't know which version to study.

1 Like

現在下載 ,現在是最後一版。

ENGLISH: This is the latest version. Read the main post to download.

2 Likes