supports add sensitive information to gif

This commit is contained in:
Mariotaku Lee 2017-03-31 19:45:11 +08:00
parent 27b2bcf3c4
commit 70b79d5019
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
3 changed files with 16 additions and 8 deletions

View File

@ -34,7 +34,7 @@ subprojects {
ext { ext {
libVersions = [ libVersions = [
Kotlin : '1.1.1', Kotlin : '1.1.1',
SupportLib : '25.3.0', SupportLib : '25.3.1',
MariotakuCommons : '0.9.11', MariotakuCommons : '0.9.11',
RestFu : '0.9.43', RestFu : '0.9.43',
ObjectCursor : '0.9.16', ObjectCursor : '0.9.16',
@ -56,7 +56,7 @@ subprojects {
TwitterText : '1.14.3', TwitterText : '1.14.3',
MediaViewerLibrary: '0.9.23', MediaViewerLibrary: '0.9.23',
MultiValueSwitch : '0.9.8', MultiValueSwitch : '0.9.8',
PickNCrop : '0.9.22', PickNCrop : '0.9.23',
AndroidGIFDrawable: '1.2.6', AndroidGIFDrawable: '1.2.6',
KPreferences : '0.9.6' KPreferences : '0.9.6'
] ]

View File

@ -298,6 +298,10 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
if (resultCode == Activity.RESULT_OK && data != null) { if (resultCode == Activity.RESULT_OK && data != null) {
val src = MediaPickerActivity.getMediaUris(data) val src = MediaPickerActivity.getMediaUris(data)
TaskStarter.execute(AddMediaTask(this, src, false, false)) TaskStarter.execute(AddMediaTask(this, src, false, false))
val extras = data.getBundleExtra(MediaPickerActivity.EXTRA_EXTRAS)
if (extras?.getBoolean(EXTRA_IS_POSSIBLY_SENSITIVE) ?: false) {
possiblySensitive = true
}
} }
} }
REQUEST_EDIT_IMAGE -> { REQUEST_EDIT_IMAGE -> {
@ -338,6 +342,9 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
if (resultCode == Activity.RESULT_OK && data != null) { if (resultCode == Activity.RESULT_OK && data != null) {
val intent = ThemedMediaPickerActivity.withThemed(this@ComposeActivity) val intent = ThemedMediaPickerActivity.withThemed(this@ComposeActivity)
.getMedia(data.data) .getMedia(data.data)
.extras(Bundle {
this[EXTRA_IS_POSSIBLY_SENSITIVE] = data.getBooleanExtra(EXTRA_IS_POSSIBLY_SENSITIVE, false)
})
.build() .build()
startActivityForResult(intent, REQUEST_PICK_MEDIA) startActivityForResult(intent, REQUEST_PICK_MEDIA)
} }

View File

@ -89,10 +89,9 @@ class ActionIconThemedTextView(
a.recycle() a.recycle()
} }
override fun drawableStateChanged() {
override fun refreshDrawableState() { super.drawableStateChanged()
updateCompoundDrawables() updateCompoundDrawables()
super.refreshDrawableState()
} }
private fun updateCompoundDrawables() { private fun updateCompoundDrawables() {
@ -108,9 +107,11 @@ class ActionIconThemedTextView(
color = disabledColor color = disabledColor
} }
val top = (d.intrinsicHeight - iconHeight) / 2 if (iconWidth > 0 && iconHeight > 0) {
val left = (d.intrinsicWidth - iconWidth) / 2 val top = (d.intrinsicHeight - iconHeight) / 2
d.setBounds(left, top, left + iconWidth, top + iconHeight) val left = (d.intrinsicWidth - iconWidth) / 2
d.setBounds(left, top, left + iconWidth, top + iconHeight)
}
d.setColorFilter(color, Mode.SRC_ATOP) d.setColorFilter(color, Mode.SRC_ATOP)
} }