SlideShare a Scribd company logo
Creating an Uber Clone - Part IX
Destination UI
© Codename One 2017 all rights reserved
Destination UI
© Codename One 2017 all rights reserved
Destination UI
© Codename One 2017 all rights reserved
private void showToNavigationBar(Container parentLayer) {
MultiButton addHome = new MultiButton("Add Home");
addHome.setUIID("Container");
addHome.setUIIDLine1("WhereToButtonLine1");
addHome.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(addHome, FontImage.MATERIAL_HOME);
MultiButton addWork = new MultiButton("Add Work");
addWork.setUIID("Container");
addWork.setUIIDLine1("WhereToButtonLine1");
addWork.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(addWork, FontImage.MATERIAL_WORK);
MultiButton savedPlaces = new MultiButton("Saved Places");
savedPlaces.setUIID("Container");
savedPlaces.setUIIDLine1("WhereToButtonLineNoBorder");
savedPlaces.setEmblemUIID("WhereToButtonLineNoBorder");
savedPlaces.setIconUIID("WhereToButtonIcon");
savedPlaces.setEmblem(FontImage.createMaterial(
FontImage.MATERIAL_NAVIGATE_NEXT,
savedPlaces.getIconComponent().getUnselectedStyle()));
FontImage.setMaterialIcon(savedPlaces,
FontImage.MATERIAL_STAR_BORDER);
Destination UI
savedPlaces.setEmblem(FontImage.createMaterial(
FontImage.MATERIAL_NAVIGATE_NEXT,
savedPlaces.getIconComponent().getUnselectedStyle()));
FontImage.setMaterialIcon(savedPlaces,
FontImage.MATERIAL_STAR_BORDER);
Label whereSeparator = new Label("", "WhereSeparator");
whereSeparator.setShowEvenIfBlank(true);
MultiButton history1 = new MultiButton("Mikve Yisrael Str...");
history1.setUIID("Container");
history1.setUIIDLine1("WhereToButtonLine1");
history1.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY);
Container result = BoxLayout.encloseY(addHome, addWork,
savedPlaces, whereSeparator, history1);
result.setUIID("Form");
result.setScrollableY(true);
result.setScrollVisible(false);
result.setY(getDisplayHeight());
Destination UI
savedPlaces.setEmblem(FontImage.createMaterial(
FontImage.MATERIAL_NAVIGATE_NEXT,
savedPlaces.getIconComponent().getUnselectedStyle()));
FontImage.setMaterialIcon(savedPlaces,
FontImage.MATERIAL_STAR_BORDER);
Label whereSeparator = new Label("", "WhereSeparator");
whereSeparator.setShowEvenIfBlank(true);
MultiButton history1 = new MultiButton("Mikve Yisrael Str...");
history1.setUIID("Container");
history1.setUIIDLine1("WhereToButtonLine1");
history1.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY);
Container result = BoxLayout.encloseY(addHome, addWork,
savedPlaces, whereSeparator, history1);
result.setUIID("Form");
result.setScrollableY(true);
result.setScrollVisible(false);
result.setY(getDisplayHeight());
Destination UI
savedPlaces.setEmblem(FontImage.createMaterial(
FontImage.MATERIAL_NAVIGATE_NEXT,
savedPlaces.getIconComponent().getUnselectedStyle()));
FontImage.setMaterialIcon(savedPlaces,
FontImage.MATERIAL_STAR_BORDER);
Label whereSeparator = new Label("", "WhereSeparator");
whereSeparator.setShowEvenIfBlank(true);
MultiButton history1 = new MultiButton("Mikve Yisrael Str...");
history1.setUIID("Container");
history1.setUIIDLine1("WhereToButtonLine1");
history1.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY);
Container result = BoxLayout.encloseY(addHome, addWork,
savedPlaces, whereSeparator, history1);
result.setUIID("Form");
result.setScrollableY(true);
result.setScrollVisible(false);
result.setY(getDisplayHeight());
Destination UI
Label whereSeparator = new Label("", "WhereSeparator");
whereSeparator.setShowEvenIfBlank(true);
MultiButton history1 = new MultiButton("Mikve Yisrael Str...");
history1.setUIID("Container");
history1.setUIIDLine1("WhereToButtonLine1");
history1.setIconUIID("WhereToButtonIcon");
FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY);
Container result = BoxLayout.encloseY(addHome, addWork,
savedPlaces, whereSeparator, history1);
result.setUIID("Form");
result.setScrollableY(true);
result.setScrollVisible(false);
result.setY(getDisplayHeight());
result.setWidth(getDisplayWidth());
result.setHeight(result.getPreferredH());
parentLayer.add(CENTER, result);
parentLayer.animateLayout(200);
}
Destination UI
WhereToButtonLine1
© Codename One 2017 all rights reserved
WhereToButtonLine1
© Codename One 2017 all rights reserved
WhereToButtonLine1
© Codename One 2017 all rights reserved
WhereToButtonLine1
© Codename One 2017 all rights reserved
WhereToButtonLine1
© Codename One 2017 all rights reserved
WhereToButtonIcon
© Codename One 2017 all rights reserved
WhereToButtonIcon
© Codename One 2017 all rights reserved
WhereToButtonNoBorder
© Codename One 2017 all rights reserved
WhereToButtonNoBorder
© Codename One 2017 all rights reserved
WhereSeparator
© Codename One 2017 all rights reserved
WhereSeparator
© Codename One 2017 all rights reserved
WhereSeparator
© Codename One 2017 all rights reserved
from.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(square);
if(layer.getComponentCount() > 1) {
Component c = layer.getComponentAt(1);
c.setY(getDisplayHeight());
layer.animateUnlayout(200, 150, () -> {
c.remove();
revalidate();
});
}
}
public void focusLost(Component cmp) {
fromSelected.setIcon(circle);
}
});
to.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(circle);
toSelected.setIcon(square);
showToNavigationBar(layer);
}
public void focusLost(Component cmp) {
toSelected.setIcon(circle);
}
});
Focus Listener
from.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(square);
if(layer.getComponentCount() > 1) {
Component c = layer.getComponentAt(1);
c.setY(getDisplayHeight());
layer.animateUnlayout(200, 150, () -> {
c.remove();
revalidate();
});
}
}
public void focusLost(Component cmp) {
fromSelected.setIcon(circle);
}
});
to.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(circle);
toSelected.setIcon(square);
showToNavigationBar(layer);
}
public void focusLost(Component cmp) {
toSelected.setIcon(circle);
}
});
Focus Listener
from.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(square);
if(layer.getComponentCount() > 1) {
Component c = layer.getComponentAt(1);
c.setY(getDisplayHeight());
layer.animateUnlayout(200, 150, () -> {
c.remove();
revalidate();
});
}
}
public void focusLost(Component cmp) {
fromSelected.setIcon(circle);
}
});
to.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(circle);
toSelected.setIcon(square);
showToNavigationBar(layer);
}
public void focusLost(Component cmp) {
toSelected.setIcon(circle);
}
});
Focus Listener
from.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(square);
if(layer.getComponentCount() > 1) {
Component c = layer.getComponentAt(1);
c.setY(getDisplayHeight());
layer.animateUnlayout(200, 150, () -> {
c.remove();
revalidate();
});
}
}
public void focusLost(Component cmp) {
fromSelected.setIcon(circle);
}
});
to.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(circle);
toSelected.setIcon(square);
showToNavigationBar(layer);
}
public void focusLost(Component cmp) {
toSelected.setIcon(circle);
}
});
Focus Listener
from.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(square);
if(layer.getComponentCount() > 1) {
Component c = layer.getComponentAt(1);
c.setY(getDisplayHeight());
layer.animateUnlayout(200, 150, () -> {
c.remove();
revalidate();
});
}
}
public void focusLost(Component cmp) {
fromSelected.setIcon(circle);
}
});
to.addFocusListener(new FocusListener() {
public void focusGained(Component cmp) {
fromSelected.setIcon(circle);
toSelected.setIcon(square);
showToNavigationBar(layer);
}
public void focusLost(Component cmp) {
toSelected.setIcon(circle);
}
});
Focus Listener
back.addActionListener(e -> {
navigationToolbar.setY(-navigationToolbar.getHeight());
if(layer.getComponentCount() > 1) {
layer.getComponentAt(1).setY(getDisplayHeight());
}
navigationToolbar.getParent().animateUnlayout(200, 120, () -> {
layer.removeAll();
revalidate();
});
});
Back
navigationToolbar.getUnselectedStyle().setBgPainter((g1, rect) -> {
g1.setAlpha(255);
g1.setColor(0xffffff);
if(dropShadow != null) {
if(layer.getComponentCount() > 1) {
g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());
}
g1.drawImage(dropShadow, rect.getX(), rect.getY() +
rect.getHeight() - dropShadow.getHeight(), rect.getWidth(),
dropShadow.getHeight());
g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight() -
dropShadow.getHeight() / 2);
} else {
g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());
}
g1.setColor(0xa4a4ac);
g1.setAntiAliased(true);
int x = fromSelected.getAbsoluteX() + fromSelected.getWidth() / 2 - 1;
int y = fromSelected.getAbsoluteY() + fromSelected.getHeight() / 2 +
circle.getHeight() / 2;
g1.fillRect(x, y, 2, toSelected.getAbsoluteY() - y +
toSelected.getHeight() / 2 - circle.getHeight() / 2);
});
Background Painter

