diff --git a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java
index 38723da8..43724aa6 100644
--- a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java
+++ b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java
@@ -32,6 +32,7 @@ import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.TextView;
+import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
@@ -170,7 +171,8 @@ public class Apple2DisksMenu implements Apple2MenuView {
@Override
public Object getPrefDefault() {
- return true;
+ // 2017/06/30 NOTE : keep this default false to accommodate initial installs that only have access to shipped public domain images
+ return false;
}
};
@@ -214,27 +216,43 @@ public class Apple2DisksMenu implements Apple2MenuView {
}
});
- {
- final Button ejectButton1 = (Button) mDisksView.findViewById(R.id.ejectButton1);
- ejectButton1.setOnClickListener(new View.OnClickListener() {
+ for (int i = 0; i < 2; i++) {
+ final Button ejectButton = (Button) mDisksView.findViewById(i == 0 ? R.id.ejectButton1 : R.id.ejectButton2);
+ final int idx = i;
+ ejectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- ejectDisk(/*isDriveA:*/true);
+ ejectDisk(/*isDriveA:*/idx == 0);
dynamicSetup();
}
});
}
- {
- final Button ejectButton2 = (Button) mDisksView.findViewById(R.id.ejectButton2);
- ejectButton2.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ejectDisk(/*isDriveA:*/false);
- dynamicSetup();
+ final CheckBox newschoolSelection = (CheckBox) mDisksView.findViewById(R.id.newschoolDiskSelectionButton);
+ newschoolSelection.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Apple2Preferences.setJSONPref(SETTINGS.USE_NEWSCHOOL_DISK_SELECTION, newschoolSelection.isChecked());
+ dynamicSetup();
+ }
+ });
+
+ final View newschoolChooser = mDisksView.findViewById(R.id.disk_selection_newschool_chooser);
+ newschoolChooser.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final boolean alreadyChoosing = Apple2DiskChooserActivity.sDiskChooserIsChoosing.getAndSet(true);
+ if (alreadyChoosing) {
+ return;
}
- });
- }
+
+ Intent chooserIntent = new Intent(mActivity, Apple2DiskChooserActivity.class);
+ chooserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION/* | Intent.FLAG_ACTIVITY_CLEAR_TOP */);
+
+ Apple2DiskChooserActivity.sDisksCallback = mActivity;
+ mActivity.startActivity(chooserIntent);
+ }
+ });
Apple2Utils.getExternalStorageDirectory(activity);
}
@@ -539,44 +557,17 @@ public class Apple2DisksMenu implements Apple2MenuView {
final CheckBox newschoolSelection = (CheckBox) mDisksView.findViewById(R.id.newschoolDiskSelectionButton);
newschoolSelection.setChecked(useNewschoolSelection);
- newschoolSelection.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Apple2Preferences.setJSONPref(SETTINGS.USE_NEWSCHOOL_DISK_SELECTION, newschoolSelection.isChecked());
- dynamicSetup();
- }
- });
final boolean isKitKatOrBetter = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT);
final boolean includeExternalFileChooser = Apple2Utils.isExternalStorageAccessible(mActivity) && isKitKatOrBetter;
final View newschoolChooser = mDisksView.findViewById(R.id.disk_selection_newschool_chooser);
- newschoolChooser.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- final boolean alreadyChoosing = Apple2DiskChooserActivity.sDiskChooserIsChoosing.getAndSet(true);
- if (alreadyChoosing) {
- return;
- }
-
- Intent chooserIntent = new Intent(mActivity, Apple2DiskChooserActivity.class);
- chooserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION/* | Intent.FLAG_ACTIVITY_CLEAR_TOP */);
-
- Apple2DiskChooserActivity.sDisksCallback = mActivity;
- mActivity.startActivity(chooserIntent);
- }
- });
-
- final Button ejectButton1 = (Button) mDisksView.findViewById(R.id.ejectButton1);
- final Button ejectButton2 = (Button) mDisksView.findViewById(R.id.ejectButton2);
if (!includeExternalFileChooser || !useNewschoolSelection) {
disksList.setEnabled(true);
disksList.setVisibility(View.VISIBLE);
newschoolChooser.setVisibility(View.INVISIBLE);
- ejectButton1.setVisibility(View.VISIBLE);
- ejectButton2.setVisibility(View.VISIBLE);
for (int i = 0; i < 2; i++) {
LinearLayout layout = (LinearLayout) mDisksView.findViewById((i == 0) ? R.id.a2_newschool_driveA_layout : R.id.a2_newschool_driveB_layout);
@@ -594,8 +585,6 @@ public class Apple2DisksMenu implements Apple2MenuView {
disksList.setEnabled(false);
disksList.setVisibility(View.INVISIBLE);
newschoolChooser.setVisibility(View.VISIBLE);
- ejectButton1.setVisibility(View.INVISIBLE);
- ejectButton2.setVisibility(View.INVISIBLE);
// new external file chooser activity can allow navigation to restricted external SD Card(s) ...
newschoolSelection.setVisibility(View.VISIBLE);
@@ -625,12 +614,6 @@ public class Apple2DisksMenu implements Apple2MenuView {
LinearLayout layout = (LinearLayout) mDisksView.findViewById((i == 0) ? R.id.a2_newschool_driveA_layout : R.id.a2_newschool_driveB_layout);
- LinearLayout widgetLayout = (LinearLayout) mDisksView.findViewById((i == 0) ? R.id.a2_newschool_diskA_widget_frame : R.id.a2_newschool_diskB_widget_frame);
- if (widgetLayout.getChildCount() > 0) {
- // layout cells appear to be reused when scrolling into view ... make sure we start with clear hierarchy
- widgetLayout.removeAllViews();
- }
-
if (imageName == null || imageName.equals("")) {
layout.setVisibility(View.INVISIBLE);
} else {
@@ -640,21 +623,7 @@ public class Apple2DisksMenu implements Apple2MenuView {
imageName = "(" + mActivity.getResources().getString((readOnly ? R.string.disk_read_only : R.string.disk_read_write)) + "): " + imageName;
TextView textView = (TextView) mDisksView.findViewById((i == 0) ? R.id.a2_newschool_diskA : R.id.a2_newschool_diskB);
textView.setText(imageName);
-
- String eject = mActivity.getResources().getString(R.string.disk_eject);
- Button ejectButton = new Button(mActivity);
- ejectButton.setText(eject);
- final boolean isDriveA = (i == 0);
- ejectButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ejectDisk(isDriveA);
- dynamicSetup();
- }
- });
- widgetLayout.addView(ejectButton);
}
-
}
}
@@ -826,7 +795,11 @@ public class Apple2DisksMenu implements Apple2MenuView {
if (hasStateExtension(imageName)) {
final String jsonString = "{ \"stateFile\" : \"" + imageName + "\" }";
- Apple2MainMenu.restoreEmulatorState(mActivity, jsonString);
+ final boolean restored = Apple2MainMenu.restoreEmulatorState(mActivity, jsonString);
+ mActivity.dismissAllMenus();
+ if (!restored) {
+ Toast.makeText(mActivity, R.string.state_not_restored, Toast.LENGTH_SHORT).show();
+ }
return;
}
diff --git a/Android/app/src/main/res/layout/activity_disks.xml b/Android/app/src/main/res/layout/activity_disks.xml
index 93e0287d..2a08896b 100644
--- a/Android/app/src/main/res/layout/activity_disks.xml
+++ b/Android/app/src/main/res/layout/activity_disks.xml
@@ -13,21 +13,33 @@
android:background="@color/black"
android:layout_weight="1">
+
+
+
+
+
+
+
-
+
@@ -56,31 +65,23 @@
-
-
+
+
-
+
@@ -114,6 +114,7 @@
android:layout_height="wrap_content" />
+
+ android:paddingLeft="0dp"
+ android:paddingStart="0dp"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:paddingEnd="?android:attr/scrollbarSize">
@@ -151,22 +156,13 @@
android:layout_alignStart="@id/a2_newschool_driveA"
android:layout_below="@id/a2_newschool_driveA"
android:maxLines="4"
- android:text="someLongSelectedDiskName.dsk.gz"
android:textAppearance="?android:attr/textAppearanceSmall" />
-
-
-
+
+ android:paddingLeft="0dp"
+ android:paddingStart="0dp"
+ android:paddingRight="?android:attr/scrollbarSize"
+ android:paddingEnd="?android:attr/scrollbarSize">
-
-
-
\ No newline at end of file
diff --git a/Android/app/src/main/res/values-de/strings.xml b/Android/app/src/main/res/values-de/strings.xml
index e42b11bd..a7c595d8 100644
--- a/Android/app/src/main/res/values-de/strings.xml
+++ b/Android/app/src/main/res/values-de/strings.xml
@@ -32,13 +32,18 @@
Laufwerk 1
Laufwerk 2
Auswerfen
+ Cannot insert (not a disk image or state file)
Schreibgeschützt
Lesen/Schreiben
+ System chooser
Zeige Disk ][ Aktivität
Zeigt wenn die Laufwerke lesen oder schreiben
Fortsetzen…
Lade Disk-Image…
+ Choose disk image or state file…
Diskette einlegen:
+ Auswerfen 1
+ Auswerfen 2
Aktuelles Touch Device
Wähle ein aktuelles Touch Device
Joystick
diff --git a/Android/app/src/main/res/values-es/strings.xml b/Android/app/src/main/res/values-es/strings.xml
index 75241d5d..1f4fe820 100644
--- a/Android/app/src/main/res/values-es/strings.xml
+++ b/Android/app/src/main/res/values-es/strings.xml
@@ -32,13 +32,18 @@
Disquetera 1
Disquetera 2
Eyectar
+ Cannot insert (not a disk image or state file)
Sólo leer
Leer y escribir
+ System chooser
Mostrar las operaciones de "Disk ]["
Shows when disk drives are reading or writing
Continuar…
Insertar imagen de disquete…
+ Choose disk image or state file…
Insertar imagen de disquete:
+ Eyectar 1
+ Eyectar 2
Unidad de entrada actual
Elija unidad de entrada
"Joystick"
diff --git a/Android/app/src/main/res/values-fr/strings.xml b/Android/app/src/main/res/values-fr/strings.xml
index cf0a23be..36ca1163 100644
--- a/Android/app/src/main/res/values-fr/strings.xml
+++ b/Android/app/src/main/res/values-fr/strings.xml
@@ -32,13 +32,18 @@
Lecteur 1
Lecteur 2
Ejecter
+ Cannot insert (not a disk image or state file)
+ System chooser
Lecture seulement
Lecture/Ecriture
Afficher les opérations (disque) ][
Indique si les disques sont en lecture ou en écriture
Continuer…
Chargement de l\'image disque…
+ Choose disk image or state file…
Insérer la disquettte :
+ Ejecter 1
+ Ejecter 2
Tactile
Choisir l\'appareil courant
Joystick
diff --git a/Android/app/src/main/res/values/strings.xml b/Android/app/src/main/res/values/strings.xml
index 82560275..498d2954 100644
--- a/Android/app/src/main/res/values/strings.xml
+++ b/Android/app/src/main/res/values/strings.xml
@@ -39,12 +39,12 @@
Cannot insert (not a disk image or state file)
Read only
Read/write
- Use system file chooser
+ System chooser
Show Disk ][ operations
Shows when disk drives are reading or writing
Continue…
Load disk image
- Choose disk…
+ Choose disk image or state file…
Insert disk:
Eject 1
Eject 2