use stylable attributes for openpgp_ colors
This commit is contained in:
parent
c4a6bf5472
commit
406334086c
19 changed files with 140 additions and 97 deletions
|
@ -8,7 +8,7 @@ import android.content.res.Resources;
|
|||
import android.graphics.PorterDuff.Mode;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -23,6 +23,7 @@ import android.widget.TextView;
|
|||
import com.fsck.k9.R;
|
||||
import com.fsck.k9.activity.compose.RecipientAdapter;
|
||||
import com.fsck.k9.view.RecipientSelectView.Recipient;
|
||||
import com.fsck.k9.view.ThemeUtils;
|
||||
|
||||
|
||||
public class AlternateRecipientAdapter extends BaseAdapter {
|
||||
|
@ -168,15 +169,15 @@ public class AlternateRecipientAdapter extends BaseAdapter {
|
|||
private void configureCryptoStatusView(RecipientTokenHolder holder, Recipient recipient) {
|
||||
switch (recipient.getCryptoStatus()) {
|
||||
case AVAILABLE_TRUSTED: {
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_dots_3, R.color.openpgp_green);
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_dots_3, R.attr.openpgp_green);
|
||||
break;
|
||||
}
|
||||
case AVAILABLE_UNTRUSTED: {
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_dots_2, R.color.openpgp_orange);
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_dots_2, R.attr.openpgp_orange);
|
||||
break;
|
||||
}
|
||||
case UNAVAILABLE: {
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_disabled_dots_1, R.color.openpgp_red);
|
||||
setCryptoStatusView(holder, R.drawable.status_lock_disabled_dots_1, R.attr.openpgp_red);
|
||||
break;
|
||||
}
|
||||
case UNDEFINED: {
|
||||
|
@ -187,14 +188,14 @@ public class AlternateRecipientAdapter extends BaseAdapter {
|
|||
}
|
||||
|
||||
private void setCryptoStatusView(RecipientTokenHolder holder, @DrawableRes int cryptoStatusRes,
|
||||
@ColorRes int cryptoStatusColorRes) {
|
||||
@AttrRes int cryptoStatusColorAttr) {
|
||||
Resources resources = context.getResources();
|
||||
|
||||
Drawable drawable = resources.getDrawable(cryptoStatusRes);
|
||||
// noinspection ConstantConditions, we know the resource exists!
|
||||
drawable.mutate();
|
||||
|
||||
int cryptoStatusColor = resources.getColor(cryptoStatusColorRes);
|
||||
int cryptoStatusColor = ThemeUtils.getStyledColor(context, cryptoStatusColorAttr);
|
||||
drawable.setColorFilter(cryptoStatusColor, Mode.SRC_ATOP);
|
||||
|
||||
holder.itemCryptoStatus.setImageDrawable(drawable);
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.fsck.k9.R;
|
|||
import com.fsck.k9.helper.ContactPicture;
|
||||
import com.fsck.k9.view.RecipientSelectView.Recipient;
|
||||
import com.fsck.k9.view.RecipientSelectView.RecipientCryptoStatus;
|
||||
import com.fsck.k9.view.ThemeUtils;
|
||||
|
||||
|
||||
public class RecipientAdapter extends BaseAdapter implements Filterable {
|
||||
|
@ -97,17 +98,17 @@ public class RecipientAdapter extends BaseAdapter implements Filterable {
|
|||
switch (cryptoStatus) {
|
||||
case AVAILABLE_TRUSTED: {
|
||||
cryptoStatusRes = R.drawable.status_lock_dots_3;
|
||||
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_green);
|
||||
cryptoStatusColor = ThemeUtils.getStyledColor(context, R.attr.openpgp_green);
|
||||
break;
|
||||
}
|
||||
case AVAILABLE_UNTRUSTED: {
|
||||
cryptoStatusRes = R.drawable.status_lock_dots_2;
|
||||
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_orange);
|
||||
cryptoStatusColor = ThemeUtils.getStyledColor(context, R.attr.openpgp_orange);
|
||||
break;
|
||||
}
|
||||
case UNAVAILABLE: {
|
||||
cryptoStatusRes = R.drawable.status_lock_disabled_dots_1;
|
||||
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_red);
|
||||
cryptoStatusColor = ThemeUtils.getStyledColor(context, R.attr.openpgp_red);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ import android.app.Fragment;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -23,6 +23,7 @@ import android.widget.TextView;
|
|||
|
||||
import com.fsck.k9.R;
|
||||
import com.fsck.k9.view.MessageCryptoDisplayStatus;
|
||||
import com.fsck.k9.view.ThemeUtils;
|
||||
|
||||
|
||||
public class CryptoInfoDialog extends DialogFragment {
|
||||
|
@ -106,23 +107,23 @@ public class CryptoInfoDialog extends DialogFragment {
|
|||
}
|
||||
|
||||
if (displayStatus.textResBottom == null) {
|
||||
setMessageSingleLine(displayStatus.colorRes,
|
||||
setMessageSingleLine(displayStatus.colorAttr,
|
||||
displayStatus.textResTop, displayStatus.statusIconRes,
|
||||
displayStatus.statusDotsRes);
|
||||
} else {
|
||||
if (displayStatus.statusDotsRes == null) {
|
||||
throw new AssertionError("second icon must be non-null if second text is non-null!");
|
||||
}
|
||||
setMessageWithAnimation(displayStatus.colorRes,
|
||||
setMessageWithAnimation(displayStatus.colorAttr,
|
||||
displayStatus.textResTop, displayStatus.statusIconRes,
|
||||
displayStatus.textResBottom, displayStatus.statusDotsRes);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMessageSingleLine(@ColorRes int colorRes,
|
||||
private void setMessageSingleLine(@AttrRes int colorAttr,
|
||||
@StringRes int topTextRes, @DrawableRes int statusIconRes,
|
||||
@DrawableRes Integer statusDotsRes) {
|
||||
@ColorInt int color = getResources().getColor(colorRes);
|
||||
@ColorInt int color = ThemeUtils.getStyledColor(getActivity(), colorAttr);
|
||||
|
||||
topIcon_1.setImageResource(statusIconRes);
|
||||
topIcon_1.setColorFilter(color);
|
||||
|
@ -140,7 +141,7 @@ public class CryptoInfoDialog extends DialogFragment {
|
|||
bottomIconFrame.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void setMessageWithAnimation(@ColorRes int colorRes,
|
||||
private void setMessageWithAnimation(@AttrRes int colorAttr,
|
||||
@StringRes int topTextRes, @DrawableRes int statusIconRes,
|
||||
@StringRes int bottomTextRes, @DrawableRes int statusDotsRes) {
|
||||
topIcon_1.setImageResource(statusIconRes);
|
||||
|
@ -152,8 +153,8 @@ public class CryptoInfoDialog extends DialogFragment {
|
|||
bottomIcon_2.setImageResource(statusDotsRes);
|
||||
bottomText.setText(bottomTextRes);
|
||||
|
||||
topIcon_1.setColorFilter(getResources().getColor(colorRes));
|
||||
bottomIcon_2.setColorFilter(getResources().getColor(colorRes));
|
||||
topIcon_1.setColorFilter(ThemeUtils.getStyledColor(getActivity(), colorAttr));
|
||||
bottomIcon_2.setColorFilter(ThemeUtils.getStyledColor(getActivity(), colorAttr));
|
||||
|
||||
prepareIconAnimation();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.fsck.k9.mail.Message;
|
|||
import com.fsck.k9.mailstore.MessageViewInfo;
|
||||
import com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener;
|
||||
import com.fsck.k9.view.MessageHeader;
|
||||
import com.fsck.k9.view.ThemeUtils;
|
||||
import com.fsck.k9.view.ToolableViewAnimator;
|
||||
import org.openintents.openpgp.OpenPgpError;
|
||||
|
||||
|
@ -192,7 +193,7 @@ public class MessageTopView extends LinearLayout {
|
|||
cryptoProviderIcon.setImageDrawable(openPgpApiProviderIcon);
|
||||
} else {
|
||||
cryptoProviderIcon.setImageResource(R.drawable.status_lock_error);
|
||||
cryptoProviderIcon.setColorFilter(getResources().getColor(R.color.openpgp_red));
|
||||
cryptoProviderIcon.setColorFilter(ThemeUtils.getStyledColor(getContext(), R.attr.openpgp_red));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CryptoModeSelector extends FrameLayout implements OnSeekBarChangeLi
|
|||
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
int grey = getResources().getColor(R.color.openpgp_grey);
|
||||
int grey = ThemeUtils.getStyledColor(getContext(), R.attr.openpgp_grey);
|
||||
|
||||
float crossfadeValue2, crossfadeValue3, crossfadeValue4;
|
||||
if (progress > CROSSFADE_THRESH_2_LOW && progress < CROSSFADE_THRESH_2_HIGH) {
|
||||
|
@ -90,13 +90,13 @@ public class CryptoModeSelector extends FrameLayout implements OnSeekBarChangeLi
|
|||
|
||||
int crossfadedColor;
|
||||
|
||||
crossfadedColor = crossfadeColor(grey, getResources().getColor(R.color.openpgp_blue), crossfadeValue2);
|
||||
crossfadedColor = crossfadeColor(grey, ThemeUtils.getStyledColor(getContext(), R.attr.openpgp_blue), crossfadeValue2);
|
||||
modeIcon2.setColorFilter(crossfadedColor, PorterDuff.Mode.SRC_ATOP);
|
||||
|
||||
crossfadedColor = crossfadeColor(grey, getResources().getColor(R.color.openpgp_orange), crossfadeValue3);
|
||||
crossfadedColor = crossfadeColor(grey, ThemeUtils.getStyledColor(getContext(), R.attr.openpgp_orange), crossfadeValue3);
|
||||
modeIcon3.setColorFilter(crossfadedColor, PorterDuff.Mode.SRC_ATOP);
|
||||
|
||||
crossfadedColor = crossfadeColor(grey, getResources().getColor(R.color.openpgp_green), crossfadeValue4);
|
||||
crossfadedColor = crossfadeColor(grey, ThemeUtils.getStyledColor(getContext(), R.attr.openpgp_green), crossfadeValue4);
|
||||
modeIcon4.setColorFilter(crossfadedColor, PorterDuff.Mode.SRC_ATOP);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.fsck.k9.view;
|
||||
|
||||
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.StringRes;
|
||||
|
@ -14,141 +14,141 @@ import org.openintents.openpgp.OpenPgpSignatureResult;
|
|||
|
||||
public enum MessageCryptoDisplayStatus {
|
||||
LOADING (
|
||||
R.color.openpgp_grey,
|
||||
R.attr.openpgp_grey,
|
||||
R.drawable.status_lock
|
||||
),
|
||||
|
||||
CANCELLED (
|
||||
R.color.openpgp_black,
|
||||
R.attr.openpgp_black,
|
||||
R.drawable.status_lock,
|
||||
R.string.crypto_msg_cancelled
|
||||
),
|
||||
|
||||
DISABLED (
|
||||
R.color.openpgp_grey,
|
||||
R.attr.openpgp_grey,
|
||||
R.drawable.status_lock_disabled,
|
||||
R.string.crypto_msg_disabled
|
||||
),
|
||||
|
||||
UNENCRYPTED_SIGN_UNKNOWN (
|
||||
R.color.openpgp_black,
|
||||
R.attr.openpgp_black,
|
||||
R.drawable.status_signature_unverified_cutout, R.drawable.status_dots,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_unknown
|
||||
),
|
||||
|
||||
UNENCRYPTED_SIGN_VERIFIED (
|
||||
R.color.openpgp_blue,
|
||||
R.attr.openpgp_blue,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_3,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_verified
|
||||
),
|
||||
UNENCRYPTED_SIGN_UNVERIFIED (
|
||||
R.color.openpgp_orange,
|
||||
R.attr.openpgp_orange,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_2,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_unverified
|
||||
),
|
||||
UNENCRYPTED_SIGN_MISMATCH (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_mismatch
|
||||
),
|
||||
UNENCRYPTED_SIGN_EXPIRED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_expired
|
||||
),
|
||||
UNENCRYPTED_SIGN_REVOKED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_revoked
|
||||
),
|
||||
UNENCRYPTED_SIGN_INSECURE (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_insecure
|
||||
),
|
||||
UNENCRYPTED_SIGN_ERROR (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_signature_verified_cutout, R.drawable.status_dots,
|
||||
R.string.crypto_msg_signed_error, null
|
||||
),
|
||||
|
||||
ENCRYPTED_SIGN_UNKNOWN (
|
||||
R.color.openpgp_black,
|
||||
R.attr.openpgp_black,
|
||||
R.drawable.status_lock_opportunistic, R.drawable.status_dots,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_unknown
|
||||
),
|
||||
|
||||
ENCRYPTED_SIGN_VERIFIED (
|
||||
R.color.openpgp_green,
|
||||
R.attr.openpgp_green,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_3,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_verified
|
||||
),
|
||||
ENCRYPTED_SIGN_UNVERIFIED (
|
||||
R.color.openpgp_orange,
|
||||
R.attr.openpgp_orange,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_2,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_unverified
|
||||
),
|
||||
ENCRYPTED_SIGN_MISMATCH (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_mismatch
|
||||
),
|
||||
ENCRYPTED_SIGN_EXPIRED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_expired
|
||||
),
|
||||
ENCRYPTED_SIGN_REVOKED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_revoked
|
||||
),
|
||||
ENCRYPTED_SIGN_INSECURE (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_none_dots_1,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_insecure
|
||||
),
|
||||
ENCRYPTED_UNSIGNED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_dots,
|
||||
R.string.crypto_msg_encrypted_unsigned, R.string.crypto_msg_unsigned_encrypted
|
||||
),
|
||||
ENCRYPTED_SIGN_ERROR (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock, R.drawable.status_dots,
|
||||
R.string.crypto_msg_signed_encrypted, R.string.crypto_msg_sign_error
|
||||
),
|
||||
|
||||
ENCRYPTED_ERROR (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock_error,
|
||||
R.string.crypto_msg_encrypted_error
|
||||
),
|
||||
|
||||
INCOMPLETE_ENCRYPTED (
|
||||
R.color.openpgp_black,
|
||||
R.attr.openpgp_black,
|
||||
R.drawable.status_lock_opportunistic,
|
||||
R.string.crypto_msg_incomplete_encrypted
|
||||
),
|
||||
INCOMPLETE_SIGNED (
|
||||
R.color.openpgp_black,
|
||||
R.attr.openpgp_black,
|
||||
R.drawable.status_signature_unverified_cutout, R.drawable.status_dots,
|
||||
R.string.crypto_msg_signed_unencrypted, R.string.crypto_msg_sign_incomplete
|
||||
),
|
||||
|
||||
UNSUPPORTED_ENCRYPTED (
|
||||
R.color.openpgp_red,
|
||||
R.attr.openpgp_red,
|
||||
R.drawable.status_lock_error,
|
||||
R.string.crypto_msg_unsupported_encrypted
|
||||
),
|
||||
UNSUPPORTED_SIGNED (
|
||||
R.color.openpgp_grey,
|
||||
R.attr.openpgp_grey,
|
||||
R.drawable.status_lock_disabled,
|
||||
R.string.crypto_msg_unsupported_signed
|
||||
),
|
||||
;
|
||||
|
||||
@ColorRes public final int colorRes;
|
||||
@AttrRes public final int colorAttr;
|
||||
|
||||
@DrawableRes public final int statusIconRes;
|
||||
@DrawableRes public final Integer statusDotsRes;
|
||||
|
@ -156,9 +156,9 @@ public enum MessageCryptoDisplayStatus {
|
|||
@StringRes public final Integer textResTop;
|
||||
@StringRes public final Integer textResBottom;
|
||||
|
||||
MessageCryptoDisplayStatus(@ColorRes int colorRes, @DrawableRes int statusIconRes, @DrawableRes Integer statusDotsRes,
|
||||
MessageCryptoDisplayStatus(@AttrRes int colorAttr, @DrawableRes int statusIconRes, @DrawableRes Integer statusDotsRes,
|
||||
@StringRes int textResTop, @StringRes Integer textResBottom) {
|
||||
this.colorRes = colorRes;
|
||||
this.colorAttr = colorAttr;
|
||||
this.statusIconRes = statusIconRes;
|
||||
this.statusDotsRes = statusDotsRes;
|
||||
|
||||
|
@ -166,8 +166,8 @@ public enum MessageCryptoDisplayStatus {
|
|||
this.textResBottom = textResBottom;
|
||||
}
|
||||
|
||||
MessageCryptoDisplayStatus(@ColorRes int colorRes, @DrawableRes int statusIconRes, @StringRes int textResTop) {
|
||||
this.colorRes = colorRes;
|
||||
MessageCryptoDisplayStatus(@AttrRes int colorAttr, @DrawableRes int statusIconRes, @StringRes int textResTop) {
|
||||
this.colorAttr = colorAttr;
|
||||
this.statusIconRes = statusIconRes;
|
||||
this.statusDotsRes = null;
|
||||
|
||||
|
@ -175,8 +175,8 @@ public enum MessageCryptoDisplayStatus {
|
|||
this.textResBottom = null;
|
||||
}
|
||||
|
||||
MessageCryptoDisplayStatus(@ColorRes int colorRes, @DrawableRes int statusIconRes) {
|
||||
this.colorRes = colorRes;
|
||||
MessageCryptoDisplayStatus(@AttrRes int colorAttr, @DrawableRes int statusIconRes) {
|
||||
this.colorAttr = colorAttr;
|
||||
this.statusIconRes = statusIconRes;
|
||||
this.statusDotsRes = null;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class MessageCryptoStatusView extends FrameLayout {
|
|||
}
|
||||
|
||||
public void setCryptoDisplayStatus(MessageCryptoDisplayStatus displayStatus) {
|
||||
@ColorInt int color = getResources().getColor(displayStatus.colorRes);
|
||||
@ColorInt int color = ThemeUtils.getStyledColor(getContext(), displayStatus.colorAttr);
|
||||
|
||||
if (displayStatus.statusDotsRes != null) {
|
||||
iconCombinedFirst.setVisibility(View.VISIBLE);
|
||||
|
|
27
k9mail/src/main/java/com/fsck/k9/view/ThemeUtils.java
Normal file
27
k9mail/src/main/java/com/fsck/k9/view/ThemeUtils.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package com.fsck.k9.view;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.UiThread;
|
||||
import android.util.TypedValue;
|
||||
|
||||
|
||||
public class ThemeUtils {
|
||||
private static final TypedValue TYPED_VALUE = new TypedValue();
|
||||
|
||||
@ColorInt
|
||||
public static int getStyledColor(Context context, @AttrRes int attr) {
|
||||
return getStyledColor(context.getTheme(), attr);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
@UiThread
|
||||
public static int getStyledColor(Theme theme, @AttrRes int attr) {
|
||||
theme.resolveAttribute(attr, TYPED_VALUE, true);
|
||||
return TYPED_VALUE.data;
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_weight="1"
|
||||
android:src="@drawable/status_lock_disabled"
|
||||
android:id="@+id/icon_1"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -28,7 +28,7 @@
|
|||
android:layout_weight="1"
|
||||
android:src="@drawable/status_signature_verified_cutout"
|
||||
android:id="@+id/icon_2"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -37,7 +37,7 @@
|
|||
android:layout_weight="1"
|
||||
android:src="@drawable/status_lock_opportunistic"
|
||||
android:id="@+id/icon_3"
|
||||
tools:tint="@color/openpgp_orange"
|
||||
tools:tint="?attr/openpgp_orange"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -46,7 +46,7 @@
|
|||
android:layout_weight="1"
|
||||
android:src="@drawable/status_lock_closed"
|
||||
android:id="@+id/icon_4"
|
||||
tools:tint="@color/openpgp_green"
|
||||
tools:tint="?attr/openpgp_green"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/status_lock_disabled"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -84,7 +84,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/status_lock_error"
|
||||
android:tint="@color/openpgp_red"
|
||||
android:tint="?attr/openpgp_red"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
|
@ -96,7 +96,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -104,7 +104,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -118,7 +118,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -126,7 +126,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock_error_dots_1"
|
||||
android:tint="@color/openpgp_red"
|
||||
android:tint="?attr/openpgp_red"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -140,7 +140,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -148,7 +148,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock_none_dots_1"
|
||||
android:tint="@color/openpgp_red"
|
||||
android:tint="?attr/openpgp_red"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -156,7 +156,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock_disabled"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -170,7 +170,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -178,7 +178,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock_dots_2"
|
||||
android:tint="@color/openpgp_orange"
|
||||
android:tint="?attr/openpgp_orange"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -192,7 +192,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -200,7 +200,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_lock_dots_3"
|
||||
android:tint="@color/openpgp_green"
|
||||
android:tint="?attr/openpgp_green"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -210,7 +210,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/status_signature_verified_cutout"
|
||||
android:tint="@color/openpgp_blue"
|
||||
android:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
</com.fsck.k9.view.ToolableViewAnimator>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:layout_gravity="left|center_vertical"
|
||||
android:id="@+id/crypto_info_top_icon_1"
|
||||
tools:src="@drawable/status_signature_verified_cutout"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -77,7 +77,7 @@
|
|||
android:layout_gravity="left|center_vertical"
|
||||
android:id="@+id/crypto_info_bottom_icon_2"
|
||||
tools:src="@drawable/status_none_dots_3"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
android:layout_gravity="left|center_vertical"
|
||||
android:id="@+id/crypto_status_dots_bg"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -26,7 +26,7 @@
|
|||
android:layout_gravity="left|center_vertical"
|
||||
android:id="@+id/crypto_status_combined_2"
|
||||
tools:src="@drawable/status_none_dots_1"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -35,7 +35,7 @@
|
|||
android:layout_gravity="left|center_vertical"
|
||||
android:id="@+id/crypto_status_combined_1"
|
||||
tools:src="@drawable/status_signature_verified_cutout"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -45,7 +45,7 @@
|
|||
android:id="@+id/crypto_status_single"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/status_signature_verified_cutout"
|
||||
tools:tint="@color/openpgp_blue"
|
||||
tools:tint="?attr/openpgp_blue"
|
||||
/>
|
||||
|
||||
</com.fsck.k9.view.MessageCryptoStatusView>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/status_signature_unverified_cutout"
|
||||
android:tint="@color/openpgp_red"
|
||||
android:tint="?attr/openpgp_red"
|
||||
android:layout_marginTop="8dip"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -126,7 +126,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
tools:src="@drawable/status_lock_dots_2"
|
||||
tools:tint="@color/openpgp_grey"
|
||||
tools:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/status_dots"
|
||||
android:tint="@color/openpgp_grey"
|
||||
android:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
@ -64,7 +64,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
tools:src="@drawable/status_lock_dots_2"
|
||||
tools:tint="@color/openpgp_grey"
|
||||
tools:tint="?attr/openpgp_grey"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/contact_crypto_status_red"
|
||||
android:src="@drawable/status_dots_1"
|
||||
android:tint="@color/openpgp_red"
|
||||
android:tint="?attr/openpgp_red"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/contact_crypto_status_orange"
|
||||
android:src="@drawable/status_dots_2"
|
||||
android:tint="@color/openpgp_orange"
|
||||
android:tint="?attr/openpgp_orange"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
|
@ -60,7 +60,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/contact_crypto_status_green"
|
||||
android:src="@drawable/status_dots_3"
|
||||
android:tint="@color/openpgp_green"
|
||||
android:tint="?attr/openpgp_green"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@
|
|||
<attr name="contactTokenBackgroundColor" format="reference|color"/>
|
||||
<attr name="tintColorBulletPointPositive" format="reference|color"/>
|
||||
<attr name="tintColorBulletPointNegative" format="reference|color"/>
|
||||
|
||||
<attr name="openpgp_black" format="reference|color" />
|
||||
<attr name="openpgp_orange" format="reference|color" />
|
||||
<attr name="openpgp_red" format="reference|color" />
|
||||
<attr name="openpgp_green" format="reference|color" />
|
||||
<attr name="openpgp_blue" format="reference|color" />
|
||||
<attr name="openpgp_grey" format="reference|color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SliderPreference">
|
||||
|
|
|
@ -3,13 +3,4 @@
|
|||
<color name="message_list_item_footer_background">#eeeeee</color>
|
||||
|
||||
<color name="light_black">#444</color>
|
||||
|
||||
<color name="openpgp_red">#CC0000</color>
|
||||
<color name="openpgp_orange">#FF8800</color>
|
||||
<color name="openpgp_green">#669900</color>
|
||||
<color name="openpgp_blue">#336699</color>
|
||||
<color name="openpgp_grey">#bbb</color>
|
||||
<color name="openpgp_black">#000</color>
|
||||
<color name="openpgp_sidebar">#D8D8D8</color>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -63,6 +63,13 @@
|
|||
<item name="composerBackgroundColor">@android:color/background_light</item>
|
||||
<item name="tintColorBulletPointPositive">#77aa22</item>
|
||||
<item name="tintColorBulletPointNegative">#dd2222</item>
|
||||
|
||||
<item name="openpgp_black">#000</item>
|
||||
<item name="openpgp_orange">#FF8800</item>
|
||||
<item name="openpgp_red">#CC0000</item>
|
||||
<item name="openpgp_green">#669900</item>
|
||||
<item name="openpgp_blue">#336699</item>
|
||||
<item name="openpgp_grey">#bbb</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Base">
|
||||
|
@ -119,6 +126,13 @@
|
|||
<item name="composerBackgroundColor">@android:color/background_dark</item>
|
||||
<item name="tintColorBulletPointPositive">#77aa22</item>
|
||||
<item name="tintColorBulletPointNegative">#dd2222</item>
|
||||
|
||||
<item name="openpgp_black">#000</item>
|
||||
<item name="openpgp_orange">#FF8800</item>
|
||||
<item name="openpgp_red">#CC0000</item>
|
||||
<item name="openpgp_green">#669900</item>
|
||||
<item name="openpgp_blue">#336699</item>
|
||||
<item name="openpgp_grey">#bbb</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.K9.Dialog.Light" parent="Theme.K9.Light">
|
||||
|
|
Loading…
Reference in a new issue