More Related Content

PDF
Creating an Uber Clone - Part VIII.pdf
PDF
Creating an Uber Clone - Part XXIII - Transcript.pdf
PDF
Creating an Uber Clone - Part VIII - Transcript.pdf
PDF
Creating an Uber Clone - Part XXIII.pdf
PDF
Creating an Uber Clone - Part XIX.pdf
PDF
Creating an Uber Clone - Part IX - Transcript.pdf
PDF
Creating an Uber Clone - Part XXI.pdf
PDF
Initial UI Mockup - Part 2.pdf
Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part XXIII - Transcript.pdf
Creating an Uber Clone - Part VIII - Transcript.pdf
Creating an Uber Clone - Part XXIII.pdf
Creating an Uber Clone - Part XIX.pdf
Creating an Uber Clone - Part IX - Transcript.pdf
Creating an Uber Clone - Part XXI.pdf
Initial UI Mockup - Part 2.pdf

Similar to Creating an Uber Clone - Part IX.pdf (15)

PDF
Creating an Uber Clone - Part XXI - Transcript.pdf
PDF
Creating an Uber Clone - Part XX - Transcript.pdf
PDF
Creating an Uber Clone - Part XXIV.pdf
PDF
Creating an Uber Clone - Part XX.pdf
PDF
Creating an Uber Clone - Part XXII.pdf
PDF
Adapting to Tablets and Desktops - Part 3 - Transcript.pdf
PDF
Miscellaneous Features - Part 3 - Transcript.pdf
PDF
Creating an Uber Clone - Part XIX - Transcript.pdf
PDF
Initial UI Mockup - Part 2 - Transcript.pdf
PDF
Creating an Uber Clone - Part XXX.pdf
KEY
Design Patterns for Tablets and Smartphones
PDF
Building iPad apps with Flex - 360Flex
PDF
Creating an Uber Clone - Part XXIV - Transcript.pdf
PPTX
Android 3
PDF
Creating an Uber Clone - Part XXXIX.pdf
Creating an Uber Clone - Part XXI - Transcript.pdf
Creating an Uber Clone - Part XX - Transcript.pdf
Creating an Uber Clone - Part XXIV.pdf
Creating an Uber Clone - Part XX.pdf
Creating an Uber Clone - Part XXII.pdf
Adapting to Tablets and Desktops - Part 3 - Transcript.pdf
Miscellaneous Features - Part 3 - Transcript.pdf
Creating an Uber Clone - Part XIX - Transcript.pdf
Initial UI Mockup - Part 2 - Transcript.pdf
Creating an Uber Clone - Part XXX.pdf
Design Patterns for Tablets and Smartphones
Building iPad apps with Flex - 360Flex
Creating an Uber Clone - Part XXIV - Transcript.pdf
Android 3
Creating an Uber Clone - Part XXXIX.pdf

