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 | |
parent | 8769be855196f17bb7bfdfb411994ea901eb51a9 (diff) | |
download | frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.tar.gz frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.tar.bz2 frost-01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21.zip |
Clean up selector activity
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/LoginActivity.kt | 9 | ||||
-rw-r--r-- | app/src/main/res/layout/login_webview.xml | 1 |
2 files changed, 6 insertions, 4 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 diff --git a/app/src/main/res/layout/login_webview.xml b/app/src/main/res/layout/login_webview.xml index 681ccaa5..74aabfab 100644 --- a/app/src/main/res/layout/login_webview.xml +++ b/app/src/main/res/layout/login_webview.xml @@ -24,7 +24,6 @@ android:layout_height="wrap_content" android:layout_below="@id/profile" android:layout_centerHorizontal="true" - android:text="@string/loading_account" android:visibility="invisible" /> <com.pitchedapps.frost.web.LoginWebView |