aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-09 18:51:37 -0700
committerGitHub <noreply@github.com>2017-08-09 18:51:37 -0700
commit80ca6242b72fdcc606c41817e7025dab46006139 (patch)
treeb38f3922122a72be5950e2789666f6dbdd38e906
parent1e2a2d77169b5de968e29873e13a78a0d8c94a18 (diff)
downloadfrost-80ca6242b72fdcc606c41817e7025dab46006139.tar.gz
frost-80ca6242b72fdcc606c41817e7025dab46006139.tar.bz2
frost-80ca6242b72fdcc606c41817e7025dab46006139.zip
Move glide loader to onCreate (#135)
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt15
-rw-r--r--docs/Changelog.md7
2 files changed, 10 insertions, 12 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
index eb991599..fa26502a 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
@@ -12,6 +12,7 @@ import ca.allanwang.kau.utils.bindView
import ca.allanwang.kau.utils.fadeIn
import ca.allanwang.kau.utils.fadeOut
import com.bumptech.glide.Glide
+import com.bumptech.glide.RequestManager
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
@@ -44,6 +45,7 @@ class LoginActivity : BaseActivity() {
val profileObservable = SingleSubject.create<Boolean>()
val usernameObservable = SingleSubject.create<String>()
+ lateinit var profileLoader: RequestManager
// Helper to set and enable swipeRefresh
var refresh: Boolean
@@ -68,6 +70,7 @@ class LoginActivity : BaseActivity() {
loadInfo(cookie)
})
}
+ profileLoader = Glide.with(profile)
}
fun loadInfo(cookie: CookieModel) {
@@ -78,7 +81,7 @@ class LoginActivity : BaseActivity() {
(foundImage, name) ->
refresh = false
if (!foundImage) {
- L.eThrow("Could not get profile photo; Invalid userId?")
+ L.e("Could not get profile photo; Invalid userId?")
L.i(null, cookie.toString())
}
textview.text = String.format(getString(R.string.welcome), name)
@@ -102,7 +105,7 @@ class LoginActivity : BaseActivity() {
fun loadProfile(id: Long) {
- Glide.with(profile).load(PROFILE_PICTURE_URL(id)).withRoundIcon().listener(object : RequestListener<Drawable> {
+ profileLoader.load(PROFILE_PICTURE_URL(id)).withRoundIcon().listener(object : RequestListener<Drawable> {
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
profileObservable.onSuccess(true)
return false
@@ -119,12 +122,4 @@ class LoginActivity : BaseActivity() {
fun loadUsername(cookie: CookieModel) {
cookie.fetchUsername { usernameObservable.onSuccess(it) }
}
-
- override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
- if (requestCode == 999) {
- L.d("Result found for activity with result $resultCode")
- L.d("Intent data ${data?.extras.toString()}")
- } else
- super.onActivityResult(requestCode, resultCode, data)
- }
} \ No newline at end of file
diff --git a/docs/Changelog.md b/docs/Changelog.md
index a7a855f7..1eddde9c 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -1,10 +1,13 @@
# Changelog
## Beta Updates
-* Fixed notification titles
-* Added support for downloading videos
+* Fix notification titles
+* ALPHA: Add support for downloading videos (hit the download button)
* Deny intents for login so the page loads properly (thank you @Zenexer)
* Reduce injection offset and move injectors to an earlier method
+* Add option to disable media loading on metered network
+* Fix menu section
+* Add more background setters to help transparent themes
## v1.5.0
* Experimental: Add notifications for messages; report to me if this drains your battery