More from ShaiAlmog1 (20)

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

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf

Creating an Uber Clone - Part IX.pdf

  • 1. Creating an Uber Clone - Part IX
  • 2. Destination UI © Codename One 2017 all rights reserved
  • 3. Destination UI © Codename One 2017 all rights reserved
  • 4. Destination UI © Codename One 2017 all rights reserved
  • 5. private void showToNavigationBar(Container parentLayer) { MultiButton addHome = new MultiButton("Add Home"); addHome.setUIID("Container"); addHome.setUIIDLine1("WhereToButtonLine1"); addHome.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(addHome, FontImage.MATERIAL_HOME); MultiButton addWork = new MultiButton("Add Work"); addWork.setUIID("Container"); addWork.setUIIDLine1("WhereToButtonLine1"); addWork.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(addWork, FontImage.MATERIAL_WORK); MultiButton savedPlaces = new MultiButton("Saved Places"); savedPlaces.setUIID("Container"); savedPlaces.setUIIDLine1("WhereToButtonLineNoBorder"); savedPlaces.setEmblemUIID("WhereToButtonLineNoBorder"); savedPlaces.setIconUIID("WhereToButtonIcon"); savedPlaces.setEmblem(FontImage.createMaterial( FontImage.MATERIAL_NAVIGATE_NEXT, savedPlaces.getIconComponent().getUnselectedStyle())); FontImage.setMaterialIcon(savedPlaces, FontImage.MATERIAL_STAR_BORDER); Destination UI
  • 6. savedPlaces.setEmblem(FontImage.createMaterial( FontImage.MATERIAL_NAVIGATE_NEXT, savedPlaces.getIconComponent().getUnselectedStyle())); FontImage.setMaterialIcon(savedPlaces, FontImage.MATERIAL_STAR_BORDER); Label whereSeparator = new Label("", "WhereSeparator"); whereSeparator.setShowEvenIfBlank(true); MultiButton history1 = new MultiButton("Mikve Yisrael Str..."); history1.setUIID("Container"); history1.setUIIDLine1("WhereToButtonLine1"); history1.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY); Container result = BoxLayout.encloseY(addHome, addWork, savedPlaces, whereSeparator, history1); result.setUIID("Form"); result.setScrollableY(true); result.setScrollVisible(false); result.setY(getDisplayHeight()); Destination UI
  • 7. savedPlaces.setEmblem(FontImage.createMaterial( FontImage.MATERIAL_NAVIGATE_NEXT, savedPlaces.getIconComponent().getUnselectedStyle())); FontImage.setMaterialIcon(savedPlaces, FontImage.MATERIAL_STAR_BORDER); Label whereSeparator = new Label("", "WhereSeparator"); whereSeparator.setShowEvenIfBlank(true); MultiButton history1 = new MultiButton("Mikve Yisrael Str..."); history1.setUIID("Container"); history1.setUIIDLine1("WhereToButtonLine1"); history1.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY); Container result = BoxLayout.encloseY(addHome, addWork, savedPlaces, whereSeparator, history1); result.setUIID("Form"); result.setScrollableY(true); result.setScrollVisible(false); result.setY(getDisplayHeight()); Destination UI
  • 8. savedPlaces.setEmblem(FontImage.createMaterial( FontImage.MATERIAL_NAVIGATE_NEXT, savedPlaces.getIconComponent().getUnselectedStyle())); FontImage.setMaterialIcon(savedPlaces, FontImage.MATERIAL_STAR_BORDER); Label whereSeparator = new Label("", "WhereSeparator"); whereSeparator.setShowEvenIfBlank(true); MultiButton history1 = new MultiButton("Mikve Yisrael Str..."); history1.setUIID("Container"); history1.setUIIDLine1("WhereToButtonLine1"); history1.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY); Container result = BoxLayout.encloseY(addHome, addWork, savedPlaces, whereSeparator, history1); result.setUIID("Form"); result.setScrollableY(true); result.setScrollVisible(false); result.setY(getDisplayHeight()); Destination UI
  • 9. Label whereSeparator = new Label("", "WhereSeparator"); whereSeparator.setShowEvenIfBlank(true); MultiButton history1 = new MultiButton("Mikve Yisrael Str..."); history1.setUIID("Container"); history1.setUIIDLine1("WhereToButtonLine1"); history1.setIconUIID("WhereToButtonIcon"); FontImage.setMaterialIcon(history1, FontImage.MATERIAL_HISTORY); Container result = BoxLayout.encloseY(addHome, addWork, savedPlaces, whereSeparator, history1); result.setUIID("Form"); result.setScrollableY(true); result.setScrollVisible(false); result.setY(getDisplayHeight()); result.setWidth(getDisplayWidth()); result.setHeight(result.getPreferredH()); parentLayer.add(CENTER, result); parentLayer.animateLayout(200); } Destination UI
  • 10. WhereToButtonLine1 © Codename One 2017 all rights reserved
  • 11. WhereToButtonLine1 © Codename One 2017 all rights reserved
  • 12. WhereToButtonLine1 © Codename One 2017 all rights reserved
  • 13. WhereToButtonLine1 © Codename One 2017 all rights reserved
  • 14. WhereToButtonLine1 © Codename One 2017 all rights reserved
  • 15. WhereToButtonIcon © Codename One 2017 all rights reserved
  • 16. WhereToButtonIcon © Codename One 2017 all rights reserved
  • 17. WhereToButtonNoBorder © Codename One 2017 all rights reserved
  • 18. WhereToButtonNoBorder © Codename One 2017 all rights reserved
  • 19. WhereSeparator © Codename One 2017 all rights reserved
  • 20. WhereSeparator © Codename One 2017 all rights reserved
  • 21. WhereSeparator © Codename One 2017 all rights reserved
  • 22. from.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(square); if(layer.getComponentCount() > 1) { Component c = layer.getComponentAt(1); c.setY(getDisplayHeight()); layer.animateUnlayout(200, 150, () -> { c.remove(); revalidate(); }); } } public void focusLost(Component cmp) { fromSelected.setIcon(circle); } }); to.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(circle); toSelected.setIcon(square); showToNavigationBar(layer); } public void focusLost(Component cmp) { toSelected.setIcon(circle); } }); Focus Listener
  • 23. from.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(square); if(layer.getComponentCount() > 1) { Component c = layer.getComponentAt(1); c.setY(getDisplayHeight()); layer.animateUnlayout(200, 150, () -> { c.remove(); revalidate(); }); } } public void focusLost(Component cmp) { fromSelected.setIcon(circle); } }); to.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(circle); toSelected.setIcon(square); showToNavigationBar(layer); } public void focusLost(Component cmp) { toSelected.setIcon(circle); } }); Focus Listener
  • 24. from.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(square); if(layer.getComponentCount() > 1) { Component c = layer.getComponentAt(1); c.setY(getDisplayHeight()); layer.animateUnlayout(200, 150, () -> { c.remove(); revalidate(); }); } } public void focusLost(Component cmp) { fromSelected.setIcon(circle); } }); to.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(circle); toSelected.setIcon(square); showToNavigationBar(layer); } public void focusLost(Component cmp) { toSelected.setIcon(circle); } }); Focus Listener
  • 25. from.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(square); if(layer.getComponentCount() > 1) { Component c = layer.getComponentAt(1); c.setY(getDisplayHeight()); layer.animateUnlayout(200, 150, () -> { c.remove(); revalidate(); }); } } public void focusLost(Component cmp) { fromSelected.setIcon(circle); } }); to.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(circle); toSelected.setIcon(square); showToNavigationBar(layer); } public void focusLost(Component cmp) { toSelected.setIcon(circle); } }); Focus Listener
  • 26. from.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(square); if(layer.getComponentCount() > 1) { Component c = layer.getComponentAt(1); c.setY(getDisplayHeight()); layer.animateUnlayout(200, 150, () -> { c.remove(); revalidate(); }); } } public void focusLost(Component cmp) { fromSelected.setIcon(circle); } }); to.addFocusListener(new FocusListener() { public void focusGained(Component cmp) { fromSelected.setIcon(circle); toSelected.setIcon(square); showToNavigationBar(layer); } public void focusLost(Component cmp) { toSelected.setIcon(circle); } }); Focus Listener
  • 27. back.addActionListener(e -> { navigationToolbar.setY(-navigationToolbar.getHeight()); if(layer.getComponentCount() > 1) { layer.getComponentAt(1).setY(getDisplayHeight()); } navigationToolbar.getParent().animateUnlayout(200, 120, () -> { layer.removeAll(); revalidate(); }); }); Back
  • 28. navigationToolbar.getUnselectedStyle().setBgPainter((g1, rect) -> { g1.setAlpha(255); g1.setColor(0xffffff); if(dropShadow != null) { if(layer.getComponentCount() > 1) { g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); } g1.drawImage(dropShadow, rect.getX(), rect.getY() + rect.getHeight() - dropShadow.getHeight(), rect.getWidth(), dropShadow.getHeight()); g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight() - dropShadow.getHeight() / 2); } else { g1.fillRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); } g1.setColor(0xa4a4ac); g1.setAntiAliased(true); int x = fromSelected.getAbsoluteX() + fromSelected.getWidth() / 2 - 1; int y = fromSelected.getAbsoluteY() + fromSelected.getHeight() / 2 + circle.getHeight() / 2; g1.fillRect(x, y, 2, toSelected.getAbsoluteY() - y + toSelected.getHeight() / 2 - circle.getHeight() / 2); }); Background Painter