From 078eea2b74173d4b28884af746d6c6b3c0208193 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Mon, 13 Jan 2025 01:22:41 +0500 Subject: [PATCH] Added: Rename app classes in `TermuxConstants` with `_APP` suffix added and add `TERMUX_*_MAIN_ACTIVITY_NAME` and `TERMUX_*_LAUNCHER_ACTIVITY_NAME` constants to each app class --- .../termux/shared/termux/TermuxConstants.java | 64 +++++++++++++++---- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java b/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java index 59f523af72..534936ffca 100644 --- a/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java +++ b/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java @@ -1,6 +1,7 @@ package com.termux.shared.termux; import android.annotation.SuppressLint; +import android.content.Intent; import com.termux.shared.shell.command.ExecutionCommand; import com.termux.shared.shell.command.ExecutionCommand.Runner; @@ -11,7 +12,7 @@ import java.util.List; /* - * Version: v0.52.0 + * Version: v0.53.0 * SPDX-License-Identifier: MIT * * Changelog @@ -277,6 +278,10 @@ * * - 0.52.0 (2022-06-18) * - Added `TERMUX_PREFIX_DIR_IGNORED_SUB_FILES_PATHS_TO_CONSIDER_AS_EMPTY`. + * + * - 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. */ /** @@ -1192,10 +1197,30 @@ public static final class RUN_COMMAND_SERVICE { /** * Termux:API app constants. */ - public static final class TERMUX_API { + public static final class TERMUX_API_APP { + + /** Termux:API app main activity name. */ + public static final String TERMUX_API_MAIN_ACTIVITY_NAME = TERMUX_API_PACKAGE_NAME + ".activities.TermuxAPIMainActivity"; // Default: "com.termux.api.activities.TermuxAPIMainActivity" + + /** Termux:API app launcher activity name. This is an `activity-alias` for {@link #TERMUX_API_MAIN_ACTIVITY_NAME} used for launchers with {@link Intent#CATEGORY_LAUNCHER}. */ + public static final String TERMUX_API_LAUNCHER_ACTIVITY_NAME = TERMUX_API_PACKAGE_NAME + ".activities.TermuxAPILauncherActivity"; // Default: "com.termux.api.activities.TermuxAPILauncherActivity" + + } + + + + + + /** + * Termux:Boot app constants. + */ + public static final class TERMUX_BOOT_APP { + + /** Termux:Boot app main activity name. */ + public static final String TERMUX_BOOT_MAIN_ACTIVITY_NAME = TERMUX_BOOT_PACKAGE_NAME + ".activities.TermuxBootMainActivity"; // Default: "com.termux.boot.activities.TermuxBootMainActivity" - /** Termux:API app core activity name. */ - public static final String TERMUX_API_ACTIVITY_NAME = TERMUX_API_PACKAGE_NAME + ".activities.TermuxAPIActivity"; // Default: "com.termux.tasker.activities.TermuxAPIActivity" + /** Termux:Boot app launcher activity name. This is an `activity-alias` for {@link #TERMUX_BOOT_MAIN_ACTIVITY_NAME} used for launchers with {@link Intent#CATEGORY_LAUNCHER}. */ + public static final String TERMUX_BOOT_LAUNCHER_ACTIVITY_NAME = TERMUX_BOOT_PACKAGE_NAME + ".activities.TermuxBootLauncherActivity"; // Default: "com.termux.boot.activities.TermuxBootLauncherActivity" } @@ -1208,6 +1233,9 @@ public static final class TERMUX_API { */ public static final class TERMUX_FLOAT_APP { + /** Termux:Float app core activity name. */ + public static final String TERMUX_FLOAT_ACTIVITY_NAME = TERMUX_FLOAT_PACKAGE_NAME + ".TermuxFloatActivity"; // Default: "com.termux.window.TermuxFloatActivity" + /** Termux:Float app core service name. */ public static final String TERMUX_FLOAT_SERVICE_NAME = TERMUX_FLOAT_PACKAGE_NAME + ".TermuxFloatService"; // Default: "com.termux.window.TermuxFloatService" @@ -1236,11 +1264,18 @@ public static final class TERMUX_FLOAT_SERVICE { /** * Termux:Styling app constants. */ - public static final class TERMUX_STYLING { + public static final class TERMUX_STYLING_APP { /** Termux:Styling app core activity name. */ public static final String TERMUX_STYLING_ACTIVITY_NAME = TERMUX_STYLING_PACKAGE_NAME + ".TermuxStyleActivity"; // Default: "com.termux.styling.TermuxStyleActivity" + + /** Termux:Styling app main activity name. */ + public static final String TERMUX_STYLING_MAIN_ACTIVITY_NAME = TERMUX_STYLING_PACKAGE_NAME + ".activities.TermuxStylingMainActivity"; // Default: "com.termux.styling.activities.TermuxStylingMainActivity" + + /** Termux:Styling app launcher activity name. This is an `activity-alias` for {@link #TERMUX_STYLING_MAIN_ACTIVITY_NAME} used for launchers with {@link Intent#CATEGORY_LAUNCHER}. */ + public static final String TERMUX_STYLING_LAUNCHER_ACTIVITY_NAME = TERMUX_STYLING_PACKAGE_NAME + ".activities.TermuxStylingLauncherActivity"; // Default: "com.termux.styling.activities.TermuxStylingLauncherActivity" + } @@ -1250,10 +1285,13 @@ public static final class TERMUX_STYLING { /** * Termux:Tasker app constants. */ - public static final class TERMUX_TASKER { + public static final class TERMUX_TASKER_APP { + + /** Termux:Tasker app main activity name. */ + public static final String TERMUX_TASKER_MAIN_ACTIVITY_NAME = TERMUX_TASKER_PACKAGE_NAME + ".activities.TermuxTaskerMainActivity"; // Default: "com.termux.tasker.activities.TermuxTaskerMainActivity" - /** Termux:Tasker app core activity name. */ - public static final String TERMUX_TASKER_ACTIVITY_NAME = TERMUX_TASKER_PACKAGE_NAME + ".activities.TermuxTaskerActivity"; // Default: "com.termux.tasker.activities.TermuxTaskerActivity" + /** Termux:Tasker app launcher activity name. This is an `activity-alias` for {@link #TERMUX_TASKER_MAIN_ACTIVITY_NAME} used for launchers with {@link Intent#CATEGORY_LAUNCHER}. */ + public static final String TERMUX_TASKER_LAUNCHER_ACTIVITY_NAME = TERMUX_TASKER_PACKAGE_NAME + ".activities.TermuxTaskerLauncherActivity"; // Default: "com.termux.tasker.activities.TermuxTaskerLauncherActivity" } @@ -1264,15 +1302,19 @@ public static final class TERMUX_TASKER { /** * Termux:Widget app constants. */ - public static final class TERMUX_WIDGET { + public static final class TERMUX_WIDGET_APP { - /** Termux:Widget app core activity name. */ - public static final String TERMUX_WIDGET_ACTIVITY_NAME = TERMUX_WIDGET_PACKAGE_NAME + ".activities.TermuxWidgetActivity"; // Default: "com.termux.widget.activities.TermuxWidgetActivity" + /** Termux:Widget app main activity name. */ + public static final String TERMUX_WIDGET_MAIN_ACTIVITY_NAME = TERMUX_WIDGET_PACKAGE_NAME + ".activities.TermuxWidgetMainActivity"; // Default: "com.termux.widget.activities.TermuxWidgetMainActivity" + + /** Termux:Widget app launcher activity name. This is an `activity-alias` for {@link #TERMUX_WIDGET_MAIN_ACTIVITY_NAME} used for launchers with {@link Intent#CATEGORY_LAUNCHER}. */ + public static final String TERMUX_WIDGET_LAUNCHER_ACTIVITY_NAME = TERMUX_WIDGET_PACKAGE_NAME + ".activities.TermuxWidgetLauncherActivity"; // Default: "com.termux.widget.activities.TermuxWidgetLauncherActivity" /** Intent {@code String} extra for the token of the Termux:Widget app shortcuts. */ public static final String EXTRA_TOKEN_NAME = TERMUX_PACKAGE_NAME + ".shortcut.token"; // Default: "com.termux.shortcut.token" + /** * Termux:Widget app {@link android.appwidget.AppWidgetProvider} class. */