Add "Add Account" to prefs headers
Borrowed + icon from authentication widget b/16298155 Change-Id: I36d0eb2c7b9e98442d72481254d9a4da2ae3c999
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -31,7 +31,7 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:padding="16dip"
|
android:padding="16dip"
|
||||||
android:drawablePadding="16dip"
|
android:drawablePadding="16dip"
|
||||||
android:drawableStart="@drawable/ic_setup_add_authentication"
|
android:drawableStart="@drawable/ic_settings_add"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="?android:attr/textColorPrimary"/>
|
android:textColor="?android:attr/textColorPrimary"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
android:padding="16dip"
|
android:padding="16dip"
|
||||||
android:drawablePadding="16dip"
|
android:drawablePadding="16dip"
|
||||||
style="@style/account_setup_label_text"
|
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:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="?android:attr/textColorPrimary"/>
|
android:textColor="?android:attr/textColorPrimary"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -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>
|
|
@ -17,7 +17,6 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
<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"
|
<header android:fragment="com.android.email.activity.setup.GeneralPreferences"
|
||||||
android:title="@string/general_preferences_title" />
|
android:title="@string/general_preferences_title" />
|
||||||
|
|
|
@ -220,7 +220,10 @@ public class EmailPreferenceActivity extends MailPreferenceActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onBuildExtraHeaders(List<Header> target) {
|
public void onBuildExtraHeaders(List<Header> target) {
|
||||||
super.onBuildExtraHeaders(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 (DEBUG_MENU_ALLOWED) {
|
||||||
if (mShowDebugMenu) {
|
if (mShowDebugMenu) {
|
||||||
// setup lightweight header for debugging
|
// setup lightweight header for debugging
|
||||||
|
@ -252,6 +255,10 @@ public class EmailPreferenceActivity extends MailPreferenceActivity {
|
||||||
} else {
|
} else {
|
||||||
mNumGeneralHeaderClicked = 0;
|
mNumGeneralHeaderClicked = 0;
|
||||||
}
|
}
|
||||||
|
if (header.id == R.id.add_account_header) {
|
||||||
|
onAddNewAccount();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Process header click normally
|
// Process header click normally
|
||||||
super.onHeaderClick(header, position);
|
super.onHeaderClick(header, position);
|
||||||
|
|