Add "Add Account" to prefs headers

Borrowed + icon from authentication widget

b/16298155

Change-Id: I36d0eb2c7b9e98442d72481254d9a4da2ae3c999
This commit is contained in:
Tony Mantler 2014-07-14 14:07:11 -07:00
parent 1fa51773bf
commit 1dcdc09e03
9 changed files with 35 additions and 4 deletions

View File

Before

Width:  |  Height:  |  Size: 470 B

After

Width:  |  Height:  |  Size: 470 B

View File

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 463 B

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -31,7 +31,7 @@
android:layout_weight="1"
android:padding="16dip"
android:drawablePadding="16dip"
android:drawableStart="@drawable/ic_setup_add_authentication"
android:drawableStart="@drawable/ic_settings_add"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"/>
</LinearLayout>

View File

@ -42,7 +42,7 @@
android:padding="16dip"
android:drawablePadding="16dip"
style="@style/account_setup_label_text"
android:drawableStart="@drawable/ic_setup_add_authentication"
android:drawableStart="@drawable/ic_settings_add"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"/>
</LinearLayout>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Google Inc.
Licensed to The Android Open Source Project.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header android:id="@+id/add_account_header"
android:title="@string/add_account"
android:icon="@drawable/ic_settings_add" />
</preference-headers>

View File

@ -17,7 +17,6 @@
-->
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<header android:fragment="com.android.email.activity.setup.GeneralPreferences"
android:title="@string/general_preferences_title" />

View File

@ -220,7 +220,10 @@ public class EmailPreferenceActivity extends MailPreferenceActivity {
@Override
public void onBuildExtraHeaders(List<Header> target) {
super.onBuildExtraHeaders(target);
// finally, if debug header is enabled, show it
loadHeadersFromResource(R.xml.email_extra_preference_headers, target);
// if debug header is enabled, show it
if (DEBUG_MENU_ALLOWED) {
if (mShowDebugMenu) {
// setup lightweight header for debugging
@ -252,6 +255,10 @@ public class EmailPreferenceActivity extends MailPreferenceActivity {
} else {
mNumGeneralHeaderClicked = 0;
}
if (header.id == R.id.add_account_header) {
onAddNewAccount();
return;
}
// Process header click normally
super.onHeaderClick(header, position);