diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-21 16:07:54 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-21 16:07:54 -0700 |
commit | 01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21 (patch) | |
tree | bebaae53ef58fa97def7c257ebeaeca5895b1879 /app/src/main/kotlin/com/pitchedapps/frost | |
parent | 8769be855196f17bb7bfdfb411994ea901eb51a9 (diff) | |
download | frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.tar.gz frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.tar.bz2 frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.zip |
Clean up selector activity
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt index 5ad0517a..1399cb32 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt @@ -14,7 +14,9 @@ import ca.allanwang.kau.utils.setTextWithFade import com.bumptech.glide.Glide import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.load.resource.bitmap.CircleCrop import com.bumptech.glide.request.RequestListener +import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target import com.crashlytics.android.answers.LoginEvent import com.pitchedapps.frost.dbflow.CookieModel @@ -71,7 +73,6 @@ class LoginActivity : BaseActivity() { cookie -> web.fadeOut(onFinish = { profile.fadeIn() - textview.fadeIn() loadInfo(cookie) }) } @@ -87,7 +88,8 @@ class LoginActivity : BaseActivity() { (foundImage, name) -> refresh = false if (!foundImage) L.e("Could not get profile photo; Invalid userId?\n\t$cookie") - textview.setTextWithFade(String.format(getString(R.string.welcome), name), duration = 500) + textview.text = String.format(getString(R.string.welcome), name) + textview.fadeIn() frostAnswers { logLogin(LoginEvent().putMethod("frost_browser").putSuccess(true)) } @@ -108,7 +110,8 @@ class LoginActivity : BaseActivity() { fun loadProfile(id: Long) { - Glide.with(this@LoginActivity).load(PROFILE_PICTURE_URL(id)).listener(object : RequestListener<Drawable> { + val options = RequestOptions().transform(CircleCrop()) + Glide.with(this@LoginActivity).load(PROFILE_PICTURE_URL(id)).apply(options).listener(object : RequestListener<Drawable> { override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { profileObservable.onSuccess(true) return false |