FM: Re-add RDS fields to UI

Change-Id: Ib7cf1e0c5de85440f7d2a7563cc5f7e508b6998f
diff --git a/fmapp2/res/drawable-hdpi/recorder_stop.png b/fmapp2/res/drawable-hdpi/recorder_stop.png
index bb8b32b..ff9839b 100644
--- a/fmapp2/res/drawable-hdpi/recorder_stop.png
+++ b/fmapp2/res/drawable-hdpi/recorder_stop.png
Binary files differ
diff --git a/fmapp2/res/drawable-mdpi/recorder_stop.png b/fmapp2/res/drawable-mdpi/recorder_stop.png
index bb8b32b..ff9839b 100644
--- a/fmapp2/res/drawable-mdpi/recorder_stop.png
+++ b/fmapp2/res/drawable-mdpi/recorder_stop.png
Binary files differ
diff --git a/fmapp2/res/drawable/btn_recorder.xml b/fmapp2/res/drawable/btn_recorder.xml
index 88a5302..2161ba1 100644
--- a/fmapp2/res/drawable/btn_recorder.xml
+++ b/fmapp2/res/drawable/btn_recorder.xml
@@ -30,8 +30,6 @@
  */
  -->
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true"
-        android:drawable="@drawable/recorder_selected" />
     <item android:state_enabled="true"
         android:drawable="@drawable/recorder_stop" />
     <item android:state_enabled="false"
diff --git a/fmapp2/res/drawable/recorder_stop.png b/fmapp2/res/drawable/recorder_stop.png
index 6017be9..ff9839b 100644
--- a/fmapp2/res/drawable/recorder_stop.png
+++ b/fmapp2/res/drawable/recorder_stop.png
Binary files differ
diff --git a/fmapp2/res/layout/fmradio.xml b/fmapp2/res/layout/fmradio.xml
index c78f563..3d13e76 100644
--- a/fmapp2/res/layout/fmradio.xml
+++ b/fmapp2/res/layout/fmradio.xml
@@ -33,41 +33,6 @@
     android:layout_height="fill_parent"
     android:orientation="vertical">
 
-    <RelativeLayout android:id="@+id/layout_on_off"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        android:layout_marginTop="3dp">
-
-        <TextView android:id="@+id/sleep_msg_tv"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:drawableLeft="@drawable/count_down"
-            android:layout_toRightOf="@+id/btn_onoff"
-            android:textSize="14sp"
-            android:layout_marginLeft="5dp"
-            android:textStyle="bold"
-            android:visibility="invisible"
-            android:text="@string/default_sleep" />
-
-        <TextView android:id="@+id/prog_service_tv"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:gravity="center"
-            android:visibility="gone"
-            android:layout_marginLeft="2dp"
-            android:layout_marginRight="2dp"
-            android:layout_toLeftOf="@+id/btn_silent"
-            android:layout_toRightOf="@+id/sleep_msg_tv"
-            android:textSize="16sp"
-            android:singleLine="true"
-            android:textStyle="bold"
-            android:text="@string/prog_service_string"/>
-
-    </RelativeLayout>
-
     <LinearLayout android:id="@+id/stationinfo_layout"
         android:layout_width="fill_parent"
         android:layout_height="match_parent"
diff --git a/fmapp2/res/layout/station_info.xml b/fmapp2/res/layout/station_info.xml
index 4d75816..aee2068 100644
--- a/fmapp2/res/layout/station_info.xml
+++ b/fmapp2/res/layout/station_info.xml
@@ -29,6 +29,7 @@
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <LinearLayout android:id="@+id/station_info"
+        android:animateLayoutChanges="true"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_weight="0"
@@ -77,7 +78,7 @@
                  android:textColor="@android:color/white"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
-                 android:textSize="56sp"
+                 android:textSize="46sp"
                  android:textStyle="bold"
                  android:gravity="center"
                  android:clickable="true"
