mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-08 20:12:39 +01:00
Update back press and changelog
This commit is contained in:
parent
93b179c7f8
commit
130b0ebf98
@ -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()
|
||||
}
|
||||
}
|
@ -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." />
|
||||
|
Loading…
Reference in New Issue
Block a user