summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2014-11-18 17:12:50 -0800
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 20:00:33 +0200
commit20091fd0d19ab4652cb7b0fcd6d342235752f0bc (patch)
tree1ffa83eba00377bf2c108ee7faf075b34a976ded
parent51f40a40230ffc976562f5652c5c356233800422 (diff)
downloadandroid_hardware_qcom_fm-20091fd0d19ab4652cb7b0fcd6d342235752f0bc.tar.gz
android_hardware_qcom_fm-20091fd0d19ab4652cb7b0fcd6d342235752f0bc.tar.bz2
android_hardware_qcom_fm-20091fd0d19ab4652cb7b0fcd6d342235752f0bc.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.java32
7 files changed, 63 insertions, 71 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 d11bae5..392a0df 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -1829,8 +1829,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);
}
}
@@ -1839,7 +1838,7 @@ public class FMRadio extends Activity
int durationInMins = FmSharedPreferences.getRecordDuration();
Log.e(LOGTAG, " Fected duration:" + durationInMins );
initiateRecordDurationTimer( durationInMins );
- //setRecordingStopImage();
+ setRecordingStopImage();
invalidateOptionsMenu();
}
@@ -1951,9 +1950,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) {
@@ -1999,23 +1998,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()) {
@@ -2034,6 +2033,7 @@ public class FMRadio extends Activity
}
if (mERadioTextTV != null) {
mERadioTextTV.setText("");
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextScroller.mOriginalString = "";
}
if (mOnOffButton != null) {
@@ -2046,6 +2046,7 @@ public class FMRadio extends Activity
}
if (mERadioTextTV != null) {
mERadioTextTV.setText("");
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextScroller.mOriginalString = "";
}
if (mOnOffButton != null) {
@@ -2157,6 +2158,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;
@@ -2440,7 +2443,7 @@ public class FMRadio extends Activity
mSleepUpdateHandlerThread.interrupt();
}
if(null != mSleepMsgTV) {
- mSleepMsgTV.setVisibility(View.INVISIBLE);
+ mSleepMsgTV.setVisibility(View.GONE);
}
}
@@ -2472,7 +2475,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) {
@@ -2481,8 +2484,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;
}
@@ -2795,6 +2798,7 @@ public class FMRadio extends Activity
mERadioTextTV.setText("");
mERadioTextScroller.mOriginalString = "";
}else {
+ mERadioTextTV.setVisibility(View.GONE);
mERadioTextTV.setText(str);
mERadioTextScroller.mOriginalString = str;
}