diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e888fd..776cb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,19 @@ This file contains all release notes from current project. Based on [keep a changelog](https://keepachangelog.com/en/1.0.0). -## [1.0.1](https://github.com/fartem/hash-checker-lite/releases/tag/1.0.1) - 2020-08-31 +## [1.0.1](https://github.com/hash-checker/hash-checker-lite/releases/tag/1.0.1) - 2020-08-31 ### Closed issues - #3 (Remove "requestLegacyExternalStorage" parameter from AndroidManifest.xml). -## [1.0.1](https://github.com/fartem/hash-checker-lite/releases/tag/1.0.1) - 2020-08-31 +## [1.0.1](https://github.com/hash-checker/hash-checker-lite/releases/tag/1.0.1) - 2020-08-31 ### Closed issues - #1 (Replace old email link by actual); - #2 (Replace all GitHub Hash Checker links by Hash Checker Lite links). -## [1.0.0](https://github.com/fartem/hash-checker-lite/releases/tag/1.0.0) - 2020-08-23 +## [1.0.0](https://github.com/hash-checker/hash-checker-lite/releases/tag/1.0.0) - 2020-08-23 - First release. diff --git a/README.md b/README.md index 5da1701..8f330d3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Hash Checker Lite - + @@ -15,18 +15,18 @@ -[![GitHubActions](https://github.com/fartem/hash-checker-lite/workflows/Build/badge.svg)](https://github.com/fartem/hash-checker-lite/actions?query=workflow%3ABuild) -[![Codebeat](https://codebeat.co/badges/82ba496d-c878-46c3-a013-8274e4836fad)](https://codebeat.co/projects/github-com-fartem-hash-checker-lite-master) -[![Codecov](https://codecov.io/gh/fartem/hash-checker-lite/branch/master/graph/badge.svg)](https://codecov.io/gh/fartem/hash-checker-lite) +[![GitHubActions](https://github.com/hash-checker/hash-checker-lite/workflows/Build/badge.svg)](https://github.com/hash-checker/hash-checker-lite/actions?query=workflow%3ABuild) +[![Codacy](https://api.codacy.com/project/badge/Grade/cf1f8beb6a5340e49ca32425ab44462d)](https://app.codacy.com/gh/hash-checker/hash-checker-lite?utm_source=github.com&utm_medium=referral&utm_content=hash-checker/hash-checker-lite&utm_campaign=Badge_Grade) +[![Codecov](https://codecov.io/gh/hash-checker/hash-checker-lite/branch/master/graph/badge.svg)](https://codecov.io/gh/hash-checker/hash-checker-lite) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Hash%20Checker%20Lite-green.svg?style=flat)](https://android-arsenal.com/details/1/8155) ## About application -Fast and simple application for generating and comparison hashes from files or text. Lite version of [Hash Checker](https://github.com/fartem/hash-checker). +Fast and simple application for generating and comparison hashes from files or text. Lite version of [Hash Checker](https://github.com/hash-checker/hash-checker). ## Original app and lite version comparison -| Feature | [Hash Checker](https://github.com/fartem/hash-checker) | Hash Checker Lite | +| Feature | [Hash Checker](https://github.com/hash-checker/hash-checker) | Hash Checker Lite | | --- | --- | --- | | MD5 support | + | + | | SHA-1 support | + | + | @@ -77,7 +77,7 @@ You can help with translation on [OneSky](https://osbvnmv.oneskyapp.com/collabor ## Feedback -If you have any question or feature idea for app, you can open issue on [this page](https://github.com/fartem/hash-checker-lite/issues) or contact me by email jaman.smlnsk@gmail.com. +If you have any question or feature idea for app, you can open issue on [this page](https://github.com/hash-checker/hash-checker-lite/issues) or contact me by email jaman.smlnsk@gmail.com. ## How to build unsigned .apk from command line without IDE @@ -92,7 +92,7 @@ Go to `app` -> `build` -> `outputs` -> `apk` -> `debug` and find `hash-checker-l ## How to contribute -Read [Commit Convention](https://github.com/fartem/repository-rules/blob/master/commit-convention/COMMIT_CONVENTION.md). Make sure your build is green before you contribute your pull request. Then: +Read [Commit Convention](https://github.com/hash-checker/repository-rules/blob/master/commit-convention/COMMIT_CONVENTION.md). Make sure your build is green before you contribute your pull request. Then: ```shell $ ./gradlew clean diff --git a/app/build.gradle b/app/build.gradle index e1ec140..d360ca5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId 'com.smlnskgmail.jaman.hashcheckerlite' minSdkVersion 21 targetSdkVersion 29 - versionCode 4 - versionName '1.0.3' + versionCode 5 + versionName '1.0.4' vectorDrawables.useSupportLibrary = true testInstrumentationRunner 'com.smlnskgmail.jaman.hashcheckerlite.runner.AndroidJacocoTestRunner' @@ -82,6 +82,10 @@ dependencies { implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.preference:preference:1.1.1' + // Checkstyle + checkstyle 'com.github.fartem:checkstyle-checks-java:master' + checkstyle 'com.github.fartem:checkstyle-checks-android:master' + // Unit tests testImplementation 'junit:junit:4.13' diff --git a/app/checkstyle.gradle b/app/checkstyle.gradle index ccc6fc9..ba28fb4 100644 --- a/app/checkstyle.gradle +++ b/app/checkstyle.gradle @@ -1,7 +1,7 @@ apply plugin: 'checkstyle' checkstyle { - toolVersion '8.29' + toolVersion '8.38' ignoreFailures false showViolations true } @@ -9,9 +9,18 @@ checkstyle { task checkstyle(type: Checkstyle) { group 'verification' - config project.resources.text.fromUri( - 'https://raw.githubusercontent.com/fartem/repository-rules/master/rules/java/checkstyle/checkstyle.xml' - ) + def checkstyleConfigPath = "$rootDir/checkstyle.xml" + def checkstyleConfig = new File(checkstyleConfigPath) + new URL( + "https://raw.githubusercontent.com/fartem/repository-rules/master/rules/java/android/checkstyle.xml" + ).withInputStream { + i -> + checkstyleConfig.withOutputStream { + it << i + } + } + + configFile file(checkstyleConfigPath) source rootProject.file('app/src/main/java') classpath = files() diff --git a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/AndroidTestSuite.java b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/AndroidTestSuite.java index 2ea5f9c..3b22b54 100644 --- a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/AndroidTestSuite.java +++ b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/AndroidTestSuite.java @@ -31,4 +31,5 @@ ClipboardTest.class, ScreenRunnerTest.class }) -public class AndroidTestSuite {} +public class AndroidTestSuite { +} diff --git a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/calculator/jdk/zeroleads/MessageDigestZeroLeadsJdkHashCalculatorTest.java b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/calculator/jdk/zeroleads/MessageDigestZeroLeadsJdkHashCalculatorTest.java index b30cdaa..5692ae7 100644 --- a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/calculator/jdk/zeroleads/MessageDigestZeroLeadsJdkHashCalculatorTest.java +++ b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/calculator/jdk/zeroleads/MessageDigestZeroLeadsJdkHashCalculatorTest.java @@ -26,7 +26,8 @@ public String getTestingText() { } @Override - public void checkFile() {} + public void checkFile() { + } @Nullable @Override diff --git a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/components/BaseUITest.java b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/components/BaseUITest.java index b6ab8b0..93ad0aa 100644 --- a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/components/BaseUITest.java +++ b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/components/BaseUITest.java @@ -45,10 +45,10 @@ protected void textEquals(@NonNull String text, int textViewId) { @SuppressWarnings("SameParameterValue") protected void inRecyclerViewClickOnPosition(int recyclerId, int position) { onView(withId(recyclerId)).perform( - RecyclerViewActions.actionOnItemAtPosition( - position, - click() - ) + RecyclerViewActions.actionOnItemAtPosition( + position, + click() + ) ); } diff --git a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/screenrunner/ScreenRunnerTest.java b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/screenrunner/ScreenRunnerTest.java index fc2d523..0ace692 100644 --- a/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/screenrunner/ScreenRunnerTest.java +++ b/app/src/androidTest/java/com/smlnskgmail/jaman/hashcheckerlite/screenrunner/ScreenRunnerTest.java @@ -76,10 +76,10 @@ private void showFragmentInMenu( private void clickOnSettingsItem(int settingsTitleResId) { onView(withId(R.id.recycler_view)).perform( - RecyclerViewActions.actionOnItem( - hasDescendant(withText(settingsTitleResId)), - click() - ) + RecyclerViewActions.actionOnItem( + hasDescendant(withText(settingsTitleResId)), + click() + ) ); delayAndBack(); } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1f8729c..05b95fa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ - getItemsAdapter(); @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/ListItem.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/ListItem.java index 7285077..df5016e 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/ListItem.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/ListItem.java @@ -8,9 +8,11 @@ public interface ListItem { int DEFAULT_ICON_VALUE = -1; + @NonNull String getTitle(@NonNull Context context); int getPrimaryIconResId(); + int getAdditionalIconResId(); } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListAdapter.java index 1a17155..37151f3 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListAdapter.java @@ -36,12 +36,12 @@ public BaseListHolder onCreateViewHolder( int viewType ) { return getItemsHolder( + getBottomSheet().getContext(), LayoutInflater.from(parent.getContext()).inflate( R.layout.item_list, parent, false - ), - getBottomSheet().getContext() + ) ); } @@ -53,9 +53,10 @@ public void onBindViewHolder( holder.bind(items.get(position)); } + @NonNull protected abstract BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ); @NonNull diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListHolder.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListHolder.java index 7188b6b..45b8bf8 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListHolder.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/bottomsheets/lists/adapter/BaseListHolder.java @@ -24,8 +24,8 @@ public abstract class BaseListHolder extends RecyclerView.Vi private final Context context; protected BaseListHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { super(itemView); @@ -87,10 +87,12 @@ protected void callItemClick() { } + @NonNull protected ImageView getIvItemAdditionalIcon() { return ivItemAdditionalIcon; } + @NonNull protected Context getContext() { return context; } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/BaseDialog.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/BaseDialog.java index de27bdf..de7683b 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/BaseDialog.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/BaseDialog.java @@ -8,6 +8,7 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smlnskgmail.jaman.hashcheckerlite.R; @@ -18,7 +19,7 @@ protected BaseDialog(@NonNull Context context) { } @Override - protected void onCreate(Bundle savedInstanceState) { + protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(getLayoutResId()); diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/system/AppSnackbar.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/system/AppSnackbar.java index 27e6c35..e4940f3 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/system/AppSnackbar.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/components/dialogs/system/AppSnackbar.java @@ -81,10 +81,10 @@ public void show() { ) ); - TextView snackbarText = snackbar.getView().findViewById( + TextView tvSnackbarText = snackbar.getView().findViewById( R.id.snackbar_text ); - snackbarText.setTextColor( + tvSnackbarText.setTextColor( UIUtils.getCommonTextColor( context ) diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/Feedback.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/Feedback.java index 60d43b1..7ea14dd 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/Feedback.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/Feedback.java @@ -25,6 +25,7 @@ public Feedback( this.model = model; } + @NonNull public String getAppInfo() { return String.format( "%s (%s)", @@ -33,13 +34,14 @@ public String getAppInfo() { ); } + @NonNull public String getConfiguredMessage(@NonNull String feedback) { return String.format( "%s" + - "\n\n\n%s (%s)" + - "\nAndroid %s" + - "\n%s" + - "\n%s", + "\n\n\n%s (%s)" + + "\nAndroid %s" + + "\n%s" + + "\n%s", feedback, appVersionName, appVersionCode, diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/FeedbackFragment.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/FeedbackFragment.java index d616263..9648396 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/FeedbackFragment.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/feedback/FeedbackFragment.java @@ -25,7 +25,7 @@ public class FeedbackFragment extends BaseFragment { private final String manufacturer = Build.MANUFACTURER; private final String model = Build.MODEL; - private EditText feedbackEdit; + private EditText etFeedbackText; private final Feedback feedback = new Feedback( BuildConfig.VERSION_NAME, @@ -41,7 +41,7 @@ public void onViewCreated( @Nullable Bundle savedInstanceState ) { super.onViewCreated(view, savedInstanceState); - feedbackEdit = view.findViewById(R.id.et_feedback_message); + etFeedbackText = view.findViewById(R.id.et_feedback_message); applyInfoToTextView( view, @@ -81,7 +81,7 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) { } else if (item.getItemId() == R.id.menu_action_send_feedback) { sendEmail( feedback.getConfiguredMessage( - feedbackEdit.getText().toString() + etFeedbackText.getText().toString() ), getString(R.string.common_email) ); @@ -98,7 +98,7 @@ private void sendEmail( ); emailIntent.putExtra( Intent.EXTRA_EMAIL, - new String[] { email } + new String[]{email} ); String subject = getString(R.string.common_app_name); @@ -120,7 +120,7 @@ private void sendEmail( ) ); emailIntent.setSelector( - selectorIntent + selectorIntent ); String chooseMessage = String.format( diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculator.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculator.java index 9c350b7..87d3331 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculator.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculator.java @@ -11,8 +11,10 @@ public interface HashCalculator { void setHashType(@NonNull HashType hashType) throws NoSuchAlgorithmException; + @NonNull String fromString(@NonNull String text); + @NonNull String fromFile( @NonNull Context context, @NonNull Uri path diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculatorTask.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculatorTask.java index cca8b35..9cedb50 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculatorTask.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashCalculatorTask.java @@ -25,29 +25,29 @@ public class HashCalculatorTask extends AsyncTask { private final boolean isText; public HashCalculatorTask( - @NonNull HashType hashType, @NonNull Context context, + @NonNull HashType hashType, @NonNull Uri fileUri, @NonNull HashCalculatorTaskTarget completeListener ) { - this(hashType, context, completeListener, false); + this(context, hashType, completeListener, false); this.fileUri = fileUri; } public HashCalculatorTask( - @NonNull HashType hashType, @NonNull Context context, + @NonNull HashType hashType, @NonNull String textValue, @NonNull HashCalculatorTaskTarget completeListener ) { - this(hashType, context, completeListener, true); + this(context, hashType, completeListener, true); this.textValue = textValue; } private HashCalculatorTask( - @NonNull HashType hashType, @NonNull Context context, + @NonNull HashType hashType, @NonNull HashCalculatorTaskTarget completeListener, boolean isText ) { @@ -57,6 +57,7 @@ private HashCalculatorTask( this.isText = isText; } + @SuppressWarnings("MethodParametersAnnotationCheck") @Override protected String doInBackground(Void... voids) { try { @@ -71,6 +72,7 @@ protected String doInBackground(Void... voids) { } } + @SuppressWarnings("MethodParametersAnnotationCheck") @Override protected void onPostExecute(String result) { completeListener.hashCalculationComplete(result); diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashType.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashType.java index 306b6bf..15b3edd 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashType.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/HashType.java @@ -23,6 +23,7 @@ public enum HashType implements ListItem { this.hashName = hashName; } + @NonNull public String getHashName() { return hashName; } @@ -34,7 +35,7 @@ public String getTypeAsString() { @NonNull public static HashType getHashTypeFromString(@NonNull String string) { - for (HashType hashType: values()) { + for (HashType hashType : values()) { if (hashType.hashName.equals(string)) { return hashType; } @@ -42,6 +43,7 @@ public static HashType getHashTypeFromString(@NonNull String string) { return MD5; } + @NonNull @Override public String getTitle(@NonNull Context context) { return hashName; diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculator.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculator.java index f257894..b958cf9 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculator.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculator.java @@ -4,7 +4,6 @@ import android.net.Uri; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.HashCalculator; import com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.HashType; @@ -27,7 +26,7 @@ public void setHashType( = JdkHashCalculatorDigest.instanceFor(hashType); } - @Nullable + @NonNull @Override public String fromString(@NonNull String text) { byte[] bytes = text.getBytes(StandardCharsets.UTF_8); @@ -35,7 +34,7 @@ public String fromString(@NonNull String text) { return jdkHashCalculatorDigest.result(); } - @Nullable + @NonNull @Override public String fromFile( @NonNull Context context, diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculatorDigest.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculatorDigest.java index ca6f635..9f2c110 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculatorDigest.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashCalculatorDigest.java @@ -19,6 +19,7 @@ private JdkHashCalculatorDigest() { } + @NonNull public static JdkHashCalculatorDigest instanceFor( @NonNull HashType hashType ) throws NoSuchAlgorithmException { @@ -41,7 +42,7 @@ private void setHashType( } } - public void update(byte[] input) { + public void update(@NonNull byte[] input) { if (!useCRC32) { messageDigest.reset(); messageDigest.update(input); @@ -52,7 +53,7 @@ public void update(byte[] input) { } public void update( - byte[] input, + @NonNull byte[] input, int length ) { if (!useCRC32) { @@ -69,7 +70,8 @@ public void update( ); } } - + + @NonNull public String result() { return !useCRC32 ? JdkHashTools.getStringFromByteArray(messageDigest.digest()) diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashTools.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashTools.java index 3c2e656..88e1513 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashTools.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/jdk/JdkHashTools.java @@ -1,10 +1,13 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.jdk; +import androidx.annotation.NonNull; + public class JdkHashTools { private static final char[] HEX_DIGITS = "0123456789ABCDEF".toCharArray(); - public static String getStringFromByteArray(byte[] data) { + @NonNull + public static String getStringFromByteArray(@NonNull byte[] data) { char[] chars = new char[data.length * 2]; for (int i = 0; i < data.length; i++) { chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf]; @@ -13,6 +16,7 @@ public static String getStringFromByteArray(byte[] data) { return new String(chars).toLowerCase(); } + @NonNull public static String getStringFromLong(long data) { return String.format( "%08x", @@ -20,4 +24,4 @@ public static String getStringFromLong(long data) { ); } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/HashCalculatorFragment.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/HashCalculatorFragment.java index d8cc94c..d8b4dab 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/HashCalculatorFragment.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/HashCalculatorFragment.java @@ -157,15 +157,15 @@ private void generateHash() { progressDialog.show(); if (isTextSelected) { new HashCalculatorTask( - hashType, context, + hashType, tvSelectedObjectName.getText().toString(), hashCalculatorTaskTarget ).execute(); } else { new HashCalculatorTask( - hashType, context, + hashType, fileUri, hashCalculatorTaskTarget ).execute(); @@ -279,6 +279,7 @@ private void validateSelectedFile(@Nullable Uri uri) { } } + @NonNull private String fileNameFromUri(@NonNull Uri uri) { String scheme = uri.getScheme(); if (scheme != null && scheme.equals("content")) { @@ -462,6 +463,8 @@ public void onViewCreated( } } + @SuppressWarnings("MethodParametersAnnotationCheck") + @NonNull private TextWatcher watcherForInputField( @NonNull ImageView copyButton, @NonNull ImageView clearButton @@ -610,7 +613,7 @@ private void checkFileManagerChanged() { public void onActivityResult( int requestCode, int resultCode, - Intent data + @Nullable Intent data ) { if (data != null) { if (requestCode == FILE_SELECT) { diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/input/TextInputDialog.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/input/TextInputDialog.java index 5e4349f..bc9d057 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/input/TextInputDialog.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/input/TextInputDialog.java @@ -49,6 +49,7 @@ public void initializeDialog() { etTextValue.setSelection(textValue.length()); } } + @Override public void setupDialogStyle() { super.setupDialogStyle(); diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/Action.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/Action.java index a268e54..e5daaa9 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/Action.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/Action.java @@ -46,6 +46,7 @@ public enum Action implements ListItem { this.userActionType = userActionType; } + @NonNull @Override public String getTitle(@NonNull Context context) { return context.getString(titleResId); @@ -61,6 +62,7 @@ public int getAdditionalIconResId() { return -1; } + @NonNull public UserActionType getUserActionType() { return userActionType; } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsBottomSheet.java index 74331c2..e68feb8 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsBottomSheet.java @@ -1,5 +1,6 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.ui.lists.actions.ui; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.smlnskgmail.jaman.hashcheckerlite.components.BaseFragment; @@ -12,6 +13,7 @@ abstract class ActionsBottomSheet extends BaseListBottomSheet { + @NonNull @Override protected BaseListAdapter getItemsAdapter() { Fragment parentFragment = getFragmentManager().findFragmentByTag( @@ -24,6 +26,7 @@ protected BaseListAdapter getItemsAdapter() { ); } + @NonNull abstract List getActions(); } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsListAdapter.java index ff65eb9..4a644fa 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/ActionsListAdapter.java @@ -26,14 +26,15 @@ public class ActionsListAdapter extends BaseListAdapter { this.userActionTarget = userActionTarget; } + @NonNull @Override protected BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ) { return new ActionHolder( - view, - themeContext + themeContext, + view ); } @@ -42,10 +43,10 @@ private class ActionHolder extends BaseListHolder { private Action action; ActionHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { - super(itemView, themeContext); + super(themeContext, itemView); } @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/SourceSelectActionsBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/SourceSelectActionsBottomSheet.java index e32f11d..07d71ae 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/SourceSelectActionsBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/actions/ui/SourceSelectActionsBottomSheet.java @@ -1,5 +1,7 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.ui.lists.actions.ui; +import androidx.annotation.NonNull; + import com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.ui.lists.actions.Action; import java.util.Arrays; @@ -7,6 +9,7 @@ public class SourceSelectActionsBottomSheet extends ActionsBottomSheet { + @NonNull @Override List getActions() { return Arrays.asList( diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/GenerateToBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/GenerateToBottomSheet.java index 238d5fe..10c5f05 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/GenerateToBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/GenerateToBottomSheet.java @@ -1,5 +1,6 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.hashcalculator.ui.lists.hashtypes; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.smlnskgmail.jaman.hashcheckerlite.components.BaseFragment; @@ -11,6 +12,7 @@ public class GenerateToBottomSheet extends BaseListBottomSheet { + @NonNull @Override public BaseListAdapter getItemsAdapter() { Fragment fragment = getFragmentManager().findFragmentByTag( diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/HashesListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/HashesListAdapter.java index 3e396aa..0d2ac52 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/HashesListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/hashcalculator/ui/lists/hashtypes/HashesListAdapter.java @@ -31,14 +31,15 @@ public class HashesListAdapter extends BaseListAdapter { ); } + @NonNull @Override public BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ) { return new HashesListHolder( - view, - themeContext + themeContext, + view ); } @@ -47,10 +48,10 @@ private class HashesListHolder extends BaseListHolder { private HashType hashTypeAtPosition; HashesListHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { - super(itemView, themeContext); + super(themeContext, itemView); } @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/SettingsHelper.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/SettingsHelper.java index f79afe9..3a96f12 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/SettingsHelper.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/SettingsHelper.java @@ -27,6 +27,7 @@ public static void saveHashTypeAsLast( ); } + @NonNull public static HashType getLastHashType( @NonNull Context context ) { @@ -87,11 +88,12 @@ public static boolean isUsingMultilineHashFields( ); } + @NonNull public static Theme getSelectedTheme( @NonNull Context context ) { String selectedTheme = SettingsHelper.getTheme(context); - for (Theme theme: Theme.values()) { + for (Theme theme : Theme.values()) { if (theme.toString().equals(selectedTheme)) { return theme; } @@ -102,6 +104,7 @@ public static Theme getSelectedTheme( /* * Saved for old versions compatibility (where themes count > 2) */ + @NonNull private static String getTheme( @NonNull Context context ) { @@ -129,6 +132,7 @@ private static boolean validateAppTheme( return false; } + @NonNull private static Theme getThemeAnalogue( @NonNull String theme ) { @@ -172,7 +176,7 @@ public static void saveShortcutsStatus( public static void saveTheme( @NonNull Context context, - Theme theme + @NonNull Theme theme ) { saveStringPreference( context, @@ -242,6 +246,7 @@ private static void saveStringPreference( .apply(); } + @NonNull private static String getStringPreference( @NonNull Context context, @NonNull String key, diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/SettingsFragment.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/SettingsFragment.java index a633108..828adac 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/SettingsFragment.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/SettingsFragment.java @@ -38,6 +38,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements AppBac private Context context; @SuppressLint("ResourceType") + @SuppressWarnings("MethodParametersAnnotationCheck") @Override public void onCreatePreferences( Bundle savedInstanceState, @@ -70,25 +71,25 @@ private void initializeActionBar() { private void initializeLanguageSettings() { findPreference(getString(R.string.key_language)) .setOnPreferenceClickListener(preference -> { - LanguagesBottomSheet languagesBottomSheet = new LanguagesBottomSheet(); - languagesBottomSheet.show( - fragmentManager, - languagesBottomSheet.getClass().getCanonicalName() - ); - return false; - }); + LanguagesBottomSheet languagesBottomSheet = new LanguagesBottomSheet(); + languagesBottomSheet.show( + fragmentManager, + languagesBottomSheet.getClass().getCanonicalName() + ); + return false; + }); } private void initializeThemesSettings() { findPreference(getString(R.string.key_theme)) .setOnPreferenceClickListener(preference -> { - ThemesBottomSheet themesBottomSheet = new ThemesBottomSheet(); - themesBottomSheet.show( - fragmentManager, - themesBottomSheet.getClass().getCanonicalName() - ); - return false; - }); + ThemesBottomSheet themesBottomSheet = new ThemesBottomSheet(); + themesBottomSheet.show( + fragmentManager, + themesBottomSheet.getClass().getCanonicalName() + ); + return false; + }); } private void initializePrivacyPolicy() { @@ -100,8 +101,8 @@ private void initializePrivacyPolicy() { fragmentManager, privacyPolicyWebLinksBottomSheet.getClass().getCanonicalName() ); - return false; - }); + return false; + }); } private void showSnackbar(@NonNull String message) { @@ -116,33 +117,33 @@ private void showSnackbar(@NonNull String message) { private void initializeAuthorLinks() { findPreference(getString(R.string.key_author)) .setOnPreferenceClickListener(preference -> { - AuthorWebLinksBottomSheet authorWebLinksBottomSheet - = new AuthorWebLinksBottomSheet(); - authorWebLinksBottomSheet.show( - fragmentManager, - authorWebLinksBottomSheet.getClass().getCanonicalName() - ); - return false; - }); + AuthorWebLinksBottomSheet authorWebLinksBottomSheet + = new AuthorWebLinksBottomSheet(); + authorWebLinksBottomSheet.show( + fragmentManager, + authorWebLinksBottomSheet.getClass().getCanonicalName() + ); + return false; + }); } private void initializeHelpWithTranslationButton() { findPreference(getString(R.string.key_help_with_translation)) .setOnPreferenceClickListener(preference -> { - WebUtils.openWebLink( - context, - context.getString(R.string.web_link_help_with_translation) - ); - return false; - }); + WebUtils.openWebLink( + context, + context.getString(R.string.web_link_help_with_translation) + ); + return false; + }); } private void initializeRateButton() { findPreference(getString(R.string.key_rate_app)) .setOnPreferenceClickListener(preference -> { - openGooglePlay(); - return false; - }); + openGooglePlay(); + return false; + }); } private void openGooglePlay() { @@ -213,14 +214,14 @@ public void onResume() { @Override public void onCreateOptionsMenu( - Menu menu, + @NonNull Menu menu, @NonNull MenuInflater inflater ) { menu.clear(); } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == android.R.id.home) { getActivity().onBackPressed(); return true; diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/Language.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/Language.java index 7ec8589..5cec9cc 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/Language.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/Language.java @@ -41,6 +41,7 @@ public String code() { return code; } + @NonNull @Override public String getTitle(@NonNull Context context) { return originalName; diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesBottomSheet.java index d504495..fa27d38 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesBottomSheet.java @@ -1,5 +1,7 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.settings.ui.lists.languages; +import androidx.annotation.NonNull; + import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.BaseListBottomSheet; import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.adapter.BaseListAdapter; import com.smlnskgmail.jaman.hashcheckerlite.logic.settings.SettingsHelper; @@ -8,6 +10,7 @@ public class LanguagesBottomSheet extends BaseListBottomSheet { + @NonNull @Override protected BaseListAdapter getItemsAdapter() { return new LanguagesListAdapter( diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesListAdapter.java index 874f740..b1bdba6 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/languages/LanguagesListAdapter.java @@ -28,14 +28,15 @@ public class LanguagesListAdapter extends BaseListAdapter { this.selectedLanguage = selectedLanguage; } + @NonNull @Override protected BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ) { return new LanguagesListHolder( - view, - themeContext + themeContext, + view ); } @@ -44,10 +45,10 @@ private class LanguagesListHolder extends BaseListHolder { private Language languageAtPosition; LanguagesListHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { - super(itemView, themeContext); + super(themeContext, itemView); } @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/Theme.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/Theme.java index 7779433..6176fcf 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/Theme.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/Theme.java @@ -26,6 +26,7 @@ public enum Theme implements ListItem { this.themeResId = themeResId; } + @NonNull @Override public String getTitle(@NonNull Context context) { return context.getString(titleResId); diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesBottomSheet.java index 07f03d2..4eea7a3 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesBottomSheet.java @@ -1,5 +1,7 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.settings.ui.lists.themes; +import androidx.annotation.NonNull; + import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.BaseListBottomSheet; import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.adapter.BaseListAdapter; import com.smlnskgmail.jaman.hashcheckerlite.logic.settings.SettingsHelper; @@ -8,6 +10,7 @@ public class ThemesBottomSheet extends BaseListBottomSheet { + @NonNull @Override public BaseListAdapter getItemsAdapter() { return new ThemesListAdapter( diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesListAdapter.java index a29f4f6..9011335 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/themes/ThemesListAdapter.java @@ -28,14 +28,15 @@ public class ThemesListAdapter extends BaseListAdapter { this.selectedTheme = selectedTheme; } + @NonNull @Override public BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ) { return new ThemesListHolder( - view, - themeContext + themeContext, + view ); } @@ -44,10 +45,10 @@ class ThemesListHolder extends BaseListHolder { private Theme themeAtPosition; ThemesListHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { - super(itemView, themeContext); + super(themeContext, itemView); } @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/AuthorWebLinksBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/AuthorWebLinksBottomSheet.java index 411c340..2f2a171 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/AuthorWebLinksBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/AuthorWebLinksBottomSheet.java @@ -5,6 +5,7 @@ public class AuthorWebLinksBottomSheet extends WebLinksBottomSheet { @Override + @androidx.annotation.NonNull List getLinks() { return WebLink.getAuthorLinks(); } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/PrivacyPolicyWebLinksBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/PrivacyPolicyWebLinksBottomSheet.java index 54128da..601608d 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/PrivacyPolicyWebLinksBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/PrivacyPolicyWebLinksBottomSheet.java @@ -6,6 +6,7 @@ public class PrivacyPolicyWebLinksBottomSheet extends WebLinksBottomSheet { @Override + @androidx.annotation.NonNull List getLinks() { return Collections.singletonList( WebLink.PRIVACY_POLICY diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLink.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLink.java index d72cb46..71d0436 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLink.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLink.java @@ -46,6 +46,7 @@ public int getLinkResId() { return linkResId; } + @NonNull @Override public String getTitle(@NonNull Context context) { return context.getString(titleResId); @@ -61,6 +62,7 @@ public int getAdditionalIconResId() { return DEFAULT_ICON_VALUE; } + @NonNull public static List getAuthorLinks() { return Arrays.asList( SOURCE_CODE, diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksBottomSheet.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksBottomSheet.java index 1d85966..722fde0 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksBottomSheet.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksBottomSheet.java @@ -1,5 +1,7 @@ package com.smlnskgmail.jaman.hashcheckerlite.logic.settings.ui.lists.weblinks; +import androidx.annotation.NonNull; + import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.BaseListBottomSheet; import com.smlnskgmail.jaman.hashcheckerlite.components.bottomsheets.lists.adapter.BaseListAdapter; @@ -7,6 +9,7 @@ abstract class WebLinksBottomSheet extends BaseListBottomSheet { + @NonNull @Override public BaseListAdapter getItemsAdapter() { return new WebLinksListAdapter( @@ -15,6 +18,7 @@ public BaseListAdapter getItemsAdapter() { ); } + @NonNull abstract List getLinks(); } diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksListAdapter.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksListAdapter.java index be0b669..20e2274 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksListAdapter.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/logic/settings/ui/lists/weblinks/WebLinksListAdapter.java @@ -21,14 +21,15 @@ public class WebLinksListAdapter extends BaseListAdapter { super(items, bottomSheet); } + @NonNull @Override public BaseListHolder getItemsHolder( - @NonNull View view, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View view ) { return new WebLinksListHolder( - view, - themeContext + themeContext, + view ); } @@ -37,10 +38,10 @@ private class WebLinksListHolder extends BaseListHolder { private WebLink webLink; WebLinksListHolder( - @NonNull View itemView, - @NonNull Context themeContext + @NonNull Context themeContext, + @NonNull View itemView ) { - super(itemView, themeContext); + super(themeContext, itemView); } @Override diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/LangUtils.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/LangUtils.java index 5bf2e1f..37f4db5 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/LangUtils.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/LangUtils.java @@ -14,6 +14,10 @@ public class LangUtils { + private LangUtils() { + + } + public static void setLocale( @NonNull Context context, @NonNull Language language diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/UIUtils.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/UIUtils.java index 0c82171..d207c1f 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/UIUtils.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/UIUtils.java @@ -19,6 +19,10 @@ public class UIUtils { + private UIUtils() { + + } + public static void removeFragment( @NonNull FragmentManager fragmentManager, @NonNull Fragment fragment diff --git a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/WebUtils.java b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/WebUtils.java index b0dcb56..732a5bb 100644 --- a/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/WebUtils.java +++ b/app/src/main/java/com/smlnskgmail/jaman/hashcheckerlite/utils/WebUtils.java @@ -11,6 +11,10 @@ public class WebUtils { + private WebUtils() { + + } + public static void openWebLink( @NonNull Context context, @NonNull String link diff --git a/app/src/main/res/drawable-v26/ic_shortcut_file.xml b/app/src/main/res/drawable-v26/ic_shortcut_file.xml index a4b349d..a62f10a 100644 --- a/app/src/main/res/drawable-v26/ic_shortcut_file.xml +++ b/app/src/main/res/drawable-v26/ic_shortcut_file.xml @@ -1,11 +1,10 @@ - + - + tools:targetApi="lollipop"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v26/ic_shortcut_from_file.xml b/app/src/main/res/drawable-v26/ic_shortcut_from_file.xml index 6fb8a54..8fdb2a2 100644 --- a/app/src/main/res/drawable-v26/ic_shortcut_from_file.xml +++ b/app/src/main/res/drawable-v26/ic_shortcut_from_file.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable-v26/ic_shortcut_from_text.xml b/app/src/main/res/drawable-v26/ic_shortcut_from_text.xml index 2fd7157..d05ce56 100644 --- a/app/src/main/res/drawable-v26/ic_shortcut_from_text.xml +++ b/app/src/main/res/drawable-v26/ic_shortcut_from_text.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable-v26/ic_shortcut_text.xml b/app/src/main/res/drawable-v26/ic_shortcut_text.xml index 1e07756..0c23f07 100644 --- a/app/src/main/res/drawable-v26/ic_shortcut_text.xml +++ b/app/src/main/res/drawable-v26/ic_shortcut_text.xml @@ -1,11 +1,10 @@ - + - + tools:targetApi="lollipop"> \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_bottom_sheet_rounded_corners.xml b/app/src/main/res/drawable/bg_bottom_sheet_rounded_corners.xml index 29c4e0c..90f504e 100644 --- a/app/src/main/res/drawable/bg_bottom_sheet_rounded_corners.xml +++ b/app/src/main/res/drawable/bg_bottom_sheet_rounded_corners.xml @@ -2,8 +2,7 @@ - + - + diff --git a/app/src/main/res/drawable/ic_arrow_back.xml b/app/src/main/res/drawable/ic_arrow_back.xml index 7502d17..5bd8f2d 100644 --- a/app/src/main/res/drawable/ic_arrow_back.xml +++ b/app/src/main/res/drawable/ic_arrow_back.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml index 1ecdde0..43cbf7d 100644 --- a/app/src/main/res/drawable/ic_close.xml +++ b/app/src/main/res/drawable/ic_close.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_compare.xml b/app/src/main/res/drawable/ic_compare.xml index 707175f..06f08d9 100644 --- a/app/src/main/res/drawable/ic_compare.xml +++ b/app/src/main/res/drawable/ic_compare.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_copy.xml b/app/src/main/res/drawable/ic_copy.xml index 751fb2b..97768b8 100644 --- a/app/src/main/res/drawable/ic_copy.xml +++ b/app/src/main/res/drawable/ic_copy.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_done.xml b/app/src/main/res/drawable/ic_done.xml index 99595d3..b03b95e 100644 --- a/app/src/main/res/drawable/ic_done.xml +++ b/app/src/main/res/drawable/ic_done.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_email.xml b/app/src/main/res/drawable/ic_email.xml index 1351310..130c3de 100644 --- a/app/src/main/res/drawable/ic_email.xml +++ b/app/src/main/res/drawable/ic_email.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_file.xml b/app/src/main/res/drawable/ic_file.xml index 1668090..b4380a0 100644 --- a/app/src/main/res/drawable/ic_file.xml +++ b/app/src/main/res/drawable/ic_file.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_from_text.xml b/app/src/main/res/drawable/ic_from_text.xml index 0fdb8b0..ca842c8 100644 --- a/app/src/main/res/drawable/ic_from_text.xml +++ b/app/src/main/res/drawable/ic_from_text.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_generate.xml b/app/src/main/res/drawable/ic_generate.xml index b9dc2b2..61cb0ea 100644 --- a/app/src/main/res/drawable/ic_generate.xml +++ b/app/src/main/res/drawable/ic_generate.xml @@ -4,8 +4,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml index 9b1dcb7..b5c31fc 100644 --- a/app/src/main/res/drawable/ic_github.xml +++ b/app/src/main/res/drawable/ic_github.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_google_play.xml b/app/src/main/res/drawable/ic_google_play.xml index 40d594a..a3420ac 100644 --- a/app/src/main/res/drawable/ic_google_play.xml +++ b/app/src/main/res/drawable/ic_google_play.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index ca5a090..d5db128 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -3,15 +3,17 @@ android:height="108dp" android:viewportWidth="108" android:viewportHeight="108"> - - - - - + + + + + diff --git a/app/src/main/res/drawable/ic_little_arrow_down.xml b/app/src/main/res/drawable/ic_little_arrow_down.xml index 2462908..069c162 100644 --- a/app/src/main/res/drawable/ic_little_arrow_down.xml +++ b/app/src/main/res/drawable/ic_little_arrow_down.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_send.xml b/app/src/main/res/drawable/ic_send.xml index f52b754..8a10dc8 100644 --- a/app/src/main/res/drawable/ic_send.xml +++ b/app/src/main/res/drawable/ic_send.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_author.xml b/app/src/main/res/drawable/ic_settings_author.xml index 8004d49..678177f 100644 --- a/app/src/main/res/drawable/ic_settings_author.xml +++ b/app/src/main/res/drawable/ic_settings_author.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_help_with_translation.xml b/app/src/main/res/drawable/ic_settings_help_with_translation.xml index 1565386..8b96ce4 100644 --- a/app/src/main/res/drawable/ic_settings_help_with_translation.xml +++ b/app/src/main/res/drawable/ic_settings_help_with_translation.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_language.xml b/app/src/main/res/drawable/ic_settings_language.xml index e6210d7..d417ae6 100644 --- a/app/src/main/res/drawable/ic_settings_language.xml +++ b/app/src/main/res/drawable/ic_settings_language.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_multiline.xml b/app/src/main/res/drawable/ic_settings_multiline.xml index 9ccb205..0fa5390 100644 --- a/app/src/main/res/drawable/ic_settings_multiline.xml +++ b/app/src/main/res/drawable/ic_settings_multiline.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_privacy_policy.xml b/app/src/main/res/drawable/ic_settings_privacy_policy.xml index a6ff6b1..d641b77 100644 --- a/app/src/main/res/drawable/ic_settings_privacy_policy.xml +++ b/app/src/main/res/drawable/ic_settings_privacy_policy.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_rate_app.xml b/app/src/main/res/drawable/ic_settings_rate_app.xml index 2bb2aa8..47446e1 100644 --- a/app/src/main/res/drawable/ic_settings_rate_app.xml +++ b/app/src/main/res/drawable/ic_settings_rate_app.xml @@ -4,6 +4,7 @@ android:viewportHeight="18" android:viewportWidth="18"> - + diff --git a/app/src/main/res/drawable/ic_settings_theme.xml b/app/src/main/res/drawable/ic_settings_theme.xml index 2cef329..9ac2481 100644 --- a/app/src/main/res/drawable/ic_settings_theme.xml +++ b/app/src/main/res/drawable/ic_settings_theme.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_upper_case.xml b/app/src/main/res/drawable/ic_settings_upper_case.xml index 1d43a87..e2ff3cd 100644 --- a/app/src/main/res/drawable/ic_settings_upper_case.xml +++ b/app/src/main/res/drawable/ic_settings_upper_case.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_settings_version.xml b/app/src/main/res/drawable/ic_settings_version.xml index 0788dbb..997bac0 100644 --- a/app/src/main/res/drawable/ic_settings_version.xml +++ b/app/src/main/res/drawable/ic_settings_version.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/layout/bottom_sheet_list_items.xml b/app/src/main/res/layout/bottom_sheet_list_items.xml index e9854ea..0a93c87 100644 --- a/app/src/main/res/layout/bottom_sheet_list_items.xml +++ b/app/src/main/res/layout/bottom_sheet_list_items.xml @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 54469e8..3479839 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 54469e8..3479839 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/values/animations.xml b/app/src/main/res/values/animations.xml index 2d10f73..db5b2cb 100644 --- a/app/src/main/res/values/animations.xml +++ b/app/src/main/res/values/animations.xml @@ -1,5 +1,6 @@ +