SlideShare a Scribd company logo
Creating an Uber Clone - Part V
Social Login
© Codename One 2017 all rights reserved
public class FacebookOrGoogleLoginForm extends Form {
public FacebookOrGoogleLoginForm() {
super(BoxLayout.y());
Form previous = getCurrentForm();
getToolbar().setBackCommand("",
Toolbar.BackCommandPolicy.AS_ARROW,
e -> previous.showBack());
add(new Label("Choose an account", "FlagButton"));
Button facebook = new Button("Facebook",
Resources.getGlobalResources().getImage("facebook.png"),
"FlagButton");
Button google = new Button("Google",
Resources.getGlobalResources().getImage("google.png"),
“FlagButton");
add(facebook).add(google);
}
}
FacebookOrGoogleLoginForm
FlagButton
© Codename One 2017 all rights reserved
FlagButton
© Codename One 2017 all rights reserved
Country Picker
© Codename One 2017 all rights reserved
public class CountryPickerForm extends Form {
public CountryPickerForm(Button sourceButton, Resources flags) {
super(BoxLayout.y());
CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val));
Image blankIcon = Image.createImage(100, 70, 0);
char lastChar = (char)-1;
for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) {
Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton");
char current = b.getText().charAt(0);
if(current != lastChar) {
lastChar = current;
Label l = new Label("" + lastChar, "FlagsLetter");
add(l);
}
b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter]));
if(b.getIcon() == null) {
b.setIcon(blankIcon);
}
String currentCountryCode = ActivationForm.COUNTRY_CODES[iter];
b.addActionListener(ee -> {
sourceButton.setIcon(b.getIcon());
sourceButton.setText("+" + currentCountryCode);
CountryPickerForm
public class CountryPickerForm extends Form {
public CountryPickerForm(Button sourceButton, Resources flags) {
super(BoxLayout.y());
CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val));
Image blankIcon = Image.createImage(100, 70, 0);
char lastChar = (char)-1;
for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) {
Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton");
char current = b.getText().charAt(0);
if(current != lastChar) {
lastChar = current;
Label l = new Label("" + lastChar, "FlagsLetter");
add(l);
}
b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter]));
if(b.getIcon() == null) {
b.setIcon(blankIcon);
}
String currentCountryCode = ActivationForm.COUNTRY_CODES[iter];
b.addActionListener(ee -> {
sourceButton.setIcon(b.getIcon());
sourceButton.setText("+" + currentCountryCode);
CountryPickerForm
public class CountryPickerForm extends Form {
public CountryPickerForm(Button sourceButton, Resources flags) {
super(BoxLayout.y());
CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val));
Image blankIcon = Image.createImage(100, 70, 0);
char lastChar = (char)-1;
for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) {
Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton");
char current = b.getText().charAt(0);
if(current != lastChar) {
lastChar = current;
Label l = new Label("" + lastChar, "FlagsLetter");
add(l);
}
b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter]));
if(b.getIcon() == null) {
b.setIcon(blankIcon);
}
String currentCountryCode = ActivationForm.COUNTRY_CODES[iter];
b.addActionListener(ee -> {
sourceButton.setIcon(b.getIcon());
sourceButton.setText("+" + currentCountryCode);
CountryPickerForm
public class CountryPickerForm extends Form {
public CountryPickerForm(Button sourceButton, Resources flags) {
super(BoxLayout.y());
CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val));
Image blankIcon = Image.createImage(100, 70, 0);
char lastChar = (char)-1;
for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) {
Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton");
char current = b.getText().charAt(0);
if(current != lastChar) {
lastChar = current;
Label l = new Label("" + lastChar, "FlagsLetter");
add(l);
}
b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter]));
if(b.getIcon() == null) {
b.setIcon(blankIcon);
}
String currentCountryCode = ActivationForm.COUNTRY_CODES[iter];
b.addActionListener(ee -> {
sourceButton.setIcon(b.getIcon());
sourceButton.setText("+" + currentCountryCode);
CountryPickerForm
b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter]));
if(b.getIcon() == null) {
b.setIcon(blankIcon);
}
String currentCountryCode = ActivationForm.COUNTRY_CODES[iter];
b.addActionListener(ee -> {
sourceButton.setIcon(b.getIcon());
sourceButton.setText("+" + currentCountryCode);
});
add(b);
}
}
@Override
protected void initGlobalToolbar() {
super.initGlobalToolbar();
getToolbar().setUIID("BlackToolbar");
}
void search(String s) {
}
}
CountryPickerForm
BlackToolbar
© Codename One 2017 all rights reserved
BlackToolbar
© Codename One 2017 all rights reserved
BlackToolbar
© Codename One 2017 all rights reserved
FlagsLetter
© Codename One 2017 all rights reserved
FlagsLetter
© Codename One 2017 all rights reserved
public static void initBlackTitleForm(Form f, String title,
SuccessCallback<String> searchResults) {
Form backTo = getCurrentForm();
f.getContentPane().setScrollVisible(false);
Button back = new Button("", "TitleCommand");
back.addActionListener(e -> backTo.showBack());
back.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK);
Container searchBack = null;
if(searchResults != null) {
Button search = new Button("", "TitleCommand");
search.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH);
search.addActionListener(e -> {
// TODO
});
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, search, back));
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
initBlackTitleForm
public static void initBlackTitleForm(Form f, String title,
SuccessCallback<String> searchResults) {
Form backTo = getCurrentForm();
f.getContentPane().setScrollVisible(false);
Button back = new Button("", "TitleCommand");
back.addActionListener(e -> backTo.showBack());
back.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK);
Container searchBack = null;
if(searchResults != null) {
Button search = new Button("", "TitleCommand");
search.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH);
search.addActionListener(e -> {
// TODO
});
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, search, back));
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
initBlackTitleForm
public static void initBlackTitleForm(Form f, String title,
SuccessCallback<String> searchResults) {
Form backTo = getCurrentForm();
f.getContentPane().setScrollVisible(false);
Button back = new Button("", "TitleCommand");
back.addActionListener(e -> backTo.showBack());
back.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK);
Container searchBack = null;
if(searchResults != null) {
Button search = new Button("", "TitleCommand");
search.getAllStyles().setFgColor(0xffffff);
FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH);
search.addActionListener(e -> {
// TODO
});
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, search, back));
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
initBlackTitleForm
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
}
Label titleLabel = new Label(title, "WhiteOnBlackTitle");
titleLabel.getAllStyles().setMarginTop(back.getPreferredH());
titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS,
Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS);
f.getToolbar().setTitleComponent(
LayeredLayout.encloseIn(searchBack, titleLabel));
f.getAnimationManager().onTitleScrollAnimation(
titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200));
f.setTransitionInAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, false, 300));
f.setTransitionOutAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, true, 300));
}
initBlackTitleForm
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
}
Label titleLabel = new Label(title, "WhiteOnBlackTitle");
titleLabel.getAllStyles().setMarginTop(back.getPreferredH());
titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS,
Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS);
f.getToolbar().setTitleComponent(
LayeredLayout.encloseIn(searchBack, titleLabel));
f.getAnimationManager().onTitleScrollAnimation(
titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200));
f.setTransitionInAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, false, 300));
f.setTransitionOutAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, true, 300));
}
initBlackTitleForm
} else {
searchBack = BorderLayout.north(
BorderLayout.centerEastWest(null, null, back));
}
Label titleLabel = new Label(title, "WhiteOnBlackTitle");
titleLabel.getAllStyles().setMarginTop(back.getPreferredH());
titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS,
Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS);
f.getToolbar().setTitleComponent(
LayeredLayout.encloseIn(searchBack, titleLabel));
f.getAnimationManager().onTitleScrollAnimation(
titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200));
f.setTransitionInAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, false, 300));
f.setTransitionOutAnimator(CommonTransitions.
createCover(CommonTransitions.SLIDE_VERTICAL, true, 300));
}
initBlackTitleForm
WhiteOnBlackTitle
© Codename One 2017 all rights reserved
WhiteOnBlackTitle
© Codename One 2017 all rights reserved
WhiteOnBlackTitle
© Codename One 2017 all rights reserved
WhiteOnBlackTitle
© Codename One 2017 all rights reserved
WhiteOnBlackTitleLeftMargin
© Codename One 2017 all rights reserved
WhiteOnBlackTitleLeftMargin
© Codename One 2017 all rights reserved
WhiteOnBlackTitleLeftMargin
© Codename One 2017 all rights reserved
WhiteOnBlackTitleLeftMargin
© Codename One 2017 all rights reserved

