Prettify more layouts

This commit is contained in:
Dominik Schürmann 2014-04-11 16:00:37 +02:00
parent 85bb3d9480
commit b5c16e2446
5 changed files with 101 additions and 105 deletions

View File

@ -151,10 +151,10 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
holder.status.setVisibility(View.GONE);
}
LinearLayout ll = (LinearLayout) convertView.findViewById(R.id.list);
ll.removeAllViews();
LinearLayout userIdsLL = (LinearLayout) convertView.findViewById(R.id.user_ids_list);
userIdsLL.removeAllViews();
if (entry.userIds.size() == 1) {
ll.setVisibility(View.GONE);
userIdsLL.setVisibility(View.GONE);
} else {
boolean first = true;
boolean second = true;
@ -167,12 +167,12 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
View sep = new View(mActivity);
sep.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 1));
sep.setBackgroundResource(android.R.drawable.divider_horizontal_dark);
ll.addView(sep);
userIdsLL.addView(sep);
}
TextView uidView = (TextView) mInflater.inflate(
R.layout.import_keys_list_entry_user_id, null);
uidView.setText(uid);
ll.addView(uidView);
userIdsLL.addView(uidView);
second = false;
}
}

View File

@ -112,13 +112,14 @@ abstract public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter
h.mainUserId.setText(R.string.user_id_no_name);
}
if (userIdSplit[1] != null) {
h.mainUserIdRest.setVisibility(View.VISIBLE);
h.mainUserIdRest.setText(highlightSearchQuery(userIdSplit[1]));
} else {
h.mainUserIdRest.setText("");
h.mainUserIdRest.setVisibility(View.GONE);
}
long masterKeyId = cursor.getLong(mIndexMasterKeyId);
h.keyId.setText(PgpKeyHelper.convertKeyIdToHexShort(masterKeyId));
h.keyId.setText(PgpKeyHelper.convertKeyIdToHex(masterKeyId));
boolean enabled = true;
if(cursor.getInt(mIndexRevoked) != 0) {

View File

@ -17,94 +17,90 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="3dip"
android:orientation="horizontal"
android:paddingLeft="4dp"
android:paddingRight="?android:attr/scrollbarSize"
android:singleLine="true" >
android:singleLine="true">
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />
<!-- focusable and clickable MUST be false to handle click and longClick in ListView Activity -->
<LinearLayout
android:layout_width="match_parent"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="5dip"
android:paddingRight="5dip">
<CheckBox
android:id="@+id/selected"
<TextView
android:id="@+id/mainUserId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />
<!-- focusable and clickable MUST be false to handle click and longClick in ListView Activity -->
android:text="Alice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="5dip"
android:paddingRight="5dip" >
<TextView
android:id="@+id/mainUserId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_main_user_id"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/mainUserIdRest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="&lt;user@somewhere.com>"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
<TextView
android:id="@+id/mainUserIdRest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:minWidth="90dip"
android:orientation="vertical"
android:paddingLeft="3dip" >
android:text="alice@example.com"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/keyId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0xBBBBBBBBBBBBBBBB"
android:textAppearance="?android:attr/textAppearanceSmall"
android:typeface="monospace"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/user_ids_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="36dip"
android:orientation="vertical" />
<TextView
android:id="@+id/algorithm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/keyId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0xBBBBBBBBBBBBBBBB"
android:textAppearance="?android:attr/textAppearanceSmall"
android:typeface="monospace" />
<TextView
android:id="@+id/fingerprint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="fingerprint"
android:typeface="monospace"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#e00" />
</LinearLayout>
<TextView
android:id="@+id/fingerprint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0000 0000 0000 0000 0000\n0000 0000 0000 0000 0000"
android:typeface="monospace"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="36dip"
android:orientation="vertical" >
android:gravity="right"
android:minWidth="90dip"
android:orientation="vertical"
android:paddingLeft="3dip">
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="status"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#e00" />
<TextView
android:id="@+id/algorithm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RSA"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="right" />
</LinearLayout>
</LinearLayout>

View File

@ -10,7 +10,7 @@
android:focusable="false">
<LinearLayout
android:layout_width="fill_parent"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"

View File

@ -1,15 +1,16 @@
<?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="?android:attr/listPreferredItemHeight"
android:paddingLeft="3dip"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="4dp"
android:paddingRight="?android:attr/scrollbarSize"
android:singleLine="true" >
android:singleLine="true">
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />
@ -19,46 +20,44 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="5dip" >
android:paddingLeft="5dip"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/mainUserId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_main_user_id"
android:text="Alice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/mainUserIdRest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="&lt;user@example.com>"
android:text="alice@example.com"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:minWidth="90dip"
android:orientation="vertical"
android:paddingLeft="3dip" >
<TextView
android:id="@+id/keyId"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="BBBBBBBB"
android:layout_height="wrap_content"
android:text="0xBBBBBBBBBBBBBBB"
android:textAppearance="?android:attr/textAppearanceSmall"
android:typeface="monospace" />
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="expired"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="italic" />
</LinearLayout>
<TextView
android:gravity="right"
android:paddingLeft="4dp"
android:minWidth="90dip"
android:id="@+id/status"
android:paddingTop="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="expired"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="italic"
android:layout_gravity="right" />
</LinearLayout>