Merge branch 'master' of github.com:open-keychain/open-keychain
@ -18,6 +18,9 @@
|
|||||||
package org.sufficientlysecure.keychain;
|
package org.sufficientlysecure.keychain;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import org.spongycastle.jce.provider.BouncyCastleProvider;
|
import org.spongycastle.jce.provider.BouncyCastleProvider;
|
||||||
@ -70,5 +73,22 @@ public class KeychainApplication extends Application {
|
|||||||
// that the directory doesn't exist at this point
|
// that the directory doesn't exist at this point
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
brandGlowEffect(getApplicationContext(),
|
||||||
|
getApplicationContext().getResources().getColor(R.color.emphasis));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void brandGlowEffect(Context context, int brandColor) {
|
||||||
|
// terrible hack to brand the edge overscroll glow effect
|
||||||
|
// https://gist.github.com/menny/7878762#file-brandgloweffect_full-java
|
||||||
|
|
||||||
|
//glow
|
||||||
|
int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
|
||||||
|
Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
|
||||||
|
androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
//edge
|
||||||
|
int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android");
|
||||||
|
Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId);
|
||||||
|
androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,9 @@ import android.support.v7.app.ActionBar;
|
|||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.TabsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.TabsAdapter;
|
||||||
|
import org.sufficientlysecure.keychain.util.SlidingTabLayout;
|
||||||
|
|
||||||
public class HelpActivity extends ActionBarActivity {
|
public class HelpActivity extends ActionBarActivity {
|
||||||
public static final String EXTRA_SELECTED_TAB = "selected_tab";
|
public static final String EXTRA_SELECTED_TAB = "selected_tab";
|
||||||
@ -37,25 +39,27 @@ public class HelpActivity extends ActionBarActivity {
|
|||||||
public static final int TAB_ABOUT = 5;
|
public static final int TAB_ABOUT = 5;
|
||||||
|
|
||||||
ViewPager mViewPager;
|
ViewPager mViewPager;
|
||||||
TabsAdapter mTabsAdapter;
|
private PagerTabStripAdapter mTabsAdapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.help_activity);
|
|
||||||
|
|
||||||
mViewPager = (ViewPager) findViewById(R.id.pager);
|
|
||||||
|
|
||||||
final ActionBar actionBar = getSupportActionBar();
|
final ActionBar actionBar = getSupportActionBar();
|
||||||
actionBar.setDisplayShowTitleEnabled(true);
|
actionBar.setDisplayShowTitleEnabled(true);
|
||||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||||
actionBar.setHomeButtonEnabled(false);
|
actionBar.setHomeButtonEnabled(false);
|
||||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
|
||||||
|
|
||||||
mTabsAdapter = new TabsAdapter(this, mViewPager);
|
setContentView(R.layout.help_activity);
|
||||||
|
|
||||||
int selectedTab = 0;
|
mViewPager = (ViewPager) findViewById(R.id.pager);
|
||||||
|
SlidingTabLayout slidingTabLayout =
|
||||||
|
(SlidingTabLayout) findViewById(R.id.sliding_tab_layout);
|
||||||
|
|
||||||
|
mTabsAdapter = new PagerTabStripAdapter(this);
|
||||||
|
mViewPager.setAdapter(mTabsAdapter);
|
||||||
|
|
||||||
|
int selectedTab = TAB_START;
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent.getExtras() != null && intent.getExtras().containsKey(EXTRA_SELECTED_TAB)) {
|
if (intent.getExtras() != null && intent.getExtras().containsKey(EXTRA_SELECTED_TAB)) {
|
||||||
selectedTab = intent.getExtras().getInt(EXTRA_SELECTED_TAB);
|
selectedTab = intent.getExtras().getInt(EXTRA_SELECTED_TAB);
|
||||||
@ -63,30 +67,36 @@ public class HelpActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
Bundle startBundle = new Bundle();
|
Bundle startBundle = new Bundle();
|
||||||
startBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_start);
|
startBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_start);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_start)),
|
mTabsAdapter.addTab(HelpHtmlFragment.class, startBundle,
|
||||||
HelpHtmlFragment.class, startBundle, (selectedTab == TAB_START));
|
getString(R.string.help_tab_start));
|
||||||
|
|
||||||
Bundle faqBundle = new Bundle();
|
Bundle faqBundle = new Bundle();
|
||||||
faqBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_faq);
|
faqBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_faq);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_faq)),
|
mTabsAdapter.addTab(HelpHtmlFragment.class, faqBundle,
|
||||||
HelpHtmlFragment.class, faqBundle, (selectedTab == TAB_FAQ));
|
getString(R.string.help_tab_faq));
|
||||||
|
|
||||||
Bundle wotBundle = new Bundle();
|
Bundle wotBundle = new Bundle();
|
||||||
wotBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_wot);
|
wotBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_wot);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_wot)),
|
mTabsAdapter.addTab(HelpHtmlFragment.class, wotBundle,
|
||||||
HelpHtmlFragment.class, wotBundle, (selectedTab == TAB_WOT));
|
getString(R.string.help_tab_wot));
|
||||||
|
|
||||||
Bundle nfcBundle = new Bundle();
|
Bundle nfcBundle = new Bundle();
|
||||||
nfcBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_nfc_beam);
|
nfcBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_nfc_beam);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_nfc_beam)),
|
mTabsAdapter.addTab(HelpHtmlFragment.class, nfcBundle,
|
||||||
HelpHtmlFragment.class, nfcBundle, (selectedTab == TAB_NFC));
|
getString(R.string.help_tab_nfc_beam));
|
||||||
|
|
||||||
Bundle changelogBundle = new Bundle();
|
Bundle changelogBundle = new Bundle();
|
||||||
changelogBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_changelog);
|
changelogBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_changelog);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_changelog)),
|
mTabsAdapter.addTab(HelpHtmlFragment.class, changelogBundle,
|
||||||
HelpHtmlFragment.class, changelogBundle, (selectedTab == TAB_CHANGELOG));
|
getString(R.string.help_tab_changelog));
|
||||||
|
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_about)),
|
mTabsAdapter.addTab(HelpAboutFragment.class, null,
|
||||||
HelpAboutFragment.class, null, (selectedTab == TAB_ABOUT));
|
getString(R.string.help_tab_about));
|
||||||
|
|
||||||
|
// NOTE: must be after adding the tabs!
|
||||||
|
slidingTabLayout.setViewPager(mViewPager);
|
||||||
|
|
||||||
|
// switch to tab selected by extra
|
||||||
|
mViewPager.setCurrentItem(selectedTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,6 +381,9 @@ public class KeyListFragment extends Fragment
|
|||||||
// Execute this when searching
|
// Execute this when searching
|
||||||
mSearchView.setOnQueryTextListener(this);
|
mSearchView.setOnQueryTextListener(this);
|
||||||
|
|
||||||
|
View searchPlate = mSearchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
|
||||||
|
searchPlate.setBackgroundResource(R.drawable.keychaintheme_searchview_holo_light);
|
||||||
|
|
||||||
// Erase search result without focus
|
// Erase search result without focus
|
||||||
MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
|
MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,6 +40,7 @@ import android.support.v7.app.ActionBar;
|
|||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
|
||||||
import com.devspark.appmsg.AppMsg;
|
import com.devspark.appmsg.AppMsg;
|
||||||
@ -55,6 +56,7 @@ import org.sufficientlysecure.keychain.util.Log;
|
|||||||
import org.sufficientlysecure.keychain.util.SlidingTabLayout;
|
import org.sufficientlysecure.keychain.util.SlidingTabLayout;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class ViewKeyActivity extends ActionBarActivity implements
|
public class ViewKeyActivity extends ActionBarActivity implements
|
||||||
@ -75,6 +77,9 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
private ViewPager mViewPager;
|
private ViewPager mViewPager;
|
||||||
private SlidingTabLayout mSlidingTabLayout;
|
private SlidingTabLayout mSlidingTabLayout;
|
||||||
private PagerTabStripAdapter mTabsAdapter;
|
private PagerTabStripAdapter mTabsAdapter;
|
||||||
|
private View mStatusDivider;
|
||||||
|
private View mStatusRevoked;
|
||||||
|
private View mStatusExpired;
|
||||||
|
|
||||||
public static final int REQUEST_CODE_LOOKUP_KEY = 0x00007006;
|
public static final int REQUEST_CODE_LOOKUP_KEY = 0x00007006;
|
||||||
|
|
||||||
@ -104,6 +109,10 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
|
|
||||||
setContentView(R.layout.view_key_activity);
|
setContentView(R.layout.view_key_activity);
|
||||||
|
|
||||||
|
mStatusDivider = findViewById(R.id.status_divider);
|
||||||
|
mStatusRevoked = findViewById(R.id.view_key_revoked);
|
||||||
|
mStatusExpired = findViewById(R.id.view_key_expired);
|
||||||
|
|
||||||
mViewPager = (ViewPager) findViewById(R.id.view_key_pager);
|
mViewPager = (ViewPager) findViewById(R.id.view_key_pager);
|
||||||
mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.view_key_sliding_tab_layout);
|
mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.view_key_sliding_tab_layout);
|
||||||
|
|
||||||
@ -363,10 +372,14 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
KeychainContract.KeyRings._ID,
|
KeychainContract.KeyRings._ID,
|
||||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||||
KeychainContract.KeyRings.USER_ID,
|
KeychainContract.KeyRings.USER_ID,
|
||||||
|
KeychainContract.KeyRings.IS_REVOKED,
|
||||||
|
KeychainContract.KeyRings.EXPIRY,
|
||||||
|
|
||||||
};
|
};
|
||||||
static final int INDEX_UNIFIED_MASTER_KEY_ID = 1;
|
static final int INDEX_UNIFIED_MASTER_KEY_ID = 1;
|
||||||
static final int INDEX_UNIFIED_USER_ID = 2;
|
static final int INDEX_UNIFIED_USER_ID = 2;
|
||||||
|
static final int INDEX_UNIFIED_IS_REVOKED = 3;
|
||||||
|
static final int INDEX_UNIFIED_EXPIRY = 4;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||||
@ -408,6 +421,24 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(masterKeyId);
|
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(masterKeyId);
|
||||||
getSupportActionBar().setSubtitle(keyIdStr);
|
getSupportActionBar().setSubtitle(keyIdStr);
|
||||||
|
|
||||||
|
// If this key is revoked, it cannot be used for anything!
|
||||||
|
if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) {
|
||||||
|
mStatusDivider.setVisibility(View.VISIBLE);
|
||||||
|
mStatusRevoked.setVisibility(View.VISIBLE);
|
||||||
|
mStatusExpired.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
mStatusRevoked.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000);
|
||||||
|
if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) {
|
||||||
|
mStatusDivider.setVisibility(View.VISIBLE);
|
||||||
|
mStatusExpired.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mStatusDivider.setVisibility(View.GONE);
|
||||||
|
mStatusExpired.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,8 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import com.devspark.appmsg.AppMsg;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;import org.sufficientlysecure.keychain.provider.KeychainContract;
|
import org.sufficientlysecure.keychain.R;import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
@ -49,8 +51,6 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
public static final String ARG_DATA_URI = "uri";
|
public static final String ARG_DATA_URI = "uri";
|
||||||
|
|
||||||
private LinearLayout mContainer;
|
private LinearLayout mContainer;
|
||||||
private View mStatusRevoked;
|
|
||||||
private View mStatusExpired;
|
|
||||||
private View mActionEdit;
|
private View mActionEdit;
|
||||||
private View mActionEditDivider;
|
private View mActionEditDivider;
|
||||||
private View mActionEncrypt;
|
private View mActionEncrypt;
|
||||||
@ -62,6 +62,9 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
private static final int LOADER_ID_UNIFIED = 0;
|
private static final int LOADER_ID_UNIFIED = 0;
|
||||||
private static final int LOADER_ID_USER_IDS = 1;
|
private static final int LOADER_ID_USER_IDS = 1;
|
||||||
|
|
||||||
|
// conservative attitude
|
||||||
|
private boolean mHasEncrypt = true;
|
||||||
|
|
||||||
private ViewKeyUserIdsAdapter mUserIdsAdapter;
|
private ViewKeyUserIdsAdapter mUserIdsAdapter;
|
||||||
|
|
||||||
private Uri mDataUri;
|
private Uri mDataUri;
|
||||||
@ -72,8 +75,6 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
|
|
||||||
mContainer = (LinearLayout) view.findViewById(R.id.container);
|
mContainer = (LinearLayout) view.findViewById(R.id.container);
|
||||||
mUserIds = (ListView) view.findViewById(R.id.view_key_user_ids);
|
mUserIds = (ListView) view.findViewById(R.id.view_key_user_ids);
|
||||||
mStatusRevoked = view.findViewById(R.id.view_key_revoked);
|
|
||||||
mStatusExpired = view.findViewById(R.id.view_key_expired);
|
|
||||||
mActionEdit = view.findViewById(R.id.view_key_action_edit);
|
mActionEdit = view.findViewById(R.id.view_key_action_edit);
|
||||||
mActionEditDivider = view.findViewById(R.id.view_key_action_edit_divider);
|
mActionEditDivider = view.findViewById(R.id.view_key_action_edit_divider);
|
||||||
mActionEncrypt = view.findViewById(R.id.view_key_action_encrypt);
|
mActionEncrypt = view.findViewById(R.id.view_key_action_encrypt);
|
||||||
@ -132,30 +133,14 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
static final String[] UNIFIED_PROJECTION = new String[]{
|
static final String[] UNIFIED_PROJECTION = new String[]{
|
||||||
KeyRings._ID, KeyRings.MASTER_KEY_ID, KeyRings.HAS_ANY_SECRET, KeyRings.IS_REVOKED,
|
KeyRings._ID, KeyRings.MASTER_KEY_ID,
|
||||||
KeyRings.USER_ID, KeyRings.FINGERPRINT,
|
KeyRings.HAS_ANY_SECRET, KeyRings.IS_REVOKED, KeyRings.EXPIRY, KeyRings.HAS_ENCRYPT
|
||||||
KeyRings.ALGORITHM, KeyRings.KEY_SIZE, KeyRings.CREATION, KeyRings.EXPIRY,
|
|
||||||
KeyRings.HAS_ENCRYPT
|
|
||||||
|
|
||||||
};
|
};
|
||||||
static final int INDEX_UNIFIED_MASTER_KEY_ID = 1;
|
static final int INDEX_UNIFIED_MASTER_KEY_ID = 1;
|
||||||
static final int INDEX_UNIFIED_HAS_ANY_SECRET = 2;
|
static final int INDEX_UNIFIED_HAS_ANY_SECRET = 2;
|
||||||
static final int INDEX_UNIFIED_IS_REVOKED = 3;
|
static final int INDEX_UNIFIED_IS_REVOKED = 3;
|
||||||
static final int INDEX_UNIFIED_USER_ID = 4;
|
static final int INDEX_UNIFIED_EXPIRY = 4;
|
||||||
static final int INDEX_UNIFIED_FINGERPRINT = 5;
|
static final int INDEX_UNIFIED_HAS_ENCRYPT = 5;
|
||||||
static final int INDEX_UNIFIED_ALGORITHM = 6;
|
|
||||||
static final int INDEX_UNIFIED_KEY_SIZE = 7;
|
|
||||||
static final int INDEX_UNIFIED_CREATION = 8;
|
|
||||||
static final int INDEX_UNIFIED_EXPIRY = 9;
|
|
||||||
static final int INDEX_UNIFIED_HAS_ENCRYPT = 10;
|
|
||||||
|
|
||||||
static final String[] KEYS_PROJECTION = new String[]{
|
|
||||||
Keys._ID,
|
|
||||||
Keys.KEY_ID, Keys.RANK, Keys.ALGORITHM, Keys.KEY_SIZE, Keys.HAS_SECRET,
|
|
||||||
Keys.CAN_CERTIFY, Keys.CAN_ENCRYPT, Keys.CAN_SIGN, Keys.IS_REVOKED,
|
|
||||||
Keys.CREATION, Keys.EXPIRY, Keys.FINGERPRINT
|
|
||||||
};
|
|
||||||
static final int KEYS_INDEX_CAN_ENCRYPT = 7;
|
|
||||||
|
|
||||||
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
@ -165,7 +150,8 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
case LOADER_ID_USER_IDS: {
|
case LOADER_ID_USER_IDS: {
|
||||||
Uri baseUri = UserIds.buildUserIdsUri(mDataUri);
|
Uri baseUri = UserIds.buildUserIdsUri(mDataUri);
|
||||||
return new CursorLoader(getActivity(), baseUri, ViewKeyUserIdsAdapter.USER_IDS_PROJECTION, null, null, null);
|
return new CursorLoader(getActivity(), baseUri,
|
||||||
|
ViewKeyUserIdsAdapter.USER_IDS_PROJECTION, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -206,9 +192,6 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
|
|
||||||
// If this key is revoked, it cannot be used for anything!
|
// If this key is revoked, it cannot be used for anything!
|
||||||
if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) {
|
if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) {
|
||||||
mStatusRevoked.setVisibility(View.VISIBLE);
|
|
||||||
mStatusExpired.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
mActionEdit.setEnabled(false);
|
mActionEdit.setEnabled(false);
|
||||||
mActionCertify.setEnabled(false);
|
mActionCertify.setEnabled(false);
|
||||||
mActionEncrypt.setEnabled(false);
|
mActionEncrypt.setEnabled(false);
|
||||||
@ -217,18 +200,16 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
|
|
||||||
Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000);
|
Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000);
|
||||||
if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) {
|
if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) {
|
||||||
mStatusRevoked.setVisibility(View.GONE);
|
|
||||||
mStatusExpired.setVisibility(View.VISIBLE);
|
|
||||||
mActionCertify.setEnabled(false);
|
mActionCertify.setEnabled(false);
|
||||||
mActionEncrypt.setEnabled(false);
|
mActionEncrypt.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
mStatusRevoked.setVisibility(View.GONE);
|
|
||||||
mStatusExpired.setVisibility(View.GONE);
|
|
||||||
mActionCertify.setEnabled(true);
|
mActionCertify.setEnabled(true);
|
||||||
mActionEncrypt.setEnabled(true);
|
mActionEncrypt.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mHasEncrypt = data.getInt(INDEX_UNIFIED_HAS_ENCRYPT) != 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,6 +236,11 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void encrypt(Uri dataUri) {
|
private void encrypt(Uri dataUri) {
|
||||||
|
// If there is no encryption key, don't bother.
|
||||||
|
if (!mHasEncrypt) {
|
||||||
|
AppMsg.makeText(getActivity(), R.string.error_no_encrypt_subkey, AppMsg.STYLE_ALERT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
long keyId = new ProviderHelper(getActivity()).extractOrGetMasterKeyId(dataUri);
|
long keyId = new ProviderHelper(getActivity()).extractOrGetMasterKeyId(dataUri);
|
||||||
long[] encryptionKeyIds = new long[]{keyId};
|
long[] encryptionKeyIds = new long[]{keyId};
|
||||||
|
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 467 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 306 B |
After Width: | Height: | Size: 324 B |
After Width: | Height: | Size: 613 B |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 911 B |
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2010 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true" android:drawable="@drawable/apptheme_fastscroll_thumb_pressed_holo" />
|
||||||
|
<item android:drawable="@drawable/apptheme_fastscroll_thumb_default_holo" />
|
||||||
|
</selector>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_focused="true"
|
||||||
|
android:drawable="@drawable/keychaintheme_textfield_activated_holo_light" />
|
||||||
|
<item android:drawable="@drawable/keychaintheme_textfield_default_holo_light" />
|
||||||
|
</selector>
|
@ -4,6 +4,11 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<org.sufficientlysecure.keychain.util.SlidingTabLayout
|
||||||
|
android:id="@+id/sliding_tab_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/pager"
|
android:id="@+id/pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/status_layout"
|
android:id="@+id/status_layout"
|
||||||
android:layout_width="80dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
@ -61,19 +61,20 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:src="@drawable/ic_action_edit"
|
android:src="@drawable/ic_action_edit"
|
||||||
android:text="@string/edit" />
|
android:text="@string/edit"
|
||||||
|
android:padding="12dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/revoked"
|
android:id="@+id/revoked"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="@string/revoked"
|
android:text="@string/revoked"
|
||||||
android:textColor="#e00"
|
android:textColor="#e00"
|
||||||
android:layout_gravity="center" />
|
android:layout_gravity="center"
|
||||||
|
android:padding="12dp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -81,7 +82,7 @@
|
|||||||
android:id="@+id/verified"
|
android:id="@+id/verified"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/key_certify_ok_depth0"
|
android:src="@drawable/key_certify_ok_depth0"
|
||||||
android:paddingLeft="25dp" />
|
android:padding="16dp" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -4,6 +4,37 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="This key is expired!"
|
||||||
|
android:id="@+id/view_key_expired"
|
||||||
|
android:textColor="@color/alert"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="This key has been revoked!"
|
||||||
|
android:id="@+id/view_key_revoked"
|
||||||
|
android:textColor="@color/alert"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dip"
|
||||||
|
android:background="?android:attr/listDivider"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/status_divider" />
|
||||||
|
|
||||||
<org.sufficientlysecure.keychain.util.SlidingTabLayout
|
<org.sufficientlysecure.keychain.util.SlidingTabLayout
|
||||||
android:id="@+id/view_key_sliding_tab_layout"
|
android:id="@+id/view_key_sliding_tab_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -16,28 +16,6 @@
|
|||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="This key is expired!"
|
|
||||||
android:id="@+id/view_key_expired"
|
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
|
||||||
android:textColor="@color/alert"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:gravity="center_vertical|center_horizontal"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="This key has been revoked!"
|
|
||||||
android:id="@+id/view_key_revoked"
|
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
|
||||||
android:textColor="@color/alert"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:gravity="center_vertical|center_horizontal"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/SectionHeader"
|
style="@style/SectionHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
android:focusable="false" />
|
android:focusable="false" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="22dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@ -25,7 +25,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/certified"
|
android:id="@+id/certified"
|
||||||
android:src="@drawable/key_certify_ok_self" />
|
android:src="@drawable/key_certify_ok_self"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Generated with http://android-holo-colors.com -->
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<style name="ButtonKeychainTheme" parent="android:Widget.Holo.Light.Button">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_btn_default_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ImageButtonKeychainTheme" parent="android:Widget.Holo.Light.ImageButton">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_btn_default_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SpinnerKeychainTheme" parent="android:Widget.Holo.Light.Spinner">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_spinner_background_holo_light</item>
|
|
||||||
<item name="android:dropDownSelector">@drawable/keychaintheme_list_selector_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ProgressBarKeychainTheme" parent="android:Widget.Holo.Light.ProgressBar.Horizontal">
|
|
||||||
<item name="android:progressDrawable">@drawable/keychaintheme_progress_horizontal_holo_light</item>
|
|
||||||
<item name="android:indeterminateDrawable">@drawable/keychaintheme_progress_indeterminate_horizontal_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Generated with http://android-holo-colors.com -->
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<style name="KeychainTheme" parent="@style/_KeychainTheme"/>
|
|
||||||
|
|
||||||
<style name="_KeychainTheme" parent="Theme.AppCompat.Light">
|
|
||||||
|
|
||||||
<item name="android:editTextBackground">@drawable/keychaintheme_edit_text_holo_light</item>
|
|
||||||
|
|
||||||
<item name="android:listChoiceIndicatorMultiple">@drawable/keychaintheme_btn_check_holo_light</item>
|
|
||||||
|
|
||||||
<item name="android:buttonStyle">@style/ButtonKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:imageButtonStyle">@style/ImageButtonKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:dropDownSpinnerStyle">@style/SpinnerKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:progressBarStyleHorizontal">@style/ProgressBarKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:listChoiceBackgroundIndicator">@drawable/keychaintheme_list_selector_holo_light</item>
|
|
||||||
|
|
||||||
<item name="android:activatedBackgroundIndicator">@drawable/keychaintheme_activated_background_holo_light</item>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="keychaintheme_color">#aa66cc</color>
|
|
||||||
</resources>
|
|
@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Generated with http://android-holo-colors.com -->
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<style name="EditTextKeychainTheme" parent="android:Widget.EditText">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_edit_text_holo_light</item>
|
|
||||||
<item name="android:textColor">#000000</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="CheckBoxKeychainTheme" parent="android:Widget.CompoundButton.CheckBox">
|
|
||||||
<item name="android:button">@drawable/keychaintheme_btn_check_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ButtonKeychainTheme" parent="android:Widget.Button">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_btn_default_holo_light</item>
|
|
||||||
<item name="android:minHeight">48dip</item>
|
|
||||||
<item name="android:minWidth">64dip</item>
|
|
||||||
<item name="android:textColor">#000000</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ImageButtonKeychainTheme" parent="android:Widget.ImageButton">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_btn_default_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SpinnerKeychainTheme" parent="android:Widget.Spinner">
|
|
||||||
<item name="android:background">@drawable/keychaintheme_spinner_background_holo_light</item>
|
|
||||||
<item name="android:dropDownSelector">@drawable/keychaintheme_list_selector_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SpinnerDropDownItemKeychainTheme" parent="android:Widget.DropDownItem.Spinner">
|
|
||||||
<item name="android:checkMark">@drawable/keychaintheme_btn_radio_holo_light</item>
|
|
||||||
</style>
|
|
||||||
<style name="ProgressBarKeychainTheme" parent="android:Widget.ProgressBar.Horizontal">
|
|
||||||
<item name="android:progressDrawable">@drawable/keychaintheme_progress_horizontal_holo_light</item>
|
|
||||||
<item name="android:indeterminateDrawable">@drawable/keychaintheme_progress_indeterminate_horizontal_holo_light</item>
|
|
||||||
<item name="android:minHeight">16dip</item>
|
|
||||||
<item name="android:maxHeight">16dip</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ListViewKeychainTheme" parent="android:Widget.ListView">
|
|
||||||
<item name="android:listSelector">@drawable/keychaintheme_list_selector_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ListViewKeychainTheme.White" parent="android:Widget.ListView.White">
|
|
||||||
<item name="android:listSelector">@drawable/keychaintheme_list_selector_holo_light</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SpinnerItemKeychainTheme" parent="android:TextAppearance.Widget.TextView.SpinnerItem">
|
|
||||||
<item name="android:textColor">#000000</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Generated with http://android-holo-colors.com -->
|
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<style name="KeychainTheme" parent="@style/_KeychainTheme"/>
|
|
||||||
|
|
||||||
<style name="_KeychainTheme" parent="Theme.AppCompat.Light">
|
|
||||||
|
|
||||||
<item name="android:editTextStyle">@style/EditTextKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:checkboxStyle">@style/CheckBoxKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:buttonStyle">@style/ButtonKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:imageButtonStyle">@style/ImageButtonKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:spinnerStyle">@style/SpinnerKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItemKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:progressBarStyleHorizontal">@style/ProgressBarKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:listViewStyle">@style/ListViewKeychainTheme</item>
|
|
||||||
|
|
||||||
<item name="android:listViewWhiteStyle">@style/ListViewKeychainTheme.White</item>
|
|
||||||
|
|
||||||
<item name="android:spinnerItemStyle">@style/SpinnerItemKeychainTheme</item>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
<item name="android:activatedBackgroundIndicator">@drawable/keychaintheme_activated_background_holo_light</item>
|
<item name="android:activatedBackgroundIndicator">@drawable/keychaintheme_activated_background_holo_light</item>
|
||||||
|
|
||||||
|
<item name="android:fastScrollThumbDrawable">@drawable/apptheme_fastscroll_thumb_holo</item>
|
||||||
|
|
||||||
|
<item name="android:selectableItemBackground">@drawable/keychaintheme_list_selector_holo_light</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -513,5 +513,6 @@
|
|||||||
<string name="title_view_cert">View Certificate Details</string>
|
<string name="title_view_cert">View Certificate Details</string>
|
||||||
<string name="unknown_algorithm">unknown</string>
|
<string name="unknown_algorithm">unknown</string>
|
||||||
<string name="can_sign_not">cannot sign</string>
|
<string name="can_sign_not">cannot sign</string>
|
||||||
|
<string name="error_no_encrypt_subkey">No encryption subkey available!</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|