aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-21 16:07:54 -0700
committerAllan Wang <me@allanwang.ca>2017-06-21 16:07:54 -0700
commit01083ccb6c7d8ecce9f13ecd0d5ef5bb328bdf21 (patch)
treebebaae53ef58fa97def7c257ebeaeca5895b1879 /app
parent8769be855196f17bb7bfdfb411994ea901eb51a9 (diff)
downloadfrost-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.kt9
-rw-r--r--app/src/main/res/layout/login_webview.xml1
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