SlideShare a Scribd company logo
Creating a Facebook Clone - Part X
User
✦First Name
✦Family Name
✦Email
✦Phone
✦Gender
✦Birthday
© Codename One 2017 all rights reserved
public class User implements PropertyBusinessObject {
public final Property<String, User> id = new Property<>("id");
public final Property<String, User>
firstName = new Property<>("firstName");
public final Property<String, User>
familyName = new Property<>("familyName");
public final Property<String, User> email = new Property<>("email");
public final Property<String, User> phone = new Property<>("phone");
public final Property<String, User> gender = new Property<>("gender");
public final LongProperty<User> birthday =
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
User
public class User implements PropertyBusinessObject {
public final Property<String, User> id = new Property<>("id");
public final Property<String, User>
firstName = new Property<>("firstName");
public final Property<String, User>
familyName = new Property<>("familyName");
public final Property<String, User> email = new Property<>("email");
public final Property<String, User> phone = new Property<>("phone");
public final Property<String, User> gender = new Property<>("gender");
public final LongProperty<User> birthday =
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
User
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
}
public Image getAvatar(float imageSize) {
String filename = "round-avatar-" + imageSize + "-" + id.get();
if(existsInStorage(filename)) {
try(InputStream is = createStorageInputStream(filename);) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
User
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
}
public Image getAvatar(float imageSize) {
String filename = "round-avatar-" + imageSize + "-" + id.get();
if(existsInStorage(filename)) {
try(InputStream is = createStorageInputStream(filename);) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
User
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
}
public Image getAvatar(float imageSize) {
String filename = "round-avatar-" + imageSize + "-" + id.get();
if(existsInStorage(filename)) {
try(InputStream is = createStorageInputStream(filename)) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
User
new LongProperty<>("birthday");
public final Property<String, User> avatar = new Property<>("avatar");
private final PropertyIndex idx = new PropertyIndex(this, "User",
id, firstName, familyName, email, phone, gender, avatar,
birthday);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
public String fullName() {
return firstName.get() + " " + familyName.get();
}
public Image getAvatar(float imageSize) {
String filename = "round-avatar-" + imageSize + "-" + id.get();
if(existsInStorage(filename)) {
try(InputStream is = createStorageInputStream(filename)) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
User
try(InputStream is = createStorageInputStream(filename)) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
Graphics g = temp.getGraphics();
g.setAntiAliased(true);
g.setColor(0xffffff);
g.fillArc(0, 0, size, size, 0, 360);
Object mask = temp.createMask();
Style s = new Style();
s.setFgColor(0xc2c2c2);
s.setBgTransparency(255);
s.setBgColor(0xe9e9e9);
FontImage x = FontImage.createMaterial(
FontImage.MATERIAL_PERSON, s, size);
Image avatarImg = x.fill(size, size);
if(avatarImg instanceof FontImage) {
avatarImg = ((FontImage)avatarImg).toImage();
}
User
try(InputStream is = createStorageInputStream(filename)) {
return Image.createImage(is);
} catch(IOException err) {
Log.e(err);
deleteStorageFile(filename);
}
}
int size = convertToPixels(imageSize);
Image temp = Image.createImage(size, size, 0xff000000);
Graphics g = temp.getGraphics();
g.setAntiAliased(true);
g.setColor(0xffffff);
g.fillArc(0, 0, size, size, 0, 360);
Object mask = temp.createMask();
Style s = new Style();
s.setFgColor(0xc2c2c2);
s.setBgTransparency(255);
s.setBgColor(0xe9e9e9);
FontImage x = FontImage.createMaterial(
FontImage.MATERIAL_PERSON, s, size);
Image avatarImg = x.fill(size, size);
if(avatarImg instanceof FontImage) {
avatarImg = ((FontImage)avatarImg).toImage();
}
User
g.setAntiAliased(true);
g.setColor(0xffffff);
g.fillArc(0, 0, size, size, 0, 360);
Object mask = temp.createMask();
Style s = new Style();
s.setFgColor(0xc2c2c2);
s.setBgTransparency(255);
s.setBgColor(0xe9e9e9);
FontImage x = FontImage.createMaterial(
FontImage.MATERIAL_PERSON, s, size);
Image avatarImg = x.fill(size, size);
if(avatarImg instanceof FontImage) {
avatarImg = ((FontImage)avatarImg).toImage();
}
avatarImg = avatarImg.applyMask(mask);
if(avatar.get() != null) {
return URLImage.createToStorage(
EncodedImage.createFromImage(avatarImg, false),
filename, avatar.get(),
URLImage.createMaskAdapter(temp));
}
return avatarImg;
}
}
User
g.setAntiAliased(true);
g.setColor(0xffffff);
g.fillArc(0, 0, size, size, 0, 360);
Object mask = temp.createMask();
Style s = new Style();
s.setFgColor(0xc2c2c2);
s.setBgTransparency(255);
s.setBgColor(0xe9e9e9);
FontImage x = FontImage.createMaterial(
FontImage.MATERIAL_PERSON, s, size);
Image avatarImg = x.fill(size, size);
if(avatarImg instanceof FontImage) {
avatarImg = ((FontImage)avatarImg).toImage();
}
avatarImg = avatarImg.applyMask(mask);
if(avatar.get() != null) {
return URLImage.createToStorage(
EncodedImage.createFromImage(avatarImg, false),
filename, avatar.get(),
URLImage.createMaskAdapter(temp));
}
return avatarImg;
}
}
User
Post
✦User
✦Date
✦Title
✦Content
✦Visibility
✦Styling
✦Comments
✦Likes
© Codename One 2017 all rights reserved
public class Post implements PropertyBusinessObject {
public final Property<String, Post> id = new Property<>("id");
public final Property<User, Post> user =
new Property<>("user", User.class);
public final LongProperty<Post> date = new LongProperty<>("date");
public final Property<String, Post> title = new Property<>("title");
public final Property<String, Post> content = new Property<>("content");
public final Property<String, Post> type = new Property<>("type");
public final Property<String, Post> visibility =
new Property<>("visibility");
public final Property<String, Post> styling = new Property<>("styling");
public final ListProperty<Comment, Post> comments =
new ListProperty<>("comment", Comment.class);
public final ListProperty<User, Post> likes =
new ListProperty<>("likes", User.class);
private final PropertyIndex idx = new PropertyIndex(this, "Post",
id, user, date, title, content, type, visibility, styling,
comments, likes);
@Override
Post
public class Post implements PropertyBusinessObject {
public final Property<String, Post> id = new Property<>("id");
public final Property<User, Post> user =
new Property<>("user", User.class);
public final LongProperty<Post> date = new LongProperty<>("date");
public final Property<String, Post> title = new Property<>("title");
public final Property<String, Post> content = new Property<>("content");
public final Property<String, Post> type = new Property<>("type");
public final Property<String, Post> visibility =
new Property<>("visibility");
public final Property<String, Post> styling = new Property<>("styling");
public final ListProperty<Comment, Post> comments =
new ListProperty<>("comment", Comment.class);
public final ListProperty<User, Post> likes =
new ListProperty<>("likes", User.class);
private final PropertyIndex idx = new PropertyIndex(this, "Post",
id, user, date, title, content, type, visibility, styling,
comments, likes);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
}
Post
public class Comment implements PropertyBusinessObject {
public final Property<String, Comment> id = new Property<>("id");
public final Property<String, Comment> postId =
new Property<>("post");
public final Property<User, Comment> userId =
new Property<>("userId");
public final Property<String, Comment> parentComment =
new Property<>("parentComment");
public final LongProperty<Comment> date = new LongProperty<>("date");
public final Property<String, Comment> text = new Property<>("text");
private final PropertyIndex idx = new PropertyIndex(this, "Comment",
id, postId, userId, date, parentComment, text);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
}
Comment
public class Comment implements PropertyBusinessObject {
public final Property<String, Comment> id = new Property<>("id");
public final Property<String, Comment> postId =
new Property<>("post");
public final Property<User, Comment> userId =
new Property<>("userId");
public final Property<String, Comment> parentComment =
new Property<>("parentComment");
public final LongProperty<Comment> date = new LongProperty<>("date");
public final Property<String, Comment> text = new Property<>("text");
private final PropertyIndex idx = new PropertyIndex(this, "Comment",
id, postId, userId, date, parentComment, text);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
}
Comment
public class Comment implements PropertyBusinessObject {
public final Property<String, Comment> id = new Property<>("id");
public final Property<String, Comment> postId =
new Property<>("post");
public final Property<User, Comment> userId =
new Property<>("userId");
public final Property<String, Comment> parentComment =
new Property<>("parentComment");
public final LongProperty<Comment> date = new LongProperty<>("date");
public final Property<String, Comment> text = new Property<>("text");
private final PropertyIndex idx = new PropertyIndex(this, "Comment",
id, postId, userId, date, parentComment, text);
@Override
public PropertyIndex getPropertyIndex() {
return idx;
}
}
Comment

More Related Content

Similar to Creating a Facebook Clone - Part X.pdf

Creating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdfCreating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdf
ShaiAlmog1
 
Vaadin7
Vaadin7Vaadin7
Creating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdfCreating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdf
ShaiAlmog1
 
Project .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdfProject .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdf
aquacosmossystems
 
Creating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdfCreating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdf
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
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examples
Nebojša Vukšić
 
Creating a Facebook Clone - Part XL - Transcript.pdf
Creating a Facebook Clone - Part XL - Transcript.pdfCreating a Facebook Clone - Part XL - Transcript.pdf
Creating a Facebook Clone - Part XL - Transcript.pdf
ShaiAlmog1
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
JavaDayUA
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodecamp Romania
 
Dev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdfDev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdf
CarolinaMatthies
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
Педагошко друштво информатичара Србије
 
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
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
Nelson Glauber Leal
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
.NET Conf UY
 
Creating a Whatsapp Clone - Part III.pdf
Creating a Whatsapp Clone - Part III.pdfCreating a Whatsapp Clone - Part III.pdf
Creating a Whatsapp Clone - Part III.pdf
ShaiAlmog1
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesSimon Willison
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
Julie Iskander
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6
Moaid Hathot
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
tdc-globalcode
 

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

Creating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdfCreating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdf
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Creating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdfCreating a Whatsapp Clone - Part XI.pdf
Creating a Whatsapp Clone - Part XI.pdf
 
Project .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdfProject .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdf
 
Creating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdfCreating a Facebook Clone - Part XI.pdf
Creating a Facebook Clone - Part XI.pdf
 
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
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examples
 
Creating a Facebook Clone - Part XL - Transcript.pdf
Creating a Facebook Clone - Part XL - Transcript.pdfCreating a Facebook Clone - Part XL - Transcript.pdf
Creating a Facebook Clone - Part XL - Transcript.pdf
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
 
Dev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdfDev Day Andreas Roth.pdf
Dev Day Andreas Roth.pdf
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
 
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
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Creating a Whatsapp Clone - Part III.pdf
Creating a Whatsapp Clone - Part III.pdfCreating a Whatsapp Clone - Part III.pdf
Creating a Whatsapp Clone - Part III.pdf
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 
Best of build 2021 - C# 10 & .NET 6
Best of build 2021 -  C# 10 & .NET 6Best of build 2021 -  C# 10 & .NET 6
Best of build 2021 - C# 10 & .NET 6
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
 

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-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 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
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdf
ShaiAlmog1
 
Creating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdfCreating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdf
ShaiAlmog1
 
Creating a Whatsapp Clone - Part III - Transcript.pdf
Creating a Whatsapp Clone - Part III - Transcript.pdfCreating a Whatsapp Clone - Part III - Transcript.pdf
Creating a Whatsapp Clone - Part III - 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-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 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
 
Creating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdfCreating a Whatsapp Clone - Part IX.pdf
Creating a Whatsapp Clone - Part IX.pdf
 
Creating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdfCreating a Whatsapp Clone - Part VI.pdf
Creating a Whatsapp Clone - Part VI.pdf
 
Creating a Whatsapp Clone - Part III - Transcript.pdf
Creating a Whatsapp Clone - Part III - Transcript.pdfCreating a Whatsapp Clone - Part III - Transcript.pdf
Creating a Whatsapp Clone - Part III - Transcript.pdf
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
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
 
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
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
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
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
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
 
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
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
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
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
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
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
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
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
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...
 
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
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
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
 

Creating a Facebook Clone - Part X.pdf

  • 1. Creating a Facebook Clone - Part X
  • 3. public class User implements PropertyBusinessObject { public final Property<String, User> id = new Property<>("id"); public final Property<String, User> firstName = new Property<>("firstName"); public final Property<String, User> familyName = new Property<>("familyName"); public final Property<String, User> email = new Property<>("email"); public final Property<String, User> phone = new Property<>("phone"); public final Property<String, User> gender = new Property<>("gender"); public final LongProperty<User> birthday = new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); User
  • 4. public class User implements PropertyBusinessObject { public final Property<String, User> id = new Property<>("id"); public final Property<String, User> firstName = new Property<>("firstName"); public final Property<String, User> familyName = new Property<>("familyName"); public final Property<String, User> email = new Property<>("email"); public final Property<String, User> phone = new Property<>("phone"); public final Property<String, User> gender = new Property<>("gender"); public final LongProperty<User> birthday = new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); User
  • 5. new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); } public Image getAvatar(float imageSize) { String filename = "round-avatar-" + imageSize + "-" + id.get(); if(existsInStorage(filename)) { try(InputStream is = createStorageInputStream(filename);) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); User
  • 6. new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); } public Image getAvatar(float imageSize) { String filename = "round-avatar-" + imageSize + "-" + id.get(); if(existsInStorage(filename)) { try(InputStream is = createStorageInputStream(filename);) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); User
  • 7. new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); } public Image getAvatar(float imageSize) { String filename = "round-avatar-" + imageSize + "-" + id.get(); if(existsInStorage(filename)) { try(InputStream is = createStorageInputStream(filename)) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); User
  • 8. new LongProperty<>("birthday"); public final Property<String, User> avatar = new Property<>("avatar"); private final PropertyIndex idx = new PropertyIndex(this, "User", id, firstName, familyName, email, phone, gender, avatar, birthday); @Override public PropertyIndex getPropertyIndex() { return idx; } public String fullName() { return firstName.get() + " " + familyName.get(); } public Image getAvatar(float imageSize) { String filename = "round-avatar-" + imageSize + "-" + id.get(); if(existsInStorage(filename)) { try(InputStream is = createStorageInputStream(filename)) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); User
  • 9. try(InputStream is = createStorageInputStream(filename)) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); Graphics g = temp.getGraphics(); g.setAntiAliased(true); g.setColor(0xffffff); g.fillArc(0, 0, size, size, 0, 360); Object mask = temp.createMask(); Style s = new Style(); s.setFgColor(0xc2c2c2); s.setBgTransparency(255); s.setBgColor(0xe9e9e9); FontImage x = FontImage.createMaterial( FontImage.MATERIAL_PERSON, s, size); Image avatarImg = x.fill(size, size); if(avatarImg instanceof FontImage) { avatarImg = ((FontImage)avatarImg).toImage(); } User
  • 10. try(InputStream is = createStorageInputStream(filename)) { return Image.createImage(is); } catch(IOException err) { Log.e(err); deleteStorageFile(filename); } } int size = convertToPixels(imageSize); Image temp = Image.createImage(size, size, 0xff000000); Graphics g = temp.getGraphics(); g.setAntiAliased(true); g.setColor(0xffffff); g.fillArc(0, 0, size, size, 0, 360); Object mask = temp.createMask(); Style s = new Style(); s.setFgColor(0xc2c2c2); s.setBgTransparency(255); s.setBgColor(0xe9e9e9); FontImage x = FontImage.createMaterial( FontImage.MATERIAL_PERSON, s, size); Image avatarImg = x.fill(size, size); if(avatarImg instanceof FontImage) { avatarImg = ((FontImage)avatarImg).toImage(); } User
  • 11. g.setAntiAliased(true); g.setColor(0xffffff); g.fillArc(0, 0, size, size, 0, 360); Object mask = temp.createMask(); Style s = new Style(); s.setFgColor(0xc2c2c2); s.setBgTransparency(255); s.setBgColor(0xe9e9e9); FontImage x = FontImage.createMaterial( FontImage.MATERIAL_PERSON, s, size); Image avatarImg = x.fill(size, size); if(avatarImg instanceof FontImage) { avatarImg = ((FontImage)avatarImg).toImage(); } avatarImg = avatarImg.applyMask(mask); if(avatar.get() != null) { return URLImage.createToStorage( EncodedImage.createFromImage(avatarImg, false), filename, avatar.get(), URLImage.createMaskAdapter(temp)); } return avatarImg; } } User
  • 12. g.setAntiAliased(true); g.setColor(0xffffff); g.fillArc(0, 0, size, size, 0, 360); Object mask = temp.createMask(); Style s = new Style(); s.setFgColor(0xc2c2c2); s.setBgTransparency(255); s.setBgColor(0xe9e9e9); FontImage x = FontImage.createMaterial( FontImage.MATERIAL_PERSON, s, size); Image avatarImg = x.fill(size, size); if(avatarImg instanceof FontImage) { avatarImg = ((FontImage)avatarImg).toImage(); } avatarImg = avatarImg.applyMask(mask); if(avatar.get() != null) { return URLImage.createToStorage( EncodedImage.createFromImage(avatarImg, false), filename, avatar.get(), URLImage.createMaskAdapter(temp)); } return avatarImg; } } User
  • 14. public class Post implements PropertyBusinessObject { public final Property<String, Post> id = new Property<>("id"); public final Property<User, Post> user = new Property<>("user", User.class); public final LongProperty<Post> date = new LongProperty<>("date"); public final Property<String, Post> title = new Property<>("title"); public final Property<String, Post> content = new Property<>("content"); public final Property<String, Post> type = new Property<>("type"); public final Property<String, Post> visibility = new Property<>("visibility"); public final Property<String, Post> styling = new Property<>("styling"); public final ListProperty<Comment, Post> comments = new ListProperty<>("comment", Comment.class); public final ListProperty<User, Post> likes = new ListProperty<>("likes", User.class); private final PropertyIndex idx = new PropertyIndex(this, "Post", id, user, date, title, content, type, visibility, styling, comments, likes); @Override Post
  • 15. public class Post implements PropertyBusinessObject { public final Property<String, Post> id = new Property<>("id"); public final Property<User, Post> user = new Property<>("user", User.class); public final LongProperty<Post> date = new LongProperty<>("date"); public final Property<String, Post> title = new Property<>("title"); public final Property<String, Post> content = new Property<>("content"); public final Property<String, Post> type = new Property<>("type"); public final Property<String, Post> visibility = new Property<>("visibility"); public final Property<String, Post> styling = new Property<>("styling"); public final ListProperty<Comment, Post> comments = new ListProperty<>("comment", Comment.class); public final ListProperty<User, Post> likes = new ListProperty<>("likes", User.class); private final PropertyIndex idx = new PropertyIndex(this, "Post", id, user, date, title, content, type, visibility, styling, comments, likes); @Override public PropertyIndex getPropertyIndex() { return idx; } } Post
  • 16. public class Comment implements PropertyBusinessObject { public final Property<String, Comment> id = new Property<>("id"); public final Property<String, Comment> postId = new Property<>("post"); public final Property<User, Comment> userId = new Property<>("userId"); public final Property<String, Comment> parentComment = new Property<>("parentComment"); public final LongProperty<Comment> date = new LongProperty<>("date"); public final Property<String, Comment> text = new Property<>("text"); private final PropertyIndex idx = new PropertyIndex(this, "Comment", id, postId, userId, date, parentComment, text); @Override public PropertyIndex getPropertyIndex() { return idx; } } Comment
  • 17. public class Comment implements PropertyBusinessObject { public final Property<String, Comment> id = new Property<>("id"); public final Property<String, Comment> postId = new Property<>("post"); public final Property<User, Comment> userId = new Property<>("userId"); public final Property<String, Comment> parentComment = new Property<>("parentComment"); public final LongProperty<Comment> date = new LongProperty<>("date"); public final Property<String, Comment> text = new Property<>("text"); private final PropertyIndex idx = new PropertyIndex(this, "Comment", id, postId, userId, date, parentComment, text); @Override public PropertyIndex getPropertyIndex() { return idx; } } Comment
  • 18. public class Comment implements PropertyBusinessObject { public final Property<String, Comment> id = new Property<>("id"); public final Property<String, Comment> postId = new Property<>("post"); public final Property<User, Comment> userId = new Property<>("userId"); public final Property<String, Comment> parentComment = new Property<>("parentComment"); public final LongProperty<Comment> date = new LongProperty<>("date"); public final Property<String, Comment> text = new Property<>("text"); private final PropertyIndex idx = new PropertyIndex(this, "Comment", id, postId, userId, date, parentComment, text); @Override public PropertyIndex getPropertyIndex() { return idx; } } Comment