Skip to content
This repository was archived by the owner on Apr 27, 2025. It is now read-only.

Commit b42759b

Browse files
committed
Update minSdkVersion to 25 = Android 7.1 (Nougat)
1 parent 909cde1 commit b42759b

File tree

16 files changed

+166
-137
lines changed

16 files changed

+166
-137
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,24 @@ android {
5454
}
5555

5656
dependencies {
57-
//def appCompatVersion = "1.4.0"
58-
def lifeCycleVersion = '2.4.0'
57+
//def appCompatVersion = "1.4.1"
58+
def lifeCycleVersion = '2.4.1'
59+
//def arch_version = '2.1.0'
5960

6061
// https://developer.android.com/studio/projects/android-library
6162
implementation project(":myutils")
6263

6364
implementation fileTree(dir: 'libs', include: ['*.jar'])
65+
// https://developer.android.com/jetpack/androidx/releases/appcompat
6466
implementation "androidx.appcompat:appcompat:${appCompatVersion}"
6567
// For loading and tinting drawables on older versions of the platform
6668
// implementation "androidx.appcompat:appcompat-resources:${appCompatVersion}"
67-
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
69+
// https://developer.android.com/jetpack/androidx/releases/constraintlayout
70+
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
71+
// To use constraintlayout in compose
72+
//implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0"
6873
implementation "androidx.webkit:webkit:1.4.0"
74+
// https://developer.android.com/jetpack/androidx/releases/lifecycle
6975
// ViewModel
7076
implementation "androidx.lifecycle:lifecycle-viewmodel:${lifeCycleVersion}"
7177
// LiveData

app/release/app-release.apk

-156 Bytes
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 22,
15-
"versionName": "1.21",
14+
"versionCode": 23,
15+
"versionName": "1.22",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

app/src/main/assets/web/about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<div id="main">
2020
<h1><a href="index.html">My WebView</a></h1>
2121
<h2>About My WebView</h2>
22-
<h3>What's New in Version 1.21</h3>
23-
<p>Update min API level to 24 = Android 7 (Nougat)</p>
22+
<h3>What's New in Version 1.22</h3>
23+
<p>Update min API level to 25 = Android 7.1 (Nougat)</p>
2424
<h3>Product Description</h3>
2525
<p>Test your websites with Android WebView, using a configurable list of sites and matches to allow or skip.
2626
Other links will not be handled by the app and will simply ask you to open the standard browser or not.</p>

app/src/main/java/net/mikespub/mywebview/AppJavaScriptProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void showMessage(final String message) {
4343
public void run() {
4444
Uri uri = Uri.parse(myWebView.getUrl());
4545
if(!uri.getHost().equals(myActivity.getString(R.string.app_host))){
46-
Log.d("WebView", "No Javascript Interface for " + uri.toString());
46+
Log.d("WebView", "No Javascript Interface for " + uri);
4747
return;
4848
}
4949

app/src/main/java/net/mikespub/mywebview/MainActivity.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package net.mikespub.mywebview;
22

3+
import android.annotation.SuppressLint;
34
import android.app.DownloadManager;
45
import android.content.BroadcastReceiver;
56
import android.content.Intent;
67
import android.content.IntentFilter;
78
import android.content.pm.PackageManager;
89
import android.content.res.Configuration;
910
import android.net.Uri;
10-
import android.os.Build;
1111
import android.os.Bundle;
1212
import android.os.ParcelFileDescriptor;
1313
import android.provider.DocumentsContract;
@@ -142,6 +142,7 @@ public void onActivityResult(Uri returnUri) {
142142
/**
143143
* @param savedInstanceState saved instance state
144144
*/
145+
@SuppressLint("SetJavaScriptEnabled")
145146
@Override
146147
protected void onCreate(Bundle savedInstanceState) {
147148
super.onCreate(savedInstanceState);
@@ -347,9 +348,9 @@ public void onBackPressed() {
347348
// https://stackoverflow.com/questions/41025200/android-view-inflateexception-error-inflating-class-android-webkit-webview
348349
@Override
349350
public void applyOverrideConfiguration(final Configuration overrideConfiguration) {
350-
if (Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT < 25) {
351-
overrideConfiguration.uiMode &= ~Configuration.UI_MODE_NIGHT_MASK;
352-
}
351+
//if (Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT < 25) {
352+
// overrideConfiguration.uiMode &= ~Configuration.UI_MODE_NIGHT_MASK;
353+
//}
353354
super.applyOverrideConfiguration(overrideConfiguration);
354355
}
355356

@@ -445,16 +446,16 @@ private Uri getActivityResultUri(int requestCode, int resultCode, Intent returnI
445446
if (returnUri == null) {
446447
// Pick text - Samsung Notes
447448
if (returnExtras != null) {
448-
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent.toString() + " No Uri: " + returnIntent.toUri(0) + " Extras: " + returnExtras.toString());
449+
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent + " No Uri: " + returnIntent.toUri(0) + " Extras: " + returnExtras);
449450
} else {
450-
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent.toString() + " No Uri: " + returnIntent.toUri(0) + " Extras: " + returnExtras);
451+
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent + " No Uri: " + returnIntent.toUri(0) + " Extras: " + returnExtras);
451452
}
452453
return null;
453454
}
454455
if (returnExtras != null) {
455-
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent.toString() + " Uri: " + returnUri + " Extras: " + returnExtras.toString());
456+
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent + " Uri: " + returnUri + " Extras: " + returnExtras);
456457
} else {
457-
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent.toString() + " Uri: " + returnUri + " Extras: " + returnExtras);
458+
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Intent: " + returnIntent + " Uri: " + returnUri + " Extras: " + returnExtras);
458459
}
459460
return returnUri;
460461
}
@@ -464,7 +465,7 @@ private boolean checkActivityResult(int requestCode, int resultCode, Intent retu
464465
if (resultCode != RESULT_OK) {
465466
// Exit without doing anything else
466467
if (returnIntent != null) {
467-
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Not OK: " + returnIntent.toString());
468+
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Not OK: " + returnIntent);
468469
} else {
469470
Log.d("Activity Result", "Request: " + requestCode + " Result: " + resultCode + " Not OK: " + returnIntent);
470471
}

app/src/main/java/net/mikespub/mywebview/MyAppWebViewClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ private boolean testOverrideUrlLoading(WebView view, String url) {
435435
if (isMatch && isSkip) {
436436
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
437437
// Create intent to show chooser
438-
String title = uri.toString() + "\n\nOpen with";
438+
String title = uri + "\n\nOpen with";
439439
Intent chooser = Intent.createChooser(intent, title);
440440
view.getContext().startActivity(chooser);
441441
return true;
@@ -444,11 +444,11 @@ private boolean testOverrideUrlLoading(WebView view, String url) {
444444
if (hasNotMatching()) {
445445
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
446446
// Create intent to show chooser
447-
String title = uri.toString() + "\n\nOpen with";
447+
String title = uri + "\n\nOpen with";
448448
Intent chooser = Intent.createChooser(intent, title);
449449
view.getContext().startActivity(chooser);
450450
} else {
451-
String message = uri.toString() + "\n\nLink not matching. You can allow opening via regular browser in Advanced Options.";
451+
String message = uri + "\n\nLink not matching. You can allow opening via regular browser in Advanced Options.";
452452
Toast toast = Toast.makeText(
453453
view.getContext().getApplicationContext(),
454454
message,

app/src/main/java/net/mikespub/mywebview/MyLocalConfigRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static void saveIconToMedia(AppCompatActivity activity) {
128128
}
129129
//Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), R.mipmap.ic_launcher);
130130
if (bitmap != null) {
131-
Log.d(TAG, "Bitmap: " + bitmap.toString());
131+
Log.d(TAG, "Bitmap: " + bitmap);
132132
File extDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
133133
if (!extDir.exists() && !extDir.mkdirs()) {
134134
Log.e(TAG, "Dir Create: FAIL " + extDir.getAbsolutePath());
@@ -198,7 +198,7 @@ public static void insertImage(ContentResolver cr, File file) {
198198

199199
static boolean updateLocalSites(AppCompatActivity activity, HashMap<String, String> localSites) {
200200
HashMap<String, String> siteMap = findLocalSites(activity);
201-
Log.d(TAG, "Sites: " + siteMap.toString());
201+
Log.d(TAG, "Sites: " + siteMap);
202202
boolean hasAdded = false;
203203
for (String url: siteMap.keySet()) {
204204
if (!localSites.containsKey(url)) {

0 commit comments

Comments
 (0)