Update to target Android 15 (SDK 35) - had to do some adjustment to layout to make MainAcivity2 display correctly

This commit is contained in:
Graham Jones
2025-07-16 21:34:18 +01:00
parent 4d9c3009ce
commit 4212860dc1
10 changed files with 36 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
OpenSeizureDetector Android App - Change Log OpenSeizureDetector Android App - Change Log
============================================ ============================================
V4.3.0a - 2024-10-01 V4.3.0 - 2024-10-01
- Added support for Android 14 (API 34) to allow publishing on Play Store. - Added support for Android 15 (API 35) to allow publishing on Play Store.
- Improved the data sharing screen to show grouped events to reduce the number of events that need to be edited. - Improved the data sharing screen to show grouped events to reduce the number of events that need to be edited.
V4.2.12 - Fixed crash when pressing 'Install Watch App' button by hiding the button if the Pebble data source is not selected V4.2.12 - Fixed crash when pressing 'Install Watch App' button by hiding the button if the Pebble data source is not selected
- Added a 'Help' and 'Troubleshooting' button and menu item to draw users' attention to the web site instructions. - Added a 'Help' and 'Troubleshooting' button and menu item to draw users' attention to the web site instructions.

View File

@@ -1,13 +1,14 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
android { android {
compileSdk 34 // Android 14 compileSdk 36
// Android 14
useLibrary 'org.apache.http.legacy' useLibrary 'org.apache.http.legacy'
defaultConfig { defaultConfig {
applicationId "uk.org.openseizuredetector" applicationId "uk.org.openseizuredetector"
minSdkVersion 23 // Android 6 minSdkVersion 23 // Android 6
targetSdkVersion 34 // Android 14 = 34 targetSdkVersion 35 // Android 15 = 35
multiDexEnabled true multiDexEnabled true
} }

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:versionCode="152" android:versionCode="153"
android:versionName="4.3.0a"> android:versionName="4.3.0">
<!-- android:allowBackup="false" --> <!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

View File

@@ -2,7 +2,9 @@ package uk.org.openseizuredetector;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.MenuCompat; import androidx.core.view.MenuCompat;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.adapter.FragmentStateAdapter;
@@ -18,6 +20,7 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import android.util.TypedValue;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@@ -53,6 +56,26 @@ public class MainActivity2 extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2); setContentView(R.layout.activity_main2);
View root = findViewById(R.id.activity_main2_root_layout);
ViewCompat.setOnApplyWindowInsetsListener(root, (v, insets) -> {
int topInset = 0;
//int topInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
int actionBarHeight = 0;
TypedValue tv = new TypedValue();
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
}
Log.i(TAG, "onCreate() - topInset = " + topInset + ", actionBarHeight = " + actionBarHeight);
v.setPadding(
v.getPaddingLeft(),
actionBarHeight,
v.getPaddingRight(),
v.getPaddingBottom()
);
return insets;
});
Log.i(TAG, "onCreate()"); Log.i(TAG, "onCreate()");
// Set our custom uncaught exception handler to report issues. // Set our custom uncaught exception handler to report issues.

View File

@@ -2,9 +2,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main2_root_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical"> android:orientation="vertical"
>
<TextView <TextView
android:id="@+id/versionTv" android:id="@+id/versionTv"

View File

@@ -3,7 +3,7 @@
<string name="app_name">OpenSeizureDetector</string> <string name="app_name">OpenSeizureDetector</string>
<string name="changelog"> <string name="changelog">
"\n "\n
\nV4.3.0a - Added support for Android 14 (API 34) and above. \nV4.3.0 - Added support for Android 15 (API 35) and above.
\n - Simplified data sharing editor by grouping events for editing. \n - Simplified data sharing editor by grouping events for editing.
\nV4.2.12 - Added butons and menu items for 'Help' and 'Troubleshooting' to point users to the web page instructoins. \nV4.2.12 - Added butons and menu items for 'Help' and 'Troubleshooting' to point users to the web page instructoins.
\nV4.2 - Added support for PineTime and BangleJS Watches using Bluetooth data source. \nV4.2 - Added support for PineTime and BangleJS Watches using Bluetooth data source.

View File

@@ -10,7 +10,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.4.1' classpath 'com.android.tools.build:gradle:8.8.0'
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.3.15'
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

View File

@@ -1,6 +1,6 @@
#Thu Oct 10 20:04:34 BST 2024 #Thu Oct 10 20:04:34 BST 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

Binary file not shown.