mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
Merge pull request #82 from PX-Byte/fix-android-backAction
Fix android back action
This commit is contained in:
commit
5596685b35
@ -9,6 +9,7 @@ android {
|
|||||||
|
|
||||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation project(':capacitor-app')
|
||||||
implementation project(':capacitor-haptics')
|
implementation project(':capacitor-haptics')
|
||||||
implementation project(':capacitor-push-notifications')
|
implementation project(':capacitor-push-notifications')
|
||||||
implementation project(':capacitor-status-bar')
|
implementation project(':capacitor-status-bar')
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
include ':capacitor-android'
|
include ':capacitor-android'
|
||||||
project(':capacitor-android').projectDir = new File('../../../node_modules/@capacitor/android/capacitor')
|
project(':capacitor-android').projectDir = new File('../../../node_modules/@capacitor/android/capacitor')
|
||||||
|
|
||||||
|
include ':capacitor-app'
|
||||||
|
project(':capacitor-app').projectDir = new File('../../../node_modules/@capacitor/app/android')
|
||||||
|
|
||||||
include ':capacitor-haptics'
|
include ':capacitor-haptics'
|
||||||
project(':capacitor-haptics').projectDir = new File('../../../node_modules/@capacitor/haptics/android')
|
project(':capacitor-haptics').projectDir = new File('../../../node_modules/@capacitor/haptics/android')
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ install! 'cocoapods', :disable_input_output_paths => true
|
|||||||
def capacitor_pods
|
def capacitor_pods
|
||||||
pod 'Capacitor', :path => '../../../../node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../../../node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../../../node_modules/@capacitor/ios'
|
||||||
|
pod 'CapacitorApp', :path => '../../../../node_modules/@capacitor/app'
|
||||||
pod 'CapacitorHaptics', :path => '../../../../node_modules/@capacitor/haptics'
|
pod 'CapacitorHaptics', :path => '../../../../node_modules/@capacitor/haptics'
|
||||||
pod 'CapacitorPushNotifications', :path => '../../../../node_modules/@capacitor/push-notifications'
|
pod 'CapacitorPushNotifications', :path => '../../../../node_modules/@capacitor/push-notifications'
|
||||||
pod 'CapacitorStatusBar', :path => '../../../../node_modules/@capacitor/status-bar'
|
pod 'CapacitorStatusBar', :path => '../../../../node_modules/@capacitor/status-bar'
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "4.7.0",
|
"@ant-design/icons": "4.7.0",
|
||||||
"@capacitor/android": "^4.5.0",
|
"@capacitor/android": "^4.5.0",
|
||||||
|
"@capacitor/app": "^4.1.1",
|
||||||
"@capacitor/cli": "^4.5.0",
|
"@capacitor/cli": "^4.5.0",
|
||||||
"@capacitor/core": "^4.5.0",
|
"@capacitor/core": "^4.5.0",
|
||||||
"@capacitor/haptics": "1.1.4",
|
"@capacitor/haptics": "1.1.4",
|
||||||
|
@ -54,6 +54,7 @@ import { Helmet } from "react-helmet"
|
|||||||
import * as antd from "antd"
|
import * as antd from "antd"
|
||||||
import { Toast } from "antd-mobile"
|
import { Toast } from "antd-mobile"
|
||||||
import { StatusBar, Style } from "@capacitor/status-bar"
|
import { StatusBar, Style } from "@capacitor/status-bar"
|
||||||
|
import { App as CapacitorApp } from "@capacitor/app"
|
||||||
import { Translation } from "react-i18next"
|
import { Translation } from "react-i18next"
|
||||||
|
|
||||||
import { Session, User } from "models"
|
import { Session, User } from "models"
|
||||||
@ -316,7 +317,7 @@ class App extends React.Component {
|
|||||||
escClosable: true,
|
escClosable: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.app.ModalController.open((props) => <Creator {...props} />)
|
return window.app.ModalController.open((props) => <Creator {...props} />)
|
||||||
},
|
},
|
||||||
openSettings: (goTo) => {
|
openSettings: (goTo) => {
|
||||||
@ -419,6 +420,14 @@ class App extends React.Component {
|
|||||||
|
|
||||||
StatusBar.setOverlaysWebView({ overlay: true })
|
StatusBar.setOverlaysWebView({ overlay: true })
|
||||||
//window.app.hideStatusBar()
|
//window.app.hideStatusBar()
|
||||||
|
|
||||||
|
CapacitorApp.addListener('backButton', ({ canGoBack }) => {
|
||||||
|
if (!canGoBack) {
|
||||||
|
CapacitorApp.exitApp();
|
||||||
|
} else {
|
||||||
|
window.history.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user