[Free] ToolBox Extension | A powerful utility toolkit designed to simplify common app development tasks and enhance user interaction

ToolBox

The ToolBox extension is a powerful utility toolkit designed to simplify common app development tasks and enhance user interaction in Kodular projects. With this extension, developers gain access to a versatile set of features, including dynamic text animation, smart variable replacement, and customizable case-result logic—all in one compact component.

:memo: Specifications


:package: Package: com.syntax.toolbox
:floppy_disk: Size: 7.98 KB
:mobile_phone: Minimum API Level: 7
:date: Updated On: 2025-04-29T18:00:00Z
:laptop: Built & documented using: FAST-CLI

:rocket: Features Overview

:white_check_mark: Animated Text Transitions

  • Animate text updates in a TextView with a smooth vertical slide and fade effect.
  • Automatically detects and animates only when the text changes.
  • Makes UI changes feel modern and responsive.

:white_check_mark: Dynamic Variable Parsing

  • Define dynamic variables with SetVariable(tag, value).
  • Parse any string and replace placeholders like %tag% with their corresponding values using ParseText(text).
  • Ideal for templating, localization, or dynamic content generation.

:white_check_mark: Custom Case–Result Logic (Switch Case Alternative)

  • Add case mappings using AddCase(key, value) and define a fallback using SetDefaultValue(value).
  • Retrieve results using GetResult(key), which automatically fires an event (WhenResultFound) indicating whether the default was used.
  • Optional SetAutoClear(true) allows one-time use logic (useful in state-driven apps).

:white_check_mark: Case Management

  • HasCase(key) to check for the presence of a case.
  • GetAllCases() returns a list of all keys.
  • Clear() resets all cases and the default value.

:brain: Practical Use Cases

  • Smoothly update chat messages, headlines, or dynamic labels.
  • Build localized or customizable strings for different users.
  • Create simplified decision trees or response systems.
  • Replace cluttered “if-then” or “select list” blocks with a cleaner case-result approach.

Events:

WhenResultFound

WhenResultFoundBlock

Triggered when a result is found.

Parameter Type
key any
value any
isDefault boolean

Methods:

SetTarget

SetTargetBlock

Set the TextView component to animate

Parameter Type
component component

SetText

SetTextBlock

Animate text change

Parameter Type
newText text

SetVariable

SetVariableBlock

Set a variable by tag and value

Parameter Type
tag text
value text

ParseText

ParseTextBlock

Parse text and replace %tag% with stored values

Parameter Type
inputText text

Return Type: text

AddCase

AddCaseBlock

Add a case with a value.

Parameter Type
key any
value any

SetDefaultValue

SetDefaultValueBlock

Set the default value if no case matches.

Parameter Type
value any

SetAutoClear

SetAutoClearBlock

Set whether to automatically clear cases after GetResult.

Parameter Type
enabled boolean

GetResult

GetResultBlock

Get result based on input key.

Parameter Type
key any

Return Type: any

HasCase

HasCaseBlock

Check if a case exists.

Parameter Type
key any

Return Type: boolean

GetAllCases

GetAllCasesBlock

Get a list of all case keys.

Return Type: list

Clear

ClearBlock

Clear all cases and reset default value.

Properties:

Text

TextBlock

Get current text

Download LInk:

com.syntax.toolbox.aix (8.0 KB)

Example:

Blocks

:thinking: Why Use ToolBox?

  • Reduces block complexity and repetitive logic.
  • Enhances UI with native Android animations.
  • Modular design allows clean integration into any project.
  • Suitable for both beginners and advanced Kodular developers.

  • :money_bag: Donations are welcome here.[dm plz]
  • :light_bulb: Ideas are welcome,
  • :bug: Submit issues.
  • :handshake: For getting additional supports, text me in PM or drop a comment below.

This documentation was generated using Akshat Developer’s Documentation Generator.

3 Likes

Good can you add any gif/video/screenshots? So it will attract others to test. As you have mentioned animation, it will be better to add it

1 Like

thanks Added

1 Like

hey @Still-learning
I have a question to know that is it possive to read kodular global/local variable from extension/java.

@SimpleFunction(description = “Set the global variable value”)
public void SetGlobalVariable(String value) {
this.globalVariable = value;
}

@SimpleFunction(description = "Get the global variable value")
public String GetGlobalVariable() {
    return this.globalVariable;
}

how was the main items, Is in list or dictionary? already we have default blocks called dictionary is there. Why dont we prefer that instead of creating an extension?

it is a multi item extension ,not a spacific function or activity . it a switch-case statement like if-else if we have lot data then we use it.and a text slide animation and a join block replcement block. we add join block to add variable but i make it short like

variable name = kodular
result = hey, %name%!
result is "hey, kodular!"

then first you should give input to the extenstion then get the item

import java.util.HashMap;
public MyExtension(ComponentContainer container) {
        super(container);
        variablesMap = new HashMap<>();
    }
// Method to set/update a variable
    @SimpleFunction(description = "Set variable value")
    public void SetVariable(String key, String value) {
        variablesMap.put(key, value);
    }

    // Method to get a variable's value
    public String GetVariable(String key) {
        return variablesMap.getOrDefault(key, "");
    }

u can’t understant .I want to get kodular build in globle/local variable value.
no my extension set it.

Sorry if i am wrong. All of our extensions are getting values type only. we use local variable only to give u input type only…

private Map<String, String> variableMap = new HashMap<>();

@SimpleFunction
public void UpdateVariable(String key, String value) {
variableMap.put(key, value);
}

public String getVariable(String key) {
return variableMap.getOrDefault(key, “”);
}

this one will work, based on input value if then case

// Suppose this is part of your extension class

private Map<String, String> variableMap = new HashMap<>();

// Method to get variable value
public String getVariable(String key) {
    return variableMap.getOrDefault(key, "");
}

// Method where you perform switch-case logic
public void performLogic() {
    String currentVal = getVariable("myVar");
    switch (currentVal) {
        case "value1":
            // Handle value1
            System.out.println("Handling value1");
            break;
        case "value2":
            // Handle value2
            System.out.println("Handling value2");
            break;
        default:
            // Handle default case
            System.out.println("Default case");
            break;
    }
}

instead of that system out use your own logic

ok thanks but now i want to get kodular variable
initializeglobal
value by name of variable in java.user set varibale in kodualr buit-in initialize global name block but i want get this initialize global nameblock value in java.

In this case, as for my knowlege, may be i am unware if exits, my naswer is No, extensions cannot directly access or read internal default global or local variables unless you explicitly pass those values into the extension via method calls.

which method calls. above code?

Yes

import java.util.HashMap;
public MyExtension(ComponentContainer container) {
super(container);
variablesMap = new HashMap<>();
}
// Method to set/update a variable
@SimpleFunction(description = “Set variable value”)
public void SetVariable(String key, String value) {
variablesMap.put(key, value);
}

// Method to get a variable's value
public String GetVariable(String key) {
    return variablesMap.getOrDefault(key, "");
}

Set variable
Get variable

1 Like

@Still-learning
pm plz. i need ur help