fixed crash when using fingerprint on Android 8.1

This commit is contained in:
Thibault Deckers 2023-03-09 20:50:59 +01:00
parent d671030cb3
commit 1374b8d492
4 changed files with 25 additions and 16 deletions

View file

@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
- Accessibility: using accessibility services keeping snack bar beyond countdown
- Accessibility: navigation with TalkBack
- Vaults: crash when using fingerprint on older Android versions
## <a id="v1.8.2"></a>[v1.8.2] - 2023-02-28

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="NormalTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
<!-- API28+, draws next to the notch in fullscreen -->

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
<!-- API28+, draws next to the notch in fullscreen -->

View file

@ -240,12 +240,15 @@ class _EntryPageViewState extends State<EntryPageView> with SingleTickerProvider
onDoubleTap = (alignment) {
final x = alignment.x;
if (seekGesture) {
if (x < sideRatio) {
_applyAction(EntryAction.videoReplay10);
return true;
} else if (x > 1 - sideRatio) {
_applyAction(EntryAction.videoSkip10);
return true;
final sideRatio = _getSideRatio();
if (sideRatio != null) {
if (x < sideRatio) {
_applyAction(EntryAction.videoReplay10);
return true;
} else if (x > 1 - sideRatio) {
_applyAction(EntryAction.videoSkip10);
return true;
}
}
}
if (playGesture) {
@ -428,12 +431,15 @@ class _EntryPageViewState extends State<EntryPageView> with SingleTickerProvider
void _onTap({Alignment? alignment}) {
if (settings.viewerGestureSideTapNext && alignment != null) {
final x = alignment.x;
if (x < sideRatio) {
const ShowPreviousEntryNotification(animate: false).dispatch(context);
return;
} else if (x > 1 - sideRatio) {
const ShowNextEntryNotification(animate: false).dispatch(context);
return;
final sideRatio = _getSideRatio();
if (sideRatio != null) {
if (x < sideRatio) {
const ShowPreviousEntryNotification(animate: false).dispatch(context);
return;
} else if (x > 1 - sideRatio) {
const ShowNextEntryNotification(animate: false).dispatch(context);
return;
}
}
}
const ToggleOverlayNotification().dispatch(context);
@ -481,12 +487,14 @@ class _EntryPageViewState extends State<EntryPageView> with SingleTickerProvider
);
}
double get sideRatio {
switch (context.read<MediaQueryData>().orientation) {
double? _getSideRatio() {
switch (context.read<MediaQueryData?>()?.orientation) {
case Orientation.portrait:
return 1 / 5;
case Orientation.landscape:
return 1 / 8;
case null:
return null;
}
}