Edit key: adding user ids
This commit is contained in:
@@ -49,7 +49,6 @@ import java.util.Date;
|
|||||||
* convenience.
|
* convenience.
|
||||||
*/
|
*/
|
||||||
public class PassphraseCacheService extends Service {
|
public class PassphraseCacheService extends Service {
|
||||||
public static final String TAG = Constants.TAG + ": PassphraseCacheService";
|
|
||||||
|
|
||||||
public static final String ACTION_PASSPHRASE_CACHE_ADD = Constants.INTENT_PREFIX
|
public static final String ACTION_PASSPHRASE_CACHE_ADD = Constants.INTENT_PREFIX
|
||||||
+ "PASSPHRASE_CACHE_ADD";
|
+ "PASSPHRASE_CACHE_ADD";
|
||||||
@@ -83,7 +82,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
* @param passphrase
|
* @param passphrase
|
||||||
*/
|
*/
|
||||||
public static void addCachedPassphrase(Context context, long keyId, String passphrase) {
|
public static void addCachedPassphrase(Context context, long keyId, String passphrase) {
|
||||||
Log.d(TAG, "cacheNewPassphrase() for " + keyId);
|
Log.d(Constants.TAG, "PassphraseCacheService.cacheNewPassphrase() for " + keyId);
|
||||||
|
|
||||||
Intent intent = new Intent(context, PassphraseCacheService.class);
|
Intent intent = new Intent(context, PassphraseCacheService.class);
|
||||||
intent.setAction(ACTION_PASSPHRASE_CACHE_ADD);
|
intent.setAction(ACTION_PASSPHRASE_CACHE_ADD);
|
||||||
@@ -103,7 +102,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
* @return passphrase or null (if no passphrase is cached for this keyId)
|
* @return passphrase or null (if no passphrase is cached for this keyId)
|
||||||
*/
|
*/
|
||||||
public static String getCachedPassphrase(Context context, long keyId) {
|
public static String getCachedPassphrase(Context context, long keyId) {
|
||||||
Log.d(TAG, "getCachedPassphrase() get masterKeyId for " + keyId);
|
Log.d(Constants.TAG, "PassphraseCacheService.getCachedPassphrase() get masterKeyId for " + keyId);
|
||||||
|
|
||||||
Intent intent = new Intent(context, PassphraseCacheService.class);
|
Intent intent = new Intent(context, PassphraseCacheService.class);
|
||||||
intent.setAction(ACTION_PASSPHRASE_CACHE_GET);
|
intent.setAction(ACTION_PASSPHRASE_CACHE_GET);
|
||||||
@@ -159,7 +158,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
private String getCachedPassphraseImpl(long keyId) {
|
private String getCachedPassphraseImpl(long keyId) {
|
||||||
// passphrase for symmetric encryption?
|
// passphrase for symmetric encryption?
|
||||||
if (keyId == Constants.key.symmetric) {
|
if (keyId == Constants.key.symmetric) {
|
||||||
Log.d(TAG, "getCachedPassphraseImpl() for symmetric encryption");
|
Log.d(Constants.TAG, "PassphraseCacheService.getCachedPassphraseImpl() for symmetric encryption");
|
||||||
String cachedPassphrase = mPassphraseCache.get(Constants.key.symmetric);
|
String cachedPassphrase = mPassphraseCache.get(Constants.key.symmetric);
|
||||||
if (cachedPassphrase == null) {
|
if (cachedPassphrase == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -170,7 +169,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
|
|
||||||
// try to get master key id which is used as an identifier for cached passphrases
|
// try to get master key id which is used as an identifier for cached passphrases
|
||||||
try {
|
try {
|
||||||
Log.d(TAG, "getCachedPassphraseImpl() for masterKeyId " + keyId);
|
Log.d(Constants.TAG, "PassphraseCacheService.getCachedPassphraseImpl() for masterKeyId " + keyId);
|
||||||
WrappedSecretKeyRing key = new ProviderHelper(this).getWrappedSecretKeyRing(
|
WrappedSecretKeyRing key = new ProviderHelper(this).getWrappedSecretKeyRing(
|
||||||
KeychainContract.KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(keyId));
|
KeychainContract.KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(keyId));
|
||||||
// no passphrase needed? just add empty string and return it, then
|
// no passphrase needed? just add empty string and return it, then
|
||||||
@@ -184,18 +183,18 @@ public class PassphraseCacheService extends Service {
|
|||||||
// get cached passphrase
|
// get cached passphrase
|
||||||
String cachedPassphrase = mPassphraseCache.get(keyId);
|
String cachedPassphrase = mPassphraseCache.get(keyId);
|
||||||
if (cachedPassphrase == null) {
|
if (cachedPassphrase == null) {
|
||||||
Log.d(TAG, "Passphrase not (yet) cached, returning null");
|
Log.d(Constants.TAG, "PassphraseCacheService Passphrase not (yet) cached, returning null");
|
||||||
// not really an error, just means the passphrase is not cached but not empty either
|
// not really an error, just means the passphrase is not cached but not empty either
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set it again to reset the cache life cycle
|
// set it again to reset the cache life cycle
|
||||||
Log.d(TAG, "Cache passphrase again when getting it!");
|
Log.d(Constants.TAG, "PassphraseCacheService Cache passphrase again when getting it!");
|
||||||
addCachedPassphrase(this, keyId, cachedPassphrase);
|
addCachedPassphrase(this, keyId, cachedPassphrase);
|
||||||
return cachedPassphrase;
|
return cachedPassphrase;
|
||||||
|
|
||||||
} catch (ProviderHelper.NotFoundException e) {
|
} catch (ProviderHelper.NotFoundException e) {
|
||||||
Log.e(TAG, "Passphrase for unknown key was requested!");
|
Log.e(Constants.TAG, "PassphraseCacheService Passphrase for unknown key was requested!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +211,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
|
|
||||||
Log.d(TAG, "Received broadcast...");
|
Log.d(Constants.TAG, "PassphraseCacheService Received broadcast...");
|
||||||
|
|
||||||
if (action.equals(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE)) {
|
if (action.equals(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE)) {
|
||||||
long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1);
|
long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1);
|
||||||
@@ -248,7 +247,7 @@ public class PassphraseCacheService extends Service {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
Log.d(TAG, "onStartCommand()");
|
Log.d(Constants.TAG, "PassphraseCacheService.onStartCommand()");
|
||||||
|
|
||||||
// register broadcastreceiver
|
// register broadcastreceiver
|
||||||
registerReceiver();
|
registerReceiver();
|
||||||
@@ -259,8 +258,8 @@ public class PassphraseCacheService extends Service {
|
|||||||
long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1);
|
long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1);
|
||||||
String passphrase = intent.getStringExtra(EXTRA_PASSPHRASE);
|
String passphrase = intent.getStringExtra(EXTRA_PASSPHRASE);
|
||||||
|
|
||||||
Log.d(TAG,
|
Log.d(Constants.TAG,
|
||||||
"Received ACTION_PASSPHRASE_CACHE_ADD intent in onStartCommand() with keyId: "
|
"PassphraseCacheService Received ACTION_PASSPHRASE_CACHE_ADD intent in onStartCommand() with keyId: "
|
||||||
+ keyId + ", ttl: " + ttl);
|
+ keyId + ", ttl: " + ttl);
|
||||||
|
|
||||||
// add keyId and passphrase to memory
|
// add keyId and passphrase to memory
|
||||||
@@ -285,10 +284,10 @@ public class PassphraseCacheService extends Service {
|
|||||||
try {
|
try {
|
||||||
messenger.send(msg);
|
messenger.send(msg);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(Constants.TAG, "Sending message failed", e);
|
Log.e(Constants.TAG, "PassphraseCacheService Sending message failed", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(Constants.TAG, "Intent or Intent Action not supported!");
|
Log.e(Constants.TAG, "PassphraseCacheService Intent or Intent Action not supported!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,11 +304,11 @@ public class PassphraseCacheService extends Service {
|
|||||||
// remove passphrase corresponding to keyId from memory
|
// remove passphrase corresponding to keyId from memory
|
||||||
mPassphraseCache.remove(keyId);
|
mPassphraseCache.remove(keyId);
|
||||||
|
|
||||||
Log.d(TAG, "Timeout of keyId " + keyId + ", removed from memory!");
|
Log.d(Constants.TAG, "PassphraseCacheService Timeout of keyId " + keyId + ", removed from memory!");
|
||||||
|
|
||||||
// stop whole service if no cached passphrases remaining
|
// stop whole service if no cached passphrases remaining
|
||||||
if (mPassphraseCache.size() == 0) {
|
if (mPassphraseCache.size() == 0) {
|
||||||
Log.d(TAG, "No passphrases remaining in memory, stopping service!");
|
Log.d(Constants.TAG, "PassphraseCacheServic No passphrases remaining in memory, stopping service!");
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
|||||||
|
|
||||||
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
||||||
// get new key from data bundle returned from service
|
// get new key from data bundle returned from service
|
||||||
Bundle data = message.getData();
|
Bundle data = message.getDataAsStringList();
|
||||||
|
|
||||||
ArrayList<UncachedSecretKey> newKeys =
|
ArrayList<UncachedSecretKey> newKeys =
|
||||||
PgpConversionHelper.BytesToPGPSecretKeyList(data
|
PgpConversionHelper.BytesToPGPSecretKeyList(data
|
||||||
|
|||||||
@@ -51,13 +51,14 @@ import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
|||||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.UserIdsNewAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class EditKeyFragment extends LoaderFragment implements
|
public class EditKeyFragment extends LoaderFragment implements
|
||||||
LoaderManager.LoaderCallbacks<Cursor> {
|
LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
@@ -76,7 +77,8 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
|
|
||||||
private UserIdsAdapter mUserIdsAdapter;
|
private UserIdsAdapter mUserIdsAdapter;
|
||||||
private SubkeysAdapter mKeysAdapter;
|
private SubkeysAdapter mKeysAdapter;
|
||||||
private UserIdsNewAdapter mUserIdsAddedAdapter;
|
private UserIdsAddedAdapter mUserIdsAddedAdapter;
|
||||||
|
private ArrayList<UserIdsAddedAdapter.UserIdModel> mUserIdsAddedData;
|
||||||
|
|
||||||
private Uri mDataUri;
|
private Uri mDataUri;
|
||||||
|
|
||||||
@@ -189,9 +191,10 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mUserIdsAddedAdapter = new UserIdsNewAdapter(getActivity());
|
// TODO: from savedInstance?!
|
||||||
|
mUserIdsAddedData = new ArrayList<UserIdsAddedAdapter.UserIdModel>();
|
||||||
|
mUserIdsAddedAdapter = new UserIdsAddedAdapter(getActivity(), mUserIdsAddedData);
|
||||||
mUserIdsAddedList.setAdapter(mUserIdsAddedAdapter);
|
mUserIdsAddedList.setAdapter(mUserIdsAddedAdapter);
|
||||||
mUserIdsAddedAdapter.setData(mSaveKeyringParcel.addUserIds);
|
|
||||||
|
|
||||||
mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0);
|
mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0);
|
||||||
mKeysList.setAdapter(mKeysAdapter);
|
mKeysList.setAdapter(mKeysAdapter);
|
||||||
@@ -321,40 +324,12 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addUserId() {
|
private void addUserId() {
|
||||||
// mSaveKeyringParcel.addUserIds.add(userId);
|
mUserIdsAddedAdapter.add(new UserIdsAddedAdapter.UserIdModel());
|
||||||
// mUserIdsAddedAdapter.setData(mSaveKeyringParcel.addUserIds);
|
|
||||||
|
|
||||||
|
|
||||||
// Handler returnHandler = new Handler() {
|
|
||||||
// @Override
|
|
||||||
// public void handleMessage(Message message) {
|
|
||||||
// switch (message.what) {
|
|
||||||
// case AddUserIdDialogFragment.MESSAGE_OKAY:
|
|
||||||
// Bundle data = message.getData();
|
|
||||||
// String userId = data.getString(AddUserIdDialogFragment.MESSAGE_DATA_USER_ID);
|
|
||||||
//
|
|
||||||
// if (userId != null) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// getLoaderManager().getLoader(LOADER_ID_USER_IDS).forceLoad();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// // Create a new Messenger for the communication back
|
|
||||||
// final Messenger messenger = new Messenger(returnHandler);
|
|
||||||
//
|
|
||||||
// DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
|
|
||||||
// public void run() {
|
|
||||||
// AddUserIdDialogFragment dialogFragment =
|
|
||||||
// AddUserIdDialogFragment.newInstance(messenger);
|
|
||||||
//
|
|
||||||
// dialogFragment.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void save() {
|
private void save() {
|
||||||
|
Log.d(Constants.TAG, "data: " + mUserIdsAddedAdapter.getDataAsStringList());
|
||||||
|
|
||||||
String passphrase = PassphraseCacheService.getCachedPassphrase(getActivity(),
|
String passphrase = PassphraseCacheService.getCachedPassphrase(getActivity(),
|
||||||
mSaveKeyringParcel.mMasterKeyId);
|
mSaveKeyringParcel.mMasterKeyId);
|
||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
|
|||||||
@@ -441,7 +441,6 @@ public class KeyListFragment extends LoaderFragment
|
|||||||
TextView mMainUserIdRest;
|
TextView mMainUserIdRest;
|
||||||
View mStatusDivider;
|
View mStatusDivider;
|
||||||
FrameLayout mStatusLayout;
|
FrameLayout mStatusLayout;
|
||||||
ImageButton mButton;
|
|
||||||
TextView mRevoked;
|
TextView mRevoked;
|
||||||
ImageView mVerified;
|
ImageView mVerified;
|
||||||
}
|
}
|
||||||
@@ -454,7 +453,6 @@ public class KeyListFragment extends LoaderFragment
|
|||||||
holder.mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
holder.mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
||||||
holder.mStatusDivider = (View) view.findViewById(R.id.status_divider);
|
holder.mStatusDivider = (View) view.findViewById(R.id.status_divider);
|
||||||
holder.mStatusLayout = (FrameLayout) view.findViewById(R.id.status_layout);
|
holder.mStatusLayout = (FrameLayout) view.findViewById(R.id.status_layout);
|
||||||
holder.mButton = (ImageButton) view.findViewById(R.id.edit);
|
|
||||||
holder.mRevoked = (TextView) view.findViewById(R.id.revoked);
|
holder.mRevoked = (TextView) view.findViewById(R.id.revoked);
|
||||||
holder.mVerified = (ImageView) view.findViewById(R.id.verified);
|
holder.mVerified = (ImageView) view.findViewById(R.id.verified);
|
||||||
view.setTag(holder);
|
view.setTag(holder);
|
||||||
@@ -496,21 +494,9 @@ public class KeyListFragment extends LoaderFragment
|
|||||||
h.mStatusLayout.setVisibility(View.VISIBLE);
|
h.mStatusLayout.setVisibility(View.VISIBLE);
|
||||||
h.mRevoked.setVisibility(View.GONE);
|
h.mRevoked.setVisibility(View.GONE);
|
||||||
h.mVerified.setVisibility(View.GONE);
|
h.mVerified.setVisibility(View.GONE);
|
||||||
h.mButton.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
final long id = cursor.getLong(INDEX_MASTER_KEY_ID);
|
|
||||||
h.mButton.setOnClickListener(new OnClickListener() {
|
|
||||||
public void onClick(View view) {
|
|
||||||
Intent editIntent = new Intent(getActivity(), EditKeyActivity.class);
|
|
||||||
editIntent.setData(KeyRingData.buildSecretKeyRingUri(Long.toString(id)));
|
|
||||||
editIntent.setAction(EditKeyActivity.ACTION_EDIT_KEY);
|
|
||||||
startActivityForResult(editIntent, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// this is a public key - hide the edit mButton, show if it's revoked
|
// this is a public key - hide the edit mButton, show if it's revoked
|
||||||
h.mStatusDivider.setVisibility(View.GONE);
|
h.mStatusDivider.setVisibility(View.GONE);
|
||||||
h.mButton.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0;
|
boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0;
|
||||||
boolean isExpired = !cursor.isNull(INDEX_EXPIRY)
|
boolean isExpired = !cursor.isNull(INDEX_EXPIRY)
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -9,14 +26,14 @@ import android.view.animation.AnimationUtils;
|
|||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
/** This is a fragment helper class, which implements a generic
|
/**
|
||||||
|
* This is a fragment helper class, which implements a generic
|
||||||
* progressbar/container view.
|
* progressbar/container view.
|
||||||
*
|
* <p/>
|
||||||
* To use it in a fragment, simply subclass, use onCreateView to create the
|
* To use it in a fragment, simply subclass, use onCreateView to create the
|
||||||
* layout's root view, and ues getContainer() as root view of your subclass.
|
* layout's root view, and ues getContainer() as root view of your subclass.
|
||||||
* The layout shows a progress bar by default, and can be switched to the
|
* The layout shows a progress bar by default, and can be switched to the
|
||||||
* actual contents by calling setContentShown().
|
* actual contents by calling setContentShown().
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class LoaderFragment extends Fragment {
|
public class LoaderFragment extends Fragment {
|
||||||
private boolean mContentShown;
|
private boolean mContentShown;
|
||||||
@@ -35,7 +52,6 @@ public class LoaderFragment extends Fragment {
|
|||||||
mContentShown = false;
|
mContentShown = false;
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ViewGroup getContainer() {
|
protected ViewGroup getContainer() {
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
TextView vComment = (TextView) view.findViewById(R.id.comment);
|
TextView vComment = (TextView) view.findViewById(R.id.comment);
|
||||||
ImageView vVerified = (ImageView) view.findViewById(R.id.certified);
|
ImageView vVerified = (ImageView) view.findViewById(R.id.certified);
|
||||||
ImageView vHasChanges = (ImageView) view.findViewById(R.id.has_changes);
|
ImageView vHasChanges = (ImageView) view.findViewById(R.id.has_changes);
|
||||||
|
ImageView vEditImage = (ImageView) view.findViewById(R.id.edit_image);
|
||||||
|
|
||||||
String userId = cursor.getString(mIndexUserId);
|
String userId = cursor.getString(mIndexUserId);
|
||||||
String[] splitUserId = KeyRing.splitUserId(userId);
|
String[] splitUserId = KeyRing.splitUserId(userId);
|
||||||
@@ -167,8 +168,10 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
} else {
|
} else {
|
||||||
vHasChanges.setVisibility(View.GONE);
|
vHasChanges.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
vEditImage.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
vHasChanges.setVisibility(View.GONE);
|
vHasChanges.setVisibility(View.GONE);
|
||||||
|
vEditImage.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRevoked) {
|
if (isRevoked) {
|
||||||
|
|||||||
@@ -0,0 +1,206 @@
|
|||||||
|
/*
|
||||||
|
* 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.adapter;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.util.Patterns;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.AutoCompleteTextView;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
|
public class UserIdsAddedAdapter extends ArrayAdapter<UserIdsAddedAdapter.UserIdModel> {
|
||||||
|
private LayoutInflater mInflater;
|
||||||
|
private Activity mActivity;
|
||||||
|
|
||||||
|
private ArrayAdapter<String> mAutoCompleteNameAdapter;
|
||||||
|
private ArrayAdapter<String> mAutoCompleteEmailAdapter;
|
||||||
|
|
||||||
|
// hold a private reference to the underlying data List
|
||||||
|
private List<UserIdModel> mData;
|
||||||
|
|
||||||
|
public static class UserIdModel {
|
||||||
|
String name = "";
|
||||||
|
String address = "";
|
||||||
|
String comment = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String userId = null;
|
||||||
|
if (!TextUtils.isEmpty(name)) {
|
||||||
|
userId = name;
|
||||||
|
if (!TextUtils.isEmpty(comment)) {
|
||||||
|
userId += " (" + comment + ")";
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(address)) {
|
||||||
|
userId += " <" + address + ">";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserIdsAddedAdapter(Activity activity, List<UserIdModel> data) {
|
||||||
|
super(activity, -1, data);
|
||||||
|
mActivity = activity;
|
||||||
|
mInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
mData = data;
|
||||||
|
mAutoCompleteNameAdapter = new ArrayAdapter<String>
|
||||||
|
(mActivity, android.R.layout.simple_dropdown_item_1line,
|
||||||
|
ContactHelper.getPossibleUserNames(mActivity)
|
||||||
|
);
|
||||||
|
mAutoCompleteEmailAdapter = new ArrayAdapter<String>
|
||||||
|
(mActivity, android.R.layout.simple_dropdown_item_1line,
|
||||||
|
ContactHelper.getPossibleUserEmails(mActivity)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getDataAsStringList() {
|
||||||
|
ArrayList<String> out = new ArrayList<String>();
|
||||||
|
for (UserIdModel id : mData) {
|
||||||
|
out.add(id.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ViewHolder {
|
||||||
|
public AutoCompleteTextView vAddress;
|
||||||
|
public AutoCompleteTextView vName;
|
||||||
|
public EditText vComment;
|
||||||
|
public ImageButton vDelete;
|
||||||
|
// also hold a reference to the model item
|
||||||
|
public UserIdModel mModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
|
if (convertView == null) {
|
||||||
|
// Not recycled, inflate a new view
|
||||||
|
convertView = mInflater.inflate(R.layout.edit_key_user_id_added_item, null);
|
||||||
|
final ViewHolder viewHolder = new ViewHolder();
|
||||||
|
viewHolder.vAddress = (AutoCompleteTextView) convertView.findViewById(R.id.user_id_added_item_address);
|
||||||
|
viewHolder.vName = (AutoCompleteTextView) convertView.findViewById(R.id.user_id_added_item_name);
|
||||||
|
viewHolder.vComment = (EditText) convertView.findViewById(R.id.user_id_added_item_comment);
|
||||||
|
viewHolder.vDelete = (ImageButton) convertView.findViewById(R.id.user_id_added_item_delete);
|
||||||
|
convertView.setTag(viewHolder);
|
||||||
|
|
||||||
|
viewHolder.vAddress.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
// update referenced item in view holder
|
||||||
|
viewHolder.mModel.address = s.toString();
|
||||||
|
|
||||||
|
// show icon on valid email addresses
|
||||||
|
if (viewHolder.mModel.address.length() > 0) {
|
||||||
|
Matcher emailMatcher = Patterns.EMAIL_ADDRESS.matcher(viewHolder.mModel.address);
|
||||||
|
if (emailMatcher.matches()) {
|
||||||
|
viewHolder.vAddress.setCompoundDrawablesWithIntrinsicBounds(0, 0,
|
||||||
|
R.drawable.uid_mail_ok, 0);
|
||||||
|
} else {
|
||||||
|
viewHolder.vAddress.setCompoundDrawablesWithIntrinsicBounds(0, 0,
|
||||||
|
R.drawable.uid_mail_bad, 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// remove drawable if email is empty
|
||||||
|
viewHolder.vAddress.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
viewHolder.vName.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
// update referenced item in view holder
|
||||||
|
viewHolder.mModel.name = s.toString();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
viewHolder.vComment.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
// update referenced item in view holder
|
||||||
|
viewHolder.mModel.comment = s.toString();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
viewHolder.vDelete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
// remove reference model item from adapter (data and notify about change)
|
||||||
|
UserIdsAddedAdapter.this.remove(viewHolder.mModel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
final ViewHolder holder = (ViewHolder) convertView.getTag();
|
||||||
|
|
||||||
|
// save reference to model item
|
||||||
|
holder.mModel = getItem(position);
|
||||||
|
|
||||||
|
holder.vAddress.setText(holder.mModel.address);
|
||||||
|
holder.vAddress.setThreshold(1); // Start working from first character
|
||||||
|
holder.vAddress.setAdapter(mAutoCompleteEmailAdapter);
|
||||||
|
|
||||||
|
holder.vName.setText(holder.mModel.name);
|
||||||
|
holder.vName.setThreshold(1); // Start working from first character
|
||||||
|
holder.vName.setAdapter(mAutoCompleteNameAdapter);
|
||||||
|
|
||||||
|
holder.vComment.setText(holder.mModel.comment);
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2013-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.adapter;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.KeyRing;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class UserIdsNewAdapter extends ArrayAdapter<String> {
|
|
||||||
protected LayoutInflater mInflater;
|
|
||||||
protected Activity mActivity;
|
|
||||||
|
|
||||||
protected List<String> mData;
|
|
||||||
|
|
||||||
// static class ViewHolder {
|
|
||||||
// public TextView vName;
|
|
||||||
// public TextView vAddress;
|
|
||||||
// public TextView vComment;
|
|
||||||
// public ImageView vVerified;
|
|
||||||
// public ImageView vHasChanges;
|
|
||||||
// public CheckBox vCheckBox;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public UserIdsNewAdapter(Activity activity) {
|
|
||||||
super(activity, -1);
|
|
||||||
mActivity = activity;
|
|
||||||
mInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public void setData(List<String> data) {
|
|
||||||
clear();
|
|
||||||
if (data != null) {
|
|
||||||
this.mData = data;
|
|
||||||
|
|
||||||
// add data to extended ArrayAdapter
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
addAll(data);
|
|
||||||
} else {
|
|
||||||
for (String entry : data) {
|
|
||||||
add(entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getData() {
|
|
||||||
// String name = mName.getText().toString();
|
|
||||||
// - String email = mAddress.getText().toString();
|
|
||||||
// - String comment = mComment.getText().toString();
|
|
||||||
// -
|
|
||||||
// - String userId = null;
|
|
||||||
// - if (!TextUtils.isEmpty(name)) {
|
|
||||||
// - userId = name;
|
|
||||||
// - if (!TextUtils.isEmpty(comment)) {
|
|
||||||
// - userId += " (" + comment + ")";
|
|
||||||
// - }
|
|
||||||
// - if (!TextUtils.isEmpty(email)) {
|
|
||||||
// - userId += " <" + email + ">";
|
|
||||||
// - }
|
|
||||||
// - }
|
|
||||||
return mData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasStableIds() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
|
||||||
String entry = mData.get(position);
|
|
||||||
// ViewHolder holder;
|
|
||||||
// if (convertView == null) {
|
|
||||||
// holder = new ViewHolder();
|
|
||||||
convertView = mInflater.inflate(R.layout.edit_key_new_userids_item, null);
|
|
||||||
EditText vName = (EditText) convertView.findViewById(R.id.userId);
|
|
||||||
EditText vAddress = (EditText) convertView.findViewById(R.id.address);
|
|
||||||
EditText vComment = (EditText) convertView.findViewById(R.id.comment);
|
|
||||||
// holder.vVerified = (ImageView) convertView.findViewById(R.id.certified);
|
|
||||||
ImageView vHasChanges = (ImageView) convertView.findViewById(R.id.has_changes);
|
|
||||||
// holder.vCheckBox = (CheckBox) convertView.findViewById(R.id.checkBox);
|
|
||||||
// convertView.setTag(holder);
|
|
||||||
// } else {
|
|
||||||
// holder = (ViewHolder) convertView.getTag();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // user id
|
|
||||||
// String[] splitUserId = KeyRing.splitUserId(entry);
|
|
||||||
// if (splitUserId[0] != null) {
|
|
||||||
// vName.setText(splitUserId[0]);
|
|
||||||
// } else {
|
|
||||||
// vName.setText(R.string.user_id_no_name);
|
|
||||||
// }
|
|
||||||
// if (splitUserId[1] != null) {
|
|
||||||
// vAddress.setText(splitUserId[1]);
|
|
||||||
// vAddress.setVisibility(View.VISIBLE);
|
|
||||||
// } else {
|
|
||||||
// holder.vAddress.setVisibility(View.GONE);
|
|
||||||
// }
|
|
||||||
// if (splitUserId[2] != null) {
|
|
||||||
// vComment.setText(splitUserId[2]);
|
|
||||||
// vComment.setVisibility(View.VISIBLE);
|
|
||||||
// } else {
|
|
||||||
// holder.vComment.setVisibility(View.GONE);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// holder.vCheckBox.setVisibility(View.GONE);
|
|
||||||
//
|
|
||||||
// holder.vVerified.setImageResource(R.drawable.key_certify_ok_depth0);
|
|
||||||
//
|
|
||||||
// // all items are "new"
|
|
||||||
// holder.vHasChanges.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
return convertView;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -25,9 +25,7 @@ import android.widget.ListView;
|
|||||||
* Automatically calculate height of ListView based on contained items. This enables to put this
|
* Automatically calculate height of ListView based on contained items. This enables to put this
|
||||||
* ListView into a ScrollView without messing up.
|
* ListView into a ScrollView without messing up.
|
||||||
* <p/>
|
* <p/>
|
||||||
* from
|
* from http://stackoverflow.com/a/3580117
|
||||||
* http://stackoverflow.com/questions/2419246/how-do-i-create-a-listview-thats-not-in-a-scrollview-
|
|
||||||
* or-has-the-scrollview-dis
|
|
||||||
*/
|
*/
|
||||||
public class FixedListView extends ListView {
|
public class FixedListView extends ListView {
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
|||||||
|
|
||||||
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
||||||
// get new key from data bundle returned from service
|
// get new key from data bundle returned from service
|
||||||
Bundle data = message.getData();
|
Bundle data = message.getDataAsStringList();
|
||||||
UncachedSecretKey newKey = PgpConversionHelper
|
UncachedSecretKey newKey = PgpConversionHelper
|
||||||
.BytesToPGPSecretKey(data
|
.BytesToPGPSecretKey(data
|
||||||
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="add key"
|
android:text="add key"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
android:drawableRight="@drawable/ic_action_add_person"
|
android:drawableRight="@drawable/ic_action_new_account"
|
||||||
android:drawablePadding="8dp"
|
android:drawablePadding="8dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:singleLine="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/has_changes"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:minWidth="10dp"
|
||||||
|
android:background="@color/result_green" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="0dip"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/user_id_added_item_address"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/label_email"
|
||||||
|
android:inputType="textEmailAddress"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/user_id_added_item_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:hint="@string/label_name"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/user_id_added_item_comment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/tertiary_text_light"
|
||||||
|
android:hint="@string/label_comment"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/user_id_added_item_delete"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:src="@drawable/ic_action_cancel"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
style="@style/SelectableItem" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -51,19 +51,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/edit"
|
|
||||||
style="@style/SelectableItem"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:focusable="false"
|
|
||||||
android:enabled="true"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:src="@drawable/ic_action_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"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:minWidth="10dp"
|
android:minWidth="10dp"
|
||||||
android:background="@color/emphasis" />
|
android:background="@color/result_green" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkBox"
|
android:id="@+id/checkBox"
|
||||||
@@ -41,6 +41,8 @@
|
|||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
@@ -68,4 +70,13 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/edit_image"
|
||||||
|
android:src="@drawable/ic_action_edit"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user