SlideShare a Scribd company logo
1 of 23
Download to read offline
Creating a Facebook Clone - Part XXVIII
Container logoContainer = BorderLayout.centerAbsolute(logo);
logoContainer.setUIID("LoginTitle");
signUp.addActionListener(e -> UIController.showSignup());
login.addActionListener(e -> {
User u = new User().password.set(password.getText());
if(user.getText().contains("@")) {
u.email.set(user.getText());
} else {
u.phone.set(user.getText());
}
Dialog d = new InfiniteProgress().showInifiniteBlocking();
ServerAPI.login(u, new Callback<User>() {
@Override
public void onSucess(User value) {
d.dispose();
UIController.showMainUI();
}
@Override
public void onError(Object sender, Throwable err,
int errorCode, String errorMessage) {
d.dispose();
ToastBar.showErrorMessage("Login Failed");
LoginForm
Container logoContainer = BorderLayout.centerAbsolute(logo);
logoContainer.setUIID("LoginTitle");
signUp.addActionListener(e -> UIController.showSignup());
login.addActionListener(e -> {
User u = new User().password.set(password.getText());
if(user.getText().contains("@")) {
u.email.set(user.getText());
} else {
u.phone.set(user.getText());
}
Dialog d = new InfiniteProgress().showInifiniteBlocking();
ServerAPI.login(u, new Callback<User>() {
@Override
public void onSucess(User value) {
d.dispose();
UIController.showMainUI();
}
@Override
public void onError(Object sender, Throwable err,
int errorCode, String errorMessage) {
d.dispose();
ToastBar.showErrorMessage("Login Failed");
LoginForm
Container logoContainer = BorderLayout.centerAbsolute(logo);
logoContainer.setUIID("LoginTitle");
signUp.addActionListener(e -> UIController.showSignup());
login.addActionListener(e -> {
User u = new User().password.set(password.getText());
if(user.getText().contains("@")) {
u.email.set(user.getText());
} else {
u.phone.set(user.getText());
}
Dialog d = new InfiniteProgress().showInifiniteBlocking();
ServerAPI.login(u, new Callback<User>() {
@Override
public void onSucess(User value) {
d.dispose();
UIController.showMainUI();
}
@Override
public void onError(Object sender, Throwable err,
int errorCode, String errorMessage) {
d.dispose();
ToastBar.showErrorMessage("Login Failed");
LoginForm
login.addActionListener(e -> {
User u = new User().password.set(password.getText());
if(user.getText().contains("@")) {
u.email.set(user.getText());
} else {
u.phone.set(user.getText());
}
Dialog d = new InfiniteProgress().showInifiniteBlocking();
ServerAPI.login(u, new Callback<User>() {
@Override
public void onSucess(User value) {
d.dispose();
UIController.showMainUI();
}
@Override
public void onError(Object sender, Throwable err,
int errorCode, String errorMessage) {
d.dispose();
ToastBar.showErrorMessage("Login Failed");
}
});
});
LoginForm
public class SignupForm extends Form {
Container content = new Container(BoxLayout.y(), "PaddedContainer");
Container south = new Container(BoxLayout.y());
protected SignupForm(String title, String backLabel, Form previous) {
super(title, new BorderLayout());
setUIID("SignupForm");
content.setScrollableY(true);
add(CENTER, content);
getToolbar().setBackCommand(backLabel,
Toolbar.BackCommandPolicy.WHEN_USES_TITLE_OTHERWISE_ARROW,
e -> previous.showBack());
getToolbar().getTitleComponent().setUIID("Title", "TitleLandscape");
Button problem = new Button("Report a Problem", "BlueLink");
south.add(problem);
problem.addActionListener(e ->
sendMessage("Problem with Facebook Clone",
new Message("Details..."),
"mark@facebook.com"));
SignupForm
next.addActionListener(al);
return next;
}
public static SignupForm createTerms() {
SignupForm s = new SignupForm("Create Account", "Sign In",
getCurrentForm());
Label title = new Label("Terms & Conditions", "SignupSubHeader");
RichTextView rt = new RichTextView(
"By signing up you agree to our " +
"<a href="terms">Facebook Terms</a> and that you have " +
"read our <a href="data-policy">Data Policy</a>, including " +
"our <a href="cookie-use">Cookie Use</a>.");
rt.setAlignment(CENTER);
rt.setUIID("PaddedContainer");
Button next = s.createNextButton(e -> createName().show());
next.setText("I Agree");
rt.addLinkListener(e -> {
String link = (String) e.getSource();
execute("https://www.codenameone.com/");
});
s.content.addAll(title, rt, next);
return s;
SignupForm
return s;
}
public static SignupForm createName() {
SignupForm s = new SignupForm("Name", "Terms",
getCurrentForm());
Label title = new Label("What's Your Name?", "SignupSubHeader");
TextComponent first = new TextComponent().
label("First Name").columns(12);
TextComponent last = new TextComponent().
label("Last Name").columns(12);
User currentUser = new User();
UiBinding uib = new UiBinding();
uib.bind(currentUser.firstName, first);
uib.bind(currentUser.familyName, last);
TextModeLayout layout = new TextModeLayout(1, 2);
Container textContainer = new Container(layout, "PaddedContainer");
textContainer.add(layout.createConstraint().
widthPercentage(50), first);
textContainer.add(layout.createConstraint().
widthPercentage(50), last);
SignupForm
return s;
}
public static SignupForm createName() {
SignupForm s = new SignupForm("Name", "Terms",
getCurrentForm());
Label title = new Label("What's Your Name?", "SignupSubHeader");
TextComponent first = new TextComponent().
label("First Name").columns(12);
TextComponent last = new TextComponent().
label("Last Name").columns(12);
User currentUser = new User();
UiBinding uib = new UiBinding();
uib.bind(currentUser.firstName, first);
uib.bind(currentUser.familyName, last);
TextModeLayout layout = new TextModeLayout(1, 2);
Container textContainer = new Container(layout, "PaddedContainer");
textContainer.add(layout.createConstraint().
widthPercentage(50), first);
textContainer.add(layout.createConstraint().
widthPercentage(50), last);
SignupForm
return s;
}
public static SignupForm createName() {
SignupForm s = new SignupForm("Name", "Terms",
getCurrentForm());
Label title = new Label("What's Your Name?", "SignupSubHeader");
TextComponent first = new TextComponent().
label("First Name").columns(12);
TextComponent last = new TextComponent().
label("Last Name").columns(12);
User currentUser = new User();
UiBinding uib = new UiBinding();
uib.bind(currentUser.firstName, first);
uib.bind(currentUser.familyName, last);
TextModeLayout layout = new TextModeLayout(1, 2);
Container textContainer = new Container(layout, "PaddedContainer");
textContainer.add(layout.createConstraint().
widthPercentage(50), first);
textContainer.add(layout.createConstraint().
widthPercentage(50), last);
SignupForm
TextModeLayout layout = new TextModeLayout(1, 2);
Container textContainer = new Container(layout, "PaddedContainer");
textContainer.add(layout.createConstraint().
widthPercentage(50), first);
textContainer.add(layout.createConstraint().
widthPercentage(50), last);
last.getField().setDoneListener(e ->
createBirthday(currentUser, uib).show());
s.content.addAll(title, textContainer,
s.createNextButton(e -> createBirthday(currentUser, uib).
show()));
return s;
}
public static SignupForm createBirthday(User currentUser, UiBinding uib) {
SignupForm s = new SignupForm("Birthday",
"Name",
getCurrentForm());
Label title = new Label("What's Your Birthday?", "SignupSubHeader");
Picker datePicker = new Picker();
datePicker.setType(PICKER_TYPE_DATE);
int twentyYears = 60000 * 60 * 24 * 365 * 20;
SignupForm
s.createNextButton(e -> createBirthday(currentUser, uib).
show()));
return s;
}
public static SignupForm createBirthday(User currentUser, UiBinding uib) {
SignupForm s = new SignupForm("Birthday",
"Name",
getCurrentForm());
Label title = new Label("What's Your Birthday?", "SignupSubHeader");
Picker datePicker = new Picker();
datePicker.setType(PICKER_TYPE_DATE);
int twentyYears = 60000 * 60 * 24 * 365 * 20;
datePicker.setDate(
new Date(System.currentTimeMillis() - twentyYears));
uib.bind(currentUser.birthday, datePicker);
s.content.addAll(title, datePicker,
s.createNextButton(e -> createGender(currentUser, uib).show()));
return s;
}
private static RadioButton createGenderButton(ButtonGroup bg,
SignupForm
s.createNextButton(e -> createBirthday(currentUser, uib).
show()));
return s;
}
public static SignupForm createBirthday(User currentUser, UiBinding uib) {
SignupForm s = new SignupForm("Birthday",
"Name",
getCurrentForm());
Label title = new Label("What's Your Birthday?", "SignupSubHeader");
Picker datePicker = new Picker();
datePicker.setType(PICKER_TYPE_DATE);
int twentyYears = 60000 * 60 * 24 * 365 * 20;
datePicker.setDate(
new Date(System.currentTimeMillis() - twentyYears));
uib.bind(currentUser.birthday, datePicker);
s.content.addAll(title, datePicker,
s.createNextButton(e -> createGender(currentUser, uib).show()));
return s;
}
private static RadioButton createGenderButton(ButtonGroup bg,
SignupForm
s.createNextButton(e -> createBirthday(currentUser, uib).
show()));
return s;
}
public static SignupForm createBirthday(User currentUser, UiBinding uib) {
SignupForm s = new SignupForm("Birthday",
"Name",
getCurrentForm());
Label title = new Label("What's Your Birthday?", "SignupSubHeader");
Picker datePicker = new Picker();
datePicker.setType(PICKER_TYPE_DATE);
int twentyYears = 60000 * 60 * 24 * 365 * 20;
datePicker.setDate(
new Date(System.currentTimeMillis() - twentyYears));
uib.bind(currentUser.birthday, datePicker);
s.content.addAll(title, datePicker,
s.createNextButton(e -> createGender(currentUser, uib).show()));
return s;
}
private static RadioButton createGenderButton(ButtonGroup bg,
SignupForm
rb.setUIID("GenderToggle");
return rb;
}
public static SignupForm createGender(User currentUser, UiBinding uib) {
SignupForm s = new SignupForm("Gender",
"Birthday",
getCurrentForm());
Label title = new Label("What's Your Gender?", "SignupSubHeader");
ButtonGroup bg = new ButtonGroup();
RadioButton female = createGenderButton(bg, "Female", "ue800");
RadioButton male = createGenderButton(bg, "Male", "ue801");
uib.bindGroup(currentUser.gender,
new String[]{"Male", "Female"}, male, female);
Container buttons = GridLayout.encloseIn(2, female, male);
buttons.setUIID("PaddedContainer");
s.content.addAll(title, buttons,
s.createNextButton(e -> createNumber(currentUser, uib).show()));
return s;
}
SignupForm
Container buttons = GridLayout.encloseIn(2, female, male);
buttons.setUIID("PaddedContainer");
s.content.addAll(title, buttons,
s.createNextButton(e -> createNumber(currentUser, uib).show()));
return s;
}
public static SignupForm createNumber(User currentUser, UiBinding uib) {
return createMobileOrEmail(currentUser, currentUser.phone, uib,
"Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail(currentUser, uib).show());
}
private static SignupForm createMobileOrEmail(User currentUser,
Property userProp, UiBinding uib, String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s =
new SignupForm(formTitle, getCurrentForm().getTitle(),
SignupForm
TextArea.PHONENUMBER,
e -> createEmail(currentUser, uib).show());
}
private static SignupForm createMobileOrEmail(User currentUser,
Property userProp, UiBinding uib, 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);
uib.bind(userProp, textEntry);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
SignupForm
TextArea.EMAILADDR,
e -> createNumber(currentUser, uib).show());
}
public static SignupForm createPassword(
User currentUser, UiBinding uib, 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);
uib.bind(currentUser.password, password);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> {
Dialog dlg = new Dialog("Signing Up...",
new BorderLayout(
SignupForm
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
columns(20);
uib.bind(currentUser.password, password);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> {
Dialog dlg = new Dialog("Signing Up...",
new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
dlg.add(CENTER, new InfiniteProgress());
dlg.showModeless();
ServerAPI.signup(currentUser, new Callback<User>() {
@Override
public void onSucess(User result) {
dlg.dispose();
SignupForm
s.content.addAll(title, textContainer,
s.createNextButton(e -> {
Dialog dlg = new Dialog("Signing Up...",
new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
dlg.add(CENTER, new InfiniteProgress());
dlg.showModeless();
ServerAPI.signup(currentUser, new Callback<User>() {
@Override
public void onSucess(User result) {
dlg.dispose();
createConfirmation(currentUser, phone, value).show();
}
@Override
public void onError(Object sender, Throwable err,
int errorCode, String errorMessage) {
dlg.dispose();
ToastBar.showErrorMessage(
"Error in server connection");
}
});
}));
return s;
SignupForm
"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 -> {
Dialog d = new InfiniteProgress().showInifiniteBlocking();
if(ServerAPI.verifyUser(confirm.getText(), !phone)) {
UIController.showMainUI();
} else {
d.dispose();
ToastBar.showErrorMessage("Verification code error!");
}
});
done.setText("Confirm");
s.content.addAll(title, line, textContainer, done);
return s;
SignupForm
"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 -> {
Dialog d = new InfiniteProgress().showInifiniteBlocking();
if(ServerAPI.verifyUser(confirm.getText(), !phone)) {
UIController.showMainUI();
} else {
d.dispose();
ToastBar.showErrorMessage("Verification code error!");
}
});
done.setText("Confirm");
s.content.addAll(title, line, textContainer, done);
return s;
SignupForm
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
if(!ServerAPI.isLoggedIn()) {
showLoginForm();
} else {
showMainUI();
}
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue() + 127);
logo.repaint();
}
});
UIController

More Related Content

Similar to Creating a Facebook Clone - Part XXVIII.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.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 XXIX - Transcript.pdf
Creating a Facebook Clone - Part XXIX - Transcript.pdfCreating a Facebook Clone - Part XXIX - Transcript.pdf
Creating a Facebook Clone - Part XXIX - Transcript.pdfShaiAlmog1
 
Initial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfInitial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XLII - Transcript.pdf
Creating a Facebook Clone - Part XLII - Transcript.pdfCreating a Facebook Clone - Part XLII - Transcript.pdf
Creating a Facebook Clone - Part XLII - Transcript.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdfCreating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdfShaiAlmog1
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.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 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 a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdfCreating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XLV.pdf
Creating a Facebook Clone - Part XLV.pdfCreating a Facebook Clone - Part XLV.pdf
Creating a Facebook Clone - Part XLV.pdfShaiAlmog1
 
Creating an Uber Clone - Part V.pdf
Creating an Uber Clone - Part V.pdfCreating an Uber Clone - Part V.pdf
Creating an Uber Clone - Part V.pdfShaiAlmog1
 
Creating a Facebook Clone - Part XLI.pdf
Creating a Facebook Clone - Part XLI.pdfCreating a Facebook Clone - Part XLI.pdf
Creating a Facebook Clone - Part XLI.pdfShaiAlmog1
 
GWT Training - Session 3/3
GWT Training - Session 3/3GWT Training - Session 3/3
GWT Training - Session 3/3Faiz Bashir
 
Parse - a mobile backend platform
Parse - a mobile backend platformParse - a mobile backend platform
Parse - a mobile backend platformCarlotta Tatti
 
Creating a Facebook Clone - Part VIII - Transcript.pdf
Creating a Facebook Clone - Part VIII - Transcript.pdfCreating a Facebook Clone - Part VIII - Transcript.pdf
Creating a Facebook Clone - Part VIII - Transcript.pdfShaiAlmog1
 
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
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
 
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.pdfShaiAlmog1
 

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

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 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 XXIX - Transcript.pdf
Creating a Facebook Clone - Part XXIX - Transcript.pdfCreating a Facebook Clone - Part XXIX - Transcript.pdf
Creating a Facebook Clone - Part XXIX - Transcript.pdf
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Initial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdfInitial UI Mockup - Part 3.pdf
Initial UI Mockup - Part 3.pdf
 
Creating a Facebook Clone - Part XLII - Transcript.pdf
Creating a Facebook Clone - Part XLII - Transcript.pdfCreating a Facebook Clone - Part XLII - Transcript.pdf
Creating a Facebook Clone - Part XLII - Transcript.pdf
 
Creating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdfCreating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdf
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.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 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 a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdfCreating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdf
 
Creating a Facebook Clone - Part XLV.pdf
Creating a Facebook Clone - Part XLV.pdfCreating a Facebook Clone - Part XLV.pdf
Creating a Facebook Clone - Part XLV.pdf
 
Creating an Uber Clone - Part V.pdf
Creating an Uber Clone - Part V.pdfCreating an Uber Clone - Part V.pdf
Creating an Uber Clone - Part V.pdf
 
Creating a Facebook Clone - Part XLI.pdf
Creating a Facebook Clone - Part XLI.pdfCreating a Facebook Clone - Part XLI.pdf
Creating a Facebook Clone - Part XLI.pdf
 
GWT Training - Session 3/3
GWT Training - Session 3/3GWT Training - Session 3/3
GWT Training - Session 3/3
 
Parse - a mobile backend platform
Parse - a mobile backend platformParse - a mobile backend platform
Parse - a mobile backend platform
 
Creating a Facebook Clone - Part VIII - Transcript.pdf
Creating a Facebook Clone - Part VIII - Transcript.pdfCreating a Facebook Clone - Part VIII - Transcript.pdf
Creating a Facebook Clone - Part VIII - Transcript.pdf
 
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
 
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
 
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
 

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 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 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
 

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 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 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
 

Recently uploaded

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Creating a Facebook Clone - Part XXVIII.pdf

  • 1. Creating a Facebook Clone - Part XXVIII
  • 2. Container logoContainer = BorderLayout.centerAbsolute(logo); logoContainer.setUIID("LoginTitle"); signUp.addActionListener(e -> UIController.showSignup()); login.addActionListener(e -> { User u = new User().password.set(password.getText()); if(user.getText().contains("@")) { u.email.set(user.getText()); } else { u.phone.set(user.getText()); } Dialog d = new InfiniteProgress().showInifiniteBlocking(); ServerAPI.login(u, new Callback<User>() { @Override public void onSucess(User value) { d.dispose(); UIController.showMainUI(); } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { d.dispose(); ToastBar.showErrorMessage("Login Failed"); LoginForm
  • 3. Container logoContainer = BorderLayout.centerAbsolute(logo); logoContainer.setUIID("LoginTitle"); signUp.addActionListener(e -> UIController.showSignup()); login.addActionListener(e -> { User u = new User().password.set(password.getText()); if(user.getText().contains("@")) { u.email.set(user.getText()); } else { u.phone.set(user.getText()); } Dialog d = new InfiniteProgress().showInifiniteBlocking(); ServerAPI.login(u, new Callback<User>() { @Override public void onSucess(User value) { d.dispose(); UIController.showMainUI(); } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { d.dispose(); ToastBar.showErrorMessage("Login Failed"); LoginForm
  • 4. Container logoContainer = BorderLayout.centerAbsolute(logo); logoContainer.setUIID("LoginTitle"); signUp.addActionListener(e -> UIController.showSignup()); login.addActionListener(e -> { User u = new User().password.set(password.getText()); if(user.getText().contains("@")) { u.email.set(user.getText()); } else { u.phone.set(user.getText()); } Dialog d = new InfiniteProgress().showInifiniteBlocking(); ServerAPI.login(u, new Callback<User>() { @Override public void onSucess(User value) { d.dispose(); UIController.showMainUI(); } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { d.dispose(); ToastBar.showErrorMessage("Login Failed"); LoginForm
  • 5. login.addActionListener(e -> { User u = new User().password.set(password.getText()); if(user.getText().contains("@")) { u.email.set(user.getText()); } else { u.phone.set(user.getText()); } Dialog d = new InfiniteProgress().showInifiniteBlocking(); ServerAPI.login(u, new Callback<User>() { @Override public void onSucess(User value) { d.dispose(); UIController.showMainUI(); } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { d.dispose(); ToastBar.showErrorMessage("Login Failed"); } }); }); LoginForm
  • 6. public class SignupForm extends Form { Container content = new Container(BoxLayout.y(), "PaddedContainer"); Container south = new Container(BoxLayout.y()); protected SignupForm(String title, String backLabel, Form previous) { super(title, new BorderLayout()); setUIID("SignupForm"); content.setScrollableY(true); add(CENTER, content); getToolbar().setBackCommand(backLabel, Toolbar.BackCommandPolicy.WHEN_USES_TITLE_OTHERWISE_ARROW, e -> previous.showBack()); getToolbar().getTitleComponent().setUIID("Title", "TitleLandscape"); Button problem = new Button("Report a Problem", "BlueLink"); south.add(problem); problem.addActionListener(e -> sendMessage("Problem with Facebook Clone", new Message("Details..."), "mark@facebook.com")); SignupForm
  • 7. next.addActionListener(al); return next; } public static SignupForm createTerms() { SignupForm s = new SignupForm("Create Account", "Sign In", getCurrentForm()); Label title = new Label("Terms & Conditions", "SignupSubHeader"); RichTextView rt = new RichTextView( "By signing up you agree to our " + "<a href="terms">Facebook Terms</a> and that you have " + "read our <a href="data-policy">Data Policy</a>, including " + "our <a href="cookie-use">Cookie Use</a>."); rt.setAlignment(CENTER); rt.setUIID("PaddedContainer"); Button next = s.createNextButton(e -> createName().show()); next.setText("I Agree"); rt.addLinkListener(e -> { String link = (String) e.getSource(); execute("https://www.codenameone.com/"); }); s.content.addAll(title, rt, next); return s; SignupForm
  • 8. return s; } public static SignupForm createName() { SignupForm s = new SignupForm("Name", "Terms", getCurrentForm()); Label title = new Label("What's Your Name?", "SignupSubHeader"); TextComponent first = new TextComponent(). label("First Name").columns(12); TextComponent last = new TextComponent(). label("Last Name").columns(12); User currentUser = new User(); UiBinding uib = new UiBinding(); uib.bind(currentUser.firstName, first); uib.bind(currentUser.familyName, last); TextModeLayout layout = new TextModeLayout(1, 2); Container textContainer = new Container(layout, "PaddedContainer"); textContainer.add(layout.createConstraint(). widthPercentage(50), first); textContainer.add(layout.createConstraint(). widthPercentage(50), last); SignupForm
  • 9. return s; } public static SignupForm createName() { SignupForm s = new SignupForm("Name", "Terms", getCurrentForm()); Label title = new Label("What's Your Name?", "SignupSubHeader"); TextComponent first = new TextComponent(). label("First Name").columns(12); TextComponent last = new TextComponent(). label("Last Name").columns(12); User currentUser = new User(); UiBinding uib = new UiBinding(); uib.bind(currentUser.firstName, first); uib.bind(currentUser.familyName, last); TextModeLayout layout = new TextModeLayout(1, 2); Container textContainer = new Container(layout, "PaddedContainer"); textContainer.add(layout.createConstraint(). widthPercentage(50), first); textContainer.add(layout.createConstraint(). widthPercentage(50), last); SignupForm
  • 10. return s; } public static SignupForm createName() { SignupForm s = new SignupForm("Name", "Terms", getCurrentForm()); Label title = new Label("What's Your Name?", "SignupSubHeader"); TextComponent first = new TextComponent(). label("First Name").columns(12); TextComponent last = new TextComponent(). label("Last Name").columns(12); User currentUser = new User(); UiBinding uib = new UiBinding(); uib.bind(currentUser.firstName, first); uib.bind(currentUser.familyName, last); TextModeLayout layout = new TextModeLayout(1, 2); Container textContainer = new Container(layout, "PaddedContainer"); textContainer.add(layout.createConstraint(). widthPercentage(50), first); textContainer.add(layout.createConstraint(). widthPercentage(50), last); SignupForm
  • 11. TextModeLayout layout = new TextModeLayout(1, 2); Container textContainer = new Container(layout, "PaddedContainer"); textContainer.add(layout.createConstraint(). widthPercentage(50), first); textContainer.add(layout.createConstraint(). widthPercentage(50), last); last.getField().setDoneListener(e -> createBirthday(currentUser, uib).show()); s.content.addAll(title, textContainer, s.createNextButton(e -> createBirthday(currentUser, uib). show())); return s; } public static SignupForm createBirthday(User currentUser, UiBinding uib) { SignupForm s = new SignupForm("Birthday", "Name", getCurrentForm()); Label title = new Label("What's Your Birthday?", "SignupSubHeader"); Picker datePicker = new Picker(); datePicker.setType(PICKER_TYPE_DATE); int twentyYears = 60000 * 60 * 24 * 365 * 20; SignupForm
  • 12. s.createNextButton(e -> createBirthday(currentUser, uib). show())); return s; } public static SignupForm createBirthday(User currentUser, UiBinding uib) { SignupForm s = new SignupForm("Birthday", "Name", getCurrentForm()); Label title = new Label("What's Your Birthday?", "SignupSubHeader"); Picker datePicker = new Picker(); datePicker.setType(PICKER_TYPE_DATE); int twentyYears = 60000 * 60 * 24 * 365 * 20; datePicker.setDate( new Date(System.currentTimeMillis() - twentyYears)); uib.bind(currentUser.birthday, datePicker); s.content.addAll(title, datePicker, s.createNextButton(e -> createGender(currentUser, uib).show())); return s; } private static RadioButton createGenderButton(ButtonGroup bg, SignupForm
  • 13. s.createNextButton(e -> createBirthday(currentUser, uib). show())); return s; } public static SignupForm createBirthday(User currentUser, UiBinding uib) { SignupForm s = new SignupForm("Birthday", "Name", getCurrentForm()); Label title = new Label("What's Your Birthday?", "SignupSubHeader"); Picker datePicker = new Picker(); datePicker.setType(PICKER_TYPE_DATE); int twentyYears = 60000 * 60 * 24 * 365 * 20; datePicker.setDate( new Date(System.currentTimeMillis() - twentyYears)); uib.bind(currentUser.birthday, datePicker); s.content.addAll(title, datePicker, s.createNextButton(e -> createGender(currentUser, uib).show())); return s; } private static RadioButton createGenderButton(ButtonGroup bg, SignupForm
  • 14. s.createNextButton(e -> createBirthday(currentUser, uib). show())); return s; } public static SignupForm createBirthday(User currentUser, UiBinding uib) { SignupForm s = new SignupForm("Birthday", "Name", getCurrentForm()); Label title = new Label("What's Your Birthday?", "SignupSubHeader"); Picker datePicker = new Picker(); datePicker.setType(PICKER_TYPE_DATE); int twentyYears = 60000 * 60 * 24 * 365 * 20; datePicker.setDate( new Date(System.currentTimeMillis() - twentyYears)); uib.bind(currentUser.birthday, datePicker); s.content.addAll(title, datePicker, s.createNextButton(e -> createGender(currentUser, uib).show())); return s; } private static RadioButton createGenderButton(ButtonGroup bg, SignupForm
  • 15. rb.setUIID("GenderToggle"); return rb; } public static SignupForm createGender(User currentUser, UiBinding uib) { SignupForm s = new SignupForm("Gender", "Birthday", getCurrentForm()); Label title = new Label("What's Your Gender?", "SignupSubHeader"); ButtonGroup bg = new ButtonGroup(); RadioButton female = createGenderButton(bg, "Female", "ue800"); RadioButton male = createGenderButton(bg, "Male", "ue801"); uib.bindGroup(currentUser.gender, new String[]{"Male", "Female"}, male, female); Container buttons = GridLayout.encloseIn(2, female, male); buttons.setUIID("PaddedContainer"); s.content.addAll(title, buttons, s.createNextButton(e -> createNumber(currentUser, uib).show())); return s; } SignupForm
  • 16. Container buttons = GridLayout.encloseIn(2, female, male); buttons.setUIID("PaddedContainer"); s.content.addAll(title, buttons, s.createNextButton(e -> createNumber(currentUser, uib).show())); return s; } public static SignupForm createNumber(User currentUser, UiBinding uib) { return createMobileOrEmail(currentUser, currentUser.phone, uib, "Mobile Number", "What's Your Mobile Number?", "Sign Up With Email Address", TextArea.PHONENUMBER, e -> createEmail(currentUser, uib).show()); } private static SignupForm createMobileOrEmail(User currentUser, Property userProp, UiBinding uib, String formTitle, String subtitle, String signUpWith, int constraint, ActionListener goToOther) { SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(), SignupForm
  • 17. TextArea.PHONENUMBER, e -> createEmail(currentUser, uib).show()); } private static SignupForm createMobileOrEmail(User currentUser, Property userProp, UiBinding uib, 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); uib.bind(userProp, textEntry); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(textEntry); Button mobile = new Button(signUpWith, "BoldBlueLink"); SignupForm
  • 18. TextArea.EMAILADDR, e -> createNumber(currentUser, uib).show()); } public static SignupForm createPassword( User currentUser, UiBinding uib, 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); uib.bind(currentUser.password, password); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(password); s.content.addAll(title, textContainer, s.createNextButton(e -> { Dialog dlg = new Dialog("Signing Up...", new BorderLayout( SignupForm
  • 19. getCurrentForm().getTitle(), getCurrentForm()); Label title = new Label("Choose a Password", "SignupSubHeader"); TextComponent password = new TextComponent(). label("Password"). columns(20); uib.bind(currentUser.password, password); Container textContainer = new Container(new TextModeLayout(1, 1), "PaddedContainer"); textContainer.add(password); s.content.addAll(title, textContainer, s.createNextButton(e -> { Dialog dlg = new Dialog("Signing Up...", new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); dlg.add(CENTER, new InfiniteProgress()); dlg.showModeless(); ServerAPI.signup(currentUser, new Callback<User>() { @Override public void onSucess(User result) { dlg.dispose(); SignupForm
  • 20. s.content.addAll(title, textContainer, s.createNextButton(e -> { Dialog dlg = new Dialog("Signing Up...", new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); dlg.add(CENTER, new InfiniteProgress()); dlg.showModeless(); ServerAPI.signup(currentUser, new Callback<User>() { @Override public void onSucess(User result) { dlg.dispose(); createConfirmation(currentUser, phone, value).show(); } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { dlg.dispose(); ToastBar.showErrorMessage( "Error in server connection"); } }); })); return s; SignupForm
  • 21. "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 -> { Dialog d = new InfiniteProgress().showInifiniteBlocking(); if(ServerAPI.verifyUser(confirm.getText(), !phone)) { UIController.showMainUI(); } else { d.dispose(); ToastBar.showErrorMessage("Verification code error!"); } }); done.setText("Confirm"); s.content.addAll(title, line, textContainer, done); return s; SignupForm
  • 22. "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 -> { Dialog d = new InfiniteProgress().showInifiniteBlocking(); if(ServerAPI.verifyUser(confirm.getText(), !phone)) { UIController.showMainUI(); } else { d.dispose(); ToastBar.showErrorMessage("Verification code error!"); } }); done.setText("Confirm"); s.content.addAll(title, line, textContainer, done); return s; SignupForm
  • 23. Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { if(!ServerAPI.isLoggedIn()) { showLoginForm(); } else { showMainUI(); } } else { logo.getUnselectedStyle().setOpacity(anim.getValue() + 127); logo.repaint(); } }); UIController