mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 08:28:50 -05:00
More color/icon consistency
This commit is contained in:
parent
be9b483ee8
commit
4e1053c6fa
@ -24,6 +24,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -51,11 +52,10 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AbsListView.MultiChoiceModeListener;
|
import android.widget.AbsListView.MultiChoiceModeListener;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
@ -84,7 +84,6 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import edu.cmu.cylab.starslinger.exchange.ExchangeActivity;
|
import edu.cmu.cylab.starslinger.exchange.ExchangeActivity;
|
||||||
import edu.cmu.cylab.starslinger.exchange.ExchangeConfig;
|
import edu.cmu.cylab.starslinger.exchange.ExchangeConfig;
|
||||||
@ -585,18 +584,22 @@ public class KeyListFragment extends LoaderFragment
|
|||||||
TextView mMainUserIdRest;
|
TextView mMainUserIdRest;
|
||||||
ImageView mStatus;
|
ImageView mStatus;
|
||||||
View mSlinger;
|
View mSlinger;
|
||||||
|
ImageButton mSlingerButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||||
View view = mInflater.inflate(R.layout.key_list_item, parent, false);
|
View view = mInflater.inflate(R.layout.key_list_item, parent, false);
|
||||||
final ItemViewHolder holder = new ItemViewHolder();
|
final ItemViewHolder holder = new ItemViewHolder();
|
||||||
holder.mMainUserId = (TextView) view.findViewById(R.id.mainUserId);
|
holder.mMainUserId = (TextView) view.findViewById(R.id.key_list_item_name);
|
||||||
holder.mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
holder.mMainUserIdRest = (TextView) view.findViewById(R.id.key_list_item_email);
|
||||||
holder.mStatus = (ImageView) view.findViewById(R.id.status_icon);
|
holder.mStatus = (ImageView) view.findViewById(R.id.key_list_item_status_icon);
|
||||||
holder.mSlinger = view.findViewById(R.id.slinger_view);
|
holder.mSlinger = view.findViewById(R.id.key_list_item_slinger_view);
|
||||||
|
holder.mSlingerButton = (ImageButton) view.findViewById(R.id.key_list_item_slinger_button);
|
||||||
|
holder.mSlingerButton.setColorFilter(context.getResources().getColor(R.color.tertiary_text_light),
|
||||||
|
PorterDuff.Mode.SRC_IN);
|
||||||
view.setTag(holder);
|
view.setTag(holder);
|
||||||
view.findViewById(R.id.slinger_button).setOnClickListener(new OnClickListener() {
|
view.findViewById(R.id.key_list_item_slinger_button).setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (holder.mMasterKeyId != null) {
|
if (holder.mMasterKeyId != null) {
|
||||||
|
@ -21,6 +21,7 @@ import android.annotation.TargetApi;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -33,6 +34,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AlphaAnimation;
|
import android.view.animation.AlphaAnimation;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
private View mFingerprintClipboardButton;
|
private View mFingerprintClipboardButton;
|
||||||
private View mKeyShareButton;
|
private View mKeyShareButton;
|
||||||
private View mKeyClipboardButton;
|
private View mKeyClipboardButton;
|
||||||
private View mKeySafeSlingerButton;
|
private ImageButton mKeySafeSlingerButton;
|
||||||
private View mNfcHelpButton;
|
private View mNfcHelpButton;
|
||||||
private View mNfcPrefsButton;
|
private View mNfcPrefsButton;
|
||||||
private View mKeyUploadButton;
|
private View mKeyUploadButton;
|
||||||
@ -96,11 +98,14 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
mFingerprintClipboardButton = view.findViewById(R.id.view_key_action_fingerprint_clipboard);
|
mFingerprintClipboardButton = view.findViewById(R.id.view_key_action_fingerprint_clipboard);
|
||||||
mKeyShareButton = view.findViewById(R.id.view_key_action_key_share);
|
mKeyShareButton = view.findViewById(R.id.view_key_action_key_share);
|
||||||
mKeyClipboardButton = view.findViewById(R.id.view_key_action_key_clipboard);
|
mKeyClipboardButton = view.findViewById(R.id.view_key_action_key_clipboard);
|
||||||
mKeySafeSlingerButton = view.findViewById(R.id.view_key_action_key_safeslinger);
|
mKeySafeSlingerButton = (ImageButton) view.findViewById(R.id.view_key_action_key_safeslinger);
|
||||||
mNfcHelpButton = view.findViewById(R.id.view_key_action_nfc_help);
|
mNfcHelpButton = view.findViewById(R.id.view_key_action_nfc_help);
|
||||||
mNfcPrefsButton = view.findViewById(R.id.view_key_action_nfc_prefs);
|
mNfcPrefsButton = view.findViewById(R.id.view_key_action_nfc_prefs);
|
||||||
mKeyUploadButton = view.findViewById(R.id.view_key_action_upload);
|
mKeyUploadButton = view.findViewById(R.id.view_key_action_upload);
|
||||||
|
|
||||||
|
mKeySafeSlingerButton.setColorFilter(getResources().getColor(R.color.tertiary_text_light),
|
||||||
|
PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
mNfcPrefsButton.setVisibility(View.VISIBLE);
|
mNfcPrefsButton.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -152,7 +152,7 @@ abstract public class SelectKeyCursorAdapter extends CursorAdapter {
|
|||||||
View view = mInflater.inflate(R.layout.select_key_item, null);
|
View view = mInflater.inflate(R.layout.select_key_item, null);
|
||||||
ViewHolderItem holder = new ViewHolderItem();
|
ViewHolderItem holder = new ViewHolderItem();
|
||||||
holder.view = view;
|
holder.view = view;
|
||||||
holder.mainUserId = (TextView) view.findViewById(R.id.mainUserId);
|
holder.mainUserId = (TextView) view.findViewById(R.id.key_list_item_name);
|
||||||
holder.mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
holder.mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
||||||
holder.keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
|
holder.keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
|
||||||
holder.statusIcon = (ImageView) view.findViewById(R.id.status_icon);
|
holder.statusIcon = (ImageView) view.findViewById(R.id.status_icon);
|
||||||
|
@ -249,15 +249,11 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": " + context.getString(R.string.none));
|
vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": " + context.getString(R.string.none));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if key is expired or revoked, strike through text
|
// if key is expired or revoked...
|
||||||
boolean isInvalid = isRevoked || isExpired;
|
boolean isInvalid = isRevoked || isExpired;
|
||||||
if (isInvalid) {
|
if (isInvalid) {
|
||||||
vStatus.setVisibility(View.VISIBLE);
|
vStatus.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
vKeyId.setText(FormattingUtils.strikeOutText(vKeyId.getText()));
|
|
||||||
vKeyDetails.setText(FormattingUtils.strikeOutText(vKeyDetails.getText()));
|
|
||||||
vKeyExpiry.setText(FormattingUtils.strikeOutText(vKeyExpiry.getText()));
|
|
||||||
|
|
||||||
vCertifyIcon.setColorFilter(
|
vCertifyIcon.setColorFilter(
|
||||||
mContext.getResources().getColor(R.color.bg_gray),
|
mContext.getResources().getColor(R.color.bg_gray),
|
||||||
PorterDuff.Mode.SRC_IN);
|
PorterDuff.Mode.SRC_IN);
|
||||||
|
@ -166,13 +166,10 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
// set revocation icon (can this even be primary?)
|
// set revocation icon (can this even be primary?)
|
||||||
KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_REVOKED, true);
|
KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_REVOKED, true);
|
||||||
|
|
||||||
// disable and strike through text for revoked user ids
|
// disable revoked user ids
|
||||||
vName.setEnabled(false);
|
vName.setEnabled(false);
|
||||||
vAddress.setEnabled(false);
|
vAddress.setEnabled(false);
|
||||||
vComment.setEnabled(false);
|
vComment.setEnabled(false);
|
||||||
vName.setText(FormattingUtils.strikeOutText(vName.getText()));
|
|
||||||
vAddress.setText(FormattingUtils.strikeOutText(vAddress.getText()));
|
|
||||||
vComment.setText(FormattingUtils.strikeOutText(vComment.getText()));
|
|
||||||
} else {
|
} else {
|
||||||
vName.setEnabled(true);
|
vName.setEnabled(true);
|
||||||
vAddress.setEnabled(true);
|
vAddress.setEnabled(true);
|
||||||
|
@ -100,14 +100,14 @@
|
|||||||
android:text="@string/decrypt_invalid_text"
|
android:text="@string/decrypt_invalid_text"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textColor="@color/android_red_dark" />
|
android:textColor="@color/android_red_light" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/decrypt_text_invalid_button"
|
android:id="@+id/decrypt_text_invalid_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/button_edgy"
|
android:background="@drawable/button_edgy"
|
||||||
android:textColor="@color/android_red_dark"
|
android:textColor="@color/android_red_light"
|
||||||
android:text="@string/decrypt_invalid_button"
|
android:text="@string/decrypt_invalid_button"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_gravity="center_horizontal" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -22,14 +22,14 @@
|
|||||||
android:paddingBottom="4dp">
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/mainUserId"
|
android:id="@+id/key_list_item_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/label_main_user_id"
|
android:text="@string/label_main_user_id"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/mainUserIdRest"
|
android:id="@+id/key_list_item_email"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/slinger_view"
|
android:id="@+id/key_list_item_slinger_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -54,7 +54,7 @@
|
|||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/slinger_button"
|
android:id="@+id/key_list_item_slinger_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@ -65,7 +65,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/status_icon"
|
android:id="@+id/key_list_item_status_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
Loading…
Reference in New Issue
Block a user