aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt18
-rw-r--r--app/src/main/res/xml/frost_changelog.xml3
2 files changed, 13 insertions, 8 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 99f95469..9b5fdb0f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
@@ -62,8 +62,7 @@ class LoginActivity : BaseActivity() {
setSupportActionBar(toolbar)
setTitle(R.string.kau_login)
setFrostColors(toolbar)
- web.loadLogin({ refresh = it != 100 }) {
- cookie ->
+ web.loadLogin({ refresh = it != 100 }) { cookie ->
L.d("Login found")
FbCookie.save(cookie.id)
web.fadeOut(onFinish = {
@@ -78,8 +77,7 @@ class LoginActivity : BaseActivity() {
refresh = true
Observable.zip(SingleToObservable(profileObservable), SingleToObservable(usernameObservable),
BiFunction<Boolean, String, Pair<Boolean, String>> { foundImage, name -> Pair(foundImage, name) })
- .observeOn(AndroidSchedulers.mainThread()).subscribe {
- (foundImage, name) ->
+ .observeOn(AndroidSchedulers.mainThread()).subscribe { (foundImage, name) ->
refresh = false
if (!foundImage) {
L.e("Could not get profile photo; Invalid userId?")
@@ -92,8 +90,7 @@ class LoginActivity : BaseActivity() {
* The user may have logged into an account that is already in the database
* We will let the db handle duplicates and load it now after the new account has been saved
*/
- loadFbCookiesAsync {
- cookies ->
+ loadFbCookiesAsync { cookies ->
Handler().postDelayed({
launchNewTask(if (Showcase.intro) IntroActivity::class.java else MainActivity::class.java,
ArrayList(cookies), clearStack = true)
@@ -113,7 +110,7 @@ class LoginActivity : BaseActivity() {
}
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>?, isFirstResource: Boolean): Boolean {
- e.logFrostAnswers( "Profile loading exception")
+ e.logFrostAnswers("Profile loading exception")
profileObservable.onSuccess(false)
return false
}
@@ -123,4 +120,11 @@ class LoginActivity : BaseActivity() {
fun loadUsername(cookie: CookieModel) {
cookie.fetchUsername { usernameObservable.onSuccess(it) }
}
+
+ override fun onBackPressed() {
+ if (web.canGoBack())
+ web.goBack()
+ else
+ super.onBackPressed()
+ }
} \ No newline at end of file
diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml
index 32227578..edfadce6 100644
--- a/app/src/main/res/xml/frost_changelog.xml
+++ b/app/src/main/res/xml/frost_changelog.xml
@@ -17,7 +17,8 @@
<item text="Improve logout logic when account is invalid" />
<item text="Fix material light background for certain items" />
<item text="Fix initial login not sticking" />
- <item text="" />
+ <item text="Allow back press in login activity" />
+ <item text="Update themes" />
<version title="v1.4.7"/>
<item text="Update secondary background for transparent themes to be more visible." />