Merge pull request #1115 from patrickbabb/master

Various Android fixes
This commit is contained in:
Eduardo MG
2025-05-06 18:38:21 -06:00
committed by GitHub
3 changed files with 61 additions and 28 deletions

View File

@@ -307,16 +307,18 @@ public class SDLActivity extends Activity implements OnKeyListener {
importDeck.setTitle("Choose Deck to Import:");
File root = new File(System.getenv("EXTERNAL_STORAGE") + "/Download");
File[] files = root.listFiles();
File[] files = root.listFiles();
for (File f : files) {
if (!myresult.contains(f.toString()) &&
(f.toString().contains(".txt") ||
f.toString().contains(".dck") ||
f.toString().contains(".dec"))) {
myresult.add(f.toString());
}
}
if (files != null) {
for (File f : files) {
if (!myresult.contains(f.toString()) &&
(f.toString().contains(".txt") ||
f.toString().contains(".dck") ||
f.toString().contains(".dec"))) {
myresult.add(f.toString());
}
}
}
//get first item?
if (!myresult.isEmpty()) {
@@ -1115,24 +1117,49 @@ public class SDLActivity extends Activity implements OnKeyListener {
}
// Setup
@Override
protected void onCreate(Bundle savedInstanceState) {
//Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
private void enterImmersiveMode() {
final View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
enterImmersiveMode();
}
}
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll()
.build();
StrictMode.setThreadPolicy(policy);
setContentView(R.layout.main);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// So we can call stuff from static callbacks
mSingleton = this;
mContext = this.getApplicationContext();
RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(mContext);
checkStorageLocationPreference();
prepareOptionMenu(null);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
setContentView(R.layout.main);
// Enable immersive mode
enterImmersiveMode();
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// So we can call stuff from static callbacks
mSingleton = this;
mContext = this.getApplicationContext();
RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(mContext);
checkStorageLocationPreference();
prepareOptionMenu(null);
}
public void forceResDownload(final File oldRes) {
AlertDialog.Builder resChooser = new AlertDialog.Builder(this);

View File

@@ -88,8 +88,8 @@ Mod by: Vitty85
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
#define WAGIC_RESOURCE_NAME "Wagic-core-" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) ".zip"
#define WAGIC_RELEASE_NAME "wagic-v" WAGIC_VERSION_STRING
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
#endif
</echo>

View File

@@ -97,6 +97,12 @@ void GameStateAwards::Start()
wgh = NEW WGuiHeader("");
listview->Add(wgh);
#if !defined(PSP)
WGuiItem* backLabel = NEW WGuiItem("Back to Main Menu");
WGuiButton* backBtn = NEW WGuiButton(backLabel, EXIT_AWARDS_MENU, GameStateAwardsConst::kBackToMainMenuID, this);
listview->Add(backBtn);
#endif
int locked = 0;