summaryrefslogtreecommitdiff
path: root/android/res
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-11-27 00:39:02 +0100
committerRobin Watts <robin.watts@artifex.com>2012-11-27 15:44:22 +0000
commit2961adbf90d5eb737bf6aceaa6bfd7ca9e1dbc97 (patch)
treedf2122990bb790a8779a4c66953e5469db67c3ce /android/res
parent554163f2fe0cde5990bf323a13e5c04de4b7b30b (diff)
downloadmupdf-2961adbf90d5eb737bf6aceaa6bfd7ca9e1dbc97.tar.xz
android: Use custom styles for widgets.
Diffstat (limited to 'android/res')
-rw-r--r--android/res/drawable/busy.xml12
-rw-r--r--android/res/drawable/button.xml23
-rw-r--r--android/res/drawable/page_num.xml11
-rw-r--r--android/res/drawable/search.xml37
-rw-r--r--android/res/drawable/seek_progress.xml6
-rw-r--r--android/res/drawable/seek_thumb.xml7
-rw-r--r--android/res/drawable/slider.xml9
-rw-r--r--android/res/layout/buttons.xml79
-rw-r--r--android/res/layout/outline_entry.xml4
-rw-r--r--android/res/layout/picker_entry.xml7
-rw-r--r--android/res/values/colors.xml15
11 files changed, 148 insertions, 62 deletions
diff --git a/android/res/drawable/busy.xml b/android/res/drawable/busy.xml
index c20d320b..5ac0ce76 100644
--- a/android/res/drawable/busy.xml
+++ b/android/res/drawable/busy.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <corners android:radius="10dp" />
- <padding android:left="20dp"
- android:right="20dp"
- android:top="20dp"
- android:bottom="20dp" />
- <solid android:color="@color/bar" />
+ <corners android:radius="12dp" />
+ <padding android:left="16dp"
+ android:right="16dp"
+ android:top="16dp"
+ android:bottom="16dp" />
+ <solid android:color="@color/busy_indicator" />
</shape>
diff --git a/android/res/drawable/button.xml b/android/res/drawable/button.xml
new file mode 100644
index 00000000..3b87ccb6
--- /dev/null
+++ b/android/res/drawable/button.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true">
+ <shape>
+ <solid android:color="@color/button_pressed" />
+ <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" />
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape>
+ <solid android:color="@color/button_normal" />
+ <stroke android:width="4dp" android:color="@color/button_pressed" />
+ <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" />
+ </shape>
+ </item>
+ <item>
+ <shape>
+ <solid android:color="@color/button_normal" />
+ <padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp" />
+ </shape>
+ </item>
+</selector>
diff --git a/android/res/drawable/page_num.xml b/android/res/drawable/page_num.xml
index 627f9b60..533579e1 100644
--- a/android/res/drawable/page_num.xml
+++ b/android/res/drawable/page_num.xml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <corners android:radius="2dp" />
- <padding android:left="5dp"
- android:right="5dp"
- android:top="5dp"
- android:bottom="5dp" />
- <solid android:color="@color/bar" />
+ <padding android:left="8dp"
+ android:right="8dp"
+ android:top="1dp"
+ android:bottom="2dp" />
+ <solid android:color="@color/page_indicator" />
</shape>
diff --git a/android/res/drawable/search.xml b/android/res/drawable/search.xml
new file mode 100644
index 00000000..d689c465
--- /dev/null
+++ b/android/res/drawable/search.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/text_pressed" />
+ <stroke android:width="4dp" android:color="@color/text_border_pressed" />
+ <padding
+ android:left="12dp"
+ android:right="12dp"
+ android:top="8dp"
+ android:bottom="8dp" />
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape>
+ <solid android:color="@color/text_normal" />
+ <stroke android:width="4dp" android:color="@color/text_border_focused" />
+ <padding
+ android:left="12dp"
+ android:right="12dp"
+ android:top="8dp"
+ android:bottom="8dp" />
+ </shape>
+ </item>
+ <item>
+ <shape>
+ <solid android:color="@color/text_normal" />
+ <stroke android:width="4dp" android:color="@color/text_border_normal" />
+ <padding
+ android:left="12dp"
+ android:right="12dp"
+ android:top="8dp"
+ android:bottom="8dp" />
+ </shape>
+ </item>
+</selector>
diff --git a/android/res/drawable/seek_progress.xml b/android/res/drawable/seek_progress.xml
new file mode 100644
index 00000000..2722ed07
--- /dev/null
+++ b/android/res/drawable/seek_progress.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="line" >
+ <stroke android:width="6dp" android:color="@color/seek_progress" />
+</shape>
diff --git a/android/res/drawable/seek_thumb.xml b/android/res/drawable/seek_thumb.xml
new file mode 100644
index 00000000..518aa588
--- /dev/null
+++ b/android/res/drawable/seek_thumb.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval" >
+ <size android:width="28dp" android:height="28dp" />
+ <solid android:color="@color/seek_thumb" />
+</shape>
diff --git a/android/res/drawable/slider.xml b/android/res/drawable/slider.xml
deleted file mode 100644
index bf4a75da..00000000
--- a/android/res/drawable/slider.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <padding android:left="15dp"
- android:right="15dp"
- android:top="5dp"
- android:bottom="5dp" />
- <solid android:color="@color/bar" />
-</shape>
diff --git a/android/res/layout/buttons.xml b/android/res/layout/buttons.xml
index fe6b27f1..642e6e6a 100644
--- a/android/res/layout/buttons.xml
+++ b/android/res/layout/buttons.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@@ -14,20 +15,30 @@
android:id="@+id/topBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="0dp"
- android:paddingLeft="0dp"
- android:paddingRight="0dp"
- android:paddingTop="0dp"
- android:background="@color/bar" >
+ android:background="@color/toolbar" >
+
+ <TextView
+ android:id="@+id/docNameText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_toLeftOf="@+id/linkButton"
+ android:layout_alignParentLeft="true"
+ android:paddingLeft="16dp"
+ android:singleLine="true"
+ android:textColor="#FFFFFF"
+ android:textStyle="bold"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageButton
- android:id="@+id/searchButton"
+ android:id="@+id/linkButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
android:layout_centerVertical="true"
- android:contentDescription="@string/search_document"
- android:src="@drawable/ic_magnifying_glass" />
+ android:layout_toLeftOf="@+id/outlineButton"
+ android:contentDescription="@string/link_control"
+ android:background="@drawable/button"
+ android:src="@drawable/ic_link" />
<ImageButton
android:id="@+id/outlineButton"
@@ -36,27 +47,18 @@
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/searchButton"
android:contentDescription="@string/search_document"
+ android:background="@drawable/button"
android:src="@drawable/ic_list" />
<ImageButton
- android:id="@+id/linkButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_toLeftOf="@+id/outlineButton"
- android:contentDescription="@string/link_control"
- android:src="@drawable/ic_link" />
-
- <TextView
- android:id="@+id/docNameText"
+ android:id="@+id/searchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
- android:layout_toLeftOf="@+id/linkButton"
- android:paddingLeft="15dp"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:layout_alignParentRight="true"
+ android:contentDescription="@string/search_document"
+ android:background="@drawable/button"
+ android:src="@drawable/ic_magnifying_glass" />
</RelativeLayout>
@@ -64,29 +66,26 @@
android:id="@+id/topBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="0dp"
- android:paddingLeft="0dp"
- android:paddingRight="0dp"
- android:paddingTop="0dp"
- android:background="@color/bar" >
+ android:background="@color/toolbar" >
<ImageButton
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
+ android:layout_alignParentLeft="true"
android:contentDescription="@string/cancel"
+ android:background="@drawable/button"
android:src="@drawable/ic_cancel" />
<EditText
android:id="@+id/searchText"
+ android:background="@drawable/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
- android:layout_toLeftOf="@+id/searchBack"
android:layout_toRightOf="@+id/cancel"
+ android:layout_toLeftOf="@+id/searchBack"
android:inputType="text"
android:hint="Search"
android:singleLine="true" />
@@ -98,15 +97,17 @@
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/searchForward"
android:contentDescription="@string/search_backwards"
+ android:background="@drawable/button"
android:src="@drawable/ic_arrow_left" />
<ImageButton
android:id="@+id/searchForward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
android:layout_centerVertical="true"
+ android:layout_alignParentRight="true"
android:contentDescription="@string/search_forwards"
+ android:background="@drawable/button"
android:src="@drawable/ic_arrow_right" />
</RelativeLayout>
@@ -127,7 +128,14 @@
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="0dp"
- android:background="@drawable/slider" />
+ android:thumb="@drawable/seek_thumb"
+ android:progressDrawable="@drawable/seek_progress"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:paddingTop="12dp"
+ android:paddingBottom="8dp"
+ android:background="@color/toolbar"
+ />
<TextView
android:id="@+id/pageNumber"
@@ -135,8 +143,9 @@
android:layout_height="wrap_content"
android:layout_above="@+id/pageSlider"
android:layout_centerHorizontal="true"
- android:layout_marginBottom="10dp"
+ android:layout_marginBottom="16dp"
android:background="@drawable/page_num"
+ android:textColor="#FFFFFF"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
diff --git a/android/res/layout/outline_entry.xml b/android/res/layout/outline_entry.xml
index 3983d766..e0a23db5 100644
--- a/android/res/layout/outline_entry.xml
+++ b/android/res/layout/outline_entry.xml
@@ -11,7 +11,7 @@
android:layout_toLeftOf="@+id/page"
android:singleLine="true"
android:layout_centerVertical="true"
- android:paddingLeft="10dp"
+ android:paddingLeft="8dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
@@ -21,7 +21,7 @@
android:layout_alignBaseline="@+id/title"
android:layout_alignBottom="@+id/title"
android:layout_alignParentRight="true"
- android:paddingRight="10dp"
+ android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
diff --git a/android/res/layout/picker_entry.xml b/android/res/layout/picker_entry.xml
index 2424630b..1b7038e6 100644
--- a/android/res/layout/picker_entry.xml
+++ b/android/res/layout/picker_entry.xml
@@ -2,6 +2,9 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:padding="10dp"
- android:textAppearance="?android:attr/textAppearanceMedium" >
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:paddingLeft="12dp"
+ android:paddingRight="12dp"
+ android:textAppearance="?android:attr/textAppearanceLarge" >
</TextView>
diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml
index 30b2dbc3..1a02ca21 100644
--- a/android/res/values/colors.xml
+++ b/android/res/values/colors.xml
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="canvas">#FF404040</color>
- <color name="bar">#C0202020</color>
+ <color name="canvas">#404040</color>
+ <color name="toolbar">#C0000000</color>
+ <color name="page_indicator">#C0202020</color>
+ <color name="busy_indicator">#C0202020</color>
+ <color name="button_normal">#00000000</color>
+ <color name="button_pressed">#FF2572AC</color>
+ <color name="text_normal">#FFFFFF</color>
+ <color name="text_pressed">#FFFFFF</color>
+ <color name="text_border_normal">#000000</color>
+ <color name="text_border_pressed">#2572AC</color>
+ <color name="text_border_focused">#000000</color>
+ <color name="seek_thumb">#2572AC</color>
+ <color name="seek_progress">#FFFFFF</color>
</resources>