Fixed Android-15 user interface layout problems (care of deepseek model, which knew that using LinearLayout as the root layout messed up insets for some reason, and suggested an alternative wrapper.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
OpenSeizureDetector Android App - Change Log
|
||||
============================================
|
||||
V4.3.0 - 2024-10-01
|
||||
V4.3.1 - Fixed corrupted user interface issues on Android 15 and Android 16.
|
||||
V4.3.0 - 2025-07-16
|
||||
- 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.
|
||||
V4.2.12 - Fixed crash when pressing 'Install Watch App' button by hiding the button if the Pebble data source is not selected
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:versionCode="153"
|
||||
android:versionName="4.3.0">
|
||||
android:versionCode="154"
|
||||
android:versionName="4.3.1">
|
||||
<!-- android:allowBackup="false" -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
|
||||
|
||||
@@ -5,10 +5,13 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
@@ -53,6 +56,22 @@ public class EditEventActivity extends AppCompatActivity {
|
||||
Log.v(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_edit_event);
|
||||
// Handle system window insets for all API levels
|
||||
View rootView = findViewById(R.id.root_layout_edit_event);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
// Get the system bar insets
|
||||
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
|
||||
// Apply padding to your main content view
|
||||
LinearLayout content = findViewById(R.id.edit_event_content_layout);
|
||||
content.setPadding(0, top, 0, bottom);
|
||||
|
||||
// Return the insets so they keep propagating
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
|
||||
|
||||
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
||||
mConnection = new SdServiceConnection(getApplicationContext());
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
@@ -22,6 +24,7 @@ import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TimePicker;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
@@ -83,6 +86,21 @@ public class ExportDataActivity extends AppCompatActivity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_dbquery);
|
||||
// Handle system window insets for all API levels
|
||||
View rootView = findViewById(R.id.root_layout_export_data);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
// Get the system bar insets
|
||||
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
|
||||
// Apply padding to your main content view
|
||||
LinearLayout content = findViewById(R.id.export_data_content_layout);
|
||||
content.setPadding(0, top, 0, bottom);
|
||||
|
||||
// Return the insets so they keep propagating
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
|
||||
|
||||
mHandler = new Handler();
|
||||
mUtil = new OsdUtil(this, mHandler);
|
||||
|
||||
@@ -12,9 +12,12 @@ import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.MenuCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -90,6 +93,20 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
|
||||
setContentView(R.layout.activity_log_manager_control);
|
||||
|
||||
// Handle system window insets for all API levels
|
||||
View rootView = findViewById(R.id.root_layout_log_manager_control);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
// Get the system bar insets
|
||||
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
|
||||
// Apply padding to your main content view
|
||||
LinearLayout content = findViewById(R.id.log_manager_control_content_layout); // Add this ID to your LinearLayout
|
||||
content.setPadding(0, top, 0, bottom);
|
||||
|
||||
// Return the insets so they keep propagating
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
/* Force display of overflow menu - from stackoverflow
|
||||
* "how to force use of..."
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.rohitss.uceh.UCEHandler;
|
||||
@@ -56,23 +57,19 @@ public class MainActivity2 extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
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;
|
||||
// Handle system window insets for all API levels
|
||||
View rootView = findViewById(R.id.activity_main2_root_layout);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
// Get the system bar insets
|
||||
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
|
||||
// Apply padding to your main content view
|
||||
LinearLayout content = findViewById(R.id.activity_main2_content_layout);
|
||||
content.setPadding(0, top, 0, bottom);
|
||||
|
||||
// Return the insets so they keep propagating
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,14 @@ import android.os.Handler;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
@@ -78,6 +81,21 @@ public class ReportSeizureActivity extends AppCompatActivity {
|
||||
mConnection = new SdServiceConnection(getApplicationContext());
|
||||
|
||||
setContentView(R.layout.activity_report_seizure);
|
||||
// Handle system window insets for all API levels
|
||||
View rootView = findViewById(R.id.root_layout_report_seizure);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
// Get the system bar insets
|
||||
int top = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
int bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
|
||||
// Apply padding to your main content view
|
||||
LinearLayout content = findViewById(R.id.report_seizure_content_layout);
|
||||
content.setPadding(0, top, 0, bottom);
|
||||
|
||||
// Return the insets so they keep propagating
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
|
||||
|
||||
mEventTypeRg = findViewById(R.id.eventTypeRg);
|
||||
mEventTypeRg.setOnCheckedChangeListener(onEventTypeChange);
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root_layout_export_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/export_data_content_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
@@ -88,4 +98,5 @@
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,10 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root_layout_edit_event"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/edit_event_content_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
@@ -67,6 +77,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/event_date"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -91,6 +102,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/alarm_state"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -115,6 +127,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/event_type"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -138,6 +151,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/event_sub_type"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -145,7 +159,6 @@
|
||||
android:textSize="20sp" />
|
||||
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/eventSubTypeRg"
|
||||
android:layout_width="match_parent"
|
||||
@@ -166,5 +179,6 @@
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,6 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root_layout_log_manager_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
@@ -8,6 +16,7 @@
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:id="@+id/log_manager_control_content_layout"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
<TextView
|
||||
@@ -121,30 +130,30 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/authStatusTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/not_authenticated"
|
||||
android:layout_marginEnd="8dp"/> <!-- Space after TextView -->
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/not_authenticated" /> <!-- Space after TextView -->
|
||||
|
||||
<Button
|
||||
android:id="@+id/auth_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/authenticate"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp" /> <!-- Space after this button -->
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/authenticate" /> <!-- Space after this button -->
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/refreshBtn"
|
||||
android:layout_marginStart="8dp" /> <!-- Space before this button -->
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/refreshBtn" /> <!-- Space before this button -->
|
||||
<!-- No marginEnd needed if ProgressBar is last and you want it close,
|
||||
or add marginEnd if you want space before ProgressBar too -->
|
||||
|
||||
@@ -152,36 +161,36 @@
|
||||
android:id="@+id/remoteAccessPb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"/> <!-- Space before ProgressBar -->
|
||||
android:layout_marginStart="8dp" /> <!-- Space before ProgressBar -->
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/group_events_cb"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/group_remote_events"
|
||||
android:checked="true" />
|
||||
android:checked="true"
|
||||
android:text="@string/group_remote_events" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/include_warnings_cb"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/include_warnings"/>
|
||||
android:text="@string/include_warnings" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/include_nda_cb"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/include_nda"/>
|
||||
android:text="@string/include_nda" />
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
@@ -234,4 +243,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_main2_root_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activity_main2_content_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/versionTv"
|
||||
@@ -25,4 +32,5 @@
|
||||
android:id="@+id/fragment_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,6 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root_layout_report_seizure"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="uk.org.openseizuredetector.LogManager">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/report_seizure_content_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
@@ -180,4 +189,5 @@
|
||||
android:text="msg" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -3,9 +3,10 @@
|
||||
<string name="app_name">OpenSeizureDetector</string>
|
||||
<string name="changelog">
|
||||
"\n
|
||||
\nV4.3.1 - Fixed user interface issues on Android-15 and Android-16
|
||||
\nV4.3.0 - Added support for Android 15 (API 35) and above.
|
||||
\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 buttons and menu items for 'Help' and 'Troubleshooting' to point users to the web page instructions.
|
||||
\nV4.2 - Added support for PineTime and BangleJS Watches using Bluetooth data source.
|
||||
\n - Added support for Version 2 of the Garmin watch app, which reduces battery drain
|
||||
\n - Added new, swipeable user interface to simplify the main screen.
|
||||
|
||||
BIN
releases/app-release-4.3.1.apk
Normal file
BIN
releases/app-release-4.3.1.apk
Normal file
Binary file not shown.
Reference in New Issue
Block a user