diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-06-24 22:58:28 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-06-24 22:58:28 +0200 |
commit | a1bcbe72a3c52d416b3dfe5c0cc96b65739641ed (patch) | |
tree | d223d91cce63dc938de8cff00934703479b4df94 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java | |
parent | bfd9de4721ab16c4f362a0294ea248813ff810cd (diff) | |
download | open-keychain-a1bcbe72a3c52d416b3dfe5c0cc96b65739641ed.tar.gz open-keychain-a1bcbe72a3c52d416b3dfe5c0cc96b65739641ed.tar.bz2 open-keychain-a1bcbe72a3c52d416b3dfe5c0cc96b65739641ed.zip |
new edit key: first version to add user ids
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java index ac4390eac..3f330ee94 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java @@ -27,6 +27,7 @@ import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.support.v7.app.ActionBarActivity; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -45,6 +46,7 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter; import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter; +import org.sufficientlysecure.keychain.ui.adapter.UserIdsArrayAdapter; import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment; @@ -68,6 +70,7 @@ public class EditKeyFragment extends LoaderFragment implements private UserIdsAdapter mUserIdsAdapter; private SubkeysAdapter mKeysAdapter; + private UserIdsArrayAdapter mUserIdsAddedAdapter; private Uri mDataUri; @@ -180,6 +183,10 @@ public class EditKeyFragment extends LoaderFragment implements } }); + mUserIdsAddedAdapter = new UserIdsArrayAdapter(getActivity()); + mUserIdsAddedList.setAdapter(mUserIdsAddedAdapter); + mUserIdsAddedAdapter.setData(mSaveKeyringParcel.addUserIds); + mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0); mKeysList.setAdapter(mKeysAdapter); @@ -321,9 +328,17 @@ public class EditKeyFragment extends LoaderFragment implements Handler returnHandler = new Handler() { @Override public void handleMessage(Message message) { - if (message.what == AddUserIdDialogFragment.MESSAGE_OK) { + switch (message.what) { + case AddUserIdDialogFragment.MESSAGE_OKAY: + Bundle data = message.getData(); + String userId = data.getString(AddUserIdDialogFragment.MESSAGE_DATA_USER_ID); + if (userId != null) { + mSaveKeyringParcel.addUserIds.add(userId); + mUserIdsAddedAdapter.setData(mSaveKeyringParcel.addUserIds); + } } + getLoaderManager().getLoader(LOADER_ID_USER_IDS).forceLoad(); } }; @@ -345,5 +360,4 @@ public class EditKeyFragment extends LoaderFragment implements // TODO } - } |