|
@@ -14,6 +14,7 @@ import com.doverfuelingsolutions.issp.R
|
|
|
import com.doverfuelingsolutions.issp.api.FuelInfoApi
|
|
|
import com.doverfuelingsolutions.issp.api.SystemApi
|
|
|
import com.doverfuelingsolutions.issp.bugly.BuglyUtil
|
|
|
+import com.doverfuelingsolutions.issp.data.GlobalData
|
|
|
import com.doverfuelingsolutions.issp.databinding.ActivityPreferenceBinding
|
|
|
import com.doverfuelingsolutions.issp.utils.AppUtil
|
|
|
import com.doverfuelingsolutions.issp.utils.DFSToastUtil
|
|
@@ -115,6 +116,16 @@ class PreferenceActivity : AppCompatActivity(),
|
|
|
binding.buttonClose -> {
|
|
|
onBackPressed()
|
|
|
}
|
|
|
+ binding.buttonReLogin -> {
|
|
|
+ GlobalData.isLogin = false
|
|
|
+ GlobalData.password.set("")
|
|
|
+ GlobalData.accessToken.set("")
|
|
|
+ GlobalData.accessTokenExpire.set(0L)
|
|
|
+ Intent(this, LoginActivity::class.java).let {
|
|
|
+ it.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
|
+ startActivity(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -145,7 +156,13 @@ class PreferenceActivity : AppCompatActivity(),
|
|
|
|
|
|
if (!result.success || result.data == null) {
|
|
|
DFSLog.e("latest version check failed: ${result.message}")
|
|
|
- DFSToastUtil.fail(StringUtil.get(R.string.fail_behave_reason, StringUtil.get(R.string.check_update), result.message))
|
|
|
+ DFSToastUtil.fail(
|
|
|
+ StringUtil.get(
|
|
|
+ R.string.fail_behave_reason,
|
|
|
+ StringUtil.get(R.string.check_update),
|
|
|
+ result.message
|
|
|
+ )
|
|
|
+ )
|
|
|
return@launch
|
|
|
}
|
|
|
|
|
@@ -163,7 +180,12 @@ class PreferenceActivity : AppCompatActivity(),
|
|
|
return@launch
|
|
|
}
|
|
|
|
|
|
- UpgradeActivity.start(this@PreferenceActivity, remoteVersion.version, remoteVersion.name, remoteVersion.info)
|
|
|
+ UpgradeActivity.start(
|
|
|
+ this@PreferenceActivity,
|
|
|
+ remoteVersion.version,
|
|
|
+ remoteVersion.name,
|
|
|
+ remoteVersion.info
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|