mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-06 17:25:05 -05:00
certs: green dots for verified status \o/
This commit is contained in:
parent
5c28da44d6
commit
f192c70179
@ -25,6 +25,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
@ -90,18 +91,25 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
|||||||
TextView vRank = (TextView) view.findViewById(R.id.rank);
|
TextView vRank = (TextView) view.findViewById(R.id.rank);
|
||||||
TextView vUserId = (TextView) view.findViewById(R.id.userId);
|
TextView vUserId = (TextView) view.findViewById(R.id.userId);
|
||||||
TextView vAddress = (TextView) view.findViewById(R.id.address);
|
TextView vAddress = (TextView) view.findViewById(R.id.address);
|
||||||
|
ImageView vVerified = (ImageView) view.findViewById(R.id.certified);
|
||||||
|
|
||||||
vRank.setText(Integer.toString(cursor.getInt(mIndexRank)));
|
vRank.setText(Integer.toString(cursor.getInt(mIndexRank)));
|
||||||
|
|
||||||
String[] userId = PgpKeyHelper.splitUserId(cursor.getString(mIndexUserId));
|
String[] userId = PgpKeyHelper.splitUserId(cursor.getString(mIndexUserId));
|
||||||
int verified = cursor.getInt(mVerifiedId);
|
|
||||||
if (userId[0] != null) {
|
if (userId[0] != null) {
|
||||||
vUserId.setText(userId[0] + (verified > 0 ? " (ok)" : "(nope)"));
|
vUserId.setText(userId[0]);
|
||||||
} else {
|
} else {
|
||||||
vUserId.setText(R.string.user_id_no_name);
|
vUserId.setText(R.string.user_id_no_name);
|
||||||
}
|
}
|
||||||
vAddress.setText(userId[1]);
|
vAddress.setText(userId[1]);
|
||||||
|
|
||||||
|
int verified = cursor.getInt(mVerifiedId);
|
||||||
|
// TODO introduce own resource for this :)
|
||||||
|
if(verified > 0)
|
||||||
|
vVerified.setImageResource(android.R.drawable.presence_online);
|
||||||
|
else
|
||||||
|
vVerified.setImageResource(android.R.drawable.presence_invisible);
|
||||||
|
|
||||||
// don't care further if checkboxes aren't shown
|
// don't care further if checkboxes aren't shown
|
||||||
if(mCheckStates == null)
|
if(mCheckStates == null)
|
||||||
return;
|
return;
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userId"
|
android:id="@+id/userId"
|
||||||
@ -40,6 +41,15 @@
|
|||||||
android:text="@string/label_email"
|
android:text="@string/label_email"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:paddingLeft="10dp" />
|
android:paddingLeft="10dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/certified"
|
||||||
|
android:src="@android:drawable/presence_invisible"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user