mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
move to Android/data (#63)
This commit is contained in:
parent
79389d9444
commit
def3344a1f
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -14,7 +14,7 @@ zh_CN.qm
|
|||
tags
|
||||
|
||||
# file produced by game
|
||||
FreeKill
|
||||
/FreeKill
|
||||
FreeKill.exe
|
||||
freekill-wrap.cxx
|
||||
server/users.db
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.notify.FreeKill"
|
||||
android:installLocation="auto"
|
||||
android:installLocation="preferExternal"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
|
37
android/src/org/notify/FreeKill/Helper.java
Normal file
37
android/src/org/notify/FreeKill/Helper.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package org.notify.FreeKill;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import org.qtproject.qt.android.QtNative;
|
||||
|
||||
public class Helper {
|
||||
public static void InitView() {
|
||||
Activity activity = QtNative.activity();
|
||||
|
||||
// create app-specific dir on external storage
|
||||
activity.getExternalFilesDir("");
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
View decorView = activity.getWindow().getDecorView();
|
||||
int uiOpt = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
decorView.setSystemUiVisibility(uiOpt);
|
||||
|
||||
decorView.setOnSystemUiVisibilityChangeListener
|
||||
(new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
// Hide navigation bar when enter fullscreen again
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
decorView.setSystemUiVisibility(uiOpt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -160,6 +160,9 @@ int main(int argc, char *argv[])
|
|||
splash.showMessage(msg, Qt::AlignHCenter | Qt::AlignBottom);
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
QJniObject::callStaticMethod <void>("org/notify/FreeKill/Helper", "InitView", "()V");
|
||||
QDir::setCurrent("/storage/emulated/0/Android/data/org.notify.FreeKill/files");
|
||||
|
||||
QScreen *screen = qobject_cast<QApplication *>(app)->primaryScreen();
|
||||
QRect screenGeometry = screen->geometry();
|
||||
int screenWidth = screenGeometry.width();
|
||||
|
|
Loading…
Reference in New Issue
Block a user