aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-23 20:56:07 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-06-23 20:56:07 -0700
commit2782d5b9da67ac759ca35e02a7945358316f8d69 (patch)
tree3283179af7ebbaee13ec4336c0bfbaae8f6ead28
parentad8ec0f7b4d9a0898c353045f3b033501d24064b (diff)
downloadetbsa-traccar-manager-android-2782d5b9da67ac759ca35e02a7945358316f8d69.tar.gz
etbsa-traccar-manager-android-2782d5b9da67ac759ca35e02a7945358316f8d69.tar.bz2
etbsa-traccar-manager-android-2782d5b9da67ac759ca35e02a7945358316f8d69.zip
Minor improvements
-rw-r--r--app/src/main/java/org/traccar/manager/MainFragment.java17
-rw-r--r--app/src/main/java/org/traccar/manager/StartFragment.java4
2 files changed, 8 insertions, 13 deletions
diff --git a/app/src/main/java/org/traccar/manager/MainFragment.java b/app/src/main/java/org/traccar/manager/MainFragment.java
index 1a7db04..78bfee1 100644
--- a/app/src/main/java/org/traccar/manager/MainFragment.java
+++ b/app/src/main/java/org/traccar/manager/MainFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package org.traccar.manager;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
@@ -64,14 +65,13 @@ public class MainFragment extends WebViewFragment {
broadcastManager = LocalBroadcastManager.getInstance(getActivity());
}
+ @SuppressLint("SetJavaScriptEnabled")
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if ((getActivity().getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- WebView.setWebContentsDebuggingEnabled(true);
- }
+ WebView.setWebContentsDebuggingEnabled(true);
}
getWebView().setWebChromeClient(webChromeClient);
@@ -89,7 +89,7 @@ public class MainFragment extends WebViewFragment {
getWebView().loadUrl(url);
}
- private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String token = intent.getStringExtra(KEY_TOKEN);
@@ -129,12 +129,7 @@ public class MainFragment extends WebViewFragment {
}
}
- private WebChromeClient webChromeClient = new WebChromeClient() {
-
- // Android 3.0+
- public void openFileChooser(ValueCallback uploadMessage, String acceptType) {
- openFileChooser(uploadMessage);
- }
+ private final WebChromeClient webChromeClient = new WebChromeClient() {
// Android 4.1+
protected void openFileChooser(ValueCallback<Uri> uploadMessage, String acceptType, String capture) {
diff --git a/app/src/main/java/org/traccar/manager/StartFragment.java b/app/src/main/java/org/traccar/manager/StartFragment.java
index fd0849a..a01f644 100644
--- a/app/src/main/java/org/traccar/manager/StartFragment.java
+++ b/app/src/main/java/org/traccar/manager/StartFragment.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ public class StartFragment extends Fragment implements View.OnClickListener {
private static final String TAG = StartFragment.class.getSimpleName();
- private static int MAX_REDIRECTS = 5;
+ private static final int MAX_REDIRECTS = 5;
private EditText serverField;
private Button startButton;