@@ -111,15 +112,15 @@
         <LinearLayout android:id="@+id/station_frequency_row"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:gravity="center">
+            android:gravity="center_horizontal"
+            android:orientation="vertical">
 
             <TextView android:id="@+id/call_sign_tv"
                 android:textColor="@android:color/white"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textStyle="bold"
-                android:textSize="50sp"
+                android:textSize="40sp"
                 android:alpha="0.5"
                 android:paddingRight="2dp"
                 android:paddingLeft="2dp"
@@ -129,7 +130,7 @@
                 android:textColor="@android:color/white"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:textSize="32sp"
+                android:textSize="22sp"
                 android:textAllCaps="true"
                 android:paddingRight="2dp"
                 android:paddingLeft="2dp"
@@ -139,43 +140,67 @@
 
         <!-- Station Radio Text information display -->
         <TextView android:id="@+id/radio_text_tv"
-            android:layout_width="fill_parent"
+            android:textColor="@android:color/white"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
             android:textSize="16sp"
             android:singleLine="true"
             android:textStyle="bold"
-            android:paddingLeft="2dp"
-            android:paddingRight="2dp"
-            android:paddingBottom="5dp"
-            android:paddingTop="20dp"
-            android:gravity="center_horizontal"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
+            android:paddingTop="10dp"
+            android:layout_gravity="center_horizontal"
             android:text="@string/radio_text_string"/>
 
         <TextView android:id="@+id/eradio_text_tv"
-            android:layout_width="fill_parent"
+            android:textColor="@android:color/white"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
             android:textSize="16sp"
             android:singleLine="true"
             android:textStyle="bold"
             android:paddingLeft="2dp"
             android:paddingRight="2dp"
-            android:paddingBottom="5dp"
             android:gravity="center_horizontal"
             android:text="@string/eradio_text_string"/>
 
-        <TextView android:id="@+id/record_msg_tv"
-            android:layout_width="fill_parent"
+        <TextView android:id="@+id/prog_service_tv"
+            android:textColor="@android:color/white"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_gravity="center_horizontal"
+            android:textSize="16sp"
+            android:singleLine="true"
+            android:textStyle="bold"
+            android:text="@string/prog_service_string"/>
+
+        <TextView android:id="@+id/sleep_msg_tv"
+            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:textSize="15sp"
+            android:drawablePadding="5dip"
+            android:paddingTop="5dp"
+            android:paddingBottom="5dp"
+            android:textStyle="bold"
+            android:visibility="invisible"
+            android:layout_gravity="center_horizontal"
+            android:text="@string/default_sleep" />
+
+        <TextView android:id="@+id/record_msg_tv"
+            android:textColor="@android:color/white"
+            android:visibility="invisible"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
             android:textSize="15sp"
             android:singleLine="true"
             android:textStyle="bold"
-            android:paddingLeft="2dp"
-            android:paddingRight="2dp"
+            android:paddingTop="5dp"
             android:paddingBottom="5dp"
-            android:gravity="center_horizontal"
+            android:drawablePadding="5dip"
+            android:layout_gravity="center_horizontal"
             android:text="@string/eradio_text_string"/>
 
     </LinearLayout>
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 1e92db9..b29f779 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -1715,8 +1715,7 @@
 
    private void setRecordingStartImage() {
        if(null != mRecordingMsgTV) {
-          mRecordingMsgTV.setCompoundDrawablesWithIntrinsicBounds
-                           (R.drawable.recorder_start, 0, 0, 0);
+          mRecordingMsgTV.setCompoundDrawables(null,  null,  null,  null);
        }
    }
 
@@ -1725,7 +1724,7 @@
       int durationInMins = FmSharedPreferences.getRecordDuration();
       Log.e(LOGTAG, " Fected duration:" + durationInMins );
       initiateRecordDurationTimer( durationInMins );
-      //setRecordingStopImage();
+      setRecordingStopImage();
       invalidateOptionsMenu();
    }
 
