Define TermuxConstants class to store all shared constants of Termux app and its plugins

This commit removes almost all hardcoded paths in Termux app and moves the references to the `TermuxConstants` class.

The `TermuxConstants` class should be imported by other termux plugin apps instead of copying and defining their own constants. The 3rd party apps can also import it for interacting with termux apps. App and sub class specific constants are defined in their own nested classes to keep them segregated from each other and for better readability.
This commit is contained in:
agnostic-apollo
2021-03-08 15:09:22 +05:00
parent 395759cc0a
commit 14c49867f7
14 changed files with 361 additions and 120 deletions

View File

@@ -1,6 +1,14 @@
<shortcuts xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<!--
For shortcut.xml:
If applicationId in build.gradle is changed from "com.termux", then targetPackage will
need to be manually patched since ${applicationId} variable or resource string does not work.
If package name in AndroidManifest is changed from "com.termux", then targetClass will
need to be manually patched since dot (.) prefix does not work to automatically prefix the
package name.
-->
<shortcut
android:shortcutId="new_session"
android:enabled="true"