FM2: Slight design adjustments

* Remove unnecessary animations
* Remove dividers (channel list, settings)
* Adjust button design (rename dialog)
* Adjust background of clickable parts and adjust
  their touch target sizes
* Hide "Stop recording" menu item when not recording
  instead of disabling it (same for "Record" when
  already recording)

Change-Id: I6705a51e38de8575e2d740c6f8bba1ffb743148f
diff --git a/fmapp2/AndroidManifest.xml b/fmapp2/AndroidManifest.xml
index 3b9f06e..7df2172 100644
--- a/fmapp2/AndroidManifest.xml
+++ b/fmapp2/AndroidManifest.xml
@@ -69,7 +69,6 @@
 
         <activity android:icon="@mipmap/ic_launcher"
             android:name=".FMRadio"
-            android:label="@string/app_name"
             android:clearTaskOnLaunch="true"
             android:screenOrientation="portrait"
             android:allowTaskReparenting="true"
diff --git a/fmapp2/res/layout/action_bar.xml b/fmapp2/res/layout/action_bar.xml
index 75c8628..7409d06 100644
--- a/fmapp2/res/layout/action_bar.xml
+++ b/fmapp2/res/layout/action_bar.xml
@@ -6,16 +6,15 @@
     android:orientation="horizontal" >
 
     <ImageView android:id="@+id/btn_onoff"
-        android:src="@drawable/btn_onoff"
-        android:layout_alignParentLeft="true"
-        android:layout_marginLeft="15dp"
+        android:src="@drawable/ic_btn_onoff_default"
         android:clickable="true"
         android:focusable="true"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
+        android:layout_width="@dimen/min_touch_size"
+        android:layout_height="@dimen/min_touch_size"
+        android:scaleType="centerInside"
+        android:background="?android:attr/selectableItemBackgroundBorderless"/>
 
     <TextView android:id="@+id/title"
-        android:paddingLeft="10dp"
         android:textSize="18sp"
         android:textColor="@color/white"
         android:textAllCaps="true"
@@ -30,19 +29,20 @@
 
     <ImageView android:id="@+id/btn_silent"
         android:src="@drawable/ic_silent_mode_off"
-        android:layout_toLeftOf="@+id/btn_speaker_earphone"
-        android:layout_width="wrap_content"
-        android:layout_marginRight="10dp"
         android:clickable="true"
         android:focusable="true"
-        android:layout_height="wrap_content" />
+        android:layout_width="@dimen/min_touch_size"
+        android:layout_height="@dimen/min_touch_size"
+        android:scaleType="centerInside"
+        android:background="?android:attr/selectableItemBackgroundBorderless" />
 
     <ImageView android:id="@+id/btn_speaker_earphone"
         android:src="@drawable/btn_earphone"
-        android:layout_alignParentRight="true"
         android:clickable="true"
         android:focusable="true"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
+        android:layout_width="@dimen/min_touch_size"
+        android:layout_height="@dimen/min_touch_size"
+        android:scaleType="centerInside"
+        android:background="?android:attr/selectableItemBackgroundBorderless" />
 
 </LinearLayout>
diff --git a/fmapp2/res/layout/fmradio.xml b/fmapp2/res/layout/fmradio.xml
index bfbbd11..244a66b 100644
--- a/fmapp2/res/layout/fmradio.xml
+++ b/fmapp2/res/layout/fmradio.xml
@@ -35,7 +35,7 @@
 
     <LinearLayout android:id="@+id/stationinfo_layout"
         android:layout_width="fill_parent"
-        android:layout_height="match_parent"
+        android:layout_height="0dp"
         android:orientation="horizontal"
         android:layout_weight="1">
 
diff --git a/fmapp2/res/layout/rename_dialog.xml b/fmapp2/res/layout/rename_dialog.xml
index 65ee7d8..d04e237 100644
--- a/fmapp2/res/layout/rename_dialog.xml
+++ b/fmapp2/res/layout/rename_dialog.xml
@@ -51,12 +51,14 @@
          android:padding="6dp" >
 
          <Button android:id="@+id/save"
+             style="?android:style/Widget.Material.Light.Button.Borderless.Colored"
              android:layout_width="120dp"
              android:layout_height="wrap_content"
              android:text="@android:string/ok"
              android:layout_alignParentLeft="true" />
 
          <Button android:id="@+id/cancel"
+             style="?android:style/Widget.Material.Light.Button.Borderless.Colored"
              android:layout_width="120dp"
              android:layout_height="wrap_content"
              android:text="@android:string/cancel"
