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

View File

@ -298,6 +298,10 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
if (resultCode == Activity.RESULT_OK && data != null) {
val src = MediaPickerActivity.getMediaUris(data)
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 -> {
@ -338,6 +342,9 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
if (resultCode == Activity.RESULT_OK && data != null) {
val intent = ThemedMediaPickerActivity.withThemed(this@ComposeActivity)
.getMedia(data.data)
.extras(Bundle {
this[EXTRA_IS_POSSIBLY_SENSITIVE] = data.getBooleanExtra(EXTRA_IS_POSSIBLY_SENSITIVE, false)
})
.build()
startActivityForResult(intent, REQUEST_PICK_MEDIA)
}

View File

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