mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-25 07:51:48 -05:00
Merge pull request #453 from thi/452-unrevoked-keys-displayed-in-red
Fix key list views in main key view
This commit is contained in:
commit
4137fbff5b
@ -18,6 +18,7 @@
|
|||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.ColorStateList;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
@ -42,6 +43,8 @@ public class ViewKeyKeysAdapter extends CursorAdapter {
|
|||||||
private int mIndexCanSign;
|
private int mIndexCanSign;
|
||||||
private int mIndexRevokedKey;
|
private int mIndexRevokedKey;
|
||||||
|
|
||||||
|
private ColorStateList mDefaultTextColor;
|
||||||
|
|
||||||
public ViewKeyKeysAdapter(Context context, Cursor c, int flags) {
|
public ViewKeyKeysAdapter(Context context, Cursor c, int flags) {
|
||||||
super(context, c, flags);
|
super(context, c, flags);
|
||||||
|
|
||||||
@ -122,13 +125,20 @@ public class ViewKeyKeysAdapter extends CursorAdapter {
|
|||||||
keyId.setTextColor(Color.RED);
|
keyId.setTextColor(Color.RED);
|
||||||
keyDetails.setTextColor(Color.RED);
|
keyDetails.setTextColor(Color.RED);
|
||||||
} else {
|
} else {
|
||||||
|
keyId.setTextColor(mDefaultTextColor);
|
||||||
|
keyDetails.setTextColor(mDefaultTextColor);
|
||||||
revokedKeyIcon.setVisibility(View.GONE);
|
revokedKeyIcon.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||||
return mInflater.inflate(R.layout.view_key_keys_item, null);
|
View view = mInflater.inflate(R.layout.view_key_keys_item, null);
|
||||||
|
if (mDefaultTextColor == null) {
|
||||||
|
TextView keyId = (TextView) view.findViewById(R.id.keyId);
|
||||||
|
mDefaultTextColor = keyId.getTextColors();
|
||||||
|
}
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user