Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/src/main/java/com/termux/app/TermuxActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,17 @@ public static void updateTermuxActivityStyling(Context context, boolean recreate
context.sendBroadcast(stylingIntent);
}

public static void toggleTermuxTerminalToolbar(Context context) {
Intent toggleIntent = new Intent(TERMUX_ACTIVITY.ACTION_TOGGLE_TERMINAL_TOOLBAR);
toggleIntent.setPackage(TermuxConstants.TERMUX_PACKAGE_NAME);
context.sendBroadcast(toggleIntent);
}

private void registerTermuxActivityBroadcastReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(TERMUX_ACTIVITY.ACTION_NOTIFY_APP_CRASH);
intentFilter.addAction(TERMUX_ACTIVITY.ACTION_RELOAD_STYLE);
intentFilter.addAction(TERMUX_ACTIVITY.ACTION_TOGGLE_TERMINAL_TOOLBAR);
intentFilter.addAction(TERMUX_ACTIVITY.ACTION_REQUEST_PERMISSIONS);

registerReceiver(mTermuxActivityBroadcastReceiver, intentFilter);
Expand Down Expand Up @@ -955,6 +962,10 @@ public void onReceive(Context context, Intent intent) {
Logger.logDebug(LOG_TAG, "Received intent to reload styling");
reloadActivityStyling(intent.getBooleanExtra(TERMUX_ACTIVITY.EXTRA_RECREATE_ACTIVITY, true));
return;
case TERMUX_ACTIVITY.ACTION_TOGGLE_TERMINAL_TOOLBAR:
Logger.logDebug(LOG_TAG, "Received intent to toggle terminal toolbar");
toggleTerminalToolbar();
return;
case TERMUX_ACTIVITY.ACTION_REQUEST_PERMISSIONS:
Logger.logDebug(LOG_TAG, "Received intent to request storage permissions");
requestStoragePermission(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.List;

/*
* Version: v0.53.0
* Version: v0.54.0
* SPDX-License-Identifier: MIT
*
* Changelog
Expand Down Expand Up @@ -282,6 +282,9 @@
* - 0.53.0 (2025-01-12)
* - Renamed `TERMUX_API`, `TERMUX_STYLING`, `TERMUX_TASKER`, `TERMUX_WIDGET` classes with `_APP` suffix added.
* - Added `TERMUX_*_MAIN_ACTIVITY_NAME` and `TERMUX_*_LAUNCHER_ACTIVITY_NAME` constants to each app class.
*
* - 0.54.0 (2026-04-20)
* - Added `TERMUX_APP.TERMUX_ACTIVITY.ACTION_TOGGLE_TERMINAL_TOOLBAR`.
*/

/**
Expand Down Expand Up @@ -959,6 +962,8 @@ public static final class TERMUX_ACTIVITY {
/** Intent {@code boolean} extra for whether to recreate activity for the TERMUX_ACTIVITY.ACTION_RELOAD_STYLE intent. */
public static final String EXTRA_RECREATE_ACTIVITY = TERMUX_APP.TERMUX_ACTIVITY_NAME + ".EXTRA_RECREATE_ACTIVITY"; // Default: "com.termux.app.TermuxActivity.EXTRA_RECREATE_ACTIVITY"

/** Intent action to make termux toggle terminal toolbar visibility */
public static final String ACTION_TOGGLE_TERMINAL_TOOLBAR = TermuxConstants.TERMUX_PACKAGE_NAME + ".app.toggle_terminal_toolbar"; // Default: "com.termux.app.toggle_terminal_toolbar"

/** Intent action to make termux request storage permissions */
public static final String ACTION_REQUEST_PERMISSIONS = TermuxConstants.TERMUX_PACKAGE_NAME + ".app.request_storage_permissions"; // Default: "com.termux.app.request_storage_permissions"
Expand Down