SlideShare a Scribd company logo
1 of 28
Download to read offline
Creating a Facebook Clone - Part VIII
We are nearing the end of the signup wizard UI
© Codename One 2017 all rights reserved
The next stage would be
© Codename One 2017 all rights reserved
Your mobile number but that’s a bit of a special case
© Codename One 2017 all rights reserved
Because it leads to the email address & both of these are effectively the same form
© Codename One 2017 all rights reserved
They both look pretty similar to one another and similar between iOS/Android with the obvious platform differences.
s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
SignupForm
This is createNumber() notice that it delegates all of the work to createMobileOrEmail so lets start there first and come back.
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
SignupForm
We can reach this Form either from gender or from Email/Number based on going back & forth. So the title of the back command can differ
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
SignupForm
The text entry is just one text field so the UI is pretty trivial
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
SignupForm
Notice I use constraint which will determine the type of virtual keyboard I’ll use
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
}
SignupForm
We pass the action listener on the link, it will navigate to the "other" form. E.g. If we are in phone entry it will go to email entry
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
}
SignupForm
We add a button to the south Container. This is the "Sign Up With Email Address" link or the similar "Sign Up With Mobile Number"
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
}
SignupForm
We pass true if this is a phone number & false for email. We also pass the text of the phone/email. We'll display that in the confirmation Form. That was mostly standard
stuff it will be further clarified with the actual calls to this method:
s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
SignupForm
These are the labels we show in the Form
s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
SignupForm
The text input constraint, in this case it's a phone number. In the other case it will be an email address constraint
s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
SignupForm
Navigation to the "other" Form here we navigate to the email entry form and there we'll navigate to the number
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
}
public static SignupForm createEmail() {
return createMobileOrEmail("Email Address",
"What's Your Email Address?",
"Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
SignupForm
As you can see the email version is practically identical.
BoldBlueLink {
cn1-derive: BlueLink;
font-family: "native:MainBold";
}
theme.css
That's pretty much it for these two forms, we will need one CSS entry though. It's the same as `BlueLink` only bold. Once we do this email/number toggle should work...
© Codename One 2017 all rights reserved
There is nothing interesting here. I considered making a generic method that would generate this and the phone number/email form but decided against that. I think that
would have overgeneralized. It would have created overly confusing code.
"What's Your Email Address?",
"Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
columns(20);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
SignupForm
The code is pretty much text book boilerplate. Nothing much to talk about.
"What's Your Email Address?",
"Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
columns(20);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
SignupForm
The only thing worth noticing in this form is the `phone` & `value` variables that are passed right through the method to the confirmation form. We can now move to the
last stage of signup as there is no CSS or anything else to this form!
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
boolean phone, String value) {
SignupForm s = new SignupForm("Account Confirmation", "Password",
getCurrentForm());
SpanLabel title;
if(phone) {
title = new SpanLabel("Enter the code from your mobile phone",
"SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
SignupForm
The final stage of the signup process is the account confirmation Form
© Codename One 2017 all rights reserved
This is a trivial form as well but it does include minor things to notice.
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
boolean phone, String value) {
SignupForm s = new SignupForm("Account Confirmation", "Password",
getCurrentForm());
SpanLabel title;
if(phone) {
title = new SpanLabel("Enter the code from your mobile phone",
"SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
SignupForm
The subtitle can span lines here depending on the size of the phone screen
title = new SpanLabel("Enter the code from your mobile phone",
"SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
}
TextComponent confirm = new TextComponent().
label("Confirmation Code").
columns(20).
constraint(TextArea.NUMERIC);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(confirm);
SignupForm
We have a special center aligned message that includes the content we passed from the phone/email stage of the wizard
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
}
TextComponent confirm = new TextComponent().
label("Confirmation Code").
columns(20).
constraint(TextArea.NUMERIC);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(confirm);
Button done = s.createNextButton(e -> UIController.showMainUI());
done.setText("Confirm");
s.content.addAll(title, line, textContainer, done);
return s;
}
}
SignupForm
When done we show the main UI, I’ll add a stub for this method soon
CenterLabel {
text-align: center;
font-size: 2.2mm;
}
theme.css
We just have one more tiny change to the CSS, we need to add the new CenterLabel style
public static void showSignup() {
SignupForm.createTerms().show();
}
public static void showMainUI() {
}
UIController
Finally we need to add some wiring to show the signup process. In UIController we'll add a new signup call and we will also need a stub for showMainUI() so the signup
wizard will compile
signUp.addActionListener(e -> UIController.showSignup());
LoginForm
And finally we bind the signup wizrd to the LoginForm constructor using this code…

With that the signup process mockup is done and we can move to mocking up the main UI.

More Related Content

Similar to Creating a Facebook Clone - Part VIII - Transcript.pdf

Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfShaiAlmog1
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfCreating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfShaiAlmog1
 
Creating an Uber Clone - Part XIV.pdf
Creating an Uber Clone - Part XIV.pdfCreating an Uber Clone - Part XIV.pdf
Creating an Uber Clone - Part XIV.pdfShaiAlmog1
 
Creating an Uber Clone - Part V - Transcript.pdf
Creating an Uber Clone - Part V - Transcript.pdfCreating an Uber Clone - Part V - Transcript.pdf
Creating an Uber Clone - Part V - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfCreating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXXIV.pdf
Creating an Uber Clone - Part XXXIV.pdfCreating an Uber Clone - Part XXXIV.pdf
Creating an Uber Clone - Part XXXIV.pdfShaiAlmog1
 
Initial UI Mockup - Part 2 - Transcript.pdf
Initial UI Mockup - Part 2 - Transcript.pdfInitial UI Mockup - Part 2 - Transcript.pdf
Initial UI Mockup - Part 2 - Transcript.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XXXV.pdf
Creating a Facebook Clone - Part XXXV.pdfCreating a Facebook Clone - Part XXXV.pdf
Creating a Facebook Clone - Part XXXV.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfShaiAlmog1
 
Miscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfMiscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part X - Transcript.pdf
Creating a Whatsapp Clone - Part X - Transcript.pdfCreating a Whatsapp Clone - Part X - Transcript.pdf
Creating a Whatsapp Clone - Part X - Transcript.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XVI - Transcript.pdf
Creating a Facebook Clone - Part XVI - Transcript.pdfCreating a Facebook Clone - Part XVI - Transcript.pdf
Creating a Facebook Clone - Part XVI - Transcript.pdfShaiAlmog1
 
Creating a Facebook Clone - Part IV.pdf
Creating a Facebook Clone - Part IV.pdfCreating a Facebook Clone - Part IV.pdf
Creating a Facebook Clone - Part IV.pdfShaiAlmog1
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfShaiAlmog1
 

Similar to Creating a Facebook Clone - Part VIII - Transcript.pdf (20)

Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdf
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdf
 
Creating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfCreating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdf
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
 
Creating an Uber Clone - Part XIV.pdf
Creating an Uber Clone - Part XIV.pdfCreating an Uber Clone - Part XIV.pdf
Creating an Uber Clone - Part XIV.pdf
 
Creating an Uber Clone - Part V - Transcript.pdf
Creating an Uber Clone - Part V - Transcript.pdfCreating an Uber Clone - Part V - Transcript.pdf
Creating an Uber Clone - Part V - Transcript.pdf
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdf
 
Creating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfCreating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdf
 
Mobile Application Development class 007
Mobile Application Development class 007Mobile Application Development class 007
Mobile Application Development class 007
 
Creating an Uber Clone - Part XXXIV.pdf
Creating an Uber Clone - Part XXXIV.pdfCreating an Uber Clone - Part XXXIV.pdf
Creating an Uber Clone - Part XXXIV.pdf
 
Initial UI Mockup - Part 2 - Transcript.pdf
Initial UI Mockup - Part 2 - Transcript.pdfInitial UI Mockup - Part 2 - Transcript.pdf
Initial UI Mockup - Part 2 - Transcript.pdf
 
Creating a Facebook Clone - Part XXXV.pdf
Creating a Facebook Clone - Part XXXV.pdfCreating a Facebook Clone - Part XXXV.pdf
Creating a Facebook Clone - Part XXXV.pdf
 
Creating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdf
 
Miscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdfMiscellaneous Features - Part 2 - Transcript.pdf
Miscellaneous Features - Part 2 - Transcript.pdf
 
Creating a Whatsapp Clone - Part X - Transcript.pdf
Creating a Whatsapp Clone - Part X - Transcript.pdfCreating a Whatsapp Clone - Part X - Transcript.pdf
Creating a Whatsapp Clone - Part X - Transcript.pdf
 
Creating a Facebook Clone - Part XVI - Transcript.pdf
Creating a Facebook Clone - Part XVI - Transcript.pdfCreating a Facebook Clone - Part XVI - Transcript.pdf
Creating a Facebook Clone - Part XVI - Transcript.pdf
 
Creating a Facebook Clone - Part IV.pdf
Creating a Facebook Clone - Part IV.pdfCreating a Facebook Clone - Part IV.pdf
Creating a Facebook Clone - Part IV.pdf
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdf
 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfShaiAlmog1
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdfCreating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdfShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 
Creating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdfCreating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdf
 

Recently uploaded

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Creating a Facebook Clone - Part VIII - Transcript.pdf

  • 1. Creating a Facebook Clone - Part VIII We are nearing the end of the signup wizard UI
  • 2. © Codename One 2017 all rights reserved The next stage would be
  • 3. © Codename One 2017 all rights reserved Your mobile number but that’s a bit of a special case
  • 4. © Codename One 2017 all rights reserved Because it leads to the email address & both of these are effectively the same form
  • 5. © Codename One 2017 all rights reserved They both look pretty similar to one another and similar between iOS/Android with the obvious platform differences.
  • 6. s.createNextButton(e -> createNumber().show())); return s; } public static SignupForm createNumber() { return createMobileOrEmail("Mobile Number", "What's Your Mobile Number?", "Sign Up With Email Address", TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), SignupForm This is createNumber() notice that it delegates all of the work to createMobileOrEmail so lets start there first and come back.
  • 7. TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> SignupForm We can reach this Form either from gender or from Email/Number based on going back & forth. So the title of the back command can differ
  • 8. TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> SignupForm The text entry is just one text field so the UI is pretty trivial
  • 9. TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> SignupForm Notice I use constraint which will determine the type of virtual keyboard I’ll use
  • 10. String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> createPassword(TextArea.PHONENUMBER == constraint, textEntry.getText()).show())); return s; } SignupForm We pass the action listener on the link, it will navigate to the "other" form. E.g. If we are in phone entry it will go to email entry
  • 11. String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> createPassword(TextArea.PHONENUMBER == constraint, textEntry.getText()).show())); return s; } SignupForm We add a button to the south Container. This is the "Sign Up With Email Address" link or the similar "Sign Up With Mobile Number"
  • 12. String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> createPassword(TextArea.PHONENUMBER == constraint, textEntry.getText()).show())); return s; } SignupForm We pass true if this is a phone number & false for email. We also pass the text of the phone/email. We'll display that in the confirmation Form. That was mostly standard stuff it will be further clarified with the actual calls to this method:
  • 13. s.createNextButton(e -> createNumber().show())); return s; } public static SignupForm createNumber() { return createMobileOrEmail("Mobile Number", "What's Your Mobile Number?", "Sign Up With Email Address", TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), SignupForm These are the labels we show in the Form
  • 14. s.createNextButton(e -> createNumber().show())); return s; } public static SignupForm createNumber() { return createMobileOrEmail("Mobile Number", "What's Your Mobile Number?", "Sign Up With Email Address", TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), SignupForm The text input constraint, in this case it's a phone number. In the other case it will be an email address constraint
  • 15. s.createNextButton(e -> createNumber().show())); return s; } public static SignupForm createNumber() { return createMobileOrEmail("Mobile Number", "What's Your Mobile Number?", "Sign Up With Email Address", TextArea.PHONENUMBER, e -> createEmail().show()); } private static SignupForm createMobileOrEmail(String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label(subtitle, "SignupSubHeader"); TextComponent textEntry = new TextComponent(). label(formTitle). columns(20). constraint(constraint); Container textContainer = new Container(new TextModeLayout(1, 1), SignupForm Navigation to the "other" Form here we navigate to the email entry form and there we'll navigate to the number
  • 16. mobile.addActionListener(goToOther); s.south.addComponent(0, mobile); s.content.addAll(title, textContainer, s.createNextButton(e -> createPassword(TextArea.PHONENUMBER == constraint, textEntry.getText()).show())); return s; } public static SignupForm createEmail() { return createMobileOrEmail("Email Address", "What's Your Email Address?", "Sign Up With Mobile Number", TextArea.EMAILADDR, e -> createNumber().show()); } public static SignupForm createPassword(boolean phone, String value) { SignupForm s = new SignupForm("Password", getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label("Choose a Password", "SignupSubHeader"); TextComponent password = new TextComponent(). label("Password"). SignupForm As you can see the email version is practically identical.
  • 17. BoldBlueLink { cn1-derive: BlueLink; font-family: "native:MainBold"; } theme.css That's pretty much it for these two forms, we will need one CSS entry though. It's the same as `BlueLink` only bold. Once we do this email/number toggle should work...
  • 18. © Codename One 2017 all rights reserved There is nothing interesting here. I considered making a generic method that would generate this and the phone number/email form but decided against that. I think that would have overgeneralized. It would have created overly confusing code.
  • 19. "What's Your Email Address?", "Sign Up With Mobile Number", TextArea.EMAILADDR, e -> createNumber().show()); } public static SignupForm createPassword(boolean phone, String value) { SignupForm s = new SignupForm("Password", getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label("Choose a Password", "SignupSubHeader"); TextComponent password = new TextComponent(). label("Password"). columns(20); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(password); s.content.addAll(title, textContainer, s.createNextButton(e -> createConfirmation(phone, value).show())); return s; } public static SignupForm createConfirmation( SignupForm The code is pretty much text book boilerplate. Nothing much to talk about.
  • 20. "What's Your Email Address?", "Sign Up With Mobile Number", TextArea.EMAILADDR, e -> createNumber().show()); } public static SignupForm createPassword(boolean phone, String value) { SignupForm s = new SignupForm("Password", getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label("Choose a Password", "SignupSubHeader"); TextComponent password = new TextComponent(). label("Password"). columns(20); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(password); s.content.addAll(title, textContainer, s.createNextButton(e -> createConfirmation(phone, value).show())); return s; } public static SignupForm createConfirmation( SignupForm The only thing worth noticing in this form is the `phone` & `value` variables that are passed right through the method to the confirmation form. We can now move to the last stage of signup as there is no CSS or anything else to this form!
  • 21. s.content.addAll(title, textContainer, s.createNextButton(e -> createConfirmation(phone, value).show())); return s; } public static SignupForm createConfirmation( boolean phone, String value) { SignupForm s = new SignupForm("Account Confirmation", "Password", getCurrentForm()); SpanLabel title; if(phone) { title = new SpanLabel("Enter the code from your mobile phone", "SignupSubHeader"); } else { title = new SpanLabel("Enter the code from your email", "SignupSubHeader"); } SpanLabel line; if(phone) { line = new SpanLabel("Let us know this phone belongs to you. " + "Enter the code in the SMS sent to " + value, "CenterLabel"); } else { line = new SpanLabel("Let us know this email belongs to you. " + "Enter the code in the message sent to " + value, "CenterLabel"); SignupForm The final stage of the signup process is the account confirmation Form
  • 22. © Codename One 2017 all rights reserved This is a trivial form as well but it does include minor things to notice.
  • 23. s.content.addAll(title, textContainer, s.createNextButton(e -> createConfirmation(phone, value).show())); return s; } public static SignupForm createConfirmation( boolean phone, String value) { SignupForm s = new SignupForm("Account Confirmation", "Password", getCurrentForm()); SpanLabel title; if(phone) { title = new SpanLabel("Enter the code from your mobile phone", "SignupSubHeader"); } else { title = new SpanLabel("Enter the code from your email", "SignupSubHeader"); } SpanLabel line; if(phone) { line = new SpanLabel("Let us know this phone belongs to you. " + "Enter the code in the SMS sent to " + value, "CenterLabel"); } else { line = new SpanLabel("Let us know this email belongs to you. " + "Enter the code in the message sent to " + value, "CenterLabel"); SignupForm The subtitle can span lines here depending on the size of the phone screen
  • 24. title = new SpanLabel("Enter the code from your mobile phone", "SignupSubHeader"); } else { title = new SpanLabel("Enter the code from your email", "SignupSubHeader"); } SpanLabel line; if(phone) { line = new SpanLabel("Let us know this phone belongs to you. " + "Enter the code in the SMS sent to " + value, "CenterLabel"); } else { line = new SpanLabel("Let us know this email belongs to you. " + "Enter the code in the message sent to " + value, "CenterLabel"); } TextComponent confirm = new TextComponent(). label("Confirmation Code"). columns(20). constraint(TextArea.NUMERIC); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(confirm); SignupForm We have a special center aligned message that includes the content we passed from the phone/email stage of the wizard
  • 25. SpanLabel line; if(phone) { line = new SpanLabel("Let us know this phone belongs to you. " + "Enter the code in the SMS sent to " + value, "CenterLabel"); } else { line = new SpanLabel("Let us know this email belongs to you. " + "Enter the code in the message sent to " + value, "CenterLabel"); } TextComponent confirm = new TextComponent(). label("Confirmation Code"). columns(20). constraint(TextArea.NUMERIC); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(confirm); Button done = s.createNextButton(e -> UIController.showMainUI()); done.setText("Confirm"); s.content.addAll(title, line, textContainer, done); return s; } } SignupForm When done we show the main UI, I’ll add a stub for this method soon
  • 26. CenterLabel { text-align: center; font-size: 2.2mm; } theme.css We just have one more tiny change to the CSS, we need to add the new CenterLabel style
  • 27. public static void showSignup() { SignupForm.createTerms().show(); } public static void showMainUI() { } UIController Finally we need to add some wiring to show the signup process. In UIController we'll add a new signup call and we will also need a stub for showMainUI() so the signup wizard will compile
  • 28. signUp.addActionListener(e -> UIController.showSignup()); LoginForm And finally we bind the signup wizrd to the LoginForm constructor using this code… With that the signup process mockup is done and we can move to mocking up the main UI.