#1069 - Add ability to take photo from app

This commit is contained in:
Moez Bhatti
2018-04-23 00:26:54 -04:00
parent d48a759ef8
commit e8c8b0aaee
7 changed files with 104 additions and 5 deletions
@@ -67,6 +67,8 @@ class ComposeActivity : QkThemedActivity<ComposeViewModel>(), ComposeView {
override val attachmentDeletedIntent: Subject<Uri> by lazy { attachmentAdapter.attachmentDeleted }
override val textChangedIntent by lazy { message.textChanges() }
override val attachIntent by lazy { attach.clicks() }
override val cameraIntent by lazy { camera.clicks() }
override val galleryIntent by lazy { gallery.clicks() }
override val sendIntent by lazy { send.clicks() }
@Inject lateinit var chipsAdapter: ChipsAdapter
@@ -129,7 +131,11 @@ class ComposeActivity : QkThemedActivity<ComposeViewModel>(), ComposeView {
colors.textSecondary
.autoDisposable(scope())
.subscribe { color -> attach.setTint(color) }
.subscribe { color ->
attach.setTint(color)
camera.setTint(color)
gallery.setTint(color)
}
colors.bubble
.autoDisposable(scope())
@@ -189,6 +195,10 @@ class ComposeActivity : QkThemedActivity<ComposeViewModel>(), ComposeView {
attachments.setVisible(state.attachments.isNotEmpty())
attachmentAdapter.data = state.attachments
attach.animate().rotation(if (state.attaching) 45f else 0f).start()
camera.setVisible(state.attaching)
gallery.setVisible(state.attaching)
if (title != state.title) title = state.title
counter.text = state.remaining