More Related Content

Similar to 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
ShaiAlmog1
 
Creating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdfCreating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdfCreating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdf
ShaiAlmog1
 
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
ShaiAlmog1
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XLVI.pdf
Creating a Facebook Clone - Part XLVI.pdfCreating a Facebook Clone - Part XLVI.pdf
Creating a Facebook Clone - Part XLVI.pdf
ShaiAlmog1
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
Devnology
 
Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XXVIII.pdf
Creating a Facebook Clone - Part XXVIII.pdfCreating a Facebook Clone - Part XXVIII.pdf
Creating a Facebook Clone - Part XXVIII.pdf
ShaiAlmog1
 
Creating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdfCreating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdf
ShaiAlmog1
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdf
ShaiAlmog1
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XLIII.pdf
Creating a Facebook Clone - Part XLIII.pdfCreating a Facebook Clone - Part XLIII.pdf
Creating a Facebook Clone - Part XLIII.pdf
ShaiAlmog1
 
Initial UI Mockup - Part 3 - Transcript.pdf
Initial UI Mockup - Part 3 - Transcript.pdfInitial UI Mockup - Part 3 - Transcript.pdf
Initial UI Mockup - Part 3 - Transcript.pdf
ShaiAlmog1
 
Creating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdfCreating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XXX.pdf
Creating a Facebook Clone - Part XXX.pdfCreating a Facebook Clone - Part XXX.pdf
Creating a Facebook Clone - Part XXX.pdf
ShaiAlmog1
 
