Use new icons in other key related activites, delete old icons
@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@ -37,6 +38,7 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
@ -64,7 +66,8 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
SelectSecretKeyLayoutFragment.SelectSecretKeyCallback, LoaderManager.LoaderCallbacks<Cursor> {
|
||||
private View mSignButton;
|
||||
private View mCertifyButton;
|
||||
private ImageView mActionCertifyImage;
|
||||
private CheckBox mUploadKeyCheckbox;
|
||||
private Spinner mSelectKeyserverSpinner;
|
||||
|
||||
@ -88,10 +91,19 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
|
||||
mSelectKeyFragment = (SelectSecretKeyLayoutFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.sign_key_select_key_fragment);
|
||||
mSelectKeyserverSpinner = (Spinner) findViewById(R.id.upload_key_keyserver);
|
||||
mUploadKeyCheckbox = (CheckBox) findViewById(R.id.sign_key_upload_checkbox);
|
||||
mCertifyButton = findViewById(R.id.certify_key_certify_button);
|
||||
mActionCertifyImage = (ImageView) findViewById(R.id.certify_key_action_certify_image);
|
||||
mUserIds = (ListView) findViewById(R.id.view_key_user_ids);
|
||||
|
||||
// make certify image gray, like action icons
|
||||
mActionCertifyImage.setColorFilter(getResources().getColor(R.color.tertiary_text_light),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
|
||||
mSelectKeyFragment.setCallback(this);
|
||||
mSelectKeyFragment.setFilterCertify(true);
|
||||
|
||||
mSelectKeyserverSpinner = (Spinner) findViewById(R.id.upload_key_keyserver);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
|
||||
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
|
||||
.getKeyServers()
|
||||
@ -99,7 +111,6 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
mSelectKeyserverSpinner.setAdapter(adapter);
|
||||
|
||||
mUploadKeyCheckbox = (CheckBox) findViewById(R.id.sign_key_upload_checkbox);
|
||||
if (!mUploadKeyCheckbox.isChecked()) {
|
||||
mSelectKeyserverSpinner.setEnabled(false);
|
||||
} else {
|
||||
@ -118,8 +129,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
}
|
||||
});
|
||||
|
||||
mSignButton = findViewById(R.id.sign_key_sign_button);
|
||||
mSignButton.setOnClickListener(new OnClickListener() {
|
||||
mCertifyButton.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -141,7 +151,6 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
}
|
||||
Log.e(Constants.TAG, "uri: " + mDataUri);
|
||||
|
||||
mUserIds = (ListView) findViewById(R.id.view_key_user_ids);
|
||||
|
||||
mUserIdsAdapter = new UserIdsAdapter(this, null, 0, true);
|
||||
mUserIds.setAdapter(mUserIdsAdapter);
|
||||
@ -230,7 +239,8 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
||||
startSigning();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
// bail out; need to wait until the user has entered the passphrase before trying again
|
||||
return;
|
||||
} else {
|
||||
|
@ -493,19 +493,19 @@ public class KeyListFragment extends LoaderFragment
|
||||
// Note: order is important!
|
||||
if (isRevoked) {
|
||||
h.mStatus.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.status_signature_revoked));
|
||||
getResources().getDrawable(R.drawable.status_signature_revoked_cutout));
|
||||
h.mStatus.setColorFilter(getResources().getColor(R.color.result_red),
|
||||
PorterDuff.Mode.SRC_ATOP);
|
||||
h.mStatus.setVisibility(View.VISIBLE);
|
||||
} else if (isExpired) {
|
||||
h.mStatus.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.status_signature_expired));
|
||||
getResources().getDrawable(R.drawable.status_signature_expired_cutout));
|
||||
h.mStatus.setColorFilter(getResources().getColor(R.color.result_orange),
|
||||
PorterDuff.Mode.SRC_ATOP);
|
||||
h.mStatus.setVisibility(View.VISIBLE);
|
||||
} else if (isVerified) {
|
||||
h.mStatus.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.status_signature_verified));
|
||||
getResources().getDrawable(R.drawable.status_signature_verified_cutout));
|
||||
h.mStatus.setColorFilter(getResources().getColor(R.color.result_green),
|
||||
PorterDuff.Mode.SRC_ATOP);
|
||||
h.mStatus.setVisibility(View.VISIBLE);
|
||||
|
@ -531,7 +531,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
||||
mStatusText.setText(R.string.view_key_revoked);
|
||||
mStatusText.setTextColor(getResources().getColor(R.color.result_red));
|
||||
mStatusImage.setImageDrawable(
|
||||
getResources().getDrawable(R.drawable.status_signature_revoked));
|
||||
getResources().getDrawable(R.drawable.status_signature_revoked_cutout));
|
||||
mStatusImage.setColorFilter(getResources().getColor(R.color.result_red),
|
||||
PorterDuff.Mode.SRC_ATOP);
|
||||
mStatusDivider.setVisibility(View.VISIBLE);
|
||||
|
@ -19,6 +19,8 @@ package org.sufficientlysecure.keychain.ui.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v4.widget.CursorAdapter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -156,7 +158,10 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
||||
|
||||
if (isRevoked) {
|
||||
// set revocation icon (can this even be primary?)
|
||||
vVerified.setImageResource(R.drawable.key_certify_revoke);
|
||||
vVerified.setImageResource(R.drawable.status_signature_revoked_cutout);
|
||||
vVerified.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.bg_gray),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
|
||||
// disable and strike through text for revoked user ids
|
||||
vName.setEnabled(false);
|
||||
@ -170,22 +175,33 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
||||
vAddress.setEnabled(true);
|
||||
vComment.setEnabled(true);
|
||||
|
||||
// verified: has been verified
|
||||
// isPrimary: show small star icon for primary user ids
|
||||
int verified = cursor.getInt(INDEX_VERIFIED);
|
||||
switch (verified) {
|
||||
if (isPrimary) {
|
||||
vName.setTypeface(null, Typeface.BOLD);
|
||||
vAddress.setTypeface(null, Typeface.BOLD);
|
||||
} else {
|
||||
vName.setTypeface(null, Typeface.NORMAL);
|
||||
vAddress.setTypeface(null, Typeface.NORMAL);
|
||||
}
|
||||
|
||||
int isVerified = cursor.getInt(INDEX_VERIFIED);
|
||||
switch (isVerified) {
|
||||
case Certs.VERIFIED_SECRET:
|
||||
vVerified.setImageResource(isPrimary
|
||||
? R.drawable.key_certify_primary_ok_depth0
|
||||
: R.drawable.key_certify_ok_depth0);
|
||||
vVerified.setImageResource(R.drawable.status_signature_verified_cutout);
|
||||
vVerified.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.result_green),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
break;
|
||||
case Certs.VERIFIED_SELF:
|
||||
vVerified.setImageResource(isPrimary
|
||||
? R.drawable.key_certify_primary_ok_self
|
||||
: R.drawable.key_certify_ok_self);
|
||||
vVerified.setImageResource(R.drawable.status_signature_unverified_cutout);
|
||||
vVerified.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.bg_gray),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
break;
|
||||
default:
|
||||
vVerified.setImageResource(R.drawable.key_certify_error);
|
||||
vVerified.setImageResource(R.drawable.status_signature_invalid_cutout);
|
||||
vVerified.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.result_red),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 898 B |
Before Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 757 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 652 B |
Before Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 884 B |
Before Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 627 B |
Before Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
@ -106,7 +106,6 @@
|
||||
style="@style/SectionHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:text="@string/section_uids_to_certify" />
|
||||
|
||||
@ -149,21 +148,35 @@
|
||||
android:text="@string/section_actions"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sign_key_sign_button"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
<LinearLayout
|
||||
android:id="@+id/certify_key_certify_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:clickable="true"
|
||||
android:paddingRight="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
style="@style/SelectableItem"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:paddingLeft="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/key_view_action_certify"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_action_good"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
style="@style/SelectableItem" />
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/certify_key_action_certify_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/status_signature_verified_cutout"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -35,21 +35,6 @@
|
||||
android:layout_height="1dip"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/view_key_action_certify"-->
|
||||
<!--android:paddingLeft="8dp"-->
|
||||
<!--android:paddingRight="8dp"-->
|
||||
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:text="@string/key_view_action_certify"-->
|
||||
<!--android:minHeight="?android:attr/listPreferredItemHeight"-->
|
||||
<!--android:drawableRight="@drawable/ic_action_good"-->
|
||||
<!--android:drawablePadding="8dp"-->
|
||||
<!--android:gravity="center_vertical"-->
|
||||
<!--android:clickable="true"-->
|
||||
<!--style="@style/SelectableItem" />-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/view_key_action_certify"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -64,9 +64,9 @@
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/edit_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/edit_image"
|
||||
android:src="@drawable/ic_action_edit"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|