SlideShare a Scribd company logo
1 of 28
Download to read offline
Creating a Facebook Clone - Part VIII
© Codename One 2017 all rights reserved
© Codename One 2017 all rights reserved
© Codename One 2017 all rights reserved
© Codename One 2017 all rights reserved
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);
SignupForm
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,
SignupForm
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,
SignupForm
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,
SignupForm
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
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
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
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);
SignupForm
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);
SignupForm
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);
SignupForm
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().
SignupForm
BoldBlueLink {
cn1-derive: BlueLink;
font-family: "native:MainBold";
}
theme.css
© Codename One 2017 all rights reserved
"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;
}
SignupForm
"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;
}
SignupForm
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,
SignupForm
© Codename One 2017 all rights reserved
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,
SignupForm
"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
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
CenterLabel {
text-align: center;
font-size: 2.2mm;
}
theme.css
public static void showSignup() {
SignupForm.createTerms().show();
}
public static void showMainUI() {
}
UIController
signUp.addActionListener(e -> UIController.showSignup());
LoginForm

More Related Content

Similar to Creating a Facebook Clone - Part VIII.pdf

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

Creating an Uber Clone - Part XIV - Transcript.pdf
Creating an Uber Clone - Part XIV - Transcript.pdfCreating an Uber Clone - Part XIV - Transcript.pdf
Creating an Uber Clone - Part XIV - Transcript.pdf
 
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 XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdf
 
Creating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.pdfCreating a Facebook Clone - Part XXXVII.pdf
Creating a Facebook Clone - Part XXXVII.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 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 III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.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 XIV.pdf
Creating an Uber Clone - Part XIV.pdfCreating an Uber Clone - Part XIV.pdf
Creating an Uber Clone - Part XIV.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
 
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
 
Creating a Facebook Clone - Part X - Transcript.pdf
Creating a Facebook Clone - Part X - Transcript.pdfCreating a Facebook Clone - Part X - Transcript.pdf
Creating a Facebook Clone - Part X - Transcript.pdf
 
Creating a Facebook Clone - Part X.pdf
Creating a Facebook Clone - Part X.pdfCreating a Facebook Clone - Part X.pdf
Creating a Facebook Clone - Part X.pdf
 
dfhdf
dfhdfdfhdf
dfhdf
 
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 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 an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdfCreating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdf
 
How do I - Create a List of Items.pdf
How do I - Create a List of Items.pdfHow do I - Create a List of Items.pdf
How do I - Create a List of Items.pdf
 
Mobile Application Development class 007
Mobile Application Development class 007Mobile Application Development class 007
Mobile Application Development class 007
 

More from ShaiAlmog1

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

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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
 
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...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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, ...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Creating a Facebook Clone - Part VIII.pdf

  • 1. Creating a Facebook Clone - Part VIII
  • 2. © Codename One 2017 all rights reserved
  • 3. © Codename One 2017 all rights reserved
  • 4. © Codename One 2017 all rights reserved
  • 5. © Codename One 2017 all rights reserved
  • 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); SignupForm
  • 7. 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, SignupForm
  • 8. 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, SignupForm
  • 9. 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, SignupForm
  • 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
  • 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
  • 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
  • 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); SignupForm
  • 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); SignupForm
  • 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); SignupForm
  • 16. 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(). SignupForm
  • 17. BoldBlueLink { cn1-derive: BlueLink; font-family: "native:MainBold"; } theme.css
  • 18. © Codename One 2017 all rights reserved
  • 19. "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; } SignupForm
  • 20. "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; } SignupForm
  • 21. 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, SignupForm
  • 22. © Codename One 2017 all rights reserved
  • 23. 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, SignupForm
  • 24. "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
  • 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
  • 27. public static void showSignup() { SignupForm.createTerms().show(); } public static void showMainUI() { } UIController