Extracting ui Design - part 4 - transcript.pdf
Extracting ui Design - part 4 - transcript.pdfExtracting ui Design - part 4 - transcript.pdf
Extracting ui Design - part 4 - transcript.pdf
ShaiAlmog1
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
apexcomputer54
 
Extracting ui Design - part 4.pdf
Extracting ui Design - part 4.pdfExtracting ui Design - part 4.pdf
Extracting ui Design - part 4.pdf
ShaiAlmog1
 
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf
allwayscollection
 

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

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
 
Creating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdfCreating a Facebook Clone - Part VI.pdf
Creating a Facebook Clone - Part VI.pdf
 
Creating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.pdfCreating a Facebook Clone - Part XLII.pdf
Creating a Facebook Clone - Part XLII.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
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdf
 
Creating a Facebook Clone - Part XLVI.pdf
Creating a Facebook Clone - Part XLVI.pdfCreating a Facebook Clone - Part XLVI.pdf
Creating a Facebook Clone - Part XLVI.pdf
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
 
Creating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdfCreating an Uber - Part VI.pdf
Creating an Uber - Part VI.pdf
 
Creating a Facebook Clone - Part XXVIII.pdf
Creating a Facebook Clone - Part XXVIII.pdfCreating a Facebook Clone - Part XXVIII.pdf
Creating a Facebook Clone - Part XXVIII.pdf
 
Creating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdfCreating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XXIV.pdf
 
Creating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdfCreating an Uber Clone - Part III.pdf
Creating an Uber Clone - Part III.pdf
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
 
Creating a Facebook Clone - Part XLIII.pdf
Creating a Facebook Clone - Part XLIII.pdfCreating a Facebook Clone - Part XLIII.pdf
Creating a Facebook Clone - Part XLIII.pdf
 
Initial UI Mockup - Part 3 - Transcript.pdf
Initial UI Mockup - Part 3 - Transcript.pdfInitial UI Mockup - Part 3 - Transcript.pdf
Initial UI Mockup - Part 3 - Transcript.pdf
 
Creating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdfCreating an Uber Clone - Part IX.pdf
Creating an Uber Clone - Part IX.pdf
 
Creating a Facebook Clone - Part XXX.pdf
Creating a Facebook Clone - Part XXX.pdfCreating a Facebook Clone - Part XXX.pdf
Creating a Facebook Clone - Part XXX.pdf
 
Extracting ui Design - part 4 - transcript.pdf
Extracting ui Design - part 4 - transcript.pdfExtracting ui Design - part 4 - transcript.pdf
Extracting ui Design - part 4 - transcript.pdf
 
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdfImport java.awt.; Import acm.program.; Import acm.graphics.;.pdf
Import java.awt.; Import acm.program.; Import acm.graphics.;.pdf
 
