Fixed: Fix typos

This commit is contained in:
agnostic-apollo
2022-03-17 02:30:41 +05:00
parent cc58ddde31
commit e0074f280f
10 changed files with 59 additions and 66 deletions

View File

@@ -336,7 +336,7 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo
removeTermuxActivityRootViewGlobalLayoutListener();
unregisterTermuxActivityBroadcastReceiever();
unregisterTermuxActivityBroadcastReceiver();
getDrawer().closeDrawers();
}
@@ -913,11 +913,11 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo
registerReceiver(mTermuxActivityBroadcastReceiver, intentFilter);
}
private void unregisterTermuxActivityBroadcastReceiever() {
private void unregisterTermuxActivityBroadcastReceiver() {
unregisterReceiver(mTermuxActivityBroadcastReceiver);
}
private void fixTermuxActivityBroadcastReceieverIntent(Intent intent) {
private void fixTermuxActivityBroadcastReceiverIntent(Intent intent) {
if (intent == null) return;
String extraReloadStyle = intent.getStringExtra(TERMUX_ACTIVITY.EXTRA_RELOAD_STYLE);
@@ -933,7 +933,7 @@ public final class TermuxActivity extends AppCompatActivity implements ServiceCo
if (intent == null) return;
if (mIsVisible) {
fixTermuxActivityBroadcastReceieverIntent(intent);
fixTermuxActivityBroadcastReceiverIntent(intent);
switch (intent.getAction()) {
case TERMUX_ACTIVITY.ACTION_NOTIFY_APP_CRASH:

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -30,7 +29,7 @@ public class TermuxAPIAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxAPIAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_API_PACKAGE_NAME}.
@@ -38,28 +37,28 @@ public class TermuxAPIAppSharedPreferences {
*/
@Nullable
public static TermuxAPIAppSharedPreferences build(@NonNull final Context context) {
Context termuxTaskerPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_API_PACKAGE_NAME);
if (termuxTaskerPackageContext == null)
Context termuxAPIPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_API_PACKAGE_NAME);
if (termuxAPIPackageContext == null)
return null;
else
return new TermuxAPIAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxAPIAppSharedPreferences(termuxAPIPackageContext);
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxAPIAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_API_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.
* @return Returns the {@link TermuxAPIAppSharedPreferences}. This will {@code null} if an exception is raised.
*/
public static TermuxAPIAppSharedPreferences build(@NonNull final Context context, final boolean exitAppOnError) {
Context termuxTaskerPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_API_PACKAGE_NAME, exitAppOnError);
if (termuxTaskerPackageContext == null)
Context termuxAPIPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_API_PACKAGE_NAME, exitAppOnError);
if (termuxAPIPackageContext == null)
return null;
else
return new TermuxAPIAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxAPIAppSharedPreferences(termuxAPIPackageContext);
}
private static SharedPreferences getPrivateSharedPreferences(Context context) {

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.TypedValue;
@@ -38,7 +37,7 @@ public class TermuxAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_PACKAGE_NAME}.
@@ -54,9 +53,9 @@ public class TermuxAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -30,7 +29,7 @@ public class TermuxBootAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxBootAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_BOOT_PACKAGE_NAME}.
@@ -38,28 +37,28 @@ public class TermuxBootAppSharedPreferences {
*/
@Nullable
public static TermuxBootAppSharedPreferences build(@NonNull final Context context) {
Context termuxTaskerPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_BOOT_PACKAGE_NAME);
if (termuxTaskerPackageContext == null)
Context termuxBootPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_BOOT_PACKAGE_NAME);
if (termuxBootPackageContext == null)
return null;
else
return new TermuxBootAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxBootAppSharedPreferences(termuxBootPackageContext);
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxBootAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_BOOT_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.
* @return Returns the {@link TermuxBootAppSharedPreferences}. This will {@code null} if an exception is raised.
*/
public static TermuxBootAppSharedPreferences build(@NonNull final Context context, final boolean exitAppOnError) {
Context termuxTaskerPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_BOOT_PACKAGE_NAME, exitAppOnError);
if (termuxTaskerPackageContext == null)
Context termuxBootPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_BOOT_PACKAGE_NAME, exitAppOnError);
if (termuxBootPackageContext == null)
return null;
else
return new TermuxBootAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxBootAppSharedPreferences(termuxBootPackageContext);
}
private static SharedPreferences getPrivateSharedPreferences(Context context) {

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -36,7 +35,7 @@ public class TermuxFloatAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxFloatAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_FLOAT_PACKAGE_NAME}.
@@ -52,9 +51,9 @@ public class TermuxFloatAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxFloatAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_FLOAT_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -30,7 +29,7 @@ public class TermuxStylingAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxStylingAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_STYLING_PACKAGE_NAME}.
@@ -38,28 +37,28 @@ public class TermuxStylingAppSharedPreferences {
*/
@Nullable
public static TermuxStylingAppSharedPreferences build(@NonNull final Context context) {
Context termuxTaskerPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_STYLING_PACKAGE_NAME);
if (termuxTaskerPackageContext == null)
Context termuxStylingPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_STYLING_PACKAGE_NAME);
if (termuxStylingPackageContext == null)
return null;
else
return new TermuxStylingAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxStylingAppSharedPreferences(termuxStylingPackageContext);
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxStylingAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_STYLING_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.
* @return Returns the {@link TermuxStylingAppSharedPreferences}. This will {@code null} if an exception is raised.
*/
public static TermuxStylingAppSharedPreferences build(@NonNull final Context context, final boolean exitAppOnError) {
Context termuxTaskerPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_STYLING_PACKAGE_NAME, exitAppOnError);
if (termuxTaskerPackageContext == null)
Context termuxStylingPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_STYLING_PACKAGE_NAME, exitAppOnError);
if (termuxStylingPackageContext == null)
return null;
else
return new TermuxStylingAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxStylingAppSharedPreferences(termuxStylingPackageContext);
}
private static SharedPreferences getPrivateSharedPreferences(Context context) {

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -30,7 +29,7 @@ public class TermuxTaskerAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxTaskerAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_TASKER_PACKAGE_NAME}.
@@ -42,13 +41,13 @@ public class TermuxTaskerAppSharedPreferences {
if (termuxTaskerPackageContext == null)
return null;
else
return new TermuxTaskerAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxTaskerAppSharedPreferences(termuxTaskerPackageContext);
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxTaskerAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_TASKER_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.
@@ -59,7 +58,7 @@ public class TermuxTaskerAppSharedPreferences {
if (termuxTaskerPackageContext == null)
return null;
else
return new TermuxTaskerAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxTaskerAppSharedPreferences(termuxTaskerPackageContext);
}
private static SharedPreferences getPrivateSharedPreferences(Context context) {

View File

@@ -1,6 +1,5 @@
package com.termux.shared.termux.settings.preferences;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@@ -32,7 +31,7 @@ public class TermuxWidgetAppSharedPreferences {
}
/**
* Get the {@link Context} for a package name.
* Get {@link TermuxWidgetAppSharedPreferences}.
*
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_WIDGET_PACKAGE_NAME}.
@@ -40,28 +39,28 @@ public class TermuxWidgetAppSharedPreferences {
*/
@Nullable
public static TermuxWidgetAppSharedPreferences build(@NonNull final Context context) {
Context termuxTaskerPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_WIDGET_PACKAGE_NAME);
if (termuxTaskerPackageContext == null)
Context termuxWidgetPackageContext = PackageUtils.getContextForPackage(context, TermuxConstants.TERMUX_WIDGET_PACKAGE_NAME);
if (termuxWidgetPackageContext == null)
return null;
else
return new TermuxWidgetAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxWidgetAppSharedPreferences(termuxWidgetPackageContext);
}
/**
* Get the {@link Context} for a package name.
* Get the {@link TermuxWidgetAppSharedPreferences}.
*
* @param context The {@link Activity} to use to get the {@link Context} of the
* @param context The {@link Context} to use to get the {@link Context} of the
* {@link TermuxConstants#TERMUX_WIDGET_PACKAGE_NAME}.
* @param exitAppOnError If {@code true} and failed to get package context, then a dialog will
* be shown which when dismissed will exit the app.
* @return Returns the {@link TermuxWidgetAppSharedPreferences}. This will {@code null} if an exception is raised.
*/
public static TermuxWidgetAppSharedPreferences build(@NonNull final Context context, final boolean exitAppOnError) {
Context termuxTaskerPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_WIDGET_PACKAGE_NAME, exitAppOnError);
if (termuxTaskerPackageContext == null)
Context termuxWidgetPackageContext = TermuxUtils.getContextForPackageOrExitApp(context, TermuxConstants.TERMUX_WIDGET_PACKAGE_NAME, exitAppOnError);
if (termuxWidgetPackageContext == null)
return null;
else
return new TermuxWidgetAppSharedPreferences(termuxTaskerPackageContext);
return new TermuxWidgetAppSharedPreferences(termuxWidgetPackageContext);
}
private static SharedPreferences getPrivateSharedPreferences(Context context) {

View File

@@ -203,13 +203,13 @@ public final class TermuxPropertyConstants {
public static final String KEY_TERMINAL_MARGIN_HORIZONTAL = "terminal-margin-horizontal"; // Default: "terminal-margin-horizontal"
public static final int IVALUE_TERMINAL_MARGIN_HORIZONTAL_MIN = 0;
public static final int IVALUE_TERMINAL_MARGIN_HORIZONTAL_MAX = 100;
public static final int DEFAULT_IVALUE_TERMINAL_HORIZONTAL_MARGIN = 3;
public static final int DEFAULT_IVALUE_TERMINAL_MARGIN_HORIZONTAL = 3;
/** Defines the key for the terminal margin on top and bottom in dp units */
public static final String KEY_TERMINAL_MARGIN_VERTICAL = "terminal-margin-vertical"; // Default: "terminal-margin-vertical"
public static final int IVALUE_TERMINAL_MARGIN_VERTICAL_MIN = 0;
public static final int IVALUE_TERMINAL_MARGIN_VERTICAL_MAX = 100;
public static final int DEFAULT_IVALUE_TERMINAL_VERTICAL_MARGIN = 0;
public static final int DEFAULT_IVALUE_TERMINAL_MARGIN_VERTICAL = 0;

View File

@@ -354,15 +354,15 @@ public abstract class TermuxSharedProperties {
* Returns the int for the value if its not null and is between
* {@link TermuxPropertyConstants#IVALUE_TERMINAL_MARGIN_HORIZONTAL_MIN} and
* {@link TermuxPropertyConstants#IVALUE_TERMINAL_MARGIN_HORIZONTAL_MAX},
* otherwise returns {@link TermuxPropertyConstants#DEFAULT_IVALUE_TERMINAL_HORIZONTAL_MARGIN}.
* otherwise returns {@link TermuxPropertyConstants#DEFAULT_IVALUE_TERMINAL_MARGIN_HORIZONTAL}.
*
* @param value The {@link String} value to convert.
* @return Returns the internal value for value.
*/
public static int getTerminalMarginHorizontalInternalPropertyValueFromValue(String value) {
return SharedProperties.getDefaultIfNotInRange(TermuxPropertyConstants.KEY_TERMINAL_MARGIN_HORIZONTAL,
DataUtils.getIntFromString(value, TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_HORIZONTAL_MARGIN),
TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_HORIZONTAL_MARGIN,
DataUtils.getIntFromString(value, TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_MARGIN_HORIZONTAL),
TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_MARGIN_HORIZONTAL,
TermuxPropertyConstants.IVALUE_TERMINAL_MARGIN_HORIZONTAL_MIN,
TermuxPropertyConstants.IVALUE_TERMINAL_MARGIN_HORIZONTAL_MAX,
true, true, LOG_TAG);
@@ -372,15 +372,15 @@ public abstract class TermuxSharedProperties {
* Returns the int for the value if its not null and is between
* {@link TermuxPropertyConstants#IVALUE_TERMINAL_MARGIN_VERTICAL_MIN} and
* {@link TermuxPropertyConstants#IVALUE_TERMINAL_MARGIN_VERTICAL_MAX},
* otherwise returns {@link TermuxPropertyConstants#DEFAULT_IVALUE_TERMINAL_VERTICAL_MARGIN}.
* otherwise returns {@link TermuxPropertyConstants#DEFAULT_IVALUE_TERMINAL_MARGIN_VERTICAL}.
*
* @param value The {@link String} value to convert.
* @return Returns the internal value for value.
*/
public static int getTerminalMarginVerticalInternalPropertyValueFromValue(String value) {
return SharedProperties.getDefaultIfNotInRange(TermuxPropertyConstants.KEY_TERMINAL_MARGIN_VERTICAL,
DataUtils.getIntFromString(value, TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_VERTICAL_MARGIN),
TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_VERTICAL_MARGIN,
DataUtils.getIntFromString(value, TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_MARGIN_VERTICAL),
TermuxPropertyConstants.DEFAULT_IVALUE_TERMINAL_MARGIN_VERTICAL,
TermuxPropertyConstants.IVALUE_TERMINAL_MARGIN_VERTICAL_MIN,
TermuxPropertyConstants.IVALUE_TERMINAL_MARGIN_VERTICAL_MAX,
true, true, LOG_TAG);