Hide "immersive mode" on pre-kitkat Android.

This commit is contained in:
Henrik Rydgard 2014-07-20 12:11:50 +02:00
parent 358050800f
commit 39cde7fc48
6 changed files with 16 additions and 2 deletions

View File

@ -126,8 +126,12 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new CheckBox(&g_Config.bSmallDisplay, gs->T("Small Display")));
if (pixel_xres < pixel_yres * 1.3) // Smaller than 4:3
graphicsSettings->Add(new CheckBox(&g_Config.bPartialStretch, gs->T("Partial Vertical Stretch")));
#ifdef ANDROID
graphicsSettings->Add(new CheckBox(&g_Config.bImmersiveMode, gs->T("Immersive Mode")))->OnClick.Handle(this, &GameSettingsScreen::OnImmersiveModeChange);
// Hide Immersive Mode on pre-kitkat Android
if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= 19) {
graphicsSettings->Add(new CheckBox(&g_Config.bImmersiveMode, gs->T("Immersive Mode")))->OnClick.Handle(this, &GameSettingsScreen::OnImmersiveModeChange);
}
#endif
graphicsSettings->Add(new ItemHeader(gs->T("Performance")));
@ -441,6 +445,8 @@ UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) {
UI::EventReturn GameSettingsScreen::OnImmersiveModeChange(UI::EventParams &e) {
System_SendMessage("immersive", "");
if (g_Config.iAndroidHwScale != 0)
System_SendMessage("recreate", "");
return UI::EVENT_DONE;
}

View File

@ -169,6 +169,10 @@ std::string System_GetProperty(SystemProperty prop) {
}
}
int System_GetPropertyInt(SystemProperty prop) {
return -1;
}
void System_SendMessage(const char *command, const char *parameter) {
if (!strcmp(command, "finish")) {
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);

View File

@ -73,6 +73,7 @@ void NativeRender() { }
void NativeResized() { }
std::string System_GetProperty(SystemProperty prop) { return ""; }
int System_GetPropertyInt(SystemProperty prop) { return -1; }
void System_SendMessage(const char *command, const char *parameter) {}
bool System_InputBoxGetWString(const wchar_t *title, const std::wstring &defaultvalue, std::wstring &outvalue) { return false; }

View File

@ -22,6 +22,8 @@ std::string System_GetProperty(SystemProperty prop) {
}
}
int System_GetPropertyInt(SystemProperty prop) { return -1; }
void System_SendMessage(const char *command, const char *parameter) {
if (!strcmp(command, "finish")) {
exit(0);

2
native

@ -1 +1 @@
Subproject commit ed04a0bf28dbe89f894bb33b0700f72c9ec17b72
Subproject commit 1bc2fef02c07e86e9d60855af21001a72d1587e6

View File

@ -48,6 +48,7 @@
#define RET(a) if (!(a)) { return false; }
std::string System_GetProperty(SystemProperty prop) { return ""; }
int System_GetPropertyInt(SystemProperty prop) { return -1; }
#define M_PI_2 1.57079632679489661923