-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from geckour/develop
Develop
- Loading branch information
Showing
62 changed files
with
2,138 additions
and
671 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
Binary file not shown.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.geckour.egret.model | ||
|
||
import com.geckour.egret.api.model.Attachment | ||
import com.geckour.egret.api.service.MastodonService | ||
import com.github.gfx.android.orma.annotation.Column | ||
import com.github.gfx.android.orma.annotation.PrimaryKey | ||
import com.github.gfx.android.orma.annotation.Setter | ||
import com.github.gfx.android.orma.annotation.Table | ||
|
||
@Table | ||
data class Draft( | ||
@Setter("id") @PrimaryKey(autoincrement = true) val id: Long = -1L, | ||
@Setter("tokenId") @Column(indexed = true) var tokenId: Long = -1L, | ||
@Setter("body") @Column var body: String = "", | ||
@Setter("alertBody") @Column var alertBody: String = "", | ||
@Setter("inReplyToId") @Column var inReplyToId: Long? = null, | ||
@Setter("inReplyToName") @Column var inReplyToName: String? = null, | ||
@Setter("attachments") @Column var attachments: Attachments, | ||
@Setter("warning") @Column var warning: Boolean = false, | ||
@Setter("sensitive") @Column var sensitive: Boolean = false, | ||
@Setter("visibility") @Column var visibility: Int = MastodonService.Visibility.public.ordinal, | ||
@Setter("createdAt") @Column(indexed = true) var createdAt: Long = System.currentTimeMillis() | ||
) { | ||
data class Attachments( | ||
val value: List<Attachment> = ArrayList() | ||
) | ||
} |
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
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
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/geckour/egret/util/OrmaAttachmentsAdapter.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,19 @@ | ||
package com.geckour.egret.util; | ||
|
||
import com.geckour.egret.App; | ||
import com.geckour.egret.model.Draft; | ||
import com.github.gfx.android.orma.annotation.StaticTypeAdapter; | ||
|
||
@StaticTypeAdapter( | ||
targetType = Draft.Attachments.class, | ||
serializedType = String.class | ||
) | ||
public class OrmaAttachmentsAdapter { | ||
public static String serialize(Draft.Attachments attachments) { | ||
return App.Companion.getGson().toJson(attachments); | ||
} | ||
|
||
public static Draft.Attachments deserialize(String string) { | ||
return App.Companion.getGson().fromJson(string, Draft.Attachments.class); | ||
} | ||
} |
Oops, something went wrong.