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
ab109ff4
Unverified
Commit
ab109ff4
authored
Oct 11, 2023
by
Susan Rati Lane
Committed by
GitHub
Oct 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore substitution for spaces in project name (#2991)
parent
7cde9da3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
30 deletions
+26
-30
appinventor/appengine/src/com/google/appinventor/client/wizards/youngandroid/NewYoungAndroidProjectWizard.java
...nt/wizards/youngandroid/NewYoungAndroidProjectWizard.java
+26
-30
No files found.
appinventor/appengine/src/com/google/appinventor/client/wizards/youngandroid/NewYoungAndroidProjectWizard.java
View file @
ab109ff4
...
...
@@ -104,10 +104,12 @@ public final class NewYoungAndroidProjectWizard {
@UiHandler
(
"addButton"
)
void
addProject
(
ClickEvent
e
)
{
TextValidators
.
ProjectNameStatus
status
=
TextValidators
.
checkNewProjectName
(
projectNameTextBox
.
getText
());
String
projectName
=
projectNameTextBox
.
getText
().
trim
();
projectName
=
projectName
.
replaceAll
(
"( )+"
,
" "
).
replace
(
" "
,
"_"
);
TextValidators
.
ProjectNameStatus
status
=
TextValidators
.
checkNewProjectName
(
projectName
);
if
(
status
==
TextValidators
.
ProjectNameStatus
.
SUCCESS
)
{
LOG
.
info
(
"Project status success"
);
createProject
(
);
doCreateProject
(
projectName
);
addDialog
.
hide
();
}
else
{
LOG
.
info
(
"Checking for error"
);
...
...
@@ -128,35 +130,29 @@ public final class NewYoungAndroidProjectWizard {
}
public
void
createProject
()
{
String
projectName
=
projectNameTextBox
.
getText
().
trim
();
projectName
=
projectName
.
replaceAll
(
"( )+"
,
" "
).
replace
(
" "
,
"_"
);
if
(
TextValidators
.
checkNewProjectName
(
projectName
)
==
TextValidators
.
ProjectNameStatus
.
SUCCESS
)
{
String
packageName
=
StringUtils
.
getProjectPackage
(
Ode
.
getInstance
().
getUser
().
getUserEmail
(),
projectName
);
NewYoungAndroidProjectParameters
parameters
=
new
NewYoungAndroidProjectParameters
(
packageName
);
NewProjectWizard
.
NewProjectCommand
callbackCommand
=
new
NewProjectWizard
.
NewProjectCommand
()
{
@Override
public
void
execute
(
final
Project
project
)
{
Scheduler
.
get
().
scheduleDeferred
(
new
Scheduler
.
ScheduledCommand
()
{
@Override
public
void
execute
()
{
if
(
Ode
.
getInstance
().
screensLocked
())
{
// Wait until I/O finished
Scheduler
.
get
().
scheduleDeferred
(
this
);
// on other project
}
else
{
Ode
.
getInstance
().
openYoungAndroidProjectInDesigner
(
project
);
}
public
void
doCreateProject
(
String
projectName
)
{
String
packageName
=
StringUtils
.
getProjectPackage
(
Ode
.
getInstance
().
getUser
().
getUserEmail
(),
projectName
);
NewYoungAndroidProjectParameters
parameters
=
new
NewYoungAndroidProjectParameters
(
packageName
);
NewProjectWizard
.
NewProjectCommand
callbackCommand
=
new
NewProjectWizard
.
NewProjectCommand
()
{
@Override
public
void
execute
(
final
Project
project
)
{
Scheduler
.
get
().
scheduleDeferred
(
new
Scheduler
.
ScheduledCommand
()
{
@Override
public
void
execute
()
{
if
(
Ode
.
getInstance
().
screensLocked
())
{
// Wait until I/O finished
Scheduler
.
get
().
scheduleDeferred
(
this
);
// on other project
}
else
{
Ode
.
getInstance
().
openYoungAndroidProjectInDesigner
(
project
);
}
});
}
};
NewProjectWizard
.
createNewProject
(
YoungAndroidProjectNode
.
YOUNG_ANDROID_PROJECT_TYPE
,
projectName
,
parameters
,
callbackCommand
);
Tracking
.
trackEvent
(
Tracking
.
PROJECT_EVENT
,
Tracking
.
PROJECT_ACTION_NEW_YA
,
projectName
);
}
});
}
};
}
NewProjectWizard
.
createNewProject
(
YoungAndroidProjectNode
.
YOUNG_ANDROID_PROJECT_TYPE
,
projectName
,
parameters
,
callbackCommand
);
Tracking
.
trackEvent
(
Tracking
.
PROJECT_EVENT
,
Tracking
.
PROJECT_ACTION_NEW_YA
,
projectName
);
}
}
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