diff --git a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicFileUtils.java b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicFileUtils.java index 5350a9e..c0b6a33 100644 --- a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicFileUtils.java +++ b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicFileUtils.java @@ -53,7 +53,7 @@ /** * Helper class to perform various {@link File} operations. * - *

A {@link FileProvider} in the form of {@code ${applicationId}.FileProvider} must be + *

A {@link FileProvider} in the form of {@code ${applicationId}.FileProvider} must be * added in the {@code manifest} to perform some operations automatically like saving the * bitmap or file in app isolated directory. * @@ -609,7 +609,7 @@ public static boolean writeStringToFile(@NonNull Context context, * Save and returns uri from the bitmap. *

It will automatically use the @link FileProvider} on API 24 and above devices. * - *

It requires {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission on + *

It requires {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission on * pre KitKat ({@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2} or below) devices. * * @param context The context to get the file provider. @@ -652,7 +652,7 @@ public static boolean writeStringToFile(@NonNull Context context, * Save and returns uri from the bitmap. *

It will automatically use the @link FileProvider} on API 24 and above devices. * - *

It requires {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission on + *

It requires {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission on * pre KitKat ({@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2} or below) devices. * * @param context The context to get the file provider. diff --git a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicLinkUtils.java b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicLinkUtils.java index b783a5d..b880557 100644 --- a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicLinkUtils.java +++ b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicLinkUtils.java @@ -16,6 +16,7 @@ package com.pranavpandey.android.dynamic.utils; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.ApplicationErrorReport; import android.content.ActivityNotFoundException; @@ -98,7 +99,7 @@ public static boolean copyToClipboard(@NonNull Context context, * Share application via system default share intent so that user can select from the * available apps if more than one apps are available. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -152,7 +153,7 @@ public static boolean share(@NonNull Context context, @Nullable String title, * Share application via system default share intent so that user can select from the * available apps if more than one apps are available. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -176,7 +177,7 @@ public static boolean share(@NonNull Context context, @Nullable String title, * Share application via system default share intent so that user can select from the * available apps if more than one apps are available. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -199,7 +200,7 @@ public static boolean share(@NonNull Context context, * Share application via system default share intent so that user can select from the * available apps if more than one apps are available. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -219,7 +220,7 @@ public static boolean shareApp(@NonNull Context context) { * respective apps if installed on the device. Special treatment is applied for the * Facebook URLs to open them directly in the app. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -285,7 +286,7 @@ public static boolean viewInGooglePlay(@NonNull Context context, * View app on Google Play or Android Market. *

Can be used for the quick feedback or rating from the user. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -304,7 +305,7 @@ public static boolean rateApp(@NonNull Context context) { /** * View other apps of a Publisher on Google Play or Android Market. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -330,7 +331,7 @@ public static boolean moreApps(@NonNull Context context, @NonNull String publish *

Subject of the email will be generated automatically by detecting the manufacturer, * device, Android version and the app version along with the supplied app name. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -367,7 +368,7 @@ public static boolean email(@NonNull Context context, @NonNull String email, *

Subject of the email will be generated automatically by detecting the manufacturer, * device, Android version and the app version along with the supplied app name. * - *

This method throws {@link ActivityNotFoundException} if there was no activity found + *

This method throws {@link ActivityNotFoundException} if there was no activity found * to run the given intent. * * @param context The context to retrieve the resources. @@ -405,13 +406,14 @@ public static boolean report(@NonNull Context context, /** * Checks whether the email client exists on the device. - *

Use {@code queries} tag for {@link Intent#ACTION_SENDTO} with scheme + *

Use {@code queries} tag for {@link Intent#ACTION_SENDTO} with scheme * {@link MailTo#MAILTO_SCHEME} in {@code AndroidManifest} to support API 30. * * @param context The context to get the package manager. * * @return {@code true} if the email client exists on the device. */ + @SuppressLint("QueryPermissionsNeeded") public static boolean isEmailExists(@NonNull Context context) { List list = null; @@ -464,7 +466,7 @@ public static boolean isFeedbackExists(@NonNull Context context) { /** * Ask questions or submit bug report to the developer via Google feedback. * - *

It will redirect to {@link #report(Context, String, String)} method if feedback + *

It will redirect to {@link #report(Context, String, String)} method if feedback * package is not available on the device. * * @param context The context to retrieve the resources. @@ -515,7 +517,7 @@ public static void feedback(@NonNull Context context, /** * Ask questions or submit bug report to the developer via Google feedback. * - *

It will redirect to {@link #report(Context, String, String)} method if feedback + *

It will redirect to {@link #report(Context, String, String)} method if feedback * package is not available on the device. * * @param context The context to retrieve the resources. diff --git a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicTextUtils.java b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicTextUtils.java index cb8ebc0..bad8aae 100644 --- a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicTextUtils.java +++ b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/DynamicTextUtils.java @@ -47,7 +47,7 @@ public class DynamicTextUtils { return text.substring(0, 1).toUpperCase(locale) + text.substring(1); } - return text.substring(0, 1).toUpperCase() + text.substring(1); + return text.substring(0, 1).toUpperCase(Locale.getDefault()) + text.substring(1); } /** diff --git a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicRunnable.java b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicRunnable.java index d56b5e7..3781a60 100644 --- a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicRunnable.java +++ b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicRunnable.java @@ -89,7 +89,7 @@ protected void onPostExecute(@Nullable DynamicResult result) { } * Runs on the UI thread after {@link #cancel(boolean)} is invoked and * {@link #doInBackground(Object)} has finished. * - *

The default implementation simply invokes {@link #onCancelled()} and + *

The default implementation simply invokes {@link #onCancelled()} and * ignores the result. If you write your own implementation, do not call * super.onCancelled(result). * @@ -110,7 +110,7 @@ protected void onCancelled(DynamicResult result) { * This method is invoked by the default implementation of {@link #onCancelled(DynamicResult)}. *

The default version does nothing. * - *

Runs on the UI thread after {@link #cancel(boolean)} is invoked and + *

Runs on the UI thread after {@link #cancel(boolean)} is invoked and * {@link #doInBackground(Object)} has finished. * * @see #onCancelled(DynamicResult) @@ -140,14 +140,14 @@ protected void onCancelled() { } * {@code mayInterruptIfRunning} parameter determines whether the thread executing this * task should be interrupted in an attempt to stop the task. * - *

Calling this method will result in {@link #onCancelled(DynamicResult)} being invoked + *

Calling this method will result in {@link #onCancelled(DynamicResult)} being invoked * on the UI thread after {@link #doInBackground(Object)} returns. Calling this method * guarantees that onPostExecute(Object) is never subsequently invoked, even if * {@code cancel} returns false, but {@link #onPostExecute} has not yet run. * To finish the task as early as possible, check {@link #isCancelled()} periodically - * from {@link #doInBackground(Object)}.

+ * from {@link #doInBackground(Object)}. * - *

This only requests cancellation. It never waits for a running background task to + *

This only requests cancellation. It never waits for a running background task to * terminate, even if {@code mayInterruptIfRunning} is true. * * @param mayInterruptIfRunning {@code true} if the thread executing this diff --git a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicTask.java b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicTask.java index 655dbe8..8d1b648 100644 --- a/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicTask.java +++ b/dynamic-utils/src/main/java/com/pranavpandey/android/dynamic/utils/concurrent/DynamicTask.java @@ -35,6 +35,7 @@ /** * Base class to represent {@link Runnable} according to the {@link DynamicRunnable}. */ +@SuppressWarnings({"unchecked", "deprecation"}) public abstract class DynamicTask extends DynamicRunnable { /**