More consisitency

This commit is contained in:
Dominik Schürmann 2014-10-15 23:22:08 +02:00
parent 4e1053c6fa
commit 0cdcc90984
5 changed files with 11 additions and 13 deletions

View File

@ -102,16 +102,16 @@ public class CertifyKeySpinner extends KeySpinner {
@Override
boolean setStatus(Context context, Cursor cursor, ImageView statusView) {
if (cursor.getInt(mIndexIsRevoked) != 0) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_REVOKED);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, false);
return false;
}
if (cursor.getInt(mIndexIsExpired) != 0) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_EXPIRED);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, false);
return false;
}
// don't invalidate the "None" entry, which is also null!
if (cursor.getPosition() != 0 && cursor.isNull(mIndexHasCertify)) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_UNAVAILABLE);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, false);
return false;
}

View File

@ -84,15 +84,15 @@ public class SignKeySpinner extends KeySpinner {
@Override
boolean setStatus(Context context, Cursor cursor, ImageView statusView) {
if (cursor.getInt(mIndexIsRevoked) != 0) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_REVOKED);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, true);
return false;
}
if (cursor.getInt(mIndexIsExpired) != 0) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_EXPIRED);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, true);
return false;
}
if (cursor.getInt(mIndexHasSign) == 0) {
KeyFormattingUtils.setStatusImage(getContext(), statusView, KeyFormattingUtils.STATE_UNAVAILABLE);
KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, true);
return false;
}

View File

@ -6,8 +6,7 @@
android:layout_height="wrap_content"
android:background="@color/holo_gray_bright">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/result_main_layout"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -99,7 +98,6 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/tertiary_text_light"
android:text="alice@example.com (set in-code)"
android:gravity="center_vertical" />

View File

@ -98,7 +98,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/decrypt_invalid_text"
android:padding="8dp"
android:padding="16dp"
android:layout_gravity="center"
android:textColor="@color/android_red_light" />

View File

@ -41,7 +41,7 @@
<LinearLayout
android:id="@+id/key_list_item_slinger_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
@ -56,10 +56,10 @@
<ImageButton
android:id="@+id/key_list_item_slinger_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@drawable/ic_action_safeslinger"
android:padding="16dp"
android:padding="12dp"
style="@style/SelectableItem" />
</LinearLayout>