diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-19 00:28:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 00:28:56 -0700 |
commit | 495b1bd49835070ca43a523831caee0f70079604 (patch) | |
tree | 7b8d56aa22fcf3a9fd1bf566a17fe1997180288a /app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt | |
parent | e4679b1663fa78a99c6c8225e454595c6c6f4e38 (diff) | |
download | frost-1.3.3.tar.gz frost-1.3.3.tar.bz2 frost-1.3.3.zip |
Dev - minor updates (#73)v1.3.3
* Add lint
* Add new libs
* Update libs and add friends tab
* Aggressively hide nonrecent posts
* Update dependencies
* Add php to most recents
* Add full size image downloader
* Fix css cleaner
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt index 487f3a9d..0b8c1a56 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt @@ -166,11 +166,9 @@ class ImageActivity : AppCompatActivity() { } } - @Suppress("SIMPLE_DATE_FORMAT") @Throws(IOException::class) private fun createImageFile(): File { // Create an image file name - @SuppressLint("SimpleDateFormat") val timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date()) val imageFileName = "Frost_" + timeStamp + "_" val storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES) @@ -264,27 +262,9 @@ internal enum class FabStates(val iicon: IIcon, val iconColor: Int = Prefs.iconC * If it's in view, give it some animations */ fun update(fab: FloatingActionButton) { - if (!fab.isShown) { - fab.setIcon(iicon, color = iconColor) - fab.backgroundTintList = ColorStateList.valueOf(backgroundTint) - } else { - var switched = false - ValueAnimator.ofFloat(1.0f, 0.0f, 1.0f).apply { - duration = 500L - addUpdateListener { - val x = it.animatedValue as Float - val scale = x * 0.3f + 0.7f - fab.scaleX = scale - fab.scaleY = scale - fab.imageAlpha = (x * 255).toInt() - if (it.animatedFraction > 0.5f && !switched) { - switched = true - fab.setIcon(iicon, color = iconColor) - fab.backgroundTintList = ColorStateList.valueOf(backgroundTint) - } - } - start() - } + fab.transition { + setIcon(iicon, color = iconColor) + backgroundTintList = ColorStateList.valueOf(backgroundTint) } } |