Skip to content

Commit

Permalink
Merge pull request #256 from sliverappbar/exit
Browse files Browse the repository at this point in the history
android: finish the activity to exit by back button
  • Loading branch information
violet-dev authored Nov 11, 2023
2 parents dea2968 + 195f654 commit 6fec5f1
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 6fec5f1

Please sign in to comment.