Commit 9024435b authored by ajoa's avatar ajoa Committed by Evan W. Patton

Change ShowListsAsJson default value from false to true


Change-Id: I8dfb4482028f96bfe05937600cb6ab930ff4c0fd
parent d2083ab5
...@@ -27,6 +27,7 @@ $Source $Yail ...@@ -27,6 +27,7 @@ $Source $Yail
(set-and-coerce-property! 'Screen1 'PrimaryColor #xFFA5CF47 'number) (set-and-coerce-property! 'Screen1 'PrimaryColor #xFFA5CF47 'number)
(set-and-coerce-property! 'Screen1 'PrimaryColorDark #xFF516623 'number) (set-and-coerce-property! 'Screen1 'PrimaryColorDark #xFF516623 'number)
(set-and-coerce-property! 'Screen1 'Scrollable #t 'boolean) (set-and-coerce-property! 'Screen1 'Scrollable #t 'boolean)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'Theme "AppTheme.Light.DarkActionBar" 'text) (set-and-coerce-property! 'Screen1 'Theme "AppTheme.Light.DarkActionBar" 'text)
(set-and-coerce-property! 'Screen1 'Title "MIT App Inventor 2" 'text) (set-and-coerce-property! 'Screen1 'Title "MIT App Inventor 2" 'text)
......
...@@ -19,7 +19,7 @@ useslocation=False ...@@ -19,7 +19,7 @@ useslocation=False
androidminsdk=7 androidminsdk=7
actionbar=true actionbar=true
sizing=Responsive sizing=Responsive
showlistsasjson=False showlistsasjson=True
theme=AppTheme.Light.DarkActionBar theme=AppTheme.Light.DarkActionBar
color.primary=&HFFA5CF47 color.primary=&HFFA5CF47
color.primary.dark=&HFF516623 color.primary.dark=&HFF516623
......
...@@ -997,6 +997,19 @@ public final class YoungAndroidFormUpgrader { ...@@ -997,6 +997,19 @@ public final class YoungAndroidFormUpgrader {
srcCompVersion = 25; srcCompVersion = 25;
} }
if (srcCompVersion < 26) {
// ShowListsAsJson changed from False to True
if (componentProperties.containsKey("ShowListsAsJson")) {
final String value = componentProperties.get("ShowListsAsJson").asString().getString();
if (value.equals("True")) {
componentProperties.remove("ShowListsAsJson");
}
} else {
componentProperties.put("ShowListsAsJson", new ClientJsonString("False"));
}
srcCompVersion = 26;
}
return srcCompVersion; return srcCompVersion;
} }
......
...@@ -2281,7 +2281,11 @@ Blockly.Versioning.AllUpgradeMaps = ...@@ -2281,7 +2281,11 @@ Blockly.Versioning.AllUpgradeMaps =
// For FORM_COMPONENT_VERSION 25: // For FORM_COMPONENT_VERSION 25:
// - Sizing default value changed from Fixed to Responsive // - Sizing default value changed from Fixed to Responsive
25: "noUpgrade" 25: "noUpgrade",
// For FORM_COMPONENT_VERISON 26:
// - ShowListsAsJson default value changed from False to True
26: "noUpgrade"
}, // End Screen }, // End Screen
......
...@@ -7,5 +7,6 @@ $Source $Yail ...@@ -7,5 +7,6 @@ $Source $Yail
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
) )
(init-runtime) (init-runtime)
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "CamcorderTest" 'text) (set-and-coerce-property! 'Screen1 'Title "CamcorderTest" 'text)
) )
......
...@@ -6,8 +6,9 @@ $Source $Yail ...@@ -6,8 +6,9 @@ $Source $Yail
(require <com.google.youngandroid.runtime>) (require <com.google.youngandroid.runtime>)
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'Title "ClockTest" 'text) (set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "ClockTest" 'text)
) )
;;; HorizontalArrangement1 ;;; HorizontalArrangement1
(add-component Screen1 HorizontalArrangement HorizontalArrangement1 ) (add-component Screen1 HorizontalArrangement HorizontalArrangement1 )
......
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "CopyCat" 'text) (set-and-coerce-property! 'Screen1 'Title "CopyCat" 'text)
) )
......
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
......
...@@ -6,6 +6,7 @@ $Source $Yail ...@@ -6,6 +6,7 @@ $Source $Yail
(require <com.google.youngandroid.runtime>) (require <com.google.youngandroid.runtime>)
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
;;; Button1 ;;; Button1
......
...@@ -14,6 +14,7 @@ $Source $Yail ...@@ -14,6 +14,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'BackgroundColor #xFFCCCCCC 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'BackgroundColor #xFFCCCCCC 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Make-A-Quiz" 'text) (set-and-coerce-property! 'Screen1 'Title "Make-A-Quiz" 'text)
) )
......
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AppName "math" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AppName "math" 'text)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
......
...@@ -11,6 +11,7 @@ $Source $Yail ...@@ -11,6 +11,7 @@ $Source $Yail
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
......
...@@ -8,6 +8,7 @@ $Source $Yail ...@@ -8,6 +8,7 @@ $Source $Yail
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
......
...@@ -12,6 +12,7 @@ $Source $Yail ...@@ -12,6 +12,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'BackgroundColor #xFF000000 'number) (set-and-coerce-property! 'Screen1 'BackgroundColor #xFF000000 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "PictureCycle" 'text) (set-and-coerce-property! 'Screen1 'Title "PictureCycle" 'text)
) )
......
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Product Lookup" 'text) (set-and-coerce-property! 'Screen1 'Title "Product Lookup" 'text)
) )
......
...@@ -6,8 +6,9 @@ $Source $Yail ...@@ -6,8 +6,9 @@ $Source $Yail
(require <com.google.youngandroid.runtime>) (require <com.google.youngandroid.runtime>)
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number) (do-after-form-creation (set-and-coerce-property! 'Screen1 'AlignHorizontal 3 'number)
(set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'Title "SensorTest" 'text) (set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "SensorTest" 'text)
) )
;;; Label1 ;;; Label1
(add-component Screen1 Label Label1 (set-and-coerce-property! 'Label1 'FontSize 30 'number) (add-component Screen1 Label Label1 (set-and-coerce-property! 'Label1 'FontSize 30 'number)
......
...@@ -9,6 +9,7 @@ $Source $Yail ...@@ -9,6 +9,7 @@ $Source $Yail
;;; Screen1 ;;; Screen1
(do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text) (do-after-form-creation (set-and-coerce-property! 'Screen1 'Sizing "Responsive" 'text)
(set-and-coerce-property! 'Screen1 'ShowListsAsJson #t 'boolean)
(set-and-coerce-property! 'Screen1 'Title "Screen1" 'text) (set-and-coerce-property! 'Screen1 'Title "Screen1" 'text)
) )
......
...@@ -475,8 +475,10 @@ public class YaVersion { ...@@ -475,8 +475,10 @@ public class YaVersion {
// - CANVAS_COMPONENT_VERSION was incremented to 12 // - CANVAS_COMPONENT_VERSION was incremented to 12
// For YOUNG_ANDROID_VERSION 192: // For YOUNG_ANDROID_VERSION 192:
// - BALL_COMPONENT_VERSION was incremented to 6 // - BALL_COMPONENT_VERSION was incremented to 6
// For YOUNG_ANDROID_VERSION 193:
// - FORM_COMPONENT_VERSION was incremented to 26
public static final int YOUNG_ANDROID_VERSION = 192; public static final int YOUNG_ANDROID_VERSION = 193;
// ............................... Blocks Language Version Number ............................... // ............................... Blocks Language Version Number ...............................
...@@ -822,7 +824,9 @@ public class YaVersion { ...@@ -822,7 +824,9 @@ public class YaVersion {
// - Added the PermissionGranted event // - Added the PermissionGranted event
// For FORM_COMOPONENT_VERSION 25: // For FORM_COMOPONENT_VERSION 25:
// - Sizing default value changed from Fixed to Responsive // - Sizing default value changed from Fixed to Responsive
public static final int FORM_COMPONENT_VERSION = 25; // For FORM_COMPONENT_VERSION 26:
// - Updated the default value of ShowListsAsJson from false -> true
public static final int FORM_COMPONENT_VERSION = 26;
// For FUSIONTABLESCONTROL_COMPONENT_VERSION 2: // For FUSIONTABLESCONTROL_COMPONENT_VERSION 2:
// - The Fusiontables API was migrated from SQL to V1 // - The Fusiontables API was migrated from SQL to V1
......
...@@ -199,7 +199,7 @@ public class Form extends AppInventorCompatActivity ...@@ -199,7 +199,7 @@ public class Form extends AppInventorCompatActivity
private ScaledFrameLayout scaleLayout; private ScaledFrameLayout scaleLayout;
private static boolean sCompatibilityMode; private static boolean sCompatibilityMode;
private static boolean showListsAsJson = false; private static boolean showListsAsJson;
private final Set<String> permissions = new HashSet<String>(); private final Set<String> permissions = new HashSet<String>();
...@@ -447,7 +447,7 @@ public class Form extends AppInventorCompatActivity ...@@ -447,7 +447,7 @@ public class Form extends AppInventorCompatActivity
Title(""); Title("");
ShowStatusBar(true); ShowStatusBar(true);
TitleVisible(true); TitleVisible(true);
ShowListsAsJson(false); // Note: Only the Screen1 value is used as this is per-project ShowListsAsJson(true); // Note: Only the Screen1 value is used as this is per-project
ActionBar(false); ActionBar(false);
AccentColor(DEFAULT_ACCENT_COLOR); AccentColor(DEFAULT_ACCENT_COLOR);
PrimaryColor(DEFAULT_PRIMARY_COLOR); PrimaryColor(DEFAULT_PRIMARY_COLOR);
...@@ -1738,7 +1738,7 @@ public class Form extends AppInventorCompatActivity ...@@ -1738,7 +1738,7 @@ public class Form extends AppInventorCompatActivity
*/ */
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN, @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN,
defaultValue = "False") defaultValue = "True", alwaysSend = true)
@SimpleProperty(category = PropertyCategory.APPEARANCE, userVisible = false, @SimpleProperty(category = PropertyCategory.APPEARANCE, userVisible = false,
// This description won't appear as a tooltip, since there's no block, but we'll keep it with the source. // This description won't appear as a tooltip, since there's no block, but we'll keep it with the source.
description = "If false, lists will be converted to strings using Lisp " description = "If false, lists will be converted to strings using Lisp "
...@@ -1746,13 +1746,11 @@ public class Form extends AppInventorCompatActivity ...@@ -1746,13 +1746,11 @@ public class Form extends AppInventorCompatActivity
+ "d). If true, lists will appear as in Json or Python, e.g. [\"a\", 1, " + "d). If true, lists will appear as in Json or Python, e.g. [\"a\", 1, "
+ "\"b\", 2, [\"c\", \"d\"]]. This property appears only in Screen 1, " + "\"b\", 2, [\"c\", \"d\"]]. This property appears only in Screen 1, "
+ "and the value for Screen 1 determines the behavior for all " + "and the value for Screen 1 determines the behavior for all "
+ "screens. The property defaults to \"false\" meaning that the App " + "screens. The property defaults to \"true\" meaning that the App "
+ "Inventor programmer must explicitly set it to \"true\" if JSON/Python " + "Inventor programmer must explicitly set it to \"false\" if Lisp "
+ "syntax is desired. At some point in the future we will alter the " + "syntax is desired. In older versions of App Inventor, this setting "
+ "system so that new projects are created with this property set to " + "defaulted to false. Older projects should not have been affected by "
+ "\"true\" by default. Existing projects will not be impacted. The App " + "this default settings update."
+ "Inventor programmer can also set it back to \"false\" in newer "
+ "projects if desired. "
) )
public void ShowListsAsJson(boolean asJson) { public void ShowListsAsJson(boolean asJson) {
showListsAsJson = asJson; showListsAsJson = asJson;
......
...@@ -1015,13 +1015,11 @@ none ...@@ -1015,13 +1015,11 @@ none
i.e., as symbols separated by spaces, e.g., (a 1 b2 (c d)). If true, i.e., as symbols separated by spaces, e.g., (a 1 b2 (c d)). If true,
lists will appear as in Json or Python, e.g. ["a", 1, "b", 2, ["c", lists will appear as in Json or Python, e.g. ["a", 1, "b", 2, ["c",
"d"]]. This property appears only in Screen 1, and the value for "d"]]. This property appears only in Screen 1, and the value for
Screen 1 determines the behavior for all screens. The property Screen 1 determines the behavior for all screens. The property defaults to true
defaults to "false" meaning that the App Inventor programmer must meaning that the App Inventor programmer must explicitly set it to false
explicitly set it to “true” if JSON/Python syntax is desired. At some if Lisp syntax is desired. In older versions of App Inventor, this setting
point in the future we will alter the system so that new projects are defaulted to false. Older projects should not have been affected by
created with this property set to "true" by default. Existing projects this default settings update.
will not be impacted. The App Inventor programmer can also set it back
to "false" in newer projects if desired.
</dd> </dd>
<dt><code><em>ShowStatusBar</em></code></dt> <dt><code><em>ShowStatusBar</em></code></dt>
<dd>The status bar is the topmost bar on the screen. This property reports whether the status bar is visible.</dd> <dd>The status bar is the topmost bar on the screen. This property reports whether the status bar is visible.</dd>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment