1
0
mirror of https://github.com/etesync/android synced 2024-11-15 20:38:58 +00:00

Account settings: add a link to the dashboard and clean up a bit.

This commit is contained in:
Tom Hacohen 2019-02-01 12:46:30 +00:00
parent 1b6a72ef00
commit efa8719ce5
4 changed files with 25 additions and 15 deletions

View File

@ -22,10 +22,8 @@ import android.support.v4.content.Loader
import android.support.v7.preference.*
import android.text.TextUtils
import android.view.MenuItem
import com.etesync.syncadapter.AccountSettings
import com.etesync.syncadapter.App
import com.etesync.syncadapter.*
import com.etesync.syncadapter.Constants.KEY_ACCOUNT
import com.etesync.syncadapter.InvalidAccountException
import com.etesync.syncadapter.R
import com.etesync.syncadapter.ui.setup.LoginCredentials
import com.etesync.syncadapter.ui.setup.LoginCredentialsChangeFragment
@ -86,6 +84,13 @@ class AccountSettingsActivity : BaseActivity() {
return
}
// Category: dashboard
val prefManageAccount = findPreference("manage_account")
prefManageAccount.onPreferenceClickListener = Preference.OnPreferenceClickListener { _ ->
WebViewActivity.openUrl(activity!!, Constants.dashboard.buildUpon().appendQueryParameter("email", account.name).build())
true
}
// category: authentication
val prefPassword = findPreference("password") as EditTextPreference
prefPassword.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->

View File

@ -180,7 +180,7 @@ class WebViewActivity : BaseActivity() {
}
private fun isAllowedUrl(uri: Uri): Boolean {
val allowedUris = arrayOf(Constants.faqUri, Constants.helpUri, Constants.registrationUrl, Constants.webUri.buildUpon().appendEncodedPath("tos/").build(), Constants.webUri.buildUpon().appendEncodedPath("about/").build())
val allowedUris = arrayOf(Constants.faqUri, Constants.helpUri, Constants.registrationUrl, Constants.dashboard, Constants.webUri.buildUpon().appendEncodedPath("tos/").build(), Constants.webUri.buildUpon().appendEncodedPath("about/").build())
val accountsUri = Constants.webUri.buildUpon().appendEncodedPath("accounts/").build()
return allowedUris(allowedUris, uri) || uri.host == accountsUri.host && uri.path!!.startsWith(accountsUri.path!!)

View File

@ -231,10 +231,11 @@
<!-- AccountSettingsActivity -->
<string name="settings_title">Settings: %s</string>
<string name="settings_authentication">Authentication</string>
<string name="settings_manage_account">Manage Account</string>
<string name="settings_manage_account_summary">Change your payment info, plan and other account settings</string>
<string name="settings_encryption">Encryption</string>
<string name="settings_password">Password</string>
<string name="settings_password_summary">Change your authentication password</string>
<string name="settings_password">Authentication Password</string>
<string name="settings_password_summary">Use a different authentication password</string>
<string name="settings_enter_password">Enter your password:</string>
<string name="settings_encryption_password">Encryption Password</string>
<string name="settings_encryption_password_summary">Change your encryption password</string>

View File

@ -8,16 +8,13 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/settings_manage_account">
<PreferenceCategory android:title="@string/settings_authentication">
<EditTextPreference
android:key="password"
android:title="@string/settings_password"
<Preference
android:key="manage_account"
android:title="@string/settings_manage_account"
android:persistent="false"
android:inputType="textPassword"
android:summary="@string/settings_password_summary"
android:dialogTitle="@string/settings_enter_password" />
android:summary="@string/settings_manage_account_summary" />
</PreferenceCategory>
@ -33,6 +30,13 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/settings_sync">
<EditTextPreference
android:key="password"
android:title="@string/settings_password"
android:persistent="false"
android:inputType="textPassword"
android:summary="@string/settings_password_summary"
android:dialogTitle="@string/settings_enter_password" />
<ListPreference
android:key="sync_interval_contacts"