SlideShare a Scribd company logo
1 of 41
Download to read offline
Creating an Uber Clone - Part III
Country Button
© Codename One 2017 all rights reserved
Country Button
© Codename One 2017 all rights reserved
public class CountryCodePicker extends Button {
private Resources flagResource;
public CountryCodePicker() {
setUIID("CountryCodePicker");
addActionListener(e -> showPickerForm());
String code = L10NManager.getInstance().getLocale();
if(code != null) {
String[] countryCodes;
if(code.length() == 2) {
countryCodes = COUNTRY_ISO2;
} else {
if(code.length() == 3) {
countryCodes = COUNTRY_ISO3;
} else {
return;
}
}
code = code.toUpperCase();
try {
flagResource = Resources.open("/flags.res");
} catch(IOException err) {
CountryCodePicker
public class CountryCodePicker extends Button {
private Resources flagResource;
public CountryCodePicker() {
setUIID("CountryCodePicker");
addActionListener(e -> showPickerForm());
String code = L10NManager.getInstance().getLocale();
if(code != null) {
String[] countryCodes;
if(code.length() == 2) {
countryCodes = COUNTRY_ISO2;
} else {
if(code.length() == 3) {
countryCodes = COUNTRY_ISO3;
} else {
return;
}
}
code = code.toUpperCase();
try {
flagResource = Resources.open("/flags.res");
} catch(IOException err) {
CountryCodePicker
public class CountryCodePicker extends Button {
private Resources flagResource;
public CountryCodePicker() {
setUIID("CountryCodePicker");
addActionListener(e -> showPickerForm());
String code = L10NManager.getInstance().getLocale();
if(code != null) {
String[] countryCodes;
if(code.length() == 2) {
countryCodes = COUNTRY_ISO2;
} else {
if(code.length() == 3) {
countryCodes = COUNTRY_ISO3;
} else {
return;
}
}
code = code.toUpperCase();
try {
flagResource = Resources.open("/flags.res");
} catch(IOException err) {
CountryCodePicker
public class CountryCodePicker extends Button {
private Resources flagResource;
public CountryCodePicker() {
setUIID("CountryCodePicker");
addActionListener(e -> showPickerForm());
String code = L10NManager.getInstance().getLocale();
if(code != null) {
String[] countryCodes;
if(code.length() == 2) {
countryCodes = COUNTRY_ISO2;
} else {
if(code.length() == 3) {
countryCodes = COUNTRY_ISO3;
} else {
return;
}
}
code = code.toUpperCase();
try {
flagResource = Resources.open("/flags.res");
} catch(IOException err) {
CountryCodePicker
try {
flagResource = Resources.open("/flags.res");
} catch(IOException err) {
Log.e(err);
}
Image blankIcon = Image.createImage(100, 70, 0);
for(int iter = 0 ; iter < countryCodes.length ; iter++) {
if(code.equals(countryCodes[iter])) {
setText("+" + COUNTRY_CODES[iter]);
setIcon(flagResource.getImage(COUNTRY_FLAGS[iter]));
if(getIcon() == null) {
setIcon(blankIcon);
}
return;
}
}
}
}
protected void showPickerForm() {
final Form f = getCurrentForm();
final Transition t = f.getTransitionOutAnimator();
CountryCodePicker
setIcon(blankIcon);
}
return;
}
}
}
}
protected void showPickerForm() {
final Form f = getCurrentForm();
final Transition t = f.getTransitionOutAnimator();
f.setTransitionOutAnimator(CommonTransitions.createEmpty());
Form tf = new CountryPickerForm(this, flagResource);
tf.addShowListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
f.setTransitionOutAnimator(t);
f.removeShowListener(this);
}
});
tf.show();
}
CountryCodePicker
CountryCodePicker
© Codename One 2017 all rights reserved
CountryCodePicker
© Codename One 2017 all rights reserved
CountryCodePicker
© Codename One 2017 all rights reserved
CountryCodePicker
© Codename One 2017 all rights reserved
public class LoginForm extends Form {
public LoginForm() {
super(new BorderLayout());
Label squareLogo = new Label("",
Resources.getGlobalResources().getImage("uber-logo.png"),
"SquareLogo") {
@Override
protected Dimension calcPreferredSize() {
Dimension size = super.calcPreferredSize();
size.setHeight(size.getWidth());
return size;
}
};
Container logo = BorderLayout.centerAbsolute(squareLogo);
logo.setUIID("LogoBackground");
add(CENTER, logo);
Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber");
CountryCodePicker countryCodeButton = new CountryCodePicker() {
@Override
LoginForm
public class LoginForm extends Form {
public LoginForm() {
super(new BorderLayout());
Label squareLogo = new Label("",
Resources.getGlobalResources().getImage("uber-logo.png"),
"SquareLogo") {
@Override
protected Dimension calcPreferredSize() {
Dimension size = super.calcPreferredSize();
size.setHeight(size.getWidth());
return size;
}
};
Container logo = BorderLayout.centerAbsolute(squareLogo);
logo.setUIID("LogoBackground");
add(CENTER, logo);
Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber");
CountryCodePicker countryCodeButton = new CountryCodePicker() {
@Override
LoginForm
public class LoginForm extends Form {
public LoginForm() {
super(new BorderLayout());
Label squareLogo = new Label("",
Resources.getGlobalResources().getImage("uber-logo.png"),
"SquareLogo") {
@Override
protected Dimension calcPreferredSize() {
Dimension size = super.calcPreferredSize();
size.setHeight(size.getWidth());
return size;
}
};
Container logo = BorderLayout.centerAbsolute(squareLogo);
logo.setUIID("LogoBackground");
add(CENTER, logo);
Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber");
CountryCodePicker countryCodeButton = new CountryCodePicker() {
@Override
LoginForm
CountryCodePicker countryCodeButton = new CountryCodePicker() {
@Override
protected void showPickerForm() {
new EnterMobileNumberForm().show();
}
};
SpanButton phoneNumber = new SpanButton("Enter your mobile number",
"PhoneNumberHint");
phoneNumber.getTextComponent().setColumns(80);
phoneNumber.getTextComponent().setRows(2);
phoneNumber.getTextComponent().setGrowByContent(false);
phoneNumber.setUIID("Container");
phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show());
Container phonePicking = BorderLayout.centerCenterEastWest(
phoneNumber,
null, countryCodeButton);
phonePicking.setUIID("Separator");
Button social = new Button("Or connect with social", "ConnectWithSocialButton");
social.addActionListener(e -> new FacebookOrGoogleLoginForm().show());
LoginForm
CountryCodePicker countryCodeButton = new CountryCodePicker() {
@Override
protected void showPickerForm() {
new EnterMobileNumberForm().show();
}
};
SpanButton phoneNumber = new SpanButton("Enter your mobile number",
"PhoneNumberHint");
phoneNumber.getTextComponent().setColumns(80);
phoneNumber.getTextComponent().setRows(2);
phoneNumber.getTextComponent().setGrowByContent(false);
phoneNumber.setUIID("Container");
phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show());
Container phonePicking = BorderLayout.centerCenterEastWest(
phoneNumber,
null, countryCodeButton);
phonePicking.setUIID("Separator");
Button social = new Button("Or connect with social", "ConnectWithSocialButton");
social.addActionListener(e -> new FacebookOrGoogleLoginForm().show());
LoginForm
phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show());
Container phonePicking = BorderLayout.centerCenterEastWest(
phoneNumber,
null, countryCodeButton);
phonePicking.setUIID("Separator");
Button social = new Button("Or connect with social", "ConnectWithSocialButton");
social.addActionListener(e -> new FacebookOrGoogleLoginForm().show());
add(SOUTH, BoxLayout.encloseY(getMovingWithUber, phonePicking, social));
}
@Override
protected boolean shouldPaintStatusBar() {
return false;
}
@Override
protected void initGlobalToolbar() {
}
}
LoginForm
Tile & Logo
© Codename One 2017 all rights reserved
Square Logo
© Codename One 2017 all rights reserved
Square Logo
© Codename One 2017 all rights reserved
Square Logo
© Codename One 2017 all rights reserved
LogoBackground
© Codename One 2017 all rights reserved
LogoBackground
© Codename One 2017 all rights reserved
LogoBackground
© Codename One 2017 all rights reserved
GetMovingWithUber
© Codename One 2017 all rights reserved
GetMovingWithUber
© Codename One 2017 all rights reserved
GetMovingWithUber
© Codename One 2017 all rights reserved
PhoneNumberHint
© Codename One 2017 all rights reserved
PhoneNumberHint
© Codename One 2017 all rights reserved
PhoneNumberHint
© Codename One 2017 all rights reserved
Separator
© Codename One 2017 all rights reserved
Separator
© Codename One 2017 all rights reserved
Separator
© Codename One 2017 all rights reserved
Separator
© Codename One 2017 all rights reserved
ConnectWithSocialButton
© Codename One 2017 all rights reserved
ConnectWithSocialButton
© Codename One 2017 all rights reserved
ConnectWithSocialButton
© Codename One 2017 all rights reserved
ConnectWithSocialButton
© Codename One 2017 all rights reserved
The Login Form
© Codename One 2017 all rights reserved

More Related Content

Similar to Creating an Uber Clone - Part III.pdf

TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsAlfonso Peletier
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 
Railway reservation
Railway reservationRailway reservation
Railway reservationSwarup Boro
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfudit652068
 
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
 
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docxCIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docxclarebernice
 
Creating a Facebook Clone - Part VIII.pdf
Creating a Facebook Clone - Part VIII.pdfCreating a Facebook Clone - Part VIII.pdf
Creating a Facebook Clone - Part VIII.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
Creating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfCreating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfShaiAlmog1
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperDeepak Singh
 
Creating an Uber Clone - Part XXXIV - Transcript.pdf
Creating an Uber Clone - Part XXXIV - Transcript.pdfCreating an Uber Clone - Part XXXIV - Transcript.pdf
Creating an Uber Clone - Part XXXIV - Transcript.pdfShaiAlmog1
 
The Ring programming language version 1.7 book - Part 87 of 196
The Ring programming language version 1.7 book - Part 87 of 196The Ring programming language version 1.7 book - Part 87 of 196
The Ring programming language version 1.7 book - Part 87 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184Mahmoud Samir Fayed
 
Creating a Facebook Clone - Part XXVIII - Transcript.pdf
Creating a Facebook Clone - Part XXVIII - Transcript.pdfCreating a Facebook Clone - Part XXVIII - Transcript.pdf
Creating a Facebook Clone - Part XXVIII - Transcript.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 an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfCreating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXXIX.pdfShaiAlmog1
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdfanitasahani11
 

Similar to Creating an Uber Clone - Part III.pdf (20)

MaintainStaffTable
MaintainStaffTableMaintainStaffTable
MaintainStaffTable
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
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
 
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docxCIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx
CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx
 
Applications
ApplicationsApplications
Applications
 
Creating a Facebook Clone - Part VIII.pdf
Creating a Facebook Clone - Part VIII.pdfCreating a Facebook Clone - Part VIII.pdf
Creating a Facebook Clone - Part VIII.pdf
 
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 a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdfCreating a Facebook Clone - Part VII.pdf
Creating a Facebook Clone - Part VII.pdf
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
Creating an Uber Clone - Part XXXIV - Transcript.pdf
Creating an Uber Clone - Part XXXIV - Transcript.pdfCreating an Uber Clone - Part XXXIV - Transcript.pdf
Creating an Uber Clone - Part XXXIV - Transcript.pdf
 
The Ring programming language version 1.7 book - Part 87 of 196
The Ring programming language version 1.7 book - Part 87 of 196The Ring programming language version 1.7 book - Part 87 of 196
The Ring programming language version 1.7 book - Part 87 of 196
 
The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184
 
Creating a Facebook Clone - Part XXVIII - Transcript.pdf
Creating a Facebook Clone - Part XXVIII - Transcript.pdfCreating a Facebook Clone - Part XXVIII - Transcript.pdf
Creating a Facebook Clone - Part XXVIII - Transcript.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 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
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .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

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging 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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 

Creating an Uber Clone - Part III.pdf

  • 1. Creating an Uber Clone - Part III
  • 2. Country Button © Codename One 2017 all rights reserved
  • 3. Country Button © Codename One 2017 all rights reserved
  • 4. public class CountryCodePicker extends Button { private Resources flagResource; public CountryCodePicker() { setUIID("CountryCodePicker"); addActionListener(e -> showPickerForm()); String code = L10NManager.getInstance().getLocale(); if(code != null) { String[] countryCodes; if(code.length() == 2) { countryCodes = COUNTRY_ISO2; } else { if(code.length() == 3) { countryCodes = COUNTRY_ISO3; } else { return; } } code = code.toUpperCase(); try { flagResource = Resources.open("/flags.res"); } catch(IOException err) { CountryCodePicker
  • 5. public class CountryCodePicker extends Button { private Resources flagResource; public CountryCodePicker() { setUIID("CountryCodePicker"); addActionListener(e -> showPickerForm()); String code = L10NManager.getInstance().getLocale(); if(code != null) { String[] countryCodes; if(code.length() == 2) { countryCodes = COUNTRY_ISO2; } else { if(code.length() == 3) { countryCodes = COUNTRY_ISO3; } else { return; } } code = code.toUpperCase(); try { flagResource = Resources.open("/flags.res"); } catch(IOException err) { CountryCodePicker
  • 6. public class CountryCodePicker extends Button { private Resources flagResource; public CountryCodePicker() { setUIID("CountryCodePicker"); addActionListener(e -> showPickerForm()); String code = L10NManager.getInstance().getLocale(); if(code != null) { String[] countryCodes; if(code.length() == 2) { countryCodes = COUNTRY_ISO2; } else { if(code.length() == 3) { countryCodes = COUNTRY_ISO3; } else { return; } } code = code.toUpperCase(); try { flagResource = Resources.open("/flags.res"); } catch(IOException err) { CountryCodePicker
  • 7. public class CountryCodePicker extends Button { private Resources flagResource; public CountryCodePicker() { setUIID("CountryCodePicker"); addActionListener(e -> showPickerForm()); String code = L10NManager.getInstance().getLocale(); if(code != null) { String[] countryCodes; if(code.length() == 2) { countryCodes = COUNTRY_ISO2; } else { if(code.length() == 3) { countryCodes = COUNTRY_ISO3; } else { return; } } code = code.toUpperCase(); try { flagResource = Resources.open("/flags.res"); } catch(IOException err) { CountryCodePicker
  • 8. try { flagResource = Resources.open("/flags.res"); } catch(IOException err) { Log.e(err); } Image blankIcon = Image.createImage(100, 70, 0); for(int iter = 0 ; iter < countryCodes.length ; iter++) { if(code.equals(countryCodes[iter])) { setText("+" + COUNTRY_CODES[iter]); setIcon(flagResource.getImage(COUNTRY_FLAGS[iter])); if(getIcon() == null) { setIcon(blankIcon); } return; } } } } protected void showPickerForm() { final Form f = getCurrentForm(); final Transition t = f.getTransitionOutAnimator(); CountryCodePicker
  • 9. setIcon(blankIcon); } return; } } } } protected void showPickerForm() { final Form f = getCurrentForm(); final Transition t = f.getTransitionOutAnimator(); f.setTransitionOutAnimator(CommonTransitions.createEmpty()); Form tf = new CountryPickerForm(this, flagResource); tf.addShowListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { f.setTransitionOutAnimator(t); f.removeShowListener(this); } }); tf.show(); } CountryCodePicker
  • 10. CountryCodePicker © Codename One 2017 all rights reserved
  • 11. CountryCodePicker © Codename One 2017 all rights reserved
  • 12. CountryCodePicker © Codename One 2017 all rights reserved
  • 13. CountryCodePicker © Codename One 2017 all rights reserved
  • 14. public class LoginForm extends Form { public LoginForm() { super(new BorderLayout()); Label squareLogo = new Label("", Resources.getGlobalResources().getImage("uber-logo.png"), "SquareLogo") { @Override protected Dimension calcPreferredSize() { Dimension size = super.calcPreferredSize(); size.setHeight(size.getWidth()); return size; } }; Container logo = BorderLayout.centerAbsolute(squareLogo); logo.setUIID("LogoBackground"); add(CENTER, logo); Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber"); CountryCodePicker countryCodeButton = new CountryCodePicker() { @Override LoginForm
  • 15. public class LoginForm extends Form { public LoginForm() { super(new BorderLayout()); Label squareLogo = new Label("", Resources.getGlobalResources().getImage("uber-logo.png"), "SquareLogo") { @Override protected Dimension calcPreferredSize() { Dimension size = super.calcPreferredSize(); size.setHeight(size.getWidth()); return size; } }; Container logo = BorderLayout.centerAbsolute(squareLogo); logo.setUIID("LogoBackground"); add(CENTER, logo); Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber"); CountryCodePicker countryCodeButton = new CountryCodePicker() { @Override LoginForm
  • 16. public class LoginForm extends Form { public LoginForm() { super(new BorderLayout()); Label squareLogo = new Label("", Resources.getGlobalResources().getImage("uber-logo.png"), "SquareLogo") { @Override protected Dimension calcPreferredSize() { Dimension size = super.calcPreferredSize(); size.setHeight(size.getWidth()); return size; } }; Container logo = BorderLayout.centerAbsolute(squareLogo); logo.setUIID("LogoBackground"); add(CENTER, logo); Label getMovingWithUber = new Label("Get moving with Uber", "GetMovingWithUber"); CountryCodePicker countryCodeButton = new CountryCodePicker() { @Override LoginForm
  • 17. CountryCodePicker countryCodeButton = new CountryCodePicker() { @Override protected void showPickerForm() { new EnterMobileNumberForm().show(); } }; SpanButton phoneNumber = new SpanButton("Enter your mobile number", "PhoneNumberHint"); phoneNumber.getTextComponent().setColumns(80); phoneNumber.getTextComponent().setRows(2); phoneNumber.getTextComponent().setGrowByContent(false); phoneNumber.setUIID("Container"); phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show()); Container phonePicking = BorderLayout.centerCenterEastWest( phoneNumber, null, countryCodeButton); phonePicking.setUIID("Separator"); Button social = new Button("Or connect with social", "ConnectWithSocialButton"); social.addActionListener(e -> new FacebookOrGoogleLoginForm().show()); LoginForm
  • 18. CountryCodePicker countryCodeButton = new CountryCodePicker() { @Override protected void showPickerForm() { new EnterMobileNumberForm().show(); } }; SpanButton phoneNumber = new SpanButton("Enter your mobile number", "PhoneNumberHint"); phoneNumber.getTextComponent().setColumns(80); phoneNumber.getTextComponent().setRows(2); phoneNumber.getTextComponent().setGrowByContent(false); phoneNumber.setUIID("Container"); phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show()); Container phonePicking = BorderLayout.centerCenterEastWest( phoneNumber, null, countryCodeButton); phonePicking.setUIID("Separator"); Button social = new Button("Or connect with social", "ConnectWithSocialButton"); social.addActionListener(e -> new FacebookOrGoogleLoginForm().show()); LoginForm
  • 19. phoneNumber.addActionListener(e -> new EnterMobileNumberForm().show()); Container phonePicking = BorderLayout.centerCenterEastWest( phoneNumber, null, countryCodeButton); phonePicking.setUIID("Separator"); Button social = new Button("Or connect with social", "ConnectWithSocialButton"); social.addActionListener(e -> new FacebookOrGoogleLoginForm().show()); add(SOUTH, BoxLayout.encloseY(getMovingWithUber, phonePicking, social)); } @Override protected boolean shouldPaintStatusBar() { return false; } @Override protected void initGlobalToolbar() { } } LoginForm
  • 20. Tile & Logo © Codename One 2017 all rights reserved
  • 21. Square Logo © Codename One 2017 all rights reserved
  • 22. Square Logo © Codename One 2017 all rights reserved
  • 23. Square Logo © Codename One 2017 all rights reserved
  • 24. LogoBackground © Codename One 2017 all rights reserved
  • 25. LogoBackground © Codename One 2017 all rights reserved
  • 26. LogoBackground © Codename One 2017 all rights reserved
  • 27. GetMovingWithUber © Codename One 2017 all rights reserved
  • 28. GetMovingWithUber © Codename One 2017 all rights reserved
  • 29. GetMovingWithUber © Codename One 2017 all rights reserved
  • 30. PhoneNumberHint © Codename One 2017 all rights reserved
  • 31. PhoneNumberHint © Codename One 2017 all rights reserved
  • 32. PhoneNumberHint © Codename One 2017 all rights reserved
  • 33. Separator © Codename One 2017 all rights reserved
  • 34. Separator © Codename One 2017 all rights reserved
  • 35. Separator © Codename One 2017 all rights reserved
  • 36. Separator © Codename One 2017 all rights reserved
  • 37. ConnectWithSocialButton © Codename One 2017 all rights reserved
  • 38. ConnectWithSocialButton © Codename One 2017 all rights reserved
  • 39. ConnectWithSocialButton © Codename One 2017 all rights reserved
  • 40. ConnectWithSocialButton © Codename One 2017 all rights reserved
  • 41. The Login Form © Codename One 2017 all rights reserved