Bug 1212596 - Highlight Remove account in rejection red. r=vivek

--HG--
extra : rebase_source : 40a4e87f6a1f66dd25630096f069a6b71181789e
This commit is contained in:
Kalpesh Krishna 2015-11-06 00:13:44 +02:00
Родитель 99907edbf0
Коммит 4e57ac8198
4 изменённых файлов: 62 добавлений и 2 удалений

Просмотреть файл

@ -850,6 +850,7 @@ sync_java_files = [
'browserid/verifier/BrowserIDVerifierException.java', 'browserid/verifier/BrowserIDVerifierException.java',
'browserid/VerifyingPublicKey.java', 'browserid/VerifyingPublicKey.java',
'fxa/AccountLoader.java', 'fxa/AccountLoader.java',
'fxa/activities/CustomColorPreference.java',
'fxa/activities/FxAccountAbstractActivity.java', 'fxa/activities/FxAccountAbstractActivity.java',
'fxa/activities/FxAccountAbstractSetupActivity.java', 'fxa/activities/FxAccountAbstractSetupActivity.java',
'fxa/activities/FxAccountAbstractUpdateCredentialsActivity.java', 'fxa/activities/FxAccountAbstractUpdateCredentialsActivity.java',

Просмотреть файл

@ -0,0 +1,52 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.fxa.activities;
import org.mozilla.gecko.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
/**
* This preference is used to define custom colors for both title and summary texts.
* Color code #777777 (placeholder_grey) is used as the fallback color for both title and summary.
*/
public class CustomColorPreference extends Preference {
private int mTitleColor;
private int mSummaryColor;
public CustomColorPreference(Context context) {
super(context);
}
public CustomColorPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public CustomColorPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context, attrs);
}
public void init(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CustomColorPreference);
mTitleColor = a.getColor(R.styleable.CustomColorPreference_titleColor, R.color.placeholder_grey);
mSummaryColor = a.getColor(R.styleable.CustomColorPreference_summaryColor, R.color.placeholder_grey);
a.recycle();
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
final TextView title = (TextView) view.findViewById(android.R.id.title);
final TextView summary = (TextView) view.findViewById(android.R.id.summary);
title.setTextColor(mTitleColor);
summary.setTextColor(mSummaryColor);
}
}

Просмотреть файл

@ -168,6 +168,11 @@
<attr name="titlebarFill" format="boolean" /> <attr name="titlebarFill" format="boolean" />
</declare-styleable> </declare-styleable>
<declare-styleable name="CustomColorPreference">
<attr name="titleColor" format="color" />
<attr name="summaryColor" format="color" />
</declare-styleable>
<declare-styleable name="TabPanelBackButton"> <declare-styleable name="TabPanelBackButton">
<attr name="rightDivider" format="reference"/> <attr name="rightDivider" format="reference"/>
<attr name="dividerVerticalPadding" format="dimension"/> <attr name="dividerVerticalPadding" format="dimension"/>

Просмотреть файл

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="status_screen" > xmlns:gecko="http://schemas.android.com/apk/res-auto"
android:key="status_screen">
<PreferenceCategory <PreferenceCategory
android:key="signed_in_as_category" android:key="signed_in_as_category"
@ -102,10 +103,11 @@
android:key="sync_server" android:key="sync_server"
android:persistent="false" android:persistent="false"
android:title="@string/fxaccount_status_sync_server" /> android:title="@string/fxaccount_status_sync_server" />
<Preference <org.mozilla.gecko.fxa.activities.CustomColorPreference
android:editable="false" android:editable="false"
android:key="remove_account" android:key="remove_account"
android:persistent="false" android:persistent="false"
gecko:titleColor="@color/rejection_red"
android:title="@string/fxaccount_remove_account" /> android:title="@string/fxaccount_remove_account" />
<Preference <Preference
android:editable="false" android:editable="false"