mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Add a function that minimizes the Android app (#692)
Add a function that minimizes the Android app
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include "platforms/android/android_controller.h"
|
||||
#include "platforms/android/android_utils.h"
|
||||
#include <QJniObject>
|
||||
#endif
|
||||
@@ -74,6 +75,13 @@ void PageController::closeWindow()
|
||||
#endif
|
||||
}
|
||||
|
||||
void PageController::hideWindow()
|
||||
{
|
||||
#ifdef Q_OS_ANDROID
|
||||
AndroidController::instance()->minimizeApp();
|
||||
#endif
|
||||
}
|
||||
|
||||
void PageController::keyPressEvent(Qt::Key key)
|
||||
{
|
||||
switch (key) {
|
||||
|
||||
@@ -76,6 +76,7 @@ public slots:
|
||||
QString getPagePath(PageLoader::PageEnum page);
|
||||
|
||||
void closeWindow();
|
||||
void hideWindow();
|
||||
void keyPressEvent(Qt::Key key);
|
||||
|
||||
unsigned int getInitialPageNavigationBarColor();
|
||||
|
||||
@@ -24,6 +24,7 @@ PageType {
|
||||
|
||||
function onClosePage() {
|
||||
if (stackView.depth <= 1) {
|
||||
PageController.hideWindow()
|
||||
return
|
||||
}
|
||||
stackView.pop()
|
||||
|
||||
@@ -40,6 +40,7 @@ PageType {
|
||||
|
||||
function onClosePage() {
|
||||
if (tabBarStackView.depth <= 1) {
|
||||
PageController.hideWindow()
|
||||
return
|
||||
}
|
||||
tabBarStackView.pop()
|
||||
|
||||
Reference in New Issue
Block a user