diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/formentry/FormNavigationButtonTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/formentry/FormNavigationButtonTest.java
index 2bea08c73..67734b191 100644
--- a/collect_app/src/androidTest/java/org/odk/collect/android/formentry/FormNavigationButtonTest.java
+++ b/collect_app/src/androidTest/java/org/odk/collect/android/formentry/FormNavigationButtonTest.java
@@ -59,7 +59,7 @@
* separately check the option to navigate with either swipes or buttons:
*
*
- * String navigation = (String) GeneralSharedPreferences.getInstance().get(GeneralKeys.KEY_NAVIGATION);
+ * String navigation = (String) GeneralSharedPreferences.newInstance().get(GeneralKeys.KEY_NAVIGATION);
* showNavigationButtons = navigation.contains(GeneralKeys.NAVIGATION_BUTTONS);
*
*/
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/SettingsActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/common/SettingsActivity.java
index 7b2403003..acb735fbd 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/common/SettingsActivity.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/common/SettingsActivity.java
@@ -17,6 +17,7 @@
import org.fieldsight.naxa.network.ServiceGenerator;
import org.odk.collect.android.utilities.ToastUtils;
+import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -93,7 +94,7 @@ public void restoreDefault() {
private boolean isValidUrl(String url) {
Pattern p = Patterns.WEB_URL;
- Matcher m = p.matcher(url.toLowerCase());
+ Matcher m = p.matcher(url.toLowerCase(Locale.getDefault()));
return m.matches();
}
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/common/downloader/utils/LongSparseArray.java b/collect_app/src/main/java/org/fieldsight/naxa/common/downloader/utils/LongSparseArray.java
index c6bfd597d..5811978f2 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/common/downloader/utils/LongSparseArray.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/common/downloader/utils/LongSparseArray.java
@@ -75,15 +75,13 @@ public LongSparseArray(int initialCapacity) {
@Override
@SuppressWarnings("unchecked")
- public LongSparseArray clone() {
+ public LongSparseArray clone() throws CloneNotSupportedException {
LongSparseArray clone = null;
- try {
- clone = (LongSparseArray) super.clone();
- clone.mKeys = mKeys.clone();
- clone.mValues = mValues.clone();
- } catch (CloneNotSupportedException cnse) {
- /* ignore */
- }
+
+ clone = (LongSparseArray) super.clone();
+ clone.mKeys = mKeys.clone();
+ clone.mValues = mValues.clone();
+
return clone;
}
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/contact/ContactDetailsBottomSheetFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/contact/ContactDetailsBottomSheetFragment.java
index 792f5cf2f..c54e1a942 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/contact/ContactDetailsBottomSheetFragment.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/contact/ContactDetailsBottomSheetFragment.java
@@ -26,7 +26,7 @@ public class ContactDetailsBottomSheetFragment extends BottomSheetDialogFragment
private ImageView profilePicture;
private TextView fullname, username, role, address, gender, email, skype, twitter, tango, hike, qq, googletalk, viber, whatsapp, wechat;
- public static ContactDetailsBottomSheetFragment getInstance() {
+ public static ContactDetailsBottomSheetFragment newInstance() {
return new ContactDetailsBottomSheetFragment();
}
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/contact/ProjectContactsFragment.java b/collect_app/src/main/java/org/fieldsight/naxa/contact/ProjectContactsFragment.java
index fa33d0163..7fd102f50 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/contact/ProjectContactsFragment.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/contact/ProjectContactsFragment.java
@@ -42,7 +42,7 @@ public class ProjectContactsFragment extends Fragment implements ContactAdapter.
@BindView(R.id.recycler_view)
RecyclerView recyclerView;
- public static ProjectContactsFragment getInstance() {
+ public static ProjectContactsFragment newInstance() {
return new ProjectContactsFragment();
}
@@ -96,7 +96,7 @@ public void onClick(View v) {
@Override
public void onContactClicked(FieldSightContactModel contactModel) {
- ContactDetailsBottomSheetFragment contactDetailsBottomSheetFragmentDialog = ContactDetailsBottomSheetFragment.getInstance();
+ ContactDetailsBottomSheetFragment contactDetailsBottomSheetFragmentDialog = ContactDetailsBottomSheetFragment.newInstance();
contactDetailsBottomSheetFragmentDialog.setContact(contactModel);
contactDetailsBottomSheetFragmentDialog.show(requireFragmentManager(), "Contact Bottom Sheet");
}
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialActivity.java b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialActivity.java
index ea64a90fb..820a9239b 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialActivity.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialActivity.java
@@ -29,7 +29,6 @@
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
-import java.util.Vector;
import butterknife.BindView;
import butterknife.ButterKnife;
diff --git a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialRecyclerViewAdapter.java b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialRecyclerViewAdapter.java
index 7e9ab59e6..1491ec0a3 100644
--- a/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialRecyclerViewAdapter.java
+++ b/collect_app/src/main/java/org/fieldsight/naxa/educational/EducationalMaterialRecyclerViewAdapter.java
@@ -7,7 +7,6 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -17,12 +16,8 @@
import androidx.core.content.FileProvider;
import androidx.recyclerview.widget.RecyclerView;
-import com.bumptech.glide.load.engine.DiskCacheStrategy;
-
import org.fieldsight.collect.android.BuildConfig;
import org.fieldsight.collect.android.R;
-import org.fieldsight.naxa.common.Connectivity;
-import org.fieldsight.naxa.common.GlideApp;
import java.io.File;
import java.util.List;
@@ -35,8 +30,6 @@
public class EducationalMaterialRecyclerViewAdapter extends RecyclerView.Adapter {
- private static final String TAG = "Education Material";
- // The items to display in your RecyclerView
private final List