remove support for "Comment" field

This commit is contained in:
Vincent Breitmoser
2016-08-25 14:54:11 +02:00
parent 6a80c51a59
commit a094730690
5 changed files with 6 additions and 37 deletions

View File

@@ -321,8 +321,7 @@ public class EditIdentitiesFragment extends Fragment
// pre-fill out primary name // pre-fill out primary name
String predefinedName = KeyRing.splitUserId(mPrimaryUserId).name; String predefinedName = KeyRing.splitUserId(mPrimaryUserId).name;
AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment.newInstance(messenger, AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment.newInstance(messenger, predefinedName);
predefinedName, false);
addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog"); addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
} }

View File

@@ -549,8 +549,7 @@ public class EditKeyFragment extends QueueingCryptoOperationFragment<SaveKeyring
// pre-fill out primary name // pre-fill out primary name
String predefinedName = KeyRing.splitUserId(mPrimaryUserId).name; String predefinedName = KeyRing.splitUserId(mPrimaryUserId).name;
AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment.newInstance(messenger, AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment.newInstance(messenger, predefinedName);
predefinedName, true);
addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog"); addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
} }

View File

@@ -210,8 +210,7 @@ public class ViewKeyAdvUserIdsFragment extends LoaderFragment implements
Messenger messenger = new Messenger(returnHandler); Messenger messenger = new Messenger(returnHandler);
// pre-fill out primary name // pre-fill out primary name
AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment addUserIdDialog = AddUserIdDialogFragment.newInstance(messenger, "");
AddUserIdDialogFragment.newInstance(messenger, "", true);
addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog"); addUserIdDialog.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
} }

View File

@@ -34,7 +34,6 @@ import android.view.View;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener;
@@ -49,7 +48,6 @@ import org.sufficientlysecure.keychain.util.Log;
public class AddUserIdDialogFragment extends DialogFragment implements OnEditorActionListener { public class AddUserIdDialogFragment extends DialogFragment implements OnEditorActionListener {
private static final String ARG_MESSENGER = "messenger"; private static final String ARG_MESSENGER = "messenger";
private static final String ARG_NAME = "name"; private static final String ARG_NAME = "name";
private static final String ARG_ALLOW_COMMENT = "allow_comment";
public static final int MESSAGE_OKAY = 1; public static final int MESSAGE_OKAY = 1;
public static final int MESSAGE_CANCEL = 2; public static final int MESSAGE_CANCEL = 2;
@@ -59,16 +57,13 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
private Messenger mMessenger; private Messenger mMessenger;
private NameEditText mName; private NameEditText mName;
private EmailEditText mEmail; private EmailEditText mEmail;
private EditText mComment;
public static AddUserIdDialogFragment newInstance(Messenger messenger, String predefinedName, public static AddUserIdDialogFragment newInstance(Messenger messenger, String predefinedName) {
boolean allowComment) {
AddUserIdDialogFragment frag = new AddUserIdDialogFragment(); AddUserIdDialogFragment frag = new AddUserIdDialogFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putParcelable(ARG_MESSENGER, messenger); args.putParcelable(ARG_MESSENGER, messenger);
args.putString(ARG_NAME, predefinedName); args.putString(ARG_NAME, predefinedName);
args.putBoolean(ARG_ALLOW_COMMENT, allowComment);
frag.setArguments(args); frag.setArguments(args);
return frag; return frag;
@@ -82,7 +77,6 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
final Activity activity = getActivity(); final Activity activity = getActivity();
mMessenger = getArguments().getParcelable(ARG_MESSENGER); mMessenger = getArguments().getParcelable(ARG_MESSENGER);
String predefinedName = getArguments().getString(ARG_NAME); String predefinedName = getArguments().getString(ARG_NAME);
boolean allowComment = getArguments().getBoolean(ARG_ALLOW_COMMENT);
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity); CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
@@ -94,13 +88,6 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
mName = (NameEditText) view.findViewById(R.id.add_user_id_name); mName = (NameEditText) view.findViewById(R.id.add_user_id_name);
mEmail = (EmailEditText) view.findViewById(R.id.add_user_id_address); mEmail = (EmailEditText) view.findViewById(R.id.add_user_id_address);
mComment = (EditText) view.findViewById(R.id.add_user_id_comment);
if (allowComment) {
mComment.setVisibility(View.VISIBLE);
} else {
mComment.setVisibility(View.GONE);
}
mName.setText(predefinedName); mName.setText(predefinedName);
@@ -111,8 +98,8 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
// return new user id back to activity // return new user id back to activity
Bundle data = new Bundle(); Bundle data = new Bundle();
String userId = KeyRing.createUserId(new OpenPgpUtils.UserId(mName.getText().toString(), String userId = KeyRing.createUserId(new OpenPgpUtils.UserId(
mEmail.getText().toString(), mComment.getText().toString())); mName.getText().toString(), mEmail.getText().toString(), null));
data.putString(MESSAGE_DATA_USER_ID, userId); data.putString(MESSAGE_DATA_USER_ID, userId);
sendMessageToHandler(MESSAGE_OKAY, data); sendMessageToHandler(MESSAGE_OKAY, data);
} }
@@ -145,9 +132,6 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
}); });
mEmail.requestFocus(); mEmail.requestFocus();
mComment.setImeActionLabel(getString(android.R.string.ok), EditorInfo.IME_ACTION_DONE);
mComment.setOnEditorActionListener(this);
return alert.show(); return alert.show();
} }

View File

@@ -25,16 +25,4 @@
android:hint="@string/create_key_hint_full_name" android:hint="@string/create_key_hint_full_name"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/add_user_id_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/colorTertiaryText"
android:singleLine="true"
android:lines="1"
android:maxLines="1"
android:imeOptions="actionDone"
android:hint="@string/label_comment"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout> </LinearLayout>