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
60a199df
Commit
60a199df
authored
Jun 07, 2019
by
Amerkashi
Committed by
Evan W. Patton
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add phone skin to designer
parent
e1df9868
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
22 deletions
+97
-22
appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java
...or/client/editor/simple/SimpleVisibleComponentsPanel.java
+18
-17
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockForm.java
...appinventor/client/editor/simple/components/MockForm.java
+31
-5
appinventor/appengine/war/Ya.css
appinventor/appengine/war/Ya.css
+48
-0
appinventor/appengine/war/images/phoneLandscape.png
appinventor/appengine/war/images/phoneLandscape.png
+0
-0
appinventor/appengine/war/images/phoneLandscapeMonitor.png
appinventor/appengine/war/images/phoneLandscapeMonitor.png
+0
-0
appinventor/appengine/war/images/phoneLandscapeTablet.png
appinventor/appengine/war/images/phoneLandscapeTablet.png
+0
-0
appinventor/appengine/war/images/phonePortrait.png
appinventor/appengine/war/images/phonePortrait.png
+0
-0
appinventor/appengine/war/images/phonePortraitMonitor.png
appinventor/appengine/war/images/phonePortraitMonitor.png
+0
-0
appinventor/appengine/war/images/phonePortraitTablet.png
appinventor/appengine/war/images/phonePortraitTablet.png
+0
-0
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java
View file @
60a199df
...
@@ -150,8 +150,11 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
...
@@ -150,8 +150,11 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
}
}
private
void
changeFormPreviewSize
(
int
idx
,
int
width
,
int
height
)
{
private
void
changeFormPreviewSize
(
int
idx
,
int
width
,
int
height
)
{
if
(
form
!=
null
)
{
form
.
changePreviewSize
(
width
,
height
);
if
(
form
==
null
)
return
;
form
.
changePreviewSize
(
width
,
height
,
idx
);
String
info
=
" ("
+
height
+
","
+
width
+
")"
;
String
info
=
" ("
+
height
+
","
+
width
+
")"
;
if
(
idx
==
0
)
{
if
(
idx
==
0
)
{
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewPhoneSize
()
+
info
);
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewPhoneSize
()
+
info
);
...
@@ -161,7 +164,6 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
...
@@ -161,7 +164,6 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewTabletSize
()
+
info
);
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewTabletSize
()
+
info
);
listboxPhoneTablet
.
setItemText
(
0
,
MESSAGES
.
previewPhoneSize
());
listboxPhoneTablet
.
setItemText
(
0
,
MESSAGES
.
previewPhoneSize
());
listboxPhoneTablet
.
setItemText
(
2
,
MESSAGES
.
previewMonitorSize
());
listboxPhoneTablet
.
setItemText
(
2
,
MESSAGES
.
previewMonitorSize
());
}
else
{
}
else
{
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewMonitorSize
()
+
info
);
listboxPhoneTablet
.
setItemText
(
idx
,
MESSAGES
.
previewMonitorSize
()
+
info
);
listboxPhoneTablet
.
setItemText
(
0
,
MESSAGES
.
previewPhoneSize
());
listboxPhoneTablet
.
setItemText
(
0
,
MESSAGES
.
previewPhoneSize
());
...
@@ -169,7 +171,6 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
...
@@ -169,7 +171,6 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
}
}
// change settings
// change settings
}
}
}
public
void
enableTabletPreviewCheckBox
(
boolean
enable
){
public
void
enableTabletPreviewCheckBox
(
boolean
enable
){
if
(
form
!=
null
){
if
(
form
!=
null
){
...
...
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockForm.java
View file @
60a199df
...
@@ -198,6 +198,7 @@ public final class MockForm extends MockContainer {
...
@@ -198,6 +198,7 @@ public final class MockForm extends MockContainer {
private
int
LANDSCAPE_WIDTH
=
PHONE_LANDSCAPE_WIDTH
;
private
int
LANDSCAPE_WIDTH
=
PHONE_LANDSCAPE_WIDTH
;
private
int
LANDSCAPE_HEIGHT
=
PHONE_LANDSCAPE_HEIGHT
;
private
int
LANDSCAPE_HEIGHT
=
PHONE_LANDSCAPE_HEIGHT
;
private
boolean
landscape
=
false
;
private
boolean
landscape
=
false
;
private
int
idxPhoneSize
=
0
;
// Property names
// Property names
private
static
final
String
PROPERTY_NAME_TITLE
=
"Title"
;
private
static
final
String
PROPERTY_NAME_TITLE
=
"Title"
;
...
@@ -220,6 +221,8 @@ public final class MockForm extends MockContainer {
...
@@ -220,6 +221,8 @@ public final class MockForm extends MockContainer {
// Form UI components
// Form UI components
AbsolutePanel
formWidget
;
AbsolutePanel
formWidget
;
AbsolutePanel
phoneWidget
;
ScrollPanel
scrollPanel
;
ScrollPanel
scrollPanel
;
private
TitleBar
titleBar
;
private
TitleBar
titleBar
;
private
MockComponent
selectedComponent
;
private
MockComponent
selectedComponent
;
...
@@ -262,6 +265,8 @@ public final class MockForm extends MockContainer {
...
@@ -262,6 +265,8 @@ public final class MockForm extends MockContainer {
// future problems if we ever have threads creating forms in parallel.
// future problems if we ever have threads creating forms in parallel.
myLayout
=
MockFormHelper
.
getLayout
();
myLayout
=
MockFormHelper
.
getLayout
();
phoneWidget
=
new
AbsolutePanel
();
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhonePortrait"
);
formWidget
=
new
AbsolutePanel
();
formWidget
=
new
AbsolutePanel
();
formWidget
.
setStylePrimaryName
(
"ode-SimpleMockForm"
);
formWidget
.
setStylePrimaryName
(
"ode-SimpleMockForm"
);
...
@@ -277,7 +282,8 @@ public final class MockForm extends MockContainer {
...
@@ -277,7 +282,8 @@ public final class MockForm extends MockContainer {
//Add navigation bar at the bottom of the viewer.
//Add navigation bar at the bottom of the viewer.
formWidget
.
add
(
new
NavigationBar
());
formWidget
.
add
(
new
NavigationBar
());
initComponent
(
formWidget
);
phoneWidget
.
add
(
formWidget
);
initComponent
(
phoneWidget
);
// Set up the initial state of the vertical alignment property editor and its dropdowns
// Set up the initial state of the vertical alignment property editor and its dropdowns
try
{
try
{
...
@@ -292,19 +298,37 @@ public final class MockForm extends MockContainer {
...
@@ -292,19 +298,37 @@ public final class MockForm extends MockContainer {
setScrollableProperty
(
getPropertyValue
(
PROPERTY_NAME_SCROLLABLE
));
setScrollableProperty
(
getPropertyValue
(
PROPERTY_NAME_SCROLLABLE
));
}
}
public
void
changePreviewSize
(
int
width
,
int
height
)
{
public
void
changePreviewSize
(
int
width
,
int
height
,
int
idx
)
{
// It will definitely be modified in the future to add more options.
// It will definitely be modified in the future to add more options.
PORTRAIT_WIDTH
=
width
;
PORTRAIT_WIDTH
=
width
;
PORTRAIT_HEIGHT
=
height
;
PORTRAIT_HEIGHT
=
height
;
LANDSCAPE_WIDTH
=
height
;
LANDSCAPE_WIDTH
=
height
;
LANDSCAPE_HEIGHT
=
width
;
LANDSCAPE_HEIGHT
=
width
;
if
(
landscape
)
idxPhoneSize
=
idx
;
if
(
landscape
)
{
setPhoneStyle
();
resizePanel
(
LANDSCAPE_WIDTH
,
LANDSCAPE_HEIGHT
);
resizePanel
(
LANDSCAPE_WIDTH
,
LANDSCAPE_HEIGHT
);
else
}
resizePanel
(
PORTRAIT_WIDTH
,
PORTRAIT_HEIGHT
);
else
{
setPhoneStyle
();
resizePanel
(
width
,
height
);
}
}
}
private
void
setPhoneStyle
()
{
if
(
landscape
)
{
if
(
idxPhoneSize
==
0
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhoneLandscape"
);
else
if
(
idxPhoneSize
==
1
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhoneLandscapeTablet"
);
else
if
(
idxPhoneSize
==
2
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhoneLandscapeMonitor"
);
}
else
{
if
(
idxPhoneSize
==
0
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhonePortrait"
);
else
if
(
idxPhoneSize
==
1
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhonePortraitTablet"
);
else
if
(
idxPhoneSize
==
2
)
phoneWidget
.
setStylePrimaryName
(
"ode-SimpleMockFormPhonePortraitMonitor"
);
}
}
/*
/*
* Resizes the scrollPanel and formWidget based on the screen size.
* Resizes the scrollPanel and formWidget based on the screen size.
*/
*/
...
@@ -521,10 +545,12 @@ public final class MockForm extends MockContainer {
...
@@ -521,10 +545,12 @@ public final class MockForm extends MockContainer {
screenWidth
=
LANDSCAPE_WIDTH
;
screenWidth
=
LANDSCAPE_WIDTH
;
screenHeight
=
LANDSCAPE_HEIGHT
;
screenHeight
=
LANDSCAPE_HEIGHT
;
landscape
=
true
;
landscape
=
true
;
setPhoneStyle
();
}
else
{
}
else
{
screenWidth
=
PORTRAIT_WIDTH
;
screenWidth
=
PORTRAIT_WIDTH
;
screenHeight
=
PORTRAIT_HEIGHT
;
screenHeight
=
PORTRAIT_HEIGHT
;
landscape
=
false
;
landscape
=
false
;
setPhoneStyle
();
}
}
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
()
-
NavigationBar
.
HEIGHT
;
usableScreenHeight
=
screenHeight
-
PhoneBar
.
HEIGHT
-
titleBar
.
getHeight
()
-
NavigationBar
.
HEIGHT
;
resizePanel
(
screenWidth
,
screenHeight
);
resizePanel
(
screenWidth
,
screenHeight
);
...
...
appinventor/appengine/war/Ya.css
View file @
60a199df
...
@@ -990,6 +990,54 @@ select.ode-PropertyEditor[disabled] {
...
@@ -990,6 +990,54 @@ select.ode-PropertyEditor[disabled] {
border
:
2px
solid
black
;
border
:
2px
solid
black
;
}
}
/* ==== start: skins for Android */
.ode-SimpleMockFormPhoneLandscape
{
background
:
url(images/phoneLandscape.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
11px
43px
7px
48px
;
}
.ode-SimpleMockFormPhonePortrait
{
background
:
url(images/phonePortrait.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
50px
11px
43px
7px
;
}
.ode-SimpleMockFormPhoneLandscapeTablet
{
background
:
url(images/phoneLandscapeTablet.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
15px
56px
12px
64px
;
;
}
.ode-SimpleMockFormPhonePortraitTablet
{
background
:
url(images/phonePortraitTablet.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
64px
13px
55px
13px
;
}
.ode-SimpleMockFormPhoneLandscapeMonitor
{
background
:
url(images/phoneLandscapeMonitor.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
44px
43px
39px
48px
;
}
.ode-SimpleMockFormPhonePortraitMonitor
{
background
:
url(images/phonePortraitMonitor.png)
;
background-repeat
:
no-repeat
;
background-position
:
right
top
;
background-size
:
100%
100%
;
padding
:
99px
36px
75px
34px
;
}
/* ==== end: skins for Android */
.ode-SimpleMockForm-selected
{
.ode-SimpleMockForm-selected
{
border
:
2px
solid
#8fc202
;
border
:
2px
solid
#8fc202
;
}
}
...
...
appinventor/appengine/war/images/phoneLandscape.png
0 → 100644
View file @
60a199df
50.7 KB
appinventor/appengine/war/images/phoneLandscapeMonitor.png
0 → 100644
View file @
60a199df
223 KB
appinventor/appengine/war/images/phoneLandscapeTablet.png
0 → 100644
View file @
60a199df
94.1 KB
appinventor/appengine/war/images/phonePortrait.png
0 → 100644
View file @
60a199df
55 KB
appinventor/appengine/war/images/phonePortraitMonitor.png
0 → 100644
View file @
60a199df
245 KB
appinventor/appengine/war/images/phonePortraitTablet.png
0 → 100644
View file @
60a199df
103 KB
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