aboutsummaryrefslogtreecommitdiffstats
path: root/main/res/layout
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-12-19 19:02:03 +0100
committerSamuel Tardieu <sam@rfc1149.net>2012-12-19 19:02:03 +0100
commit5b2bcc270c832f8ab76b0243e43bdeaf52b2294d (patch)
tree4a92e76aabdb1aae8968deff34bf28923c06a355 /main/res/layout
parent8e375c548899bd719814a306ab4fc5fcacbf40f5 (diff)
downloadcgeo-5b2bcc270c832f8ab76b0243e43bdeaf52b2294d.zip
cgeo-5b2bcc270c832f8ab76b0243e43bdeaf52b2294d.tar.gz
cgeo-5b2bcc270c832f8ab76b0243e43bdeaf52b2294d.tar.bz2
Use better aligned attributes in cache description
This was already discussed in #82 but the solution seems not to have been fully satisfactory, especially when stars were present. This center aligns all the fields, use a relative layout to order them and use the same layout for fields with and without stars.
Diffstat (limited to 'main/res/layout')
-rw-r--r--main/res/layout/cache_item.xml35
-rw-r--r--main/res/layout/cache_layout.xml50
2 files changed, 24 insertions, 61 deletions
diff --git a/main/res/layout/cache_item.xml b/main/res/layout/cache_item.xml
deleted file mode 100644
index 6de416e..0000000
--- a/main/res/layout/cache_item.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="3dip" >
- <TextView android:id="@+id/name"
- android:layout_width="80dip"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_gravity="left|top"
- android:layout_marginRight="4dip"
- android:gravity="right"
- android:lines="1"
- android:singleLine="true"
- android:scrollHorizontally="true"
- android:ellipsize="end"
- android:textSize="12dip"
- android:textColor="?text_color_headline"
- android:text="@null" />
- <TextView android:id="@+id/value"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignBaseline="@id/name"
- android:layout_marginTop="2dip"
- android:layout_marginLeft="83dip"
- android:layout_marginRight="6dip"
- android:layout_gravity="left|top"
- android:textSize="14dip"
- android:textColor="?text_color"
- android:linksClickable="true"
- android:textColorLink="?text_color_link" />
-</RelativeLayout> \ No newline at end of file
diff --git a/main/res/layout/cache_layout.xml b/main/res/layout/cache_layout.xml
index 59507eb..256026c 100644
--- a/main/res/layout/cache_layout.xml
+++ b/main/res/layout/cache_layout.xml
@@ -6,7 +6,7 @@
<TextView android:id="@+id/name"
android:layout_width="80dip"
android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
+ android:layout_alignParentTop="false"
android:layout_alignParentLeft="true"
android:layout_gravity="left|top"
android:layout_marginRight="4dip"
@@ -17,29 +17,27 @@
android:ellipsize="end"
android:textSize="12dip"
android:textColor="?text_color_headline"
- android:text="@null" />
- <LinearLayout android:id="@+id/stars"
- android:orientation="horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_marginTop="2dip"
- android:layout_marginLeft="83dip"
- android:layout_marginRight="6dip"
- android:layout_gravity="left|top" >
- <TextView android:id="@+id/value"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="5dip"
- android:textSize="14dip"
- android:textColor="?text_color" />
- <TextView android:id="@+id/addition"
- android:visibility="gone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dip"
- android:textSize="11dip"
- android:textColor="?text_color_grey" />
- </LinearLayout>
+ android:text="@null" android:layout_centerVertical="true"/>
+ <TextView android:id="@+id/value"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="5dip"
+ android:textSize="14dip"
+ android:textColor="?text_color" android:gravity="center_vertical" android:layout_toRightOf="@+id/name"
+ android:layout_centerVertical="true"/>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:id="@+id/stars" android:layout_toRightOf="@+id/value"
+ android:layout_centerVertical="true" android:visibility="gone" android:baselineAligned="false"
+ android:gravity="center_vertical">
+ </LinearLayout>
+ <TextView android:id="@+id/addition"
+ android:visibility="gone"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dip"
+ android:textSize="11dip"
+ android:textColor="?text_color_grey" android:gravity="center_vertical"
+ android:layout_centerVertical="true" android:layout_toRightOf="@+id/stars"/>
</RelativeLayout> \ No newline at end of file