-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #21107 from wordpress-mobile/issue/21105-feedback-…
…form-attachments-ui Feedback form attachments UI
- Loading branch information
Showing
9 changed files
with
442 additions
and
25 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
29 changes: 29 additions & 0 deletions
29
WordPress/src/main/java/org/wordpress/android/ui/main/feedbackform/FeedbackFormAttachment.kt
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,29 @@ | ||
package org.wordpress.android.ui.main.feedbackform | ||
|
||
import android.net.Uri | ||
import java.io.File | ||
|
||
data class FeedbackFormAttachment( | ||
val uri: Uri, | ||
val tempFile: File, | ||
val displayName: String, | ||
val mimeType: String, | ||
val attachmentType: FeedbackFormAttachmentType, | ||
val size: Long, | ||
) | ||
|
||
enum class FeedbackFormAttachmentType { | ||
IMAGE, | ||
VIDEO, | ||
} | ||
|
||
/** | ||
* TODO | ||
* | ||
fun FeedbackFormAttachment.toZenDeskAttachment(): SupportNetworkService.ZenDeskSupportTicket.Attachment { | ||
return SupportNetworkService.ZenDeskSupportTicket.Attachment( | ||
file = this.tempFile, | ||
type = this.mimeType | ||
) | ||
} | ||
*/ |
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
16 changes: 16 additions & 0 deletions
16
WordPress/src/main/java/org/wordpress/android/ui/main/feedbackform/FeedbackFormUtils.kt
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,16 @@ | ||
package org.wordpress.android.ui.main.feedbackform | ||
|
||
import javax.inject.Inject | ||
|
||
class FeedbackFormUtils @Inject constructor() { | ||
/** | ||
* Only images & photos are supported at this point | ||
*/ | ||
fun isSupportedMimeType(mimeType: String): Boolean { | ||
return when { | ||
mimeType.startsWith("image") -> true | ||
mimeType.startsWith("video") -> true | ||
else -> false | ||
} | ||
} | ||
} |
Oops, something went wrong.