diff --git a/res/drawable-hdpi/ic_btn_next.png b/res/drawable-hdpi/ic_btn_next.png
deleted file mode 100644
index ad00a956a8e..00000000000
Binary files a/res/drawable-hdpi/ic_btn_next.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_sync_anim_holo.png b/res/drawable-hdpi/ic_sync_anim_holo.png
deleted file mode 100644
index f5e19bd4d8d..00000000000
Binary files a/res/drawable-hdpi/ic_sync_anim_holo.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_sync_error_holo.png b/res/drawable-hdpi/ic_sync_error_holo.png
deleted file mode 100644
index cfa2d2b92da..00000000000
Binary files a/res/drawable-hdpi/ic_sync_error_holo.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_btn_next.png b/res/drawable-mdpi/ic_btn_next.png
deleted file mode 100644
index c6cf436cdf3..00000000000
Binary files a/res/drawable-mdpi/ic_btn_next.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_sync_anim_holo.png b/res/drawable-mdpi/ic_sync_anim_holo.png
deleted file mode 100644
index b4f1dfcd4e3..00000000000
Binary files a/res/drawable-mdpi/ic_sync_anim_holo.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_sync_error_holo.png b/res/drawable-mdpi/ic_sync_error_holo.png
deleted file mode 100644
index 77a6077fd68..00000000000
Binary files a/res/drawable-mdpi/ic_sync_error_holo.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_btn_next.png b/res/drawable-xhdpi/ic_btn_next.png
deleted file mode 100644
index feae23ce069..00000000000
Binary files a/res/drawable-xhdpi/ic_btn_next.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_sync_anim_holo.png b/res/drawable-xhdpi/ic_sync_anim_holo.png
deleted file mode 100644
index bca0d17725a..00000000000
Binary files a/res/drawable-xhdpi/ic_sync_anim_holo.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_sync_error_holo.png b/res/drawable-xhdpi/ic_sync_error_holo.png
deleted file mode 100644
index 1394a19cdce..00000000000
Binary files a/res/drawable-xhdpi/ic_sync_error_holo.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/ic_sync_anim_holo.png b/res/drawable-xxhdpi/ic_sync_anim_holo.png
deleted file mode 100644
index e7466fa5371..00000000000
Binary files a/res/drawable-xxhdpi/ic_sync_anim_holo.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/ic_sync_error_holo.png b/res/drawable-xxhdpi/ic_sync_error_holo.png
deleted file mode 100644
index 8fb1ee383ed..00000000000
Binary files a/res/drawable-xxhdpi/ic_sync_error_holo.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/ic_sync_anim_holo.png b/res/drawable-xxxhdpi/ic_sync_anim_holo.png
deleted file mode 100644
index 3ad0217c3f2..00000000000
Binary files a/res/drawable-xxxhdpi/ic_sync_anim_holo.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/ic_sync_error_holo.png b/res/drawable-xxxhdpi/ic_sync_error_holo.png
deleted file mode 100644
index bb093d946b3..00000000000
Binary files a/res/drawable-xxxhdpi/ic_sync_error_holo.png and /dev/null differ
diff --git a/res/drawable/ic_list_sync_anim.xml b/res/drawable/ic_list_sync_anim.xml
index e70c300dba6..c0011b1509a 100644
--- a/res/drawable/ic_list_sync_anim.xml
+++ b/res/drawable/ic_list_sync_anim.xml
@@ -19,6 +19,6 @@
-->
diff --git a/res/drawable/ic_sync_problem_24dp.xml b/res/drawable/ic_sync_problem_24dp.xml
new file mode 100644
index 00000000000..2139e98ec90
--- /dev/null
+++ b/res/drawable/ic_sync_problem_24dp.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
diff --git a/res/layout/account_sync_screen.xml b/res/layout/account_sync_screen.xml
deleted file mode 100644
index 7e981f15d48..00000000000
--- a/res/layout/account_sync_screen.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/manage_accounts_screen.xml b/res/layout/manage_accounts_screen.xml
deleted file mode 100644
index 57241c1753b..00000000000
--- a/res/layout/manage_accounts_screen.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/preference_widget_sync_toggle.xml b/res/layout/preference_widget_sync_toggle.xml
index 13ee460eb1b..a8dcdba758c 100644
--- a/res/layout/preference_widget_sync_toggle.xml
+++ b/res/layout/preference_widget_sync_toggle.xml
@@ -24,7 +24,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ac64654bc44..66a7f13fcb4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5908,8 +5908,6 @@
Remove account
Add an account
-
- Finish
Remove account?
diff --git a/res/xml/account_sync_settings.xml b/res/xml/account_sync_settings.xml
index ab274eb0879..a3d5e49cb7b 100644
--- a/res/xml/account_sync_settings.xml
+++ b/res/xml/account_sync_settings.xml
@@ -14,11 +14,9 @@
limitations under the License.
-->
-
-
-
-
+
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index cea92283da8..66f9179ed64 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -35,22 +35,17 @@ import android.os.Binder;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
-import androidx.preference.Preference;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
-import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
+import com.android.settings.widget.EntityHeaderController;
import com.google.android.collect.Lists;
@@ -58,6 +53,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import androidx.preference.Preference;
+
public class AccountSyncSettings extends AccountPreferenceBase {
public static final String ACCOUNT_KEY = "account";
@@ -65,10 +62,6 @@ public class AccountSyncSettings extends AccountPreferenceBase {
private static final int MENU_SYNC_CANCEL_ID = Menu.FIRST + 1;
private static final int CANT_DO_ONETIME_SYNC_DIALOG = 102;
- private TextView mUserId;
- private TextView mProviderId;
- private ImageView mProviderIcon;
- private TextView mErrorInfoView;
private Account mAccount;
private ArrayList mInvisibleAdapters = Lists.newArrayList();
@@ -103,36 +96,8 @@ public class AccountSyncSettings extends AccountPreferenceBase {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- setPreferenceScreen(null);
addPreferencesFromResource(R.xml.account_sync_settings);
- getPreferenceScreen().setOrderingAsAdded(false);
setAccessibilityTitle();
-
- setHasOptionsMenu(true);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- final View view = inflater.inflate(R.layout.account_sync_screen, container, false);
-
- final ViewGroup prefs_container = view.findViewById(R.id.prefs_container);
- Utils.prepareCustomPreferencesList(container, view, prefs_container, false);
- View prefs = super.onCreateView(inflater, prefs_container, savedInstanceState);
- prefs_container.addView(prefs);
-
- initializeUi(view);
-
- return view;
- }
-
- protected void initializeUi(final View rootView) {
- mErrorInfoView = (TextView) rootView.findViewById(R.id.sync_settings_error_info);
- mErrorInfoView.setVisibility(View.GONE);
-
- mUserId = (TextView) rootView.findViewById(R.id.user_id);
- mProviderId = (TextView) rootView.findViewById(R.id.provider_id);
- mProviderIcon = (ImageView) rootView.findViewById(R.id.provider_icon);
}
@Override
@@ -145,7 +110,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
finish();
return;
}
- mAccount = (Account) arguments.getParcelable(ACCOUNT_KEY);
+ mAccount = arguments.getParcelable(ACCOUNT_KEY);
if (!accountExists(mAccount)) {
Log.e(TAG, "Account provided does not exist: " + mAccount);
finish();
@@ -154,8 +119,15 @@ public class AccountSyncSettings extends AccountPreferenceBase {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Got account: " + mAccount);
}
- mUserId.setText(mAccount.name);
- mProviderId.setText(mAccount.type);
+ final Activity activity = getActivity();
+ final Preference pref = EntityHeaderController
+ .newInstance(activity, this, null /* header */)
+ .setRecyclerView(getListView(), getLifecycle())
+ .setIcon(getDrawableForType(mAccount.type))
+ .setLabel(mAccount.name)
+ .setSummary(getLabelForType(mAccount.type))
+ .done(activity, getPrefContext());
+ getPreferenceScreen().addPreference(pref);
}
private void setAccessibilityTitle() {
@@ -172,7 +144,6 @@ public class AccountSyncSettings extends AccountPreferenceBase {
@Override
public void onResume() {
- removePreference("dummy");
mAuthenticatorHelper.listenToAccountUpdates();
updateAuthDescriptions();
onAccountsUpdate(Binder.getCallingUserHandle());
@@ -481,7 +452,10 @@ public class AccountSyncSettings extends AccountPreferenceBase {
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
}
- mErrorInfoView.setVisibility(syncIsFailing ? View.VISIBLE : View.GONE);
+ if (syncIsFailing) {
+ mFooterPreferenceMixin.createFooterPreference()
+ .setTitle(R.string.sync_is_failing);
+ }
}
@Override
@@ -536,7 +510,9 @@ public class AccountSyncSettings extends AccountPreferenceBase {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "looking for sync adapters that match account " + mAccount);
}
+
cacheRemoveAllPrefs(getPreferenceScreen());
+ getCachedPreference(EntityHeaderController.PREF_KEY_APP_HEADER);
for (int j = 0, m = authorities.size(); j < m; j++) {
final SyncAdapterType syncAdapter = authorities.get(j);
// We could check services here....
@@ -560,18 +536,6 @@ public class AccountSyncSettings extends AccountPreferenceBase {
removeCachedPrefs(getPreferenceScreen());
}
- /**
- * Updates the titlebar with an icon for the provider type.
- */
- @Override
- protected void onAuthDescriptionsUpdated() {
- super.onAuthDescriptionsUpdated();
- if (mAccount != null) {
- mProviderIcon.setImageDrawable(getDrawableForType(mAccount.type));
- mProviderId.setText(getLabelForType(mAccount.type));
- }
- }
-
@Override
public int getHelpResource() {
return R.string.help_url_accounts;
diff --git a/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
index ca23fa5e8ce..58e42f038bb 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java
@@ -24,7 +24,6 @@ import static org.mockito.Mockito.when;
import android.content.Context;
import android.hardware.input.InputManager;
-import androidx.preference.Preference;
import android.view.InputDevice;
import com.android.settings.R;
@@ -40,6 +39,8 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
+import androidx.preference.Preference;
+
@RunWith(SettingsRobolectricTestRunner.class)
public class PhysicalKeyboardPreferenceControllerTest {