Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
cc2f5bb2
Unverified
Commit
cc2f5bb2
authored
Dec 01, 2020
by
Himani
Committed by
GitHub
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the Designer reflect "ShowStatusBar" checkbox state (#2331)
parent
2cb788cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockForm.java
...appinventor/client/editor/simple/components/MockForm.java
+27
-5
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockForm.java
View file @
cc2f5bb2
...
...
@@ -133,6 +133,7 @@ public final class MockForm extends MockContainer {
// UI elements
private
DockPanel
bar
;
private
Image
phoneBarImage
;
private
boolean
visible
;
/*
* Creates a new phone status bar.
...
...
@@ -149,6 +150,15 @@ public final class MockForm extends MockContainer {
setStylePrimaryName
(
"ode-SimpleMockFormPhoneBar"
);
setSize
(
"100%"
,
HEIGHT
+
"px"
);
}
void
getVisibility
(
boolean
visible
)
{
this
.
visible
=
visible
;
}
int
getHeight
()
{
// Adjust for CSS borders, which are not included in the height value
return
visible
?
PhoneBar
.
HEIGHT
+
3
:
0
;
}
}
/*
...
...
@@ -219,6 +229,7 @@ public final class MockForm extends MockContainer {
private
static
final
String
PROPERTY_NAME_ANAME
=
"AppName"
;
private
static
final
String
PROPERTY_NAME_SIZING
=
"Sizing"
;
// Don't show except on screen1
private
static
final
String
PROPERTY_NAME_TITLEVISIBLE
=
"TitleVisible"
;
private
static
final
String
PROPERTY_NAME_SHOW_STATUS_BAR
=
"ShowStatusBar"
;
// Don't show except on screen1
private
static
final
String
PROPERTY_NAME_SHOW_LISTS_AS_JSON
=
"ShowListsAsJson"
;
private
static
final
String
PROPERTY_NAME_TUTORIAL_URL
=
"TutorialURL"
;
...
...
@@ -236,6 +247,7 @@ public final class MockForm extends MockContainer {
ScrollPanel
scrollPanel
;
private
TitleBar
titleBar
;
private
PhoneBar
phoneBar
;
private
NavigationBar
navigationBar
;
private
List
<
MockComponent
>
selectedComponents
=
new
ArrayList
<
MockComponent
>(
Collections
.
singleton
(
this
));
private
MockContainer
pasteTarget
=
this
;
...
...
@@ -286,7 +298,8 @@ public final class MockForm extends MockContainer {
responsivePanel
=
new
AbsolutePanel
();
// Initialize mock form UI by adding the phone bar and title bar.
responsivePanel
.
add
(
new
PhoneBar
());
phoneBar
=
new
PhoneBar
();
responsivePanel
.
add
(
phoneBar
);
titleBar
=
new
TitleBar
();
responsivePanel
.
add
(
titleBar
);
...
...
@@ -355,10 +368,10 @@ public final class MockForm extends MockContainer {
screenHeight
=
newHeight
;
if
(
landscape
)
{
usableScreenWidth
=
screenWidth
-
navigationBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
phoneBar
.
getHeight
()
-
titleBar
.
getHeight
();
}
else
{
usableScreenWidth
=
screenWidth
;
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
()
-
navigationBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
phoneBar
.
getHeight
()
-
titleBar
.
getHeight
()
-
navigationBar
.
getHeight
();
}
rootPanel
.
setPixelSize
(
usableScreenWidth
,
usableScreenHeight
);
...
...
@@ -550,10 +563,10 @@ public final class MockForm extends MockContainer {
setPhoneStyle
();
if
(
landscape
)
{
usableScreenWidth
=
screenWidth
-
navigationBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
phoneBar
.
getHeight
()
-
titleBar
.
getHeight
();
}
else
{
usableScreenWidth
=
screenWidth
;
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
()
-
navigationBar
.
getHeight
();
usableScreenHeight
=
screenHeight
-
phoneBar
.
getHeight
()
-
titleBar
.
getHeight
()
-
navigationBar
.
getHeight
();
}
resizePanel
(
screenWidth
,
screenHeight
);
...
...
@@ -628,6 +641,13 @@ public final class MockForm extends MockContainer {
}
}
private
void
setShowStatusBarProperty
(
String
text
)
{
boolean
visible
=
Boolean
.
parseBoolean
(
text
);
phoneBar
.
setVisible
(
visible
);
phoneBar
.
getVisibility
(
visible
);
resizePanel
(
screenWidth
,
screenHeight
);
// update the MockForm size
}
private
void
setTutorialURLProperty
(
String
asJson
)
{
// This property actually applies to the application and is only visible on
// Screen1. When we load a form that is not Screen1, this method will be called with the
...
...
@@ -1028,6 +1048,8 @@ public final class MockForm extends MockContainer {
setANameProperty
(
newValue
);
}
else
if
(
propertyName
.
equals
(
PROPERTY_NAME_SHOW_LISTS_AS_JSON
))
{
setShowListsAsJsonProperty
(
newValue
);
}
else
if
(
propertyName
.
equals
(
PROPERTY_NAME_SHOW_STATUS_BAR
))
{
setShowStatusBarProperty
(
newValue
);
}
else
if
(
propertyName
.
equals
(
PROPERTY_NAME_TUTORIAL_URL
))
{
setTutorialURLProperty
(
newValue
);
}
else
if
(
propertyName
.
equals
(
PROPERTY_NAME_BLOCK_SUBSET
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment