am 845001d2
: Merge "Add "Add Account" to prefs headers" into ub-mail-master
* commit '845001d250419eaf2230b7dd587432f352299e13': Add "Add Account" to prefs headers
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: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>
|
||||
|
@ -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>
|
||||
|
25
res/xml/email_extra_preference_headers.xml
Normal 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>
|
@ -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" />
|
||||
|
@ -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);
|
||||
|