Extracting ui Design - part 4.pdf
Extracting ui Design - part 4.pdfExtracting ui Design - part 4.pdf
Extracting ui Design - part 4.pdf
 
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.pdf
2. Section 2. Implementing functionality in the PersonEntry. (1.5 ma.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.pdf
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
ShaiAlmog1
 
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
ShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 
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
ShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part 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

Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 

Recently uploaded (20)

Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 

Creating an Uber Clone - Part V.pdf

  • 1. Creating an Uber Clone - Part V
  • 2. Social Login © Codename One 2017 all rights reserved
  • 3. public class FacebookOrGoogleLoginForm extends Form { public FacebookOrGoogleLoginForm() { super(BoxLayout.y()); Form previous = getCurrentForm(); getToolbar().setBackCommand("", Toolbar.BackCommandPolicy.AS_ARROW, e -> previous.showBack()); add(new Label("Choose an account", "FlagButton")); Button facebook = new Button("Facebook", Resources.getGlobalResources().getImage("facebook.png"), "FlagButton"); Button google = new Button("Google", Resources.getGlobalResources().getImage("google.png"), “FlagButton"); add(facebook).add(google); } } FacebookOrGoogleLoginForm
  • 4. FlagButton © Codename One 2017 all rights reserved
  • 5. FlagButton © Codename One 2017 all rights reserved
  • 6. Country Picker © Codename One 2017 all rights reserved
  • 7. public class CountryPickerForm extends Form { public CountryPickerForm(Button sourceButton, Resources flags) { super(BoxLayout.y()); CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val)); Image blankIcon = Image.createImage(100, 70, 0); char lastChar = (char)-1; for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) { Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton"); char current = b.getText().charAt(0); if(current != lastChar) { lastChar = current; Label l = new Label("" + lastChar, "FlagsLetter"); add(l); } b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter])); if(b.getIcon() == null) { b.setIcon(blankIcon); } String currentCountryCode = ActivationForm.COUNTRY_CODES[iter]; b.addActionListener(ee -> { sourceButton.setIcon(b.getIcon()); sourceButton.setText("+" + currentCountryCode); CountryPickerForm
  • 8. public class CountryPickerForm extends Form { public CountryPickerForm(Button sourceButton, Resources flags) { super(BoxLayout.y()); CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val)); Image blankIcon = Image.createImage(100, 70, 0); char lastChar = (char)-1; for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) { Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton"); char current = b.getText().charAt(0); if(current != lastChar) { lastChar = current; Label l = new Label("" + lastChar, "FlagsLetter"); add(l); } b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter])); if(b.getIcon() == null) { b.setIcon(blankIcon); } String currentCountryCode = ActivationForm.COUNTRY_CODES[iter]; b.addActionListener(ee -> { sourceButton.setIcon(b.getIcon()); sourceButton.setText("+" + currentCountryCode); CountryPickerForm
  • 9. public class CountryPickerForm extends Form { public CountryPickerForm(Button sourceButton, Resources flags) { super(BoxLayout.y()); CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val)); Image blankIcon = Image.createImage(100, 70, 0); char lastChar = (char)-1; for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) { Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton"); char current = b.getText().charAt(0); if(current != lastChar) { lastChar = current; Label l = new Label("" + lastChar, "FlagsLetter"); add(l); } b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter])); if(b.getIcon() == null) { b.setIcon(blankIcon); } String currentCountryCode = ActivationForm.COUNTRY_CODES[iter]; b.addActionListener(ee -> { sourceButton.setIcon(b.getIcon()); sourceButton.setText("+" + currentCountryCode); CountryPickerForm
  • 10. public class CountryPickerForm extends Form { public CountryPickerForm(Button sourceButton, Resources flags) { super(BoxLayout.y()); CommonCode.initBlackTitleForm(this, "Select a Country", val -> search(val)); Image blankIcon = Image.createImage(100, 70, 0); char lastChar = (char)-1; for(int iter = 0 ; iter < ActivationForm.COUNTRY_CODES.length ; iter++) { Button b = new Button(ActivationForm.COUNTRY_NAMES[iter], "FlagButton"); char current = b.getText().charAt(0); if(current != lastChar) { lastChar = current; Label l = new Label("" + lastChar, "FlagsLetter"); add(l); } b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter])); if(b.getIcon() == null) { b.setIcon(blankIcon); } String currentCountryCode = ActivationForm.COUNTRY_CODES[iter]; b.addActionListener(ee -> { sourceButton.setIcon(b.getIcon()); sourceButton.setText("+" + currentCountryCode); CountryPickerForm
  • 11. b.setIcon(flags.getImage(ActivationForm.COUNTRY_FLAGS[iter])); if(b.getIcon() == null) { b.setIcon(blankIcon); } String currentCountryCode = ActivationForm.COUNTRY_CODES[iter]; b.addActionListener(ee -> { sourceButton.setIcon(b.getIcon()); sourceButton.setText("+" + currentCountryCode); }); add(b); } } @Override protected void initGlobalToolbar() { super.initGlobalToolbar(); getToolbar().setUIID("BlackToolbar"); } void search(String s) { } } CountryPickerForm
  • 12. BlackToolbar © Codename One 2017 all rights reserved
  • 13. BlackToolbar © Codename One 2017 all rights reserved
  • 14. BlackToolbar © Codename One 2017 all rights reserved
  • 15. FlagsLetter © Codename One 2017 all rights reserved
  • 16. FlagsLetter © Codename One 2017 all rights reserved
  • 17. public static void initBlackTitleForm(Form f, String title, SuccessCallback<String> searchResults) { Form backTo = getCurrentForm(); f.getContentPane().setScrollVisible(false); Button back = new Button("", "TitleCommand"); back.addActionListener(e -> backTo.showBack()); back.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK); Container searchBack = null; if(searchResults != null) { Button search = new Button("", "TitleCommand"); search.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH); search.addActionListener(e -> { // TODO }); searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, search, back)); } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); initBlackTitleForm
  • 18. public static void initBlackTitleForm(Form f, String title, SuccessCallback<String> searchResults) { Form backTo = getCurrentForm(); f.getContentPane().setScrollVisible(false); Button back = new Button("", "TitleCommand"); back.addActionListener(e -> backTo.showBack()); back.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK); Container searchBack = null; if(searchResults != null) { Button search = new Button("", "TitleCommand"); search.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH); search.addActionListener(e -> { // TODO }); searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, search, back)); } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); initBlackTitleForm
  • 19. public static void initBlackTitleForm(Form f, String title, SuccessCallback<String> searchResults) { Form backTo = getCurrentForm(); f.getContentPane().setScrollVisible(false); Button back = new Button("", "TitleCommand"); back.addActionListener(e -> backTo.showBack()); back.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(back, FontImage.MATERIAL_ARROW_BACK); Container searchBack = null; if(searchResults != null) { Button search = new Button("", "TitleCommand"); search.getAllStyles().setFgColor(0xffffff); FontImage.setMaterialIcon(search, FontImage.MATERIAL_SEARCH); search.addActionListener(e -> { // TODO }); searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, search, back)); } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); initBlackTitleForm
  • 20. } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); } Label titleLabel = new Label(title, "WhiteOnBlackTitle"); titleLabel.getAllStyles().setMarginTop(back.getPreferredH()); titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS); f.getToolbar().setTitleComponent( LayeredLayout.encloseIn(searchBack, titleLabel)); f.getAnimationManager().onTitleScrollAnimation( titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200)); f.setTransitionInAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, false, 300)); f.setTransitionOutAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, true, 300)); } initBlackTitleForm
  • 21. } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); } Label titleLabel = new Label(title, "WhiteOnBlackTitle"); titleLabel.getAllStyles().setMarginTop(back.getPreferredH()); titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS); f.getToolbar().setTitleComponent( LayeredLayout.encloseIn(searchBack, titleLabel)); f.getAnimationManager().onTitleScrollAnimation( titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200)); f.setTransitionInAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, false, 300)); f.setTransitionOutAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, true, 300)); } initBlackTitleForm
  • 22. } else { searchBack = BorderLayout.north( BorderLayout.centerEastWest(null, null, back)); } Label titleLabel = new Label(title, "WhiteOnBlackTitle"); titleLabel.getAllStyles().setMarginTop(back.getPreferredH()); titleLabel.getAllStyles().setMarginUnit(Style.UNIT_TYPE_PIXELS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS); f.getToolbar().setTitleComponent( LayeredLayout.encloseIn(searchBack, titleLabel)); f.getAnimationManager().onTitleScrollAnimation( titleLabel.createStyleAnimation("WhiteOnBlackTitleLeftMargin", 200)); f.setTransitionInAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, false, 300)); f.setTransitionOutAnimator(CommonTransitions. createCover(CommonTransitions.SLIDE_VERTICAL, true, 300)); } initBlackTitleForm
  • 23. WhiteOnBlackTitle © Codename One 2017 all rights reserved
  • 24. WhiteOnBlackTitle © Codename One 2017 all rights reserved
  • 25. WhiteOnBlackTitle © Codename One 2017 all rights reserved
  • 26. WhiteOnBlackTitle © Codename One 2017 all rights reserved