|
|
@ -421,8 +421,8 @@ class ComposeActivity : BaseActivity(), |
|
|
|
composeEditField.setSelection(start + text.length) |
|
|
|
composeEditField.setSelection(start + text.length) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun toggleMarkdownMode() { |
|
|
|
private fun enableMarkdownMode(enable: Boolean) { |
|
|
|
viewModel.toggleMarkdownMode() |
|
|
|
viewModel.markdownMode = enable |
|
|
|
|
|
|
|
|
|
|
|
enableMarkdownWYSIWYGButtons(viewModel.markdownMode) |
|
|
|
enableMarkdownWYSIWYGButtons(viewModel.markdownMode) |
|
|
|
|
|
|
|
|
|
|
@ -432,6 +432,10 @@ class ComposeActivity : BaseActivity(), |
|
|
|
composeMarkdownButton.drawable.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN); |
|
|
|
composeMarkdownButton.drawable.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun toggleMarkdownMode() { |
|
|
|
|
|
|
|
enableMarkdownMode(!viewModel.markdownMode) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun enableMarkdownWYSIWYGButtons(visible: Boolean) { |
|
|
|
private fun enableMarkdownWYSIWYGButtons(visible: Boolean) { |
|
|
|
val visibility = if(visible) View.VISIBLE else View.GONE |
|
|
|
val visibility = if(visible) View.VISIBLE else View.GONE |
|
|
|
codeButton.visibility = visibility |
|
|
|
codeButton.visibility = visibility |
|
|
@ -478,7 +482,7 @@ class ComposeActivity : BaseActivity(), |
|
|
|
currentInputContentInfo = null |
|
|
|
currentInputContentInfo = null |
|
|
|
currentFlags = 0 |
|
|
|
currentFlags = 0 |
|
|
|
outState.putParcelable("photoUploadUri", photoUploadUri) |
|
|
|
outState.putParcelable("photoUploadUri", photoUploadUri) |
|
|
|
outState.putParcelable("markdownMode", viewModel.markdownMode) |
|
|
|
outState.putBoolean("markdownMode", viewModel.markdownMode) |
|
|
|
super.onSaveInstanceState(outState) |
|
|
|
super.onSaveInstanceState(outState) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|