summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2014-11-18 17:12:50 -0800
committerEthan Chen <intervigil@gmail.com>2015-01-08 12:37:01 -0800
commit4283877b254ba75ef42d540a6755ebf29724d302 (patch)
tree53bd54bdf352df720b10cbeb21d75c2989c6a062
parent659fb041e31008a33b1ca62c073bd6af607ccf01 (diff)
downloadandroid_hardware_qcom_fm-4283877b254ba75ef42d540a6755ebf29724d302.tar.gz
android_hardware_qcom_fm-4283877b254ba75ef42d540a6755ebf29724d302.tar.bz2
android_hardware_qcom_fm-4283877b254ba75ef42d540a6755ebf29724d302.zip
FmRadio : Re-add RDS fields to UI
Change-Id: Ib7cf1e0c5de85440f7d2a7563cc5f7e508b6998f
-rw-r--r--fmapp2/res/drawable-hdpi/recorder_stop.pngbin4930 -> 696 bytes
-rw-r--r--fmapp2/res/drawable-mdpi/recorder_stop.pngbin4930 -> 696 bytes
-rw-r--r--fmapp2/res/drawable/btn_recorder.xml2
-rw-r--r--fmapp2/res/drawable/recorder_stop.pngbin4172 -> 696 bytes
-rw-r--r--fmapp2/res/layout/fmradio.xml35
-rw-r--r--fmapp2/res/layout/station_info.xml65
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadio.java34
7 files changed, 64 insertions, 72 deletions
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/prog_service_tv"
+ android:textColor="@android:color/white"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ 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:layout_width="fill_parent"
+ android:textColor="@android:color/white"
+ android:visibility="invisible"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
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 695b6fb..7070ffa 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -1776,8 +1776,7 @@ public class FMRadio extends Activity
private void setRecordingStartImage() {
if(null != mRecordingMsgTV) {
- mRecordingMsgTV.setCompoundDrawablesWithIntrinsicBounds
- (R.drawable.recorder_start, 0, 0, 0);
+ mRecordingMsgTV.setCompoundDrawables(null, null, null, null);
}
}
@@ -1786,7 +1785,7 @@ public class FMRadio extends Activity
int durationInMins = FmSharedPreferences.getRecordDuration();
Log.e(LOGTAG, " Fected duration:" + durationInMins );
initiateRecordDurationTimer( durationInMins );
- //setRecordingStopImage();
+ setRecordingStopImage();
invalidateOptionsMenu();
}
@@ -1798,7 +1797,7 @@ public class FMRadio extends Activity
}
if(null != mRecordingMsgTV) {
mRecordingMsgTV.setText("");
- //setRecordingStartImage();
+ setRecordingStartImage();
}
if (mService != null) {
try {
@@ -1882,9 +1881,9 @@ public class FMRadio extends Activity
mRecordingMsgTV.setText("");
}
if(isRecording()) {
- //setRecordingStopImage();
+ setRecordingStopImage();
}else {
- //setRecordingStartImage();
+ setRecordingStartImage();
}
for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) {
if (mPresetButtons[nButton] != null) {
@@ -1930,23 +1929,23 @@ public class FMRadio extends Activity
}
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 (mProgramServiceTV != null) {
-// mProgramServiceTV.setVisibility(((bEnable == true) ? View.VISIBLE
-// : View.INVISIBLE));
+ mProgramServiceTV.setVisibility(((bEnable == true) ? View.VISIBLE
+ : View.GONE));
}
if (!isAntennaAvailable()) {
@@ -1965,6 +1964,7 @@ public class FMRadio extends Activity
}
if (mERadioTextTV != null) {
mERadioTextTV.setText("");
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextScroller.mOriginalString = "";
}
if (mOnOffButton != null) {
@@ -1977,6 +1977,7 @@ public class FMRadio extends Activity
}
if (mERadioTextTV != null) {
mERadioTextTV.setText("");
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextScroller.mOriginalString = "";
}
if (mOnOffButton != null) {
@@ -2088,6 +2089,8 @@ public class FMRadio extends Activity
mProgramTypeTV.setText(mTunedStation.getPtyString());
mRadioTextTV.setText("");
mERadioTextTV.setText("");
+ mERadioTextTV.setVisibility(View.GONE);
+ mRadioTextTV.setVisibility(View.GONE);
mRadioTextScroller.mOriginalString = "";
mRadioTextScroller.mStringlength = 0;
mRadioTextScroller.mIteration = 0;
@@ -2361,7 +2364,7 @@ public class FMRadio extends Activity
mSleepUpdateHandlerThread.interrupt();
}
if(null != mSleepMsgTV) {
- mSleepMsgTV.setVisibility(View.INVISIBLE);
+ mSleepMsgTV.setVisibility(View.GONE);
}
}
@@ -2393,7 +2396,7 @@ public class FMRadio extends Activity
}
private void updateExpiredSleepTime() {
- int vis = View.INVISIBLE;
+ int vis = View.GONE;
if (isSleepTimerActive()) {
long timeNow = ((SystemClock.elapsedRealtime()));
if (mSleepAtPhoneTime >= timeNow) {
@@ -2402,8 +2405,8 @@ public class FMRadio extends Activity
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;
}
@@ -2732,6 +2735,7 @@ public class FMRadio extends Activity
mERadioTextTV.setText("");
mERadioTextScroller.mOriginalString = "";
}else {
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextTV.setText(str);
mERadioTextScroller.mOriginalString = str;
}