Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: finish the activity to exit by back button #256

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/pages/after_loading/afterloading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'package:violet/pages/main/main_page.dart';
import 'package:violet/pages/search/search_page.dart';
import 'package:violet/pages/segment/double_tap_to_top.dart';
import 'package:violet/pages/settings/settings_page.dart';
import 'package:violet/platform/misc.dart';
import 'package:violet/script/script_webview.dart';
import 'package:violet/settings/settings.dart';
import 'package:violet/update/update_manager.dart';
Expand Down Expand Up @@ -299,6 +300,10 @@ class AfterLoadingPageState extends State<AfterLoadingPage>

if (_lastPopAt != null &&
now.difference(_lastPopAt!) <= const Duration(seconds: 2)) {
if (Platform.isAndroid) {
await PlatformMiscMethods.instance.finishMainActivity();
}

return true;
}

Expand Down
Loading