- Change the name from "Emu48 for Android" for "Emu48".

- Always prompt to save when closing.
- Fix MostRecentUsed file issue.
This commit is contained in:
dgis 2019-03-12 22:46:21 +01:00
parent f4384c5484
commit 91ee7150e9
4 changed files with 23 additions and 9 deletions

View file

@ -47,10 +47,13 @@ Version 1.2alpha (2019-03-XX)
- Rewrite the StretchBlt() function to improve the pixel rendering. - Rewrite the StretchBlt() function to improve the pixel rendering.
- Allow to build the project with "gradlew build". - Allow to build the project with "gradlew build".
- Fix issues with back button in the Settings, Help and About. - Fix issues with back button in the Settings, Help and About.
- Build with Android 4.4 support. - Build with Android 4.4 support (Not sure the settings work).
- Prevent empty MRU. - Prevent empty MRU.
- Allow to go back from the settings in Android 4.4 and may be more recent versions. - Allow to go back from the settings in Android 4.4 and may be more recent versions.
- Save the Port 2 at the same time we save the state file. - Save the Port 2 at the same time we save the state file.
- Change the name from "Emu48 for Android" for "Emu48".
- Always prompt to save when closing.
- Fix MostRecentUsed file issue.
Version 1.1 (2019-03-01) Version 1.1 (2019-03-01)

View file

@ -47,10 +47,13 @@ Version 1.2alpha (2019-03-XX)
- Rewrite the StretchBlt() function to improve the pixel rendering. - Rewrite the StretchBlt() function to improve the pixel rendering.
- Allow to build the project with "gradlew build". - Allow to build the project with "gradlew build".
- Fix issues with back button in the Settings, Help and About. - Fix issues with back button in the Settings, Help and About.
- Build with Android 4.4 support. - Build with Android 4.4 support (Not sure the settings work).
- Prevent empty MRU. - Prevent empty MRU.
- Allow to go back from the settings in Android 4.4 and may be more recent versions. - Allow to go back from the settings in Android 4.4 and may be more recent versions.
- Save the Port 2 at the same time we save the state file. - Save the Port 2 at the same time we save the state file.
- Change the name from "Emu48 for Android" for "Emu48".
- Always prompt to save when closing.
- Fix MostRecentUsed file issue.
Version 1.1 (2019-03-01) Version 1.1 (2019-03-01)

View file

@ -522,8 +522,12 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
private Runnable fileSaveAsCallback = null;
private void ensureDocumentSaved(final Runnable continueCallback) { private void ensureDocumentSaved(final Runnable continueCallback) {
ensureDocumentSaved(continueCallback, false);
}
private Runnable fileSaveAsCallback = null;
private void ensureDocumentSaved(final Runnable continueCallback, boolean forceRequest) {
if(NativeLib.isDocumentAvailable()) { if(NativeLib.isDocumentAvailable()) {
final String currentFilename = NativeLib.getCurrentFilename(); final String currentFilename = NativeLib.getCurrentFilename();
final boolean hasFilename = (currentFilename != null && currentFilename.length() > 0); final boolean hasFilename = (currentFilename != null && currentFilename.length() > 0);
@ -548,7 +552,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
}; };
if(hasFilename && sharedPreferences.getBoolean("settings_autosave", true)) { if(!forceRequest && hasFilename && sharedPreferences.getBoolean("settings_autosave", true)) {
onClickListener.onClick(null, DialogInterface.BUTTON_POSITIVE); onClickListener.onClick(null, DialogInterface.BUTTON_POSITIVE);
} else { } else {
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
@ -637,7 +641,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}, 300); }, 300);
} }
} }
}); }, true);
} }
private void OnSettings() { private void OnSettings() {
startActivityForResult(new Intent(this, SettingsActivity.class), INTENT_SETTINGS); startActivityForResult(new Intent(this, SettingsActivity.class), INTENT_SETTINGS);
@ -912,9 +916,13 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
editor.putString("lastDocument", url); editor.putString("lastDocument", url);
editor.apply(); editor.apply();
if(url != null & !url.isEmpty()) if(url != null && !url.isEmpty())
mruLinkedHashMap.put(url, null); mruLinkedHashMap.put(url, null);
updateMRU(); navigationView.post(new Runnable() {
public void run() {
updateMRU();
}
});
} }
private void makeUriPersistable(Intent data, Uri uri) { private void makeUriPersistable(Intent data, Uri uri) {

View file

@ -15,11 +15,11 @@
<!-- PaintByNumber Activity --> <!-- PaintByNumber Activity -->
<string name="app_name">Emu48 for Android</string> <string name="app_name">Emu48</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string>
<!--<string name="nav_header_title">Emu48 for Android</string>--> <!--<string name="nav_header_title">Emu48</string>-->
<!--<string name="nav_header_subtitle">android.studio@android.com</string>--> <!--<string name="nav_header_subtitle">android.studio@android.com</string>-->
<!--<string name="nav_header_desc">Navigation header</string>--> <!--<string name="nav_header_desc">Navigation header</string>-->
<string name="nav_new">New...</string> <string name="nav_new">New...</string>