Update text for Users & accounts page.
- add back the summary loader for UserSettings - remove "configure" preference category - add summary for Auto sync data and update the title Change-Id: Ia00397f775f86d0e160a54783a8518847fce8de8 Bug: 36540644 Test: builds
This commit is contained in:
@@ -7542,8 +7542,11 @@
|
|||||||
<!-- Summary of memory screen [CHAR LIMIT=NONE] -->
|
<!-- Summary of memory screen [CHAR LIMIT=NONE] -->
|
||||||
<string name="memory_summary">Avg <xliff:g id="used_memory" example="1.7GB">%1$s</xliff:g> of <xliff:g id="total_memory" example="2GB">%2$s</xliff:g> memory used</string>
|
<string name="memory_summary">Avg <xliff:g id="used_memory" example="1.7GB">%1$s</xliff:g> of <xliff:g id="total_memory" example="2GB">%2$s</xliff:g> memory used</string>
|
||||||
|
|
||||||
<!-- Summary of user screen [CHAR LIMIT=NONE] -->
|
<!-- Summary of Users & accounts setting screen [CHAR LIMIT=NONE] -->
|
||||||
<string name="user_summary">Current user: <xliff:g id="user_name" example="Jason">%1$s</xliff:g></string>
|
<string name="users_and_accounts_summary">Current user: <xliff:g id="user_name" example="Jason">%1$s</xliff:g></string>
|
||||||
|
|
||||||
|
<!-- Summary of User settings [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="users_summary">Signed in as <xliff:g id="user_name" example="Jason">%1$s</xliff:g></string>
|
||||||
|
|
||||||
<!-- Summary of payment screen [CHAR LIMIT=NONE] -->
|
<!-- Summary of payment screen [CHAR LIMIT=NONE] -->
|
||||||
<string name="payment_summary"><xliff:g id="app_name" example="Payment App">%1$s</xliff:g> is default</string>
|
<string name="payment_summary"><xliff:g id="app_name" example="Payment App">%1$s</xliff:g> is default</string>
|
||||||
@@ -8198,11 +8201,13 @@
|
|||||||
<string name="configure_section_header">Configure</string>
|
<string name="configure_section_header">Configure</string>
|
||||||
|
|
||||||
<!-- Switch label to enable auto sync account [CHAR LIMIT=60] -->
|
<!-- Switch label to enable auto sync account [CHAR LIMIT=60] -->
|
||||||
<string name="auto_sync_account_title">Auto sync account data</string>
|
<string name="auto_sync_account_title">Automatically sync data</string>
|
||||||
<!-- Switch label to enable auto sync personal account [CHAR LIMIT=60] -->
|
<!-- Switch label to enable auto sync personal account [CHAR LIMIT=60] -->
|
||||||
<string name="auto_sync_personal_account_title">Auto sync personal account data</string>
|
<string name="auto_sync_personal_account_title">Automatically sync personal data</string>
|
||||||
<!-- Switch label to enable auto sync work account [CHAR LIMIT=60] -->
|
<!-- Switch label to enable auto sync work account [CHAR LIMIT=60] -->
|
||||||
<string name="auto_sync_work_account_title">Auto sync work account data</string>
|
<string name="auto_sync_work_account_title">Automatically sync work data</string>
|
||||||
|
<!-- Switch summary to enable auto sync account [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="auto_sync_account_summary">Let apps refresh data automatically</string>
|
||||||
<!-- Preference label to sync account [CHAR LIMIT=60] -->
|
<!-- Preference label to sync account [CHAR LIMIT=60] -->
|
||||||
<string name="account_sync_title">Account sync</string>
|
<string name="account_sync_title">Account sync</string>
|
||||||
|
|
||||||
|
@@ -26,25 +26,23 @@
|
|||||||
android:order="100"
|
android:order="100"
|
||||||
settings:allowDividerAbove="true"/>
|
settings:allowDividerAbove="true"/>
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:key="account_configuration_header"
|
|
||||||
android:title="@string/configure_section_header"
|
|
||||||
android:order="101">
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="auto_sync_account_data"
|
android:key="auto_sync_account_data"
|
||||||
android:title="@string/auto_sync_account_title"
|
android:title="@string/auto_sync_account_title"
|
||||||
android:order="102"/>
|
android:summary="@string/auto_sync_account_summary"
|
||||||
|
android:order="102"
|
||||||
|
settings:allowDividerAbove="true"/>
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="auto_sync_work_account_data"
|
android:key="auto_sync_work_account_data"
|
||||||
android:title="@string/account_settings_menu_auto_sync_work"
|
android:title="@string/account_settings_menu_auto_sync_work"
|
||||||
|
android:summary="@string/auto_sync_account_summary"
|
||||||
android:order="103"/>
|
android:order="103"/>
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="auto_sync_personal_account_data"
|
android:key="auto_sync_personal_account_data"
|
||||||
android:title="@string/account_settings_menu_auto_sync_personal"
|
android:title="@string/account_settings_menu_auto_sync_personal"
|
||||||
|
android:summary="@string/auto_sync_account_summary"
|
||||||
android:order="104"/>
|
android:order="104"/>
|
||||||
|
|
||||||
<com.android.settingslib.RestrictedSwitchPreference
|
<com.android.settingslib.RestrictedSwitchPreference
|
||||||
|
@@ -100,8 +100,8 @@ public class UserAndAccountDashboardFragment extends DashboardFragment {
|
|||||||
if (listening) {
|
if (listening) {
|
||||||
UserInfo info = mContext.getSystemService(UserManager.class).getUserInfo(
|
UserInfo info = mContext.getSystemService(UserManager.class).getUserInfo(
|
||||||
UserHandle.myUserId());
|
UserHandle.myUserId());
|
||||||
mSummaryLoader.setSummary(this, mContext.getString(R.string.user_summary,
|
mSummaryLoader.setSummary(this,
|
||||||
info.name));
|
mContext.getString(R.string.users_and_accounts_summary, info.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@ import com.android.settings.R;
|
|||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.SettingsPreferenceFragment;
|
import com.android.settings.SettingsPreferenceFragment;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
|
import com.android.settings.dashboard.SummaryLoader;
|
||||||
import com.android.settings.search.BaseSearchIndexProvider;
|
import com.android.settings.search.BaseSearchIndexProvider;
|
||||||
import com.android.settings.search.Indexable;
|
import com.android.settings.search.Indexable;
|
||||||
import com.android.settings.search.SearchIndexableRaw;
|
import com.android.settings.search.SearchIndexableRaw;
|
||||||
@@ -1007,6 +1008,36 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
mMePreference.setTitle(label);
|
mMePreference.setTitle(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class SummaryProvider implements SummaryLoader.SummaryProvider {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final SummaryLoader mSummaryLoader;
|
||||||
|
|
||||||
|
public SummaryProvider(Context context, SummaryLoader summaryLoader) {
|
||||||
|
mContext = context;
|
||||||
|
mSummaryLoader = summaryLoader;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setListening(boolean listening) {
|
||||||
|
if (listening) {
|
||||||
|
UserInfo info = mContext.getSystemService(UserManager.class).getUserInfo(
|
||||||
|
UserHandle.myUserId());
|
||||||
|
mSummaryLoader.setSummary(this, mContext.getString(R.string.users_summary,
|
||||||
|
info.name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY =
|
||||||
|
new SummaryLoader.SummaryProviderFactory() {
|
||||||
|
@Override
|
||||||
|
public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
|
||||||
|
SummaryLoader summaryLoader) {
|
||||||
|
return new SummaryProvider(activity, summaryLoader);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||||
new BaseSearchIndexProvider() {
|
new BaseSearchIndexProvider() {
|
||||||
@Override
|
@Override
|
||||||
|
@@ -101,7 +101,7 @@ public class UserAndAccountDashboardFragmentTest {
|
|||||||
.createSummaryProvider(activity, loader);
|
.createSummaryProvider(activity, loader);
|
||||||
provider.setListening(true);
|
provider.setListening(true);
|
||||||
|
|
||||||
verify(activity).getString(R.string.user_summary,
|
verify(activity).getString(R.string.users_and_accounts_summary,
|
||||||
userInfo.name);
|
userInfo.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user