move to Android/data (#63)
This commit is contained in:
parent
79389d9444
commit
def3344a1f
|
@ -14,7 +14,7 @@ zh_CN.qm
|
||||||
tags
|
tags
|
||||||
|
|
||||||
# file produced by game
|
# file produced by game
|
||||||
FreeKill
|
/FreeKill
|
||||||
FreeKill.exe
|
FreeKill.exe
|
||||||
freekill-wrap.cxx
|
freekill-wrap.cxx
|
||||||
server/users.db
|
server/users.db
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.notify.FreeKill"
|
package="org.notify.FreeKill"
|
||||||
android:installLocation="auto"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
|
@ -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);
|
splash.showMessage(msg, Qt::AlignHCenter | Qt::AlignBottom);
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#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();
|
QScreen *screen = qobject_cast<QApplication *>(app)->primaryScreen();
|
||||||
QRect screenGeometry = screen->geometry();
|
QRect screenGeometry = screen->geometry();
|
||||||
int screenWidth = screenGeometry.width();
|
int screenWidth = screenGeometry.width();
|
||||||
|
|
Loading…
Reference in New Issue