@@ -1837,9 +1836,9 @@
              mRecordingMsgTV.setText("");
          }
          if(isRecording()) {
-            //setRecordingStopImage();
+            setRecordingStopImage();
          }else {
-            //setRecordingStartImage();
+            setRecordingStartImage();
          }
          for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) {
              if (mPresetButtons[nButton] != null) {
@@ -1885,23 +1884,23 @@
       }
       if (mSleepMsgTV != null) {
          mSleepMsgTV.setVisibility(((bEnable && isSleepTimerActive()) ? View.VISIBLE
-                                 : View.INVISIBLE));
+                                 : View.GONE));
       }
       if (mRecordingMsgTV != null) {
          mRecordingMsgTV.setVisibility(((bEnable == true) ? View.VISIBLE
-                                     : View.INVISIBLE));
+                                     : View.GONE));
       }
       if (mRadioTextTV != null) {
          mRadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE
-                                  : View.INVISIBLE));
+                                  : View.GONE));
       }
       if(mERadioTextTV != null) {
          mERadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE
                                   : View.GONE));
       }
-      if (false && mProgramServiceTV != null) {
+      if (mProgramServiceTV != null) {
          mProgramServiceTV.setVisibility(((bEnable == true) ? View.VISIBLE
-                                  : View.INVISIBLE));
+                                  : View.GONE));
       }
 
       if (!isAntennaAvailable()) {
@@ -1920,6 +1919,7 @@
          }
          if (mERadioTextTV != null) {
              mERadioTextTV.setText("");
+             mERadioTextTV.setVisibility(View.GONE);
              mERadioTextScroller.mOriginalString = "";
          }
          if (mOnOffButton != null) {
@@ -1932,6 +1932,7 @@
          }
          if (mERadioTextTV != null) {
              mERadioTextTV.setText("");
+             mERadioTextTV.setVisibility(View.GONE);
              mERadioTextScroller.mOriginalString = "";
          }
          if (mOnOffButton != null) {
@@ -2043,6 +2044,8 @@
       mProgramTypeTV.setText(mTunedStation.getPtyString());
       mRadioTextTV.setText("");
       mERadioTextTV.setText("");
+      mERadioTextTV.setVisibility(View.GONE);
+      mRadioTextTV.setVisibility(View.GONE);
       mRadioTextScroller.mOriginalString = "";
       mRadioTextScroller.mStringlength = 0;
       mRadioTextScroller.mIteration = 0;
@@ -2331,7 +2334,7 @@
          }
       }
       if(null != mSleepMsgTV) {
-         mSleepMsgTV.setVisibility(View.INVISIBLE);
+         mSleepMsgTV.setVisibility(View.GONE);
       }
    }
 
@@ -2363,7 +2366,7 @@
    }
 
    private void updateExpiredSleepTime() {
-      int vis = View.INVISIBLE;
+      int vis = View.GONE;
       if (isSleepTimerActive()) {
          long timeNow = ((SystemClock.elapsedRealtime()));
          if (mSleepAtPhoneTime >= timeNow) {
@@ -2372,8 +2375,8 @@
             mSleepMsgTV.setText(sleepMsg);
             if (seconds < SLEEP_TOGGLE_SECONDS) {
                int nowVis = mSleepMsgTV.getVisibility();
-               vis = (nowVis == View.INVISIBLE) ? View.VISIBLE
-                     : View.INVISIBLE;
+               vis = (nowVis == View.GONE) ? View.VISIBLE
+                     : View.GONE;
             }else {
                vis = View.VISIBLE;
             }
@@ -2686,6 +2689,7 @@
                    mERadioTextTV.setText("");
                    mERadioTextScroller.mOriginalString = "";
                }else {
+                   mERadioTextTV.setVisibility(View.GONE);
                    mERadioTextTV.setText(str);
                    mERadioTextScroller.mOriginalString = str;
                }