diff --git a/fmapp2/res/layout/station_info.xml b/fmapp2/res/layout/station_info.xml
index 0bee765..d8e5d4e 100644
--- a/fmapp2/res/layout/station_info.xml
+++ b/fmapp2/res/layout/station_info.xml
@@ -26,7 +26,8 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
+<merge xmlns:tools="http://schemas.android.com/tools"
+    xmlns:android="http://schemas.android.com/apk/res/android">
 
     <LinearLayout android:id="@+id/station_info"
         android:animateLayoutChanges="true"
@@ -40,29 +41,33 @@
         <RelativeLayout android:id="@+id/top_most"
             android:visibility="gone"
             android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
+            android:layout_height="wrap_content"
+            tools:visibility="visible">
 
             <ImageView android:id="@+id/signal_level"
                 android:src="@drawable/ic_signal_2"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:paddingLeft="5dp"
+                android:paddingStart="5dp"
                 android:layout_alignParentTop="true"
-                android:layout_alignParentLeft="true"
-                android:visibility="gone" />
+                android:layout_alignParentStart="true"
+                android:visibility="gone"
+                tools:visibility="visible"/>
 
 
             <TextView android:id="@+id/stereo_text_tv"
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:paddingRight="16dp"
+                android:paddingEnd="16dp"
                 android:visibility="invisible"
                 android:layout_alignParentTop="true"
-                android:layout_alignParentRight="true"
+                android:layout_alignParentEnd="true"
                 android:layout_alignBaseline="@id/signal_level"
                 android:textSize="13sp"
-                android:text="@string/default_blank"/>
+                android:text="@string/default_blank"
+                tools:text="@string/audio_type_stereo"
+                tools:visibility="visible"/>
 
         </RelativeLayout>
 
@@ -88,24 +93,28 @@
             <ImageView android:id="@+id/btn_back"
                  android:clickable="true"
                  android:focusable="true"
-                 android:layout_width="wrap_content"
-                 android:layout_height="wrap_content"
-                 android:paddingLeft="15dp"
+                 android:layout_width="@dimen/min_touch_size"
+                 android:layout_height="@dimen/min_touch_size"
+                 android:layout_marginStart="15dp"
                  android:layout_centerVertical="true"
-                 android:layout_alignParentLeft="true"
+                 android:layout_alignParentStart="true"
                  android:layout_alignWithParentIfMissing="true"
-                 android:src="@drawable/btn_arrow_left"/>
+                 android:src="@drawable/btn_arrow_left_default"
+                 android:scaleType="centerInside"
+                 android:background="?android:attr/selectableItemBackgroundBorderless"/>
 
             <ImageView android:id="@+id/btn_forward"
                  android:clickable="true"
                  android:focusable="true"
-                 android:layout_width="wrap_content"
-                 android:layout_height="wrap_content"
-                 android:paddingRight="15dp"
+                 android:layout_width="@dimen/min_touch_size"
+                 android:layout_height="@dimen/min_touch_size"
+                 android:layout_marginEnd="15dp"
                  android:layout_centerVertical="true"
-                 android:layout_alignParentRight="true"
+                 android:layout_alignParentEnd="true"
                  android:layout_alignWithParentIfMissing="true"
-                 android:src="@drawable/btn_arrow_right"/>
+                 android:src="@drawable/btn_arrow_right_default"
+                 android:scaleType="centerInside"
+                 android:background="?android:attr/selectableItemBackgroundBorderless"/>
 
          </RelativeLayout>
 
@@ -117,14 +126,16 @@
 
             <TextView android:id="@+id/call_sign_tv"
                 android:textColor="@android:color/white"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:textStyle="bold"
                 android:textSize="40sp"
                 android:alpha="0.5"
                 android:paddingRight="2dp"
                 android:paddingLeft="2dp"
-                android:text="@string/default_blank" />
+                android:text="@string/default_blank"
+                android:gravity="center"
+                tools:text="ABCD"/>
 
             <TextView android:id="@+id/pty_tv"
                 android:textColor="@android:color/white"
@@ -132,8 +143,8 @@
                 android:layout_height="wrap_content"
                 android:textSize="22sp"
                 android:textAllCaps="true"
-                android:paddingRight="2dp"
                 android:paddingLeft="2dp"
+                android:paddingRight="2dp"
                 android:text="@string/default_blank" />
 
         </LinearLayout>
@@ -150,11 +161,13 @@
             android:paddingRight="10dp"
             android:paddingTop="10dp"
             android:layout_gravity="center_horizontal"
-            android:text="@string/default_blank"/>
+            android:text="@string/default_blank"
+            tools:text="@string/fm_off"
+            />
 
         <TextView android:id="@+id/eradio_text_tv"
             android:textColor="@android:color/white"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:textSize="16sp"
             android:singleLine="true"
@@ -162,7 +175,8 @@
             android:paddingLeft="2dp"
             android:paddingRight="2dp"
             android:gravity="center_horizontal"
-            android:text="@string/default_blank"/>
+            android:text="@string/default_blank"
+            tools:text="Some example text"/>
 
         <TextView android:id="@+id/prog_service_tv"
             android:textColor="@android:color/white"
@@ -178,8 +192,8 @@
             android:textColor="@android:color/white"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:drawableLeft="@drawable/count_down"
-            android:layout_toRightOf="@+id/btn_onoff"
+            android:drawableStart="@drawable/count_down"
+            android:layout_toEndOf="@+id/btn_onoff"
             android:textSize="15sp"
             android:drawablePadding="5dip"
             android:paddingTop="5dp"
diff --git a/fmapp2/res/layout/station_list.xml b/fmapp2/res/layout/station_list.xml
index 18d31f0..4532614 100644
--- a/fmapp2/res/layout/station_list.xml
+++ b/fmapp2/res/layout/station_list.xml
@@ -34,10 +34,10 @@
     android:layout_height="fill_parent"
     android:orientation="vertical">
 
-    <!--Change layout_height value "wrap_content" to "fill_parent" can dispaly last item dividing line -->
     <ListView android:id="@+id/station_list"
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent" >
+        android:layout_height="fill_parent"
+        android:divider="@null">
     </ListView>
 
 </LinearLayout>
diff --git a/fmapp2/res/layout/station_list_item.xml b/fmapp2/res/layout/station_list_item.xml
index 40c05d5..c53f815 100644
--- a/fmapp2/res/layout/station_list_item.xml
+++ b/fmapp2/res/layout/station_list_item.xml
@@ -29,48 +29,41 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/item"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical">
 
-   <TableLayout
-       android:id="@+id/TableLayout1"
-       android:layout_width="match_parent"
-       android:layout_height="wrap_content"
-       android:stretchColumns="1">
+   <TextView
+	   android:id="@+id/fixName"
+	   android:layout_width="wrap_content"
+	   android:layout_height="wrap_content"
+	   android:paddingStart="16dp"
+	   android:paddingEnd="8dp"
+	   android:paddingTop="15dp"
+	   android:text="@string/station_name" />
 
-       <TableRow>
-           <TextView
-               android:id="@+id/fixName"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               android:paddingLeft="30dp"
-               android:paddingTop="15dp"
-               android:text="@string/station_name" />
+   <TextView
+	   android:id="@+id/name"
+	   android:layout_width="wrap_content"
+	   android:layout_height="wrap_content"
+	   android:paddingTop="15dp"
+	   android:ellipsize="marquee"
+	   android:marqueeRepeatLimit="marquee_forever"
+	   android:layout_toEndOf="@id/fixName"
+	   tools:text="10"/>
 
-           <TextView
-               android:id="@+id/name"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               android:ellipsize="marquee"
-               android:marqueeRepeatLimit="marquee_forever" />
 
-       </TableRow>
-       <TableRow >
+	<TextView
+		android:id="@+id/freq"
+		android:layout_width="match_parent"
+		android:layout_height="wrap_content"
+		android:paddingStart="16dp"
+		android:paddingEnd="16dp"
+		android:paddingBottom="15dp"
+		android:textSize="20sp"
+		android:layout_below="@id/fixName"/>
 
-	    <TextView
-	        android:id="@+id/freq"
-	        android:layout_width="wrap_content"
-	        android:layout_height="wrap_content"
-	        android:paddingLeft="30dp"
-	        android:paddingBottom="15dp"
-	        android:textSize="20sp"
-	        android:layout_span="2" />
-
-       </TableRow>
-
-    </TableLayout>
-
-</LinearLayout>
+</RelativeLayout>
diff --git a/fmapp2/res/values/lineage_dimens.xml b/fmapp2/res/values/lineage_dimens.xml
new file mode 100644
index 0000000..0532ceb
--- /dev/null
+++ b/fmapp2/res/values/lineage_dimens.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="min_touch_size">48dp</dimen>
+</resources>
diff --git a/fmapp2/res/values/styles.xml b/fmapp2/res/values/styles.xml
index a53ced9..9be17ff 100644
--- a/fmapp2/res/values/styles.xml
+++ b/fmapp2/res/values/styles.xml
@@ -49,7 +49,7 @@
         <item name="android:layout_height">match_parent</item>
         <item name="android:textSize">18sp</item>
         <item name="android:textColor">@color/white</item>
-        <item name="android:background">@drawable/preset_button_background</item>
+        <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
         <item name="android:singleLine">true</item>
         <item name="android:text">@string/add_station</item>
         <item name="android:textStyle">bold</item>
@@ -61,8 +61,9 @@
         <item name="android:layout_height">wrap_content</item>
         <item name="android:textSize">18sp</item>
         <item name="android:textColor">@color/white</item>
-        <item name="android:background">@drawable/preset_button_background</item>
-        <item name="android:singleLine">true</item>    </style>
+        <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
+        <item name="android:singleLine">true</item>
+    </style>
 
     <style name="ButtonStripMiddle">
         <item name="android:gravity">center</item>
@@ -70,7 +71,7 @@
         <item name="android:layout_height">wrap_content</item>
         <item name="android:textSize">18sp</item>
         <item name="android:textColor">@color/white</item>
-        <item name="android:background">@drawable/preset_button_background</item>
+        <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
         <item name="android:singleLine">true</item>
     </style>
 
@@ -80,7 +81,7 @@
         <item name="android:layout_height">wrap_content</item>
         <item name="android:textSize">18sp</item>
         <item name="android:textColor">@color/white</item>
-        <item name="android:background">@drawable/preset_button_background</item>
+        <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
         <item name="android:singleLine">true</item>
     </style>
 
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 97e6961..325d213 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -61,8 +61,6 @@
 import android.view.View;
 import android.view.Window;
 import android.view.KeyEvent;
-import android.view.animation.Animation;
-import android.view.animation.AnimationUtils;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.EditText;
@@ -244,7 +242,6 @@
    private static boolean mIsSearching = false;
    private static int mScanPty = 0;
    private static int mScanPtyIndex = 0;
-   private Animation mAnimation = null;
    private ScrollerText mRadioTextScroller = null;
    private ScrollerText mERadioTextScroller = null;
 
@@ -370,9 +367,6 @@
         });
       }
 
-      mAnimation = AnimationUtils.loadAnimation(this,
-                                                R.anim.preset_select);
-
       mMuteButton = (ImageView)findViewById(R.id.btn_silent);
       if (mMuteButton != null) {
           mMuteButton.setOnClickListener(mMuteModeClickListener);
@@ -780,14 +774,13 @@
       }
       if (RECORDING_ENABLE) {
          item = menu.findItem(MENU_RECORD_START);
+         boolean canRecordOrStop = radioOn && !isAnalogModeEnabled();
          if (item != null) {
-            item.setVisible(true);
-            item.setEnabled((!recording) && radioOn && (!isAnalogModeEnabled()));
+            item.setVisible(!recording && canRecordOrStop);
          }
          item = menu.findItem(MENU_RECORD_STOP);
          if (item != null) {
-             item.setVisible(true);
-             item.setEnabled(recording && radioOn && (!isAnalogModeEnabled()));
+             item.setVisible(recording && canRecordOrStop);
          }
       }
 
@@ -1439,7 +1432,6 @@
               Log.d(LOGTAG, "station - " + station.getName() + " ("
                     + station.getFrequency() + ")");
               tuneRadio(station.getFrequency());
-              view.startAnimation(mAnimation);
            }
       }
    };
@@ -1455,7 +1447,6 @@
                displayDialog(DIALOG_PRESET_OPTIONS);
            }else {
                addToPresets();
-               //view.startAnimation(mAnimation);
            }
          return true;
       }
@@ -1502,7 +1493,6 @@
                }
                if (bStatus) {
                    setMuteModeButtonImage(true);
-                   v.startAnimation(mAnimation);
                }else {
                    mCommandFailed = CMD_MUTE;
                    if(isCallActive()) {
diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java
index 4a7c304..50f7872 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -112,6 +112,7 @@
           // Root
           PreferenceScreen root = getPreferenceManager().createPreferenceScreen(
                                 this);
+          getListView().setDivider(null);
 
            summaryBandItems = getResources().getStringArray(
                                 R.array.regional_band_summary);