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
4bfa0e35
Commit
4bfa0e35
authored
Feb 26, 2019
by
ZhengCornell
Committed by
Evan W. Patton
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make preview size listbox invisible when Sizing = Fixed
parent
648cdbf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
22 deletions
+38
-22
appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java
...or/client/editor/simple/SimpleVisibleComponentsPanel.java
+38
-22
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java
View file @
4bfa0e35
...
...
@@ -92,27 +92,15 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
@Override
protected
void
onLoad
()
{
// onLoad is called immediately after a widget becomes attached to the browser's document.
String
val
=
projectEditor
.
getProjectSettingsProperty
(
SettingsConstants
.
PROJECT_YOUNG_ANDROID_SETTINGS
,
SettingsConstants
.
YOUNG_ANDROID_SETTINGS_PHONE_TABLET
);
int
idx
=
0
;
int
width
=
320
;
int
height
=
505
;
if
(
val
.
equals
(
"True"
))
{
idx
=
1
;
width
=
drop_lst
[
idx
][
0
];
height
=
drop_lst
[
idx
][
1
];
}
String
[]
parts
=
val
.
split
(
","
);
if
(
parts
.
length
==
3
)
{
idx
=
Integer
.
parseInt
(
parts
[
0
]);
width
=
Integer
.
parseInt
(
parts
[
1
]);
height
=
Integer
.
parseInt
(
parts
[
2
]);
String
sizing
=
projectEditor
.
getProjectSettingsProperty
(
SettingsConstants
.
PROJECT_YOUNG_ANDROID_SETTINGS
,
SettingsConstants
.
YOUNG_ANDROID_SETTINGS_SIZING
);
boolean
fixed
=
(
sizing
.
equals
(
"Fixed"
));
listboxPhoneTablet
.
setVisible
(!
fixed
);
if
(
fixed
)
{
changeFormPreviewSize
(
0
,
320
,
505
);
}
else
{
getUserSettingChangeSize
();
}
listboxPhoneTablet
.
setItemSelected
(
idx
,
true
);
changeFormPreviewSize
(
idx
,
width
,
height
);
}
};
listboxPhoneTablet
.
addItem
(
"Phone size"
);
...
...
@@ -131,11 +119,36 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
changeFormPreviewSize
(
idx
,
width
,
height
);
}
});
phoneScreen
.
add
(
listboxPhoneTablet
);
initWidget
(
phoneScreen
);
}
// get width and height stored in user settings, and change the preview size.
private
void
getUserSettingChangeSize
()
{
String
val
=
projectEditor
.
getProjectSettingsProperty
(
SettingsConstants
.
PROJECT_YOUNG_ANDROID_SETTINGS
,
SettingsConstants
.
YOUNG_ANDROID_SETTINGS_PHONE_TABLET
);
int
idx
=
0
;
int
width
=
320
;
int
height
=
505
;
if
(
val
.
equals
(
"True"
))
{
idx
=
1
;
width
=
drop_lst
[
idx
][
0
];
height
=
drop_lst
[
idx
][
1
];
}
String
[]
parts
=
val
.
split
(
","
);
if
(
parts
.
length
==
3
)
{
idx
=
Integer
.
parseInt
(
parts
[
0
]);
width
=
Integer
.
parseInt
(
parts
[
1
]);
height
=
Integer
.
parseInt
(
parts
[
2
]);
}
listboxPhoneTablet
.
setItemSelected
(
idx
,
true
);
changeFormPreviewSize
(
idx
,
width
,
height
);
}
private
void
changeFormPreviewSize
(
int
idx
,
int
width
,
int
height
)
{
if
(
form
!=
null
)
{
form
.
changePreviewSize
(
width
,
height
);
...
...
@@ -161,8 +174,11 @@ public final class SimpleVisibleComponentsPanel extends Composite implements Dro
public
void
enableTabletPreviewCheckBox
(
boolean
enable
){
if
(
form
!=
null
){
if
(!
enable
){
form
.
changePreviewSize
(
320
,
505
);
listboxPhoneTablet
.
setItemSelected
(
0
,
true
);
changeFormPreviewSize
(
0
,
320
,
505
);
listboxPhoneTablet
.
setVisible
(
enable
);
}
else
{
getUserSettingChangeSize
();
listboxPhoneTablet
.
setVisible
(
enable
);
}
}
listboxPhoneTablet
.
setEnabled
(
enable
);
...
...
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