]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - res/layout/dictionary_activity.xml
Prefer XML click handling setup.
[Dictionary.git] / res / layout / dictionary_activity.xml
index 0a070573ffde37952fb9942a1295f62cad5ba145..3e381371e68176e0a98681b7c22fb2fc313cad0f 100644 (file)
@@ -1,14 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical" >
 
+    <!--
+
     <LinearLayout
         android:id="@+id/SearchBarLinearLayout"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" >
 
+        <Button
+            android:id="@+id/LangButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:maxLines="1"
+            android:minWidth="50dip"
+            android:text="" />
+
         <EditText
             android:id="@+id/SearchText"
             android:layout_width="0dip"
             android:imeOptions="actionSearch|flagNoEnterAction|flagNoExtractUi"
             android:inputType="text" />
 
-        <Button
+        <ImageButton
             android:id="@+id/ClearSearchTextButton"
+            style="@style/BorderlessButton"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginRight="15dip"
-            android:background="#00000000"
-            android:drawableLeft="@drawable/ic_input_delete" />
-        <!-- transparent -->
-
-        <Button
-            android:id="@+id/LangButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:maxLines="1"
-            android:minWidth="50dip"
-            android:text="" />
-
-        <Button
-            android:id="@+id/DownButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:background="#00000000"
-            android:drawableLeft="@drawable/arrow_down_float"
-            android:minHeight="30dip"
-            android:minWidth="30dip" />
+            android:src="@drawable/ic_input_delete" />
 
-        <Button
-            android:id="@+id/UpButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:background="#00000000"
-            android:drawableLeft="@drawable/arrow_up_float"
-            android:minHeight="30dip"
-            android:minWidth="30dip" />
     </LinearLayout>
 
+ -->
+
     <ListView
         android:id="@id/android:list"
         android:layout_width="fill_parent"
         android:focusable="true"
         android:focusableInTouchMode="true" />
 
+     <!-- force fabSize to mini, otherwise it is normal on some
+          phones and mini on others, with not particular sense to it.
+          Also leaves more space for content. -->
+     <android.support.design.widget.FloatingActionButton
+        android:id="@+id/floatSwapButton"
+        app:fabSize="mini"
+        app:useCompatPadding="true"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:onClick="onLanguageButtonClick"
+        android:src="@drawable/ic_swap_horiz_black_24dp" />
+
+     <android.support.design.widget.FloatingActionButton
+        android:id="@+id/floatSearchButton"
+        app:fabSize="mini"
+        app:useCompatPadding="true"
+        android:layout_toLeftOf="@+id/floatSwapButton"
+        android:layout_alignParentBottom="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:onClick="onSearchButtonClick"
+        android:src="@drawable/ic_search_black_24dp" />
+
     <TextView
         android:id="@android:id/empty"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:text="@string/noSearchResults" />
 
-</LinearLayout>
\ No newline at end of file
+</RelativeLayout>