SlideShare a Scribd company logo
Creating a Facebook Clone - Part III
Facebook has a Splash Screen which takes a short time to load the login UI. I'm assuming Facebook tries to figure out as much as possible about the device & its owner
before showing the login UI. Since we don't have such capabilities which I personally find "disturbing" we might not need a splash screen at all. We can go directly to the
login.
Splash Screen
© Codename One 2017 all rights reserved
However, this isn't ideal and we should show a splash screen the first time the app is launched.

iOS applications take a while to load. They feel much faster because they show a splash screen when they first load. This means the image of the UI appears almost
instantly and is replaced by the actual UI once that finishes loading. To the user this seems seamless in a well crafted app.

Codename One runs the application on the Mac cloud servers 16 times (as of this writing) to produce 16 separate screenshots matching all the various device
configurations. Some device configurations include both landscape & portrait modes (e.g. iPads/high resolutions phones). As a result the numbers add up to 16 separate
screenshots. Notice that this is subject to change as we are moving towards an automatically generated native splash screen in iOS but since that isn’t there yet at this
time this is still relevant.

For a typical application that doesn't require login this isn't a problem, it can show the UI of the first Form. E.g. in the case of Facebook we'd show a "feed" without any
data. This would give the sense of loading data which would pop in once loading finishes.

Unfortunately, Facebooks login UI looks very different from its feed UI so the first activation would seem "odd" if the feed UI was replaced with the login UI. In that case
we'd rather have a splash screen appear for the screenshot process.

Since the splash screen is pretty much identical in the native iOS/Android implementation there isn't much we need to do in terms of design…
public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
First we need to add a new UIController class that will handle UI navigation and hide the underlying forms. Here we can implement the splash screen and later the
navigation to additional forms.

This can be static as it happens once and we can control it
public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
Using absolute center the logo will be in the middle of the screen for all devices/resolutions
public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
We defined this UIID earlier it uses the Facebook icon font, that means that the f308 character will render as the Facebook logo
public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
This is important for the morph transition… We use that to animate to the first form
public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
When departing this Form we will move the component named "Logo" in this form to assume the position/appearance of the "Logo" component in the destination form.
The duration of the transition is 1200ms

public class UIController {
public static void showSplashScreen() {
Form splash = new Form(new BorderLayout(
BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
UIController
This animation controls an effect where the logo appears translucent and gradually becomes opaque
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
splash.show();
}
public static void showLoginForm() {
}
}
UIController
Every 20ms we update the opacity of the logo until we finish which should take 1000ms. This will create an effect where the logo fades in and then moves from the center
of the screen to the top (or side in landscape mode).
splash.setUIID("SplashForm");
Label logo = new Label("uf308", "IconFont");
logo.setName("Logo");
splash.add(CENTER, logo);
splash.setTransitionOutAnimator(
MorphTransition.
create(1200).
morph("Logo"));
final Motion anim = Motion.createLinearMotion(0, 127, 1000);
anim.start();
UITimer.timer(20, true, splash, () -> {
if(anim.isFinished()) {
showLoginForm();
} else {
logo.getUnselectedStyle().setOpacity(anim.getValue()+127);
logo.repaint();
}
});
splash.show();
}
public static void showLoginForm() {
}
}
UIController
When we are done we show the login form which I currently implemented as a stub
SplashForm {
background-color: #4367b3;
margin: 0px;
padding: 0px;
}
theme.css
All we now need now is one additional CSS entry to support this. We set the background color to the blue of the splash screen and that's pretty much it
public void start() {
if(current != null){
current.show();
return;
}
UIController.showSplashScreen();
}
FacebookClone
We now need to bind this to the main UI so we will need one change to the main class FacebookClone. I replaced the default hi world form with this call

Pressing play should result in a splash screen fading in.

More Related Content

Similar to Creating a Facebook Clone - Part III - Transcript.pdf

Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
Motorola Mobility - MOTODEV
 
iOSインタラクションデザイン
iOSインタラクションデザインiOSインタラクションデザイン
iOSインタラクションデザイン
hIDDENxv
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
John Wilker
 
iPhone - web development lotus notes domino
iPhone - web development lotus notes dominoiPhone - web development lotus notes domino
iPhone - web development lotus notes dominodominion
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
Binary Studio
 
Exploring iTools
Exploring iToolsExploring iTools
Exploring iTools
www.netgains.org
 
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 LightupPinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Wes Yanaga
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
PushApps - Content Recommendation in Push Notifications
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with Mono
Craig Dunn
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
Siddharth Yadav
 
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp AnatomyCorso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Andrea Picchi
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
Atlassian
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
.NET Conf UY
 
Tips and Tricks for Mobile Flash Development
Tips and Tricks for Mobile Flash DevelopmentTips and Tricks for Mobile Flash Development
Tips and Tricks for Mobile Flash Development
paultrani
 
PhotoFlipCardView
PhotoFlipCardViewPhotoFlipCardView
PhotoFlipCardView
Katsumi Kishikawa
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android TabletsOSCON Byrum
 
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
olrandir
 
A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS
Gregor Woiwode
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
kenshin03
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
Right IT Services
 

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

Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
 
iOSインタラクションデザイン
iOSインタラクションデザインiOSインタラクションデザイン
iOSインタラクションデザイン
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
iPhone - web development lotus notes domino
iPhone - web development lotus notes dominoiPhone - web development lotus notes domino
iPhone - web development lotus notes domino
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
 
Exploring iTools
Exploring iToolsExploring iTools
Exploring iTools
 
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 LightupPinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with Mono
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
 
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp AnatomyCorso WebApp iOS - Lezione 07: iOS WebApp Anatomy
Corso WebApp iOS - Lezione 07: iOS WebApp Anatomy
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
 
Tips and Tricks for Mobile Flash Development
Tips and Tricks for Mobile Flash DevelopmentTips and Tricks for Mobile Flash Development
Tips and Tricks for Mobile Flash Development
 
PhotoFlipCardView
PhotoFlipCardViewPhotoFlipCardView
PhotoFlipCardView
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
 
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
Android: the Single Activity, Multiple Fragments pattern | One Activity to ru...
 
A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
 

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

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Creating a Facebook Clone - Part III - Transcript.pdf

  • 1. Creating a Facebook Clone - Part III Facebook has a Splash Screen which takes a short time to load the login UI. I'm assuming Facebook tries to figure out as much as possible about the device & its owner before showing the login UI. Since we don't have such capabilities which I personally find "disturbing" we might not need a splash screen at all. We can go directly to the login.
  • 2. Splash Screen © Codename One 2017 all rights reserved However, this isn't ideal and we should show a splash screen the first time the app is launched. iOS applications take a while to load. They feel much faster because they show a splash screen when they first load. This means the image of the UI appears almost instantly and is replaced by the actual UI once that finishes loading. To the user this seems seamless in a well crafted app. Codename One runs the application on the Mac cloud servers 16 times (as of this writing) to produce 16 separate screenshots matching all the various device configurations. Some device configurations include both landscape & portrait modes (e.g. iPads/high resolutions phones). As a result the numbers add up to 16 separate screenshots. Notice that this is subject to change as we are moving towards an automatically generated native splash screen in iOS but since that isn’t there yet at this time this is still relevant. For a typical application that doesn't require login this isn't a problem, it can show the UI of the first Form. E.g. in the case of Facebook we'd show a "feed" without any data. This would give the sense of loading data which would pop in once loading finishes. Unfortunately, Facebooks login UI looks very different from its feed UI so the first activation would seem "odd" if the feed UI was replaced with the login UI. In that case we'd rather have a splash screen appear for the screenshot process. Since the splash screen is pretty much identical in the native iOS/Android implementation there isn't much we need to do in terms of design…
  • 3. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController First we need to add a new UIController class that will handle UI navigation and hide the underlying forms. Here we can implement the splash screen and later the navigation to additional forms. This can be static as it happens once and we can control it
  • 4. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController Using absolute center the logo will be in the middle of the screen for all devices/resolutions
  • 5. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController We defined this UIID earlier it uses the Facebook icon font, that means that the f308 character will render as the Facebook logo
  • 6. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController This is important for the morph transition… We use that to animate to the first form
  • 7. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController When departing this Form we will move the component named "Logo" in this form to assume the position/appearance of the "Logo" component in the destination form. The duration of the transition is 1200ms

  • 8. public class UIController { public static void showSplashScreen() { Form splash = new Form(new BorderLayout( BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE)); splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); UIController This animation controls an effect where the logo appears translucent and gradually becomes opaque
  • 9. splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); splash.show(); } public static void showLoginForm() { } } UIController Every 20ms we update the opacity of the logo until we finish which should take 1000ms. This will create an effect where the logo fades in and then moves from the center of the screen to the top (or side in landscape mode).
  • 10. splash.setUIID("SplashForm"); Label logo = new Label("uf308", "IconFont"); logo.setName("Logo"); splash.add(CENTER, logo); splash.setTransitionOutAnimator( MorphTransition. create(1200). morph("Logo")); final Motion anim = Motion.createLinearMotion(0, 127, 1000); anim.start(); UITimer.timer(20, true, splash, () -> { if(anim.isFinished()) { showLoginForm(); } else { logo.getUnselectedStyle().setOpacity(anim.getValue()+127); logo.repaint(); } }); splash.show(); } public static void showLoginForm() { } } UIController When we are done we show the login form which I currently implemented as a stub
  • 11. SplashForm { background-color: #4367b3; margin: 0px; padding: 0px; } theme.css All we now need now is one additional CSS entry to support this. We set the background color to the blue of the splash screen and that's pretty much it
  • 12. public void start() { if(current != null){ current.show(); return; } UIController.showSplashScreen(); } FacebookClone We now need to bind this to the main UI so we will need one change to the main class FacebookClone. I replaced the default hi world form with this call Pressing play should result in a splash screen fading in.