mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-23 15:38:50 -05:00
Manage my keys wizard
This commit is contained in:
parent
0bcc2793c3
commit
98817d13ee
@ -86,16 +86,10 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.FirstTimeActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name=".ui.CreateKeyActivity"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:label="@string/title_create_key"
|
||||
android:label="@string/title_manage_my_keys"
|
||||
android:parentActivityName=".ui.MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
|
@ -22,6 +22,7 @@ import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -29,12 +30,67 @@ public class CreateKeyActivity extends BaseActivity {
|
||||
|
||||
public static final String EXTRA_NAME = "name";
|
||||
public static final String EXTRA_EMAIL = "email";
|
||||
public static final String EXTRA_FIRST_TIME = "first_time";
|
||||
public static final String EXTRA_ADDITIONAL_EMAILS = "additional_emails";
|
||||
public static final String EXTRA_PASSPHRASE = "passphrase";
|
||||
|
||||
public class State {
|
||||
String name;
|
||||
String email;
|
||||
ArrayList<String> additionalEmails;
|
||||
char[] passphrase;
|
||||
public static final String FRAGMENT_TAG = "currentFragment";
|
||||
|
||||
String mName;
|
||||
String mEmail;
|
||||
ArrayList<String> mAdditionalEmails;
|
||||
Passphrase mPassphrase;
|
||||
boolean mFirstTime;
|
||||
|
||||
Fragment mCurrentFragment;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Check whether we're recreating a previously destroyed instance
|
||||
if (savedInstanceState != null) {
|
||||
// Restore value of members from saved state
|
||||
mName = savedInstanceState.getString(EXTRA_NAME);
|
||||
mEmail = savedInstanceState.getString(EXTRA_EMAIL);
|
||||
mAdditionalEmails = savedInstanceState.getStringArrayList(EXTRA_ADDITIONAL_EMAILS);
|
||||
mPassphrase = savedInstanceState.getParcelable(EXTRA_PASSPHRASE);
|
||||
mFirstTime = savedInstanceState.getBoolean(EXTRA_FIRST_TIME);
|
||||
|
||||
mCurrentFragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
|
||||
} else {
|
||||
// Initialize members with default values for a new instance
|
||||
mName = getIntent().getStringExtra(EXTRA_NAME);
|
||||
mEmail = getIntent().getStringExtra(EXTRA_EMAIL);
|
||||
mFirstTime = getIntent().getBooleanExtra(EXTRA_FIRST_TIME, false);
|
||||
|
||||
// Start with first fragment of wizard
|
||||
CreateKeyStartFragment frag = CreateKeyStartFragment.newInstance();
|
||||
loadFragment(frag, FragAction.START);
|
||||
}
|
||||
|
||||
if (mFirstTime) {
|
||||
setTitle(R.string.app_name);
|
||||
setActionBarIcon(R.drawable.ic_launcher);
|
||||
} else {
|
||||
setTitle(R.string.title_manage_my_keys);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
outState.putString(EXTRA_NAME, mName);
|
||||
outState.putString(EXTRA_EMAIL, mEmail);
|
||||
outState.putStringArrayList(EXTRA_ADDITIONAL_EMAILS, mAdditionalEmails);
|
||||
outState.putParcelable(EXTRA_PASSPHRASE, mPassphrase);
|
||||
outState.putBoolean(EXTRA_FIRST_TIME, mFirstTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.create_key_activity);
|
||||
}
|
||||
|
||||
public static enum FragAction {
|
||||
@ -43,41 +99,17 @@ public class CreateKeyActivity extends BaseActivity {
|
||||
TO_LEFT
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// pass extras into fragment
|
||||
CreateKeyNameFragment frag =
|
||||
CreateKeyNameFragment.newInstance(
|
||||
getIntent().getStringExtra(EXTRA_NAME),
|
||||
getIntent().getStringExtra(EXTRA_EMAIL)
|
||||
);
|
||||
loadFragment(savedInstanceState, frag, FragAction.START);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.create_key_activity);
|
||||
}
|
||||
|
||||
public void loadFragment(Bundle savedInstanceState, Fragment fragment, FragAction action) {
|
||||
// However, if we're being restored from a previous state,
|
||||
// then we don't need to do anything and should return or else
|
||||
// we could end up with overlapping fragments.
|
||||
if (savedInstanceState != null) {
|
||||
return;
|
||||
}
|
||||
public void loadFragment(Fragment fragment, FragAction action) {
|
||||
mCurrentFragment = fragment;
|
||||
|
||||
// Add the fragment to the 'fragment_container' FrameLayout
|
||||
// NOTE: We use commitAllowingStateLoss() to prevent weird crashes!
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
switch (action) {
|
||||
case START:
|
||||
transaction.setCustomAnimations(0, 0);
|
||||
transaction.replace(R.id.create_key_fragment_container, fragment)
|
||||
.commitAllowingStateLoss();
|
||||
transaction.replace(R.id.create_key_fragment_container, fragment, FRAGMENT_TAG)
|
||||
.commit();
|
||||
break;
|
||||
case TO_LEFT:
|
||||
getSupportFragmentManager().popBackStackImmediate();
|
||||
@ -86,8 +118,8 @@ public class CreateKeyActivity extends BaseActivity {
|
||||
transaction.setCustomAnimations(R.anim.frag_slide_in_from_right, R.anim.frag_slide_out_to_left,
|
||||
R.anim.frag_slide_in_from_left, R.anim.frag_slide_out_to_right);
|
||||
transaction.addToBackStack(null);
|
||||
transaction.replace(R.id.create_key_fragment_container, fragment)
|
||||
.commitAllowingStateLoss();
|
||||
transaction.replace(R.id.create_key_fragment_container, fragment, FRAGMENT_TAG)
|
||||
.commit();
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -46,16 +46,12 @@ import java.util.List;
|
||||
|
||||
public class CreateKeyEmailFragment extends Fragment {
|
||||
|
||||
public static final String ARG_NAME = "name";
|
||||
public static final String ARG_EMAIL = "email";
|
||||
|
||||
CreateKeyActivity mCreateKeyActivity;
|
||||
EmailEditText mEmailEdit;
|
||||
RecyclerView mEmailsRecyclerView;
|
||||
View mBackButton;
|
||||
View mNextButton;
|
||||
|
||||
String mName;
|
||||
ArrayList<EmailAdapter.ViewModel> mAdditionalEmailModels;
|
||||
|
||||
EmailAdapter mEmailAdapter;
|
||||
@ -63,13 +59,10 @@ public class CreateKeyEmailFragment extends Fragment {
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateKeyEmailFragment newInstance(String name, String email) {
|
||||
public static CreateKeyEmailFragment newInstance() {
|
||||
CreateKeyEmailFragment frag = new CreateKeyEmailFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_NAME, name);
|
||||
args.putString(ARG_EMAIL, email);
|
||||
|
||||
frag.setArguments(args);
|
||||
|
||||
return frag;
|
||||
@ -106,31 +99,33 @@ public class CreateKeyEmailFragment extends Fragment {
|
||||
mEmailsRecyclerView = (RecyclerView) view.findViewById(R.id.create_key_emails);
|
||||
|
||||
// initial values
|
||||
mName = getArguments().getString(ARG_NAME);
|
||||
String email = getArguments().getString(ARG_EMAIL);
|
||||
mEmailEdit.setText(email);
|
||||
mEmailEdit.setText(mCreateKeyActivity.mEmail);
|
||||
|
||||
// focus empty edit fields
|
||||
if (email == null) {
|
||||
if (mCreateKeyActivity.mEmail == null) {
|
||||
mEmailEdit.requestFocus();
|
||||
}
|
||||
mBackButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCreateKeyActivity.loadFragment(null, null, FragAction.TO_LEFT);
|
||||
mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT);
|
||||
}
|
||||
});
|
||||
mNextButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
createKeyCheck();
|
||||
nextClicked();
|
||||
}
|
||||
});
|
||||
mEmailsRecyclerView.setHasFixedSize(true);
|
||||
mEmailsRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mEmailsRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||
|
||||
// initial values
|
||||
mAdditionalEmailModels = new ArrayList<>();
|
||||
if (mCreateKeyActivity.mAdditionalEmails != null) {
|
||||
setAdditionalEmails(mCreateKeyActivity.mAdditionalEmails);
|
||||
}
|
||||
mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -171,25 +166,38 @@ public class CreateKeyEmailFragment extends Fragment {
|
||||
mCreateKeyActivity = (CreateKeyActivity) getActivity();
|
||||
}
|
||||
|
||||
private void createKeyCheck() {
|
||||
private void nextClicked() {
|
||||
if (isEditTextNotEmpty(getActivity(), mEmailEdit)) {
|
||||
// save state
|
||||
mCreateKeyActivity.mEmail = mEmailEdit.getText().toString();
|
||||
mCreateKeyActivity.mAdditionalEmails = getAdditionalEmails();
|
||||
|
||||
ArrayList<String> emails = new ArrayList<>();
|
||||
for (EmailAdapter.ViewModel holder : mAdditionalEmailModels) {
|
||||
emails.add(holder.toString());
|
||||
}
|
||||
|
||||
CreateKeyPassphraseFragment frag =
|
||||
CreateKeyPassphraseFragment.newInstance(
|
||||
mName,
|
||||
mEmailEdit.getText().toString(),
|
||||
emails
|
||||
);
|
||||
|
||||
mCreateKeyActivity.loadFragment(null, frag, FragAction.TO_RIGHT);
|
||||
CreateKeyPassphraseFragment frag = CreateKeyPassphraseFragment.newInstance();
|
||||
mCreateKeyActivity.loadFragment(frag, FragAction.TO_RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> getAdditionalEmails() {
|
||||
ArrayList<String> emails = new ArrayList<>();
|
||||
for (EmailAdapter.ViewModel holder : mAdditionalEmailModels) {
|
||||
emails.add(holder.toString());
|
||||
}
|
||||
return emails;
|
||||
}
|
||||
|
||||
private void setAdditionalEmails(ArrayList<String> emails) {
|
||||
for (String email : emails) {
|
||||
mAdditionalEmailModels.add(new EmailAdapter.ViewModel(email));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
// save state in activity
|
||||
mCreateKeyActivity.mAdditionalEmails = getAdditionalEmails();
|
||||
}
|
||||
|
||||
public static class EmailAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
private List<ViewModel> mDataset;
|
||||
private View.OnClickListener mFooterOnClickListener;
|
||||
|
@ -65,32 +65,15 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
TextView mEditText;
|
||||
View mEditButton;
|
||||
|
||||
public static final String ARG_NAME = "name";
|
||||
public static final String ARG_EMAIL = "email";
|
||||
public static final String ARG_ADDITIONAL_EMAILS = "emails";
|
||||
public static final String ARG_PASSPHRASE = "passphrase";
|
||||
|
||||
String mName;
|
||||
String mEmail;
|
||||
ArrayList<String> mAdditionalEmails;
|
||||
Passphrase mPassphrase;
|
||||
|
||||
SaveKeyringParcel mSaveKeyringParcel;
|
||||
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateKeyFinalFragment newInstance(String name, String email,
|
||||
ArrayList<String> additionalEmails,
|
||||
Passphrase passphrase) {
|
||||
public static CreateKeyFinalFragment newInstance() {
|
||||
CreateKeyFinalFragment frag = new CreateKeyFinalFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_NAME, name);
|
||||
args.putString(ARG_EMAIL, email);
|
||||
args.putStringArrayList(ARG_ADDITIONAL_EMAILS, additionalEmails);
|
||||
args.putParcelable(ARG_PASSPHRASE, passphrase);
|
||||
|
||||
frag.setArguments(args);
|
||||
|
||||
return frag;
|
||||
@ -108,17 +91,11 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
mEditText = (TextView) view.findViewById(R.id.create_key_edit_text);
|
||||
mEditButton = view.findViewById(R.id.create_key_edit_button);
|
||||
|
||||
// get args
|
||||
mName = getArguments().getString(ARG_NAME);
|
||||
mEmail = getArguments().getString(ARG_EMAIL);
|
||||
mAdditionalEmails = getArguments().getStringArrayList(ARG_ADDITIONAL_EMAILS);
|
||||
mPassphrase = getArguments().getParcelable(ARG_PASSPHRASE);
|
||||
|
||||
// set values
|
||||
mNameEdit.setText(mName);
|
||||
if (mAdditionalEmails != null && mAdditionalEmails.size() > 0) {
|
||||
String emailText = mEmail + ", ";
|
||||
Iterator<?> it = mAdditionalEmails.iterator();
|
||||
mNameEdit.setText(mCreateKeyActivity.mName);
|
||||
if (mCreateKeyActivity.mAdditionalEmails != null && mCreateKeyActivity.mAdditionalEmails.size() > 0) {
|
||||
String emailText = mCreateKeyActivity.mEmail + ", ";
|
||||
Iterator<?> it = mCreateKeyActivity.mAdditionalEmails.iterator();
|
||||
while (it.hasNext()) {
|
||||
Object next = it.next();
|
||||
emailText += next;
|
||||
@ -128,7 +105,7 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
}
|
||||
mEmailEdit.setText(emailText);
|
||||
} else {
|
||||
mEmailEdit.setText(mEmail);
|
||||
mEmailEdit.setText(mCreateKeyActivity.mEmail);
|
||||
}
|
||||
|
||||
mCreateButton.setOnClickListener(new View.OnClickListener() {
|
||||
@ -141,7 +118,7 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
mBackButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCreateKeyActivity.loadFragment(null, null, FragAction.TO_LEFT);
|
||||
mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT);
|
||||
}
|
||||
});
|
||||
|
||||
@ -157,6 +134,12 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
mCreateKeyActivity = (CreateKeyActivity) getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
@ -187,17 +170,22 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
Algorithm.RSA, 4096, null, KeyFlags.SIGN_DATA, 0L));
|
||||
mSaveKeyringParcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(
|
||||
Algorithm.RSA, 4096, null, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, 0L));
|
||||
String userId = KeyRing.createUserId(new KeyRing.UserId(mName, mEmail, null));
|
||||
String userId = KeyRing.createUserId(
|
||||
new KeyRing.UserId(mCreateKeyActivity.mName, mCreateKeyActivity.mEmail, null)
|
||||
);
|
||||
mSaveKeyringParcel.mAddUserIds.add(userId);
|
||||
mSaveKeyringParcel.mChangePrimaryUserId = userId;
|
||||
if (mAdditionalEmails != null && mAdditionalEmails.size() > 0) {
|
||||
for (String email : mAdditionalEmails) {
|
||||
String thisUserId = KeyRing.createUserId(new KeyRing.UserId(mName, email, null));
|
||||
if (mCreateKeyActivity.mAdditionalEmails != null
|
||||
&& mCreateKeyActivity.mAdditionalEmails.size() > 0) {
|
||||
for (String email : mCreateKeyActivity.mAdditionalEmails) {
|
||||
String thisUserId = KeyRing.createUserId(
|
||||
new KeyRing.UserId(mCreateKeyActivity.mName, email, null)
|
||||
);
|
||||
mSaveKeyringParcel.mAddUserIds.add(thisUserId);
|
||||
}
|
||||
}
|
||||
mSaveKeyringParcel.mNewUnlock = mPassphrase != null
|
||||
? new ChangeUnlockParcel(mPassphrase, null)
|
||||
mSaveKeyringParcel.mNewUnlock = mCreateKeyActivity.mPassphrase != null
|
||||
? new ChangeUnlockParcel(mCreateKeyActivity.mPassphrase, null)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
@ -24,34 +24,26 @@ import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.ui.CreateKeyActivity.FragAction;
|
||||
import org.sufficientlysecure.keychain.ui.widget.EmailEditText;
|
||||
import org.sufficientlysecure.keychain.ui.widget.NameEditText;
|
||||
|
||||
public class CreateKeyNameFragment extends Fragment {
|
||||
|
||||
public static final String ARG_NAME = "name";
|
||||
public static final String ARG_EMAIL = "email";
|
||||
|
||||
CreateKeyActivity mCreateKeyActivity;
|
||||
NameEditText mNameEdit;
|
||||
View mBackButton;
|
||||
View mNextButton;
|
||||
|
||||
String mEmail;
|
||||
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateKeyNameFragment newInstance(String name, String email) {
|
||||
public static CreateKeyNameFragment newInstance() {
|
||||
CreateKeyNameFragment frag = new CreateKeyNameFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_NAME, name);
|
||||
args.putString(ARG_EMAIL, email);
|
||||
|
||||
frag.setArguments(args);
|
||||
|
||||
@ -84,21 +76,26 @@ public class CreateKeyNameFragment extends Fragment {
|
||||
View view = inflater.inflate(R.layout.create_key_name_fragment, container, false);
|
||||
|
||||
mNameEdit = (NameEditText) view.findViewById(R.id.create_key_name);
|
||||
mBackButton = view.findViewById(R.id.create_key_back_button);
|
||||
mNextButton = view.findViewById(R.id.create_key_next_button);
|
||||
|
||||
// initial values
|
||||
String name = getArguments().getString(ARG_NAME);
|
||||
mEmail = getArguments().getString(ARG_EMAIL);
|
||||
mNameEdit.setText(name);
|
||||
mNameEdit.setText(mCreateKeyActivity.mName);
|
||||
|
||||
// focus empty edit fields
|
||||
if (name == null) {
|
||||
if (mCreateKeyActivity.mName == null) {
|
||||
mNameEdit.requestFocus();
|
||||
}
|
||||
mBackButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT);
|
||||
}
|
||||
});
|
||||
mNextButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
createKeyCheck();
|
||||
nextClicked();
|
||||
}
|
||||
});
|
||||
|
||||
@ -111,16 +108,13 @@ public class CreateKeyNameFragment extends Fragment {
|
||||
mCreateKeyActivity = (CreateKeyActivity) getActivity();
|
||||
}
|
||||
|
||||
private void createKeyCheck() {
|
||||
private void nextClicked() {
|
||||
if (isEditTextNotEmpty(getActivity(), mNameEdit)) {
|
||||
// save state
|
||||
mCreateKeyActivity.mName = mNameEdit.getText().toString();
|
||||
|
||||
CreateKeyEmailFragment frag =
|
||||
CreateKeyEmailFragment.newInstance(
|
||||
mNameEdit.getText().toString(),
|
||||
mEmail
|
||||
);
|
||||
|
||||
mCreateKeyActivity.loadFragment(null, frag, FragAction.TO_RIGHT);
|
||||
CreateKeyEmailFragment frag = CreateKeyEmailFragment.newInstance();
|
||||
mCreateKeyActivity.loadFragment(frag, FragAction.TO_RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.method.HideReturnsTransformationMethod;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.view.LayoutInflater;
|
||||
@ -37,18 +38,10 @@ import org.sufficientlysecure.keychain.ui.widget.PassphraseEditText;
|
||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class CreateKeyPassphraseFragment extends Fragment {
|
||||
|
||||
public static final String ARG_NAME = "name";
|
||||
public static final String ARG_EMAIL = "email";
|
||||
public static final String ARG_ADDITIONAL_EMAILS = "emails";
|
||||
|
||||
// model
|
||||
String mName;
|
||||
String mEmail;
|
||||
ArrayList<String> mAdditionalEmails;
|
||||
|
||||
// view
|
||||
CreateKeyActivity mCreateKeyActivity;
|
||||
PassphraseEditText mPassphraseEdit;
|
||||
@ -60,15 +53,10 @@ public class CreateKeyPassphraseFragment extends Fragment {
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateKeyPassphraseFragment newInstance(String name, String email,
|
||||
ArrayList<String> additionalEmails) {
|
||||
public static CreateKeyPassphraseFragment newInstance() {
|
||||
CreateKeyPassphraseFragment frag = new CreateKeyPassphraseFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_NAME, name);
|
||||
args.putString(ARG_EMAIL, email);
|
||||
args.putStringArrayList(ARG_ADDITIONAL_EMAILS, additionalEmails);
|
||||
|
||||
frag.setArguments(args);
|
||||
|
||||
return frag;
|
||||
@ -121,9 +109,12 @@ public class CreateKeyPassphraseFragment extends Fragment {
|
||||
mNextButton = view.findViewById(R.id.create_key_next_button);
|
||||
|
||||
// initial values
|
||||
mName = getArguments().getString(ARG_NAME);
|
||||
mEmail = getArguments().getString(ARG_EMAIL);
|
||||
mAdditionalEmails = getArguments().getStringArrayList(ARG_ADDITIONAL_EMAILS);
|
||||
// TODO: using String here is unsafe...
|
||||
if (mCreateKeyActivity.mPassphrase != null) {
|
||||
mPassphraseEdit.setText(Arrays.toString(mCreateKeyActivity.mPassphrase.getCharArray()));
|
||||
mPassphraseEditAgain.setText(Arrays.toString(mCreateKeyActivity.mPassphrase.getCharArray()));
|
||||
}
|
||||
|
||||
mPassphraseEdit.requestFocus();
|
||||
mBackButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -134,7 +125,7 @@ public class CreateKeyPassphraseFragment extends Fragment {
|
||||
mNextButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
createKeyCheck();
|
||||
nextClicked();
|
||||
}
|
||||
});
|
||||
mShowPassphrase.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@ -162,23 +153,19 @@ public class CreateKeyPassphraseFragment extends Fragment {
|
||||
|
||||
private void back() {
|
||||
hideKeyboard();
|
||||
mCreateKeyActivity.loadFragment(null, null, FragAction.TO_LEFT);
|
||||
mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT);
|
||||
}
|
||||
|
||||
private void createKeyCheck() {
|
||||
private void nextClicked() {
|
||||
if (isEditTextNotEmpty(getActivity(), mPassphraseEdit)
|
||||
&& areEditTextsEqual(getActivity(), mPassphraseEdit, mPassphraseEditAgain)) {
|
||||
|
||||
CreateKeyFinalFragment frag =
|
||||
CreateKeyFinalFragment.newInstance(
|
||||
mName,
|
||||
mEmail,
|
||||
mAdditionalEmails,
|
||||
new Passphrase(mPassphraseEdit.getText())
|
||||
);
|
||||
// save state
|
||||
mCreateKeyActivity.mPassphrase = new Passphrase(mPassphraseEdit);
|
||||
|
||||
CreateKeyFinalFragment frag = CreateKeyFinalFragment.newInstance();
|
||||
hideKeyboard();
|
||||
mCreateKeyActivity.loadFragment(null, frag, FragAction.TO_RIGHT);
|
||||
mCreateKeyActivity.loadFragment(frag, FragAction.TO_RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.sufficientlysecure.keychain.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.DefaultItemAnimator;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.sufficientlysecure.keychain.Constants;
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.ui.CreateKeyActivity.FragAction;
|
||||
import org.sufficientlysecure.keychain.ui.dialog.AddEmailDialogFragment;
|
||||
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
||||
import org.sufficientlysecure.keychain.ui.widget.EmailEditText;
|
||||
import org.sufficientlysecure.keychain.util.Log;
|
||||
import org.sufficientlysecure.keychain.util.Preferences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CreateKeyStartFragment extends Fragment {
|
||||
|
||||
CreateKeyActivity mCreateKeyActivity;
|
||||
|
||||
View mCreateKey;
|
||||
View mImportKey;
|
||||
View mYubiKey;
|
||||
TextView mCancel;
|
||||
public static final int REQUEST_CODE_CREATE_OR_IMPORT_KEY = 0x00007012;
|
||||
|
||||
/**
|
||||
* Creates new instance of this fragment
|
||||
*/
|
||||
public static CreateKeyStartFragment newInstance() {
|
||||
CreateKeyStartFragment frag = new CreateKeyStartFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
frag.setArguments(args);
|
||||
|
||||
return frag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.create_key_start_fragment, container, false);
|
||||
|
||||
mCreateKey = view.findViewById(R.id.create_key_create_key_button);
|
||||
mImportKey = view.findViewById(R.id.create_key_import_button);
|
||||
// mYubiKey = view.findViewById(R.id.create_key_yubikey_button);
|
||||
mCancel = (TextView) view.findViewById(R.id.create_key_cancel);
|
||||
|
||||
if (mCreateKeyActivity.mFirstTime) {
|
||||
mCancel.setText(R.string.first_time_skip);
|
||||
} else {
|
||||
mCancel.setText(R.string.btn_do_not_save);
|
||||
}
|
||||
|
||||
mCreateKey.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CreateKeyNameFragment frag = CreateKeyNameFragment.newInstance();
|
||||
mCreateKeyActivity.loadFragment(frag, FragAction.TO_RIGHT);
|
||||
}
|
||||
});
|
||||
|
||||
mImportKey.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(mCreateKeyActivity, ImportKeysActivity.class);
|
||||
intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN);
|
||||
startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY);
|
||||
}
|
||||
});
|
||||
|
||||
mCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finishSetup(null);
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
private void finishSetup(Intent srcData) {
|
||||
if (mCreateKeyActivity.mFirstTime) {
|
||||
Preferences prefs = Preferences.getPreferences(mCreateKeyActivity);
|
||||
prefs.setFirstTime(false);
|
||||
}
|
||||
Intent intent = new Intent(mCreateKeyActivity, MainActivity.class);
|
||||
// give intent through to display notify
|
||||
if (srcData != null) {
|
||||
intent.putExtras(srcData);
|
||||
}
|
||||
startActivity(intent);
|
||||
mCreateKeyActivity.finish();
|
||||
}
|
||||
|
||||
// workaround for https://code.google.com/p/android/issues/detail?id=61394
|
||||
// @Override
|
||||
// public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
// return keyCode == KeyEvent.KEYCODE_MENU || super.onKeyDown(keyCode, event);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == REQUEST_CODE_CREATE_OR_IMPORT_KEY) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
finishSetup(data);
|
||||
}
|
||||
} else {
|
||||
Log.e(Constants.TAG, "No valid request code!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
mCreateKeyActivity = (CreateKeyActivity) getActivity();
|
||||
}
|
||||
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.sufficientlysecure.keychain.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import org.sufficientlysecure.keychain.Constants;
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.util.Log;
|
||||
import org.sufficientlysecure.keychain.util.Preferences;
|
||||
|
||||
public class FirstTimeActivity extends BaseActivity {
|
||||
|
||||
View mCreateKey;
|
||||
View mImportKey;
|
||||
View mSkipSetup;
|
||||
|
||||
public static final int REQUEST_CODE_CREATE_OR_IMPORT_KEY = 0x00007012;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mCreateKey = findViewById(R.id.first_time_create_key);
|
||||
mImportKey = findViewById(R.id.first_time_import_key);
|
||||
mSkipSetup = findViewById(R.id.first_time_cancel);
|
||||
|
||||
mSkipSetup.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finishSetup(null);
|
||||
}
|
||||
});
|
||||
|
||||
mImportKey.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(FirstTimeActivity.this, ImportKeysActivity.class);
|
||||
intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN);
|
||||
startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY);
|
||||
}
|
||||
});
|
||||
|
||||
mCreateKey.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(FirstTimeActivity.this, CreateKeyActivity.class);
|
||||
startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
setContentView(R.layout.first_time_activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == REQUEST_CODE_CREATE_OR_IMPORT_KEY) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
finishSetup(data);
|
||||
}
|
||||
} else {
|
||||
Log.e(Constants.TAG, "No valid request code!");
|
||||
}
|
||||
}
|
||||
|
||||
private void finishSetup(Intent srcData) {
|
||||
Preferences prefs = Preferences.getPreferences(this);
|
||||
prefs.setFirstTime(false);
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
// give intent through to display notify
|
||||
if (srcData != null) {
|
||||
intent.putExtras(srcData);
|
||||
}
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
// workaround for https://code.google.com/p/android/issues/detail?id=61394
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return keyCode == KeyEvent.KEYCODE_MENU || super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
}
|
@ -489,7 +489,8 @@ public class KeyListFragment extends LoaderFragment
|
||||
case R.id.menu_key_list_debug_first_time:
|
||||
Preferences prefs = Preferences.getPreferences(getActivity());
|
||||
prefs.setFirstTime(true);
|
||||
Intent intent = new Intent(getActivity(), FirstTimeActivity.class);
|
||||
Intent intent = new Intent(getActivity(), CreateKeyActivity.class);
|
||||
intent.putExtra(CreateKeyActivity.EXTRA_FIRST_TIME, true);
|
||||
startActivity(intent);
|
||||
getActivity().finish();
|
||||
return true;
|
||||
|
@ -54,7 +54,9 @@ public class MainActivity extends MaterialNavigationDrawer implements FabContain
|
||||
// if this is the first time show first time activity
|
||||
Preferences prefs = Preferences.getPreferences(this);
|
||||
if (prefs.isFirstTime()) {
|
||||
startActivity(new Intent(this, FirstTimeActivity.class));
|
||||
Intent intent = new Intent(this, CreateKeyActivity.class);
|
||||
intent.putExtra(CreateKeyActivity.EXTRA_FIRST_TIME, true);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
@ -58,9 +58,10 @@ public class EmailEditText extends AutoCompleteTextView {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
this.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
|
||||
this.addTextChangedListener(textWatcher);
|
||||
removeFlag();
|
||||
setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
|
||||
reenableKeyboardSuggestions();
|
||||
|
||||
addTextChangedListener(textWatcher);
|
||||
initAdapter();
|
||||
}
|
||||
|
||||
@ -104,7 +105,7 @@ public class EmailEditText extends AutoCompleteTextView {
|
||||
* Hack to re-enable keyboard auto correction in AutoCompleteTextView.
|
||||
* From http://stackoverflow.com/a/22512858
|
||||
*/
|
||||
private void removeFlag() {
|
||||
private void reenableKeyboardSuggestions() {
|
||||
int inputType = getInputType();
|
||||
inputType &= ~EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
|
||||
setRawInputType(inputType);
|
||||
|
@ -50,7 +50,7 @@ public class NameEditText extends AutoCompleteTextView {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
removeFlag();
|
||||
reenableKeyboardSuggestions();
|
||||
initAdapter();
|
||||
}
|
||||
|
||||
@ -62,10 +62,10 @@ public class NameEditText extends AutoCompleteTextView {
|
||||
}
|
||||
|
||||
/**
|
||||
* Hack to re-enable keyboard auto correction in AutoCompleteTextView.
|
||||
* Hack to re-enable keyboard suggestions in AutoCompleteTextView.
|
||||
* From http://stackoverflow.com/a/22512858
|
||||
*/
|
||||
private void removeFlag() {
|
||||
private void reenableKeyboardSuggestions() {
|
||||
int inputType = getInputType();
|
||||
inputType &= ~EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
|
||||
setRawInputType(inputType);
|
||||
|
@ -56,11 +56,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btn_back"
|
||||
android:textAllCaps="true"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableLeft="@drawable/ic_chevron_left_grey_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="left|center_vertical"
|
||||
android:clickable="false"
|
||||
android:clickable="true"
|
||||
style="?android:attr/borderlessButtonStyle" />
|
||||
|
||||
<TextView
|
||||
|
104
OpenKeychain/src/main/res/layout/create_key_start_fragment.xml
Normal file
104
OpenKeychain/src/main/res/layout/create_key_start_fragment.xml
Normal file
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_above="@+id/create_key_buttons">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/first_time_1"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="@color/holo_gray_bright"
|
||||
android:id="@+id/create_key_buttons">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_key_create_key_button"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/first_time_create_key"
|
||||
android:textAllCaps="true"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_chevron_right_grey_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="right|center_vertical"
|
||||
android:clickable="true"
|
||||
style="?android:attr/borderlessButtonStyle" />
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/create_key_yubikey_button"-->
|
||||
<!--android:paddingLeft="16dp"-->
|
||||
<!--android:paddingRight="16dp"-->
|
||||
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_weight="1"-->
|
||||
<!--android:text="@string/first_time_yubikey"-->
|
||||
<!--android:textAllCaps="true"-->
|
||||
<!--android:minHeight="?android:attr/listPreferredItemHeight"-->
|
||||
<!--android:drawableRight="@drawable/ic_chevron_right_grey_24dp"-->
|
||||
<!--android:drawablePadding="8dp"-->
|
||||
<!--android:gravity="right|center_vertical"-->
|
||||
<!--android:clickable="true"-->
|
||||
<!--style="?android:attr/borderlessButtonStyle" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_key_import_button"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/first_time_import_key"
|
||||
android:textAllCaps="true"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_chevron_right_grey_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="right|center_vertical"
|
||||
android:clickable="true"
|
||||
style="?android:attr/borderlessButtonStyle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_key_cancel"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btn_do_not_save"
|
||||
android:textAllCaps="true"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_close_grey_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="right|center_vertical"
|
||||
android:clickable="true"
|
||||
style="?android:attr/borderlessButtonStyle" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
@ -1,137 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/statusbar_height" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/first_time_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dip"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/first_time_import_key"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/first_time_import_key"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_folder_grey_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:background="?android:selectableItemBackground" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/first_time_create_key"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/first_time_create_key"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:drawableRight="@drawable/ic_key_plus_grey600_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:background="?android:selectableItemBackground" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dip"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/first_time_cancel"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/first_time_skip"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/status_bar"
|
||||
android:layout_above="@+id/first_time_buttons">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:text="@string/app_name"
|
||||
android:drawableLeft="@drawable/ic_launcher"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/first_time_1"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="64dp"
|
||||
android:layout_marginRight="64dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/first_time_text1"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -16,7 +16,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_key_list_create"
|
||||
android:title="@string/menu_create_key"
|
||||
android:title="@string/menu_manage_keys"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
|
@ -71,7 +71,7 @@
|
||||
<string name="menu_help">Nápověda</string>
|
||||
<string name="menu_export_key">Exportovat do souboru</string>
|
||||
<string name="menu_delete_key">Smazat klíč</string>
|
||||
<string name="menu_create_key">Vytvořit moje klíče</string>
|
||||
<string name="menu_manage_keys">Vytvořit moje klíče</string>
|
||||
<string name="menu_import_existing_key">Importovat ze souboru</string>
|
||||
<string name="menu_search">Hledat</string>
|
||||
<string name="menu_beam_preferences">Beam settings</string>
|
||||
|
@ -88,7 +88,7 @@
|
||||
<string name="menu_help">Hilfe</string>
|
||||
<string name="menu_export_key">In Datei exportieren</string>
|
||||
<string name="menu_delete_key">Schlüssel löschen</string>
|
||||
<string name="menu_create_key">Erzeuge meinen Schlüssel</string>
|
||||
<string name="menu_manage_keys">Erzeuge meinen Schlüssel</string>
|
||||
<string name="menu_import_existing_key">Von Datei importieren</string>
|
||||
<string name="menu_search">Suchen</string>
|
||||
<string name="menu_nfc_preferences">NFC-Einstellungen</string>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<string name="menu_help">Ayuda</string>
|
||||
<string name="menu_export_key">Exportar hacia archivo</string>
|
||||
<string name="menu_delete_key">Borrar clave</string>
|
||||
<string name="menu_create_key">Crear mi clave</string>
|
||||
<string name="menu_manage_keys">Crear mi clave</string>
|
||||
<string name="menu_import_existing_key">Importar desde fichero</string>
|
||||
<string name="menu_search">Buscar</string>
|
||||
<string name="menu_nfc_preferences">Configuraciones NFC</string>
|
||||
|
@ -76,7 +76,7 @@
|
||||
<string name="menu_help">Laguntza</string>
|
||||
<string name="menu_export_key">Esportatu agirira</string>
|
||||
<string name="menu_delete_key">Ezabatu giltza</string>
|
||||
<string name="menu_create_key">Sortu nire giltza</string>
|
||||
<string name="menu_manage_keys">Sortu nire giltza</string>
|
||||
<string name="menu_import_existing_key">inportatu agiritik</string>
|
||||
<string name="menu_search">Bilatu</string>
|
||||
<string name="menu_nfc_preferences">NFC ezarpenak</string>
|
||||
|
@ -70,7 +70,7 @@
|
||||
<string name="menu_help">Apua</string>
|
||||
<string name="menu_export_key">Vie tiedostoon</string>
|
||||
<string name="menu_delete_key">Poista avain</string>
|
||||
<string name="menu_create_key">Luo minun avaimeni</string>
|
||||
<string name="menu_manage_keys">Luo minun avaimeni</string>
|
||||
<string name="menu_import_existing_key">Tuo tiedostosta</string>
|
||||
<string name="menu_search">Etsi</string>
|
||||
<string name="menu_beam_preferences">Beam asetukset</string>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<string name="menu_help">Aide</string>
|
||||
<string name="menu_export_key">Exporter vers un fichier</string>
|
||||
<string name="menu_delete_key">Supprimer la clef</string>
|
||||
<string name="menu_create_key">Créer ma clef</string>
|
||||
<string name="menu_manage_keys">Créer ma clef</string>
|
||||
<string name="menu_import_existing_key">Importer depuis un fichier</string>
|
||||
<string name="menu_search">Rechercher</string>
|
||||
<string name="menu_nfc_preferences">Paramètres NFC</string>
|
||||
|
@ -69,7 +69,7 @@
|
||||
<string name="menu_help">Aiuto</string>
|
||||
<string name="menu_export_key">Esporta su un file</string>
|
||||
<string name="menu_delete_key">Cancella chiave</string>
|
||||
<string name="menu_create_key">Crea mia chiave</string>
|
||||
<string name="menu_manage_keys">Crea mia chiave</string>
|
||||
<string name="menu_import_existing_key">Importa da file</string>
|
||||
<string name="menu_search">Cerca</string>
|
||||
<string name="menu_beam_preferences">Impostazioni Beam</string>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<string name="menu_help">ヘルプ</string>
|
||||
<string name="menu_export_key">ファイルへのエクスポート</string>
|
||||
<string name="menu_delete_key">鍵の削除</string>
|
||||
<string name="menu_create_key">自分の鍵の生成</string>
|
||||
<string name="menu_manage_keys">自分の鍵の生成</string>
|
||||
<string name="menu_import_existing_key">ファイルからインポート</string>
|
||||
<string name="menu_search">検索</string>
|
||||
<string name="menu_nfc_preferences">NFC設定</string>
|
||||
|
@ -96,7 +96,7 @@
|
||||
<string name="menu_help">Help</string>
|
||||
<string name="menu_export_key">Exporteren naar bestand</string>
|
||||
<string name="menu_delete_key">Sleutel verwijderen</string>
|
||||
<string name="menu_create_key">Mijn sleutel aanmaken</string>
|
||||
<string name="menu_manage_keys">Mijn sleutel aanmaken</string>
|
||||
<string name="menu_import_existing_key">Importeren van bestand</string>
|
||||
<string name="menu_search">Zoeken</string>
|
||||
<string name="menu_nfc_preferences">NFC-instellingen</string>
|
||||
|
@ -78,7 +78,7 @@
|
||||
<string name="menu_help">Pomoc</string>
|
||||
<string name="menu_export_key">Eksportuj do pliku</string>
|
||||
<string name="menu_delete_key">Usuń klucz</string>
|
||||
<string name="menu_create_key">Utwórz mój klucz</string>
|
||||
<string name="menu_manage_keys">Utwórz mój klucz</string>
|
||||
<string name="menu_import_existing_key">Importuj z pliku</string>
|
||||
<string name="menu_search">Szukaj</string>
|
||||
<string name="menu_beam_preferences">Ustawienia Beam</string>
|
||||
|
@ -85,7 +85,7 @@
|
||||
<string name="menu_help">Помощь</string>
|
||||
<string name="menu_export_key">Экспорт в файл</string>
|
||||
<string name="menu_delete_key">Удалить ключ</string>
|
||||
<string name="menu_create_key">Создать свой ключ</string>
|
||||
<string name="menu_manage_keys">Создать свой ключ</string>
|
||||
<string name="menu_import_existing_key">Импорт из файла</string>
|
||||
<string name="menu_search">Поиск</string>
|
||||
<string name="menu_nfc_preferences">Настройки NFC</string>
|
||||
|
@ -75,7 +75,7 @@
|
||||
<string name="menu_help">Pomoč</string>
|
||||
<string name="menu_export_key">Izvozi v datoteko</string>
|
||||
<string name="menu_delete_key">Izbriši ključ</string>
|
||||
<string name="menu_create_key">Ustvari zasebni ključ</string>
|
||||
<string name="menu_manage_keys">Ustvari zasebni ključ</string>
|
||||
<string name="menu_import_existing_key">Uvozi iz datoteke</string>
|
||||
<string name="menu_search">Išči</string>
|
||||
<string name="menu_beam_preferences">Nastavitve Beam</string>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<string name="menu_help">Помоћ</string>
|
||||
<string name="menu_export_key">Извези у фајл</string>
|
||||
<string name="menu_delete_key">Обриши кључ</string>
|
||||
<string name="menu_create_key">Направи ми кључ</string>
|
||||
<string name="menu_manage_keys">Направи ми кључ</string>
|
||||
<string name="menu_import_existing_key">Увези из фајла</string>
|
||||
<string name="menu_search">Претрага</string>
|
||||
<string name="menu_nfc_preferences">НФЦ поставке</string>
|
||||
|
@ -78,7 +78,7 @@
|
||||
<string name="menu_help">Hjälp</string>
|
||||
<string name="menu_export_key">Exportera till fil</string>
|
||||
<string name="menu_delete_key">Radera nyckel</string>
|
||||
<string name="menu_create_key">Skapa min nyckel</string>
|
||||
<string name="menu_manage_keys">Skapa min nyckel</string>
|
||||
<string name="menu_import_existing_key">Importera från fil</string>
|
||||
<string name="menu_search">Sök</string>
|
||||
<string name="menu_beam_preferences">Beam-inställningar</string>
|
||||
|
@ -69,7 +69,7 @@
|
||||
<string name="menu_help">Yardım</string>
|
||||
<string name="menu_export_key">Dosyaya ver</string>
|
||||
<string name="menu_delete_key">Anahtar sil</string>
|
||||
<string name="menu_create_key">Anahtarımı oluştur</string>
|
||||
<string name="menu_manage_keys">Anahtarımı oluştur</string>
|
||||
<string name="menu_import_existing_key">Dosyadan al</string>
|
||||
<string name="menu_search">Ara</string>
|
||||
<string name="menu_beam_preferences">NFC ayarları</string>
|
||||
|
@ -69,7 +69,7 @@
|
||||
<string name="menu_help">Довідка</string>
|
||||
<string name="menu_export_key">Експорт до файлу</string>
|
||||
<string name="menu_delete_key">Вилучити ключ</string>
|
||||
<string name="menu_create_key">Створити мій ключ</string>
|
||||
<string name="menu_manage_keys">Створити мій ключ</string>
|
||||
<string name="menu_import_existing_key">Імпорт з файлу</string>
|
||||
<string name="menu_search">Пошук</string>
|
||||
<string name="menu_beam_preferences">Налаштування променя</string>
|
||||
|
@ -65,7 +65,7 @@
|
||||
<string name="menu_help">說明</string>
|
||||
<string name="menu_export_key">匯出到檔案</string>
|
||||
<string name="menu_delete_key">刪除金鑰</string>
|
||||
<string name="menu_create_key">建立金鑰</string>
|
||||
<string name="menu_manage_keys">建立金鑰</string>
|
||||
<string name="menu_import_existing_key">從檔案匯入</string>
|
||||
<string name="menu_search">搜尋</string>
|
||||
<string name="menu_beam_preferences">Beam 設定</string>
|
||||
|
@ -57,7 +57,7 @@
|
||||
<string name="menu_help">帮助</string>
|
||||
<string name="menu_export_key">导出密钥</string>
|
||||
<string name="menu_delete_key">删除密钥</string>
|
||||
<string name="menu_create_key">创建密钥</string>
|
||||
<string name="menu_manage_keys">创建密钥</string>
|
||||
<string name="menu_search">搜索</string>
|
||||
<string name="menu_beam_preferences">参数</string>
|
||||
<string name="menu_key_edit_cancel">取消</string>
|
||||
|
@ -44,6 +44,7 @@
|
||||
<string name="title_keys">"Keys"</string>
|
||||
<string name="title_delete_secret_key">"Delete YOUR key '%s'?"</string>
|
||||
<string name="title_export_log">"Export Log"</string>
|
||||
<string name="title_manage_my_keys">"Manage my keys"</string>
|
||||
|
||||
<!-- section -->
|
||||
<string name="section_user_ids">"Identities"</string>
|
||||
@ -106,7 +107,7 @@
|
||||
<string name="menu_help">"Help"</string>
|
||||
<string name="menu_export_key">"Export to file"</string>
|
||||
<string name="menu_delete_key">"Delete key"</string>
|
||||
<string name="menu_create_key">"Create my key"</string>
|
||||
<string name="menu_manage_keys">"Manage my keys"</string>
|
||||
<string name="menu_import_existing_key">"Import from file"</string>
|
||||
<string name="menu_search">"Search"</string>
|
||||
<string name="menu_nfc_preferences">"NFC settings"</string>
|
||||
@ -1197,8 +1198,9 @@
|
||||
|
||||
<!-- First Time -->
|
||||
<string name="first_time_text1">"Take back your privacy with OpenKeychain!"</string>
|
||||
<string name="first_time_create_key">"Create my key"</string>
|
||||
<string name="first_time_import_key">"Import from file"</string>
|
||||
<string name="first_time_create_key">"Create my key (recommended)"</string>
|
||||
<string name="first_time_import_key">"Import key from file"</string>
|
||||
<string name="first_time_yubikey">"Use YubiKey NEO"</string>
|
||||
<string name="first_time_skip">"Skip Setup"</string>
|
||||
|
||||
<!-- unsorted -->
|
||||
|
Loading…
Reference in New Issue
Block a user