-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test version of sending encrypted message. (Compose variant).
- Loading branch information
Showing
31 changed files
with
1,069 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.flowcrypt.email.api.email.model; | ||
|
||
import android.os.Parcel; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Date; | ||
|
||
/** | ||
* Simple POJO class which describe an incoming message model. | ||
* | ||
* @author DenBond7 | ||
* Date: 09.05.2017 | ||
* Time: 11:20 | ||
* E-mail: DenBond7@gmail.com | ||
*/ | ||
|
||
public class IncomingMessageInfo extends MessageInfo { | ||
|
||
public static final Creator<IncomingMessageInfo> CREATOR = new Creator<IncomingMessageInfo>() { | ||
@Override | ||
public IncomingMessageInfo createFromParcel(Parcel source) { | ||
return new IncomingMessageInfo(source); | ||
} | ||
|
||
@Override | ||
public IncomingMessageInfo[] newArray(int size) { | ||
return new IncomingMessageInfo[size]; | ||
} | ||
}; | ||
|
||
private ArrayList<String> from; | ||
private Date receiveDate; | ||
|
||
public IncomingMessageInfo() { | ||
} | ||
|
||
protected IncomingMessageInfo(Parcel in) { | ||
super(in); | ||
this.from = in.createStringArrayList(); | ||
long tmpReceiveDate = in.readLong(); | ||
this.receiveDate = tmpReceiveDate == -1 ? null : new Date(tmpReceiveDate); | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
super.writeToParcel(dest, flags); | ||
dest.writeStringList(this.from); | ||
dest.writeLong(this.receiveDate != null ? this.receiveDate.getTime() : -1); | ||
} | ||
|
||
/** | ||
* Return a list of String which contain an information | ||
* about from addresses. | ||
* | ||
* @return <tt>ArrayList<String></tt> The list of from addresses. | ||
*/ | ||
public ArrayList<String> getFrom() { | ||
return from; | ||
} | ||
|
||
public void setFrom(ArrayList<String> from) { | ||
this.from = from; | ||
} | ||
|
||
public Date getReceiveDate() { | ||
return receiveDate; | ||
} | ||
|
||
public void setReceiveDate(Date receiveDate) { | ||
this.receiveDate = receiveDate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/OutgoingMessageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.flowcrypt.email.api.email.model; | ||
|
||
import android.os.Parcel; | ||
|
||
import com.flowcrypt.email.test.PgpContact; | ||
|
||
/** | ||
* Simple POJO class which describe an outgoing message model. | ||
* | ||
* @author DenBond7 | ||
* Date: 09.05.2017 | ||
* Time: 11:20 | ||
* E-mail: DenBond7@gmail.com | ||
*/ | ||
|
||
public class OutgoingMessageInfo extends MessageInfo { | ||
public static final Creator<OutgoingMessageInfo> CREATOR = new Creator<OutgoingMessageInfo>() { | ||
@Override | ||
public OutgoingMessageInfo createFromParcel(Parcel source) { | ||
return new OutgoingMessageInfo(source); | ||
} | ||
|
||
@Override | ||
public OutgoingMessageInfo[] newArray(int size) { | ||
return new OutgoingMessageInfo[size]; | ||
} | ||
}; | ||
private PgpContact[] toPgpContacts; | ||
private PgpContact fromPgpContact; | ||
|
||
public OutgoingMessageInfo() { | ||
} | ||
|
||
protected OutgoingMessageInfo(Parcel in) { | ||
super(in); | ||
this.toPgpContacts = in.createTypedArray(PgpContact.CREATOR); | ||
this.fromPgpContact = in.readParcelable(PgpContact.class.getClassLoader()); | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
super.writeToParcel(dest, flags); | ||
dest.writeTypedArray(this.toPgpContacts, flags); | ||
dest.writeParcelable(this.fromPgpContact, flags); | ||
} | ||
|
||
public PgpContact[] getToPgpContacts() { | ||
return toPgpContacts; | ||
} | ||
|
||
public void setToPgpContacts(PgpContact[] toPgpContacts) { | ||
this.toPgpContacts = toPgpContacts; | ||
} | ||
|
||
public PgpContact getFromPgpContact() { | ||
return fromPgpContact; | ||
} | ||
|
||
public void setFromPgpContact(PgpContact fromPgpContact) { | ||
this.fromPgpContact = fromPgpContact; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.