diff options
author | Danesh M <daneshm90@gmail.com> | 2014-11-14 11:05:18 -0800 |
---|---|---|
committer | Raj Yengisetty <rajesh@cyngn.com> | 2014-11-14 17:04:39 -0800 |
commit | c1f1e9cb65757b416c9be00a21bc73a5ae7306d6 (patch) | |
tree | d0f761fbefc85adb136f1e09ec1d919a5377555f | |
parent | ebe0d15fba5396d4c3e14e9e9f77043f7dc635a7 (diff) | |
download | android_hardware_qcom_fm-c1f1e9cb65757b416c9be00a21bc73a5ae7306d6.tar.gz android_hardware_qcom_fm-c1f1e9cb65757b416c9be00a21bc73a5ae7306d6.tar.bz2 android_hardware_qcom_fm-c1f1e9cb65757b416c9be00a21bc73a5ae7306d6.zip |
FMRadio : Re-vamp UI
Change-Id: Ib9cb3d5663f9eec92922a3eea7d605a2bf3b538c
58 files changed, 292 insertions, 1056 deletions
diff --git a/fmapp/res/layout-normal/fmradio.xml b/fmapp/res/layout-normal/fmradio.xml deleted file mode 100644 index 5b9197c..0000000 --- a/fmapp/res/layout-normal/fmradio.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2009, 2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/fmradio" - android:background="@drawable/application_border" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <!-- This LinearLayout contains Station Information display and the function buttons --> - - <RelativeLayout android:id="@+id/stationinfo_layout" - android:background="@drawable/station_border" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="5dp" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" > - - <!-- This included layout contains Station Information to display --> - <include layout="@layout/station_info" /> - </RelativeLayout> - - <RelativeLayout android:id="@+id/preset_full_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_below="@id/stationinfo_layout" - android:layout_alignParentLeft="true"> - - <!-- Layout contains the Next/Previous Presets and Tune buttons and status msg text--> - <include layout="@layout/navigate" /> - </RelativeLayout> - - <RelativeLayout android:id="@+id/on_off_separator_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="20dp" - android:layout_below="@id/preset_full_layout"> - - <View android:id="@+id/on_off_separator" - android:layout_width="fill_parent" - android:layout_height="1dp" - android:background="#ffffffff"/> - - </RelativeLayout> - - <RelativeLayout android:id="@+id/layout_on_off" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="1dp" - android:layout_centerInParent="true" - android:layout_below="@id/on_off_separator_layout"> - - <ImageButton android:id="@+id/btn_silent" - android:src="@drawable/ic_silent_mode_off" - android:layout_width="120dp" - android:layout_height="65dp" /> - - <ImageButton android:id="@+id/btn_onoff" - android:src="@drawable/ic_btn_onoff" - android:layout_toRightOf="@id/btn_silent" - android:layout_width="120dp" - android:layout_height="65dp" /> - </RelativeLayout> - -</RelativeLayout> diff --git a/fmapp/res/layout-normal/station_info.xml b/fmapp/res/layout-normal/station_info.xml deleted file mode 100644 index e47f823..0000000 --- a/fmapp/res/layout-normal/station_info.xml +++ /dev/null @@ -1,182 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2009, 2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * 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"> - -<RelativeLayout android:id="@+id/station_info" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_weight="0" - android:gravity="top"> - - <RelativeLayout android:id="@+id/top_most" - android:layout_width="fill_parent" - android:gravity="top" - android:layout_height="wrap_content"> - - <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:layout_alignParentTop="true" - android:layout_alignParentLeft="true"/> - - <TextView android:id="@+id/prog_service_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" - android:layout_alignBaseline="@id/signal_level" - android:textSize="16dp" - android:singleLine="true" - android:textStyle="bold" - android:text="@string/prog_service_string" /> - - <TextView android:id="@+id/stereo_text_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingRight="5dp" - android:layout_alignParentTop="true" - android:layout_alignParentRight="true" - android:layout_alignBaseline="@id/signal_level" - android:textSize="16dp" - android:text="@string/default_audio" /> - - </RelativeLayout> - - <RelativeLayout android:id="@+id/station_id_row" - android:layout_width="fill_parent" - android:layout_below="@id/top_most" - android:layout_height="wrap_content"> - - <TextView android:id="@+id/call_sign_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="16dp" - android:layout_centerInParent="true" - android:text="@string/station_id_string" /> - - </RelativeLayout> - - <RelativeLayout android:id="@+id/station_frequency_row" - android:layout_width="fill_parent" - android:layout_below="@id/station_id_row" - android:layout_height="wrap_content" - android:gravity="center" > - - <TextView android:id="@+id/prog_frequency_tv" - android:textAppearance="?android:attr/textAppearanceLarge" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="50dp" - android:layout_centerHorizontal="true" - android:layout_centerVertical="true" - android:text="@string/frequency_string"/> - - <ImageView android:id="@+id/btn_back" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="100dp" - android:paddingLeft="2dp" - android:layout_alignParentLeft="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_left" /> - - <ImageView android:id="@+id/btn_forward" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="100dp" - android:paddingRight="2dp" - android:layout_alignParentRight="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_right" /> - </RelativeLayout> - - <RelativeLayout android:id="@+id/second_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_alignLeft="@id/station_frequency_row" - android:layout_alignRight="@id/station_frequency_row" - android:layout_below="@id/station_frequency_row" > - - <TextView android:id="@+id/pty_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="16dp" - android:layout_centerInParent="true" - android:text="@string/pty_string" /> - </RelativeLayout> - - <RelativeLayout android:id="@+id/third_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:layout_alignLeft="@id/second_layout" - android:layout_alignRight="@id/second_layout" - android:layout_below="@id/second_layout" > - - <TextView android:id="@+id/radio_text_tv" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="16dp" - android:singleLine="true" - android:textStyle="bold" - android:paddingLeft="2dp" - android:paddingRight="2dp" - android:paddingBottom="5dp" - android:gravity="center" - android:text="@string/radio_text_string" /> - - <TextView android:id="@+id/eradio_text_tv" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="16dp" - android:singleLine="true" - android:textStyle="bold" - android:paddingLeft="2dp" - android:paddingRight="2dp" - android:paddingBottom="5dp" - android:layout_below="@id/radio_text_tv" - android:gravity="center_horizontal" - android:text="@string/eradio_text_string"/> - </RelativeLayout> - <!-- Station Radio Text information display --> - </RelativeLayout> -</merge> diff --git a/fmapp/res/layout-small/station_info.xml b/fmapp/res/layout-small/station_info.xml deleted file mode 100644 index 0f3fce4..0000000 --- a/fmapp/res/layout-small/station_info.xml +++ /dev/null @@ -1,176 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * 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"> - - <LinearLayout android:id="@+id/station_info" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_weight="0" - android:orientation="vertical" - android:gravity="top"> - - <RelativeLayout android:id="@+id/top_most" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <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:layout_alignParentTop="true" - android:layout_alignParentLeft="true"/> - - <TextView android:id="@+id/prog_service_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" - android:layout_alignBaseline="@id/signal_level" - android:textSize="20dp" - android:singleLine="true" - android:textStyle="bold" - android:text="@string/prog_service_string"/> - - <TextView android:id="@+id/stereo_text_tv" - android:textAppearance="?android:attr/textAppearanceSmall" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingRight="5dp" - android:layout_alignParentTop="true" - android:layout_alignParentRight="true" - android:layout_alignBaseline="@id/signal_level" - android:textSize="14dp" - android:text="@string/default_audio"/> - - </RelativeLayout> - - <LinearLayout android:id="@+id/station_frequency_row" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:paddingTop="5dp" - android:paddingBottom="5dp" - android:layout_alignWithParentIfMissing="true" - android:gravity="center"> - - <TextView android:id="@+id/call_sign_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="14dp" - android:paddingTop="2dp" - android:paddingRight="2dp" - android:paddingBottom="2dp" - android:paddingLeft="2dp" - android:text="@string/station_id_string" /> - - <RelativeLayout android:id="@+id/second_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="2dp" - android:layout_marginBottom="2dp" - android:layout_marginLeft="2dp" - android:layout_marginRight="2dp"> - - <TextView android:id="@+id/prog_frequency_tv" - android:textAppearance="?android:attr/textAppearanceLarge" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="64dp" - android:layout_centerHorizontal="true" - android:text="@string/frequency_string"/> - - <ImageView android:id="@+id/btn_back" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="100dp" - android:paddingLeft="2dp" - android:layout_alignParentLeft="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_left"/> - - <ImageView android:id="@+id/btn_forward" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="100dp" - android:paddingRight="2dp" - android:layout_alignParentRight="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_right"/> - - </RelativeLayout> - - <TextView android:id="@+id/pty_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="14dp" - android:paddingTop="2dp" - android:paddingRight="2dp" - android:paddingBottom="2dp" - android:paddingLeft="2dp" - android:text="@string/pty_string" /> - - </LinearLayout> - - <!-- Station Radio Text information display --> - <TextView android:id="@+id/radio_text_tv" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="20dp" - android:singleLine="true" - android:textStyle="bold" - android:paddingLeft="2dp" - android:paddingRight="2dp" - android:paddingBottom="5dp" - android:gravity="center_horizontal" - android:text="@string/radio_text_string"/> - - <TextView android:id="@+id/eradio_text_tv" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="20dp" - 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"/> - </LinearLayout> - -</merge> diff --git a/fmapp2/AndroidManifest.xml b/fmapp2/AndroidManifest.xml index 77fc3e7..9905c23 100644 --- a/fmapp2/AndroidManifest.xml +++ b/fmapp2/AndroidManifest.xml @@ -59,6 +59,7 @@ android:name=".FMRadio" android:label="@string/app_name" android:clearTaskOnLaunch="true" + android:screenOrientation="portrait" android:allowTaskReparenting="true" android:launchMode="singleTask" android:excludeFromRecents="false" > diff --git a/fmapp2/res/drawable-hdpi/bg.png b/fmapp2/res/drawable-hdpi/bg.png Binary files differdeleted file mode 100644 index fd10f0b..0000000 --- a/fmapp2/res/drawable-hdpi/bg.png +++ /dev/null diff --git a/fmapp2/res/drawable-hdpi/ic_btn_earphone_default.png b/fmapp2/res/drawable-hdpi/ic_btn_earphone_default.png Binary files differindex 6a5b8db..2f45a17 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_earphone_default.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_earphone_default.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_earphone_diable.png b/fmapp2/res/drawable-hdpi/ic_btn_earphone_diable.png Binary files differindex f32b96e..2f45a17 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_earphone_diable.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_earphone_diable.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_earphone_select.png b/fmapp2/res/drawable-hdpi/ic_btn_earphone_select.png Binary files differindex 67afd3e..66ac5c1 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_earphone_select.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_earphone_select.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_onoff_default.png b/fmapp2/res/drawable-hdpi/ic_btn_onoff_default.png Binary files differindex 1c0f511..456c77f 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_onoff_default.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_onoff_default.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_onoff_disable.png b/fmapp2/res/drawable-hdpi/ic_btn_onoff_disable.png Binary files differindex 12b2d28..6fac84e 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_onoff_disable.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_onoff_disable.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_onoff_press.png b/fmapp2/res/drawable-hdpi/ic_btn_onoff_press.png Binary files differindex efeebd3..94893c2 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_onoff_press.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_onoff_press.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_spaker.png b/fmapp2/res/drawable-hdpi/ic_btn_spaker.png Binary files differindex f439e2e..07614df 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_spaker.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_spaker.png diff --git a/fmapp2/res/drawable-hdpi/ic_btn_spaker_select.png b/fmapp2/res/drawable-hdpi/ic_btn_spaker_select.png Binary files differindex bd5d57b..1b14993 100644 --- a/fmapp2/res/drawable-hdpi/ic_btn_spaker_select.png +++ b/fmapp2/res/drawable-hdpi/ic_btn_spaker_select.png diff --git a/fmapp2/res/drawable-hdpi/ic_silent_mode.png b/fmapp2/res/drawable-hdpi/ic_silent_mode.png Binary files differnew file mode 100644 index 0000000..1bb2631 --- /dev/null +++ b/fmapp2/res/drawable-hdpi/ic_silent_mode.png diff --git a/fmapp2/res/drawable-hdpi/ic_silent_mode_off.png b/fmapp2/res/drawable-hdpi/ic_silent_mode_off.png Binary files differnew file mode 100644 index 0000000..76a7498 --- /dev/null +++ b/fmapp2/res/drawable-hdpi/ic_silent_mode_off.png diff --git a/fmapp2/res/drawable-mdpi/bg.png b/fmapp2/res/drawable-mdpi/bg.png Binary files differdeleted file mode 100644 index fd10f0b..0000000 --- a/fmapp2/res/drawable-mdpi/bg.png +++ /dev/null diff --git a/fmapp2/res/drawable-mdpi/ic_btn_earphone_default.png b/fmapp2/res/drawable-mdpi/ic_btn_earphone_default.png Binary files differindex c729ed0..384a6bd 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_earphone_default.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_earphone_default.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_earphone_diable.png b/fmapp2/res/drawable-mdpi/ic_btn_earphone_diable.png Binary files differindex c0929ba..384a6bd 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_earphone_diable.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_earphone_diable.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_earphone_select.png b/fmapp2/res/drawable-mdpi/ic_btn_earphone_select.png Binary files differindex fb51ce1..543dc81 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_earphone_select.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_earphone_select.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_onoff_default.png b/fmapp2/res/drawable-mdpi/ic_btn_onoff_default.png Binary files differindex 9303cfb..0f21a6c 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_onoff_default.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_onoff_default.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_onoff_disable.png b/fmapp2/res/drawable-mdpi/ic_btn_onoff_disable.png Binary files differindex 57e060a..9835514 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_onoff_disable.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_onoff_disable.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_onoff_press.png b/fmapp2/res/drawable-mdpi/ic_btn_onoff_press.png Binary files differindex 1228a66..524a101 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_onoff_press.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_onoff_press.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_spaker.png b/fmapp2/res/drawable-mdpi/ic_btn_spaker.png Binary files differindex b72fab9..82a6d91 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_spaker.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_spaker.png diff --git a/fmapp2/res/drawable-mdpi/ic_btn_spaker_select.png b/fmapp2/res/drawable-mdpi/ic_btn_spaker_select.png Binary files differindex 250baea..da74c11 100644 --- a/fmapp2/res/drawable-mdpi/ic_btn_spaker_select.png +++ b/fmapp2/res/drawable-mdpi/ic_btn_spaker_select.png diff --git a/fmapp2/res/drawable-mdpi/ic_silent_mode.png b/fmapp2/res/drawable-mdpi/ic_silent_mode.png Binary files differnew file mode 100644 index 0000000..fb64fc7 --- /dev/null +++ b/fmapp2/res/drawable-mdpi/ic_silent_mode.png diff --git a/fmapp2/res/drawable-mdpi/ic_silent_mode_off.png b/fmapp2/res/drawable-mdpi/ic_silent_mode_off.png Binary files differnew file mode 100644 index 0000000..5e1a972 --- /dev/null +++ b/fmapp2/res/drawable-mdpi/ic_silent_mode_off.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_earphone_default.png b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_default.png Binary files differnew file mode 100644 index 0000000..70e0193 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_default.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_earphone_diable.png b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_diable.png Binary files differnew file mode 100644 index 0000000..70e0193 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_diable.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_earphone_select.png b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_select.png Binary files differnew file mode 100644 index 0000000..4cbbee1 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_earphone_select.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_onoff_default.png b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_default.png Binary files differnew file mode 100644 index 0000000..87e7444 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_default.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_onoff_disable.png b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_disable.png Binary files differnew file mode 100644 index 0000000..ca13752 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_disable.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_onoff_press.png b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_press.png Binary files differnew file mode 100644 index 0000000..9256e04 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_onoff_press.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_spaker.png b/fmapp2/res/drawable-xhdpi/ic_btn_spaker.png Binary files differnew file mode 100644 index 0000000..e51c03d --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_spaker.png diff --git a/fmapp2/res/drawable-xhdpi/ic_btn_spaker_select.png b/fmapp2/res/drawable-xhdpi/ic_btn_spaker_select.png Binary files differnew file mode 100644 index 0000000..be19ec0 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_btn_spaker_select.png diff --git a/fmapp2/res/drawable-xhdpi/ic_silent_mode.png b/fmapp2/res/drawable-xhdpi/ic_silent_mode.png Binary files differnew file mode 100644 index 0000000..38b2097 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_silent_mode.png diff --git a/fmapp2/res/drawable-xhdpi/ic_silent_mode_off.png b/fmapp2/res/drawable-xhdpi/ic_silent_mode_off.png Binary files differnew file mode 100644 index 0000000..cd253f5 --- /dev/null +++ b/fmapp2/res/drawable-xhdpi/ic_silent_mode_off.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_default.png b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_default.png Binary files differnew file mode 100644 index 0000000..ec3c9b8 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_default.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_diable.png b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_diable.png Binary files differnew file mode 100644 index 0000000..ec3c9b8 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_diable.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_select.png b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_select.png Binary files differnew file mode 100644 index 0000000..08544f3 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_earphone_select.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_default.png b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_default.png Binary files differnew file mode 100644 index 0000000..57e34e0 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_default.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_disable.png b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_disable.png Binary files differnew file mode 100644 index 0000000..a345efc --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_disable.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_press.png b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_press.png Binary files differnew file mode 100644 index 0000000..c5ed5af --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_onoff_press.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_spaker.png b/fmapp2/res/drawable-xxhdpi/ic_btn_spaker.png Binary files differnew file mode 100644 index 0000000..870da4d --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_spaker.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_btn_spaker_select.png b/fmapp2/res/drawable-xxhdpi/ic_btn_spaker_select.png Binary files differnew file mode 100644 index 0000000..52b4585 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_btn_spaker_select.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_silent_mode.png b/fmapp2/res/drawable-xxhdpi/ic_silent_mode.png Binary files differnew file mode 100644 index 0000000..7414f33 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_silent_mode.png diff --git a/fmapp2/res/drawable-xxhdpi/ic_silent_mode_off.png b/fmapp2/res/drawable-xxhdpi/ic_silent_mode_off.png Binary files differnew file mode 100644 index 0000000..200ef39 --- /dev/null +++ b/fmapp2/res/drawable-xxhdpi/ic_silent_mode_off.png diff --git a/fmapp2/res/drawable/bg.png b/fmapp2/res/drawable/bg.png Binary files differindex fd10f0b..ebd97fd 100644 --- a/fmapp2/res/drawable/bg.png +++ b/fmapp2/res/drawable/bg.png diff --git a/fmapp2/res/drawable/preset_button_background.xml b/fmapp2/res/drawable/preset_button_background.xml new file mode 100644 index 0000000..d6acfa5 --- /dev/null +++ b/fmapp2/res/drawable/preset_button_background.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:state_pressed="true" + android:drawable="@color/favorite_button_active" /> + + <item android:state_focused="true" + android:drawable="@color/favorite_button_active" /> + + <item android:state_enabled="true" + android:drawable="@color/favorite_button_normal" /> + +</selector> diff --git a/fmapp2/res/drawable/seeker.png b/fmapp2/res/drawable/seeker.png Binary files differnew file mode 100644 index 0000000..7ad3927 --- /dev/null +++ b/fmapp2/res/drawable/seeker.png diff --git a/fmapp2/res/layout-800x480/fmradio.xml b/fmapp2/res/layout-800x480/fmradio.xml deleted file mode 100644 index 83b9f7c..0000000 --- a/fmapp2/res/layout-800x480/fmradio.xml +++ /dev/null @@ -1,202 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2009, 2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/fmradio" - android:background="@drawable/bg" - android:layout_width="fill_parent" - 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" - android:layout_alignParentTop="true"> - - <ImageView android:id="@+id/btn_onoff" - android:src="@drawable/btn_onoff" - android:layout_alignParentLeft="true" - android:layout_marginLeft="15dp" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - - <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: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"/> - - <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" /> - - <ImageView android:id="@+id/btn_speaker_earphone" - android:src="@drawable/btn_earphone" - android:layout_alignParentRight="true" - android:layout_marginRight="15dp" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - - </RelativeLayout> - - <LinearLayout android:id="@+id/stationinfo_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginTop="5dp" - android:layout_below="@+id/layout_on_off"> - - <!-- This included layout contains Station Information to display --> - <include layout="@layout/station_info" /> - - </LinearLayout> - - <com.caf.fmradio.HorizontalNumberPicker - android:id="@+id/fm_picker" - android:layout_width="fill_parent" - android:layout_height="200dp" - android:layout_marginBottom="50dp" - android:layout_below="@+id/stationinfo_layout"/> - - <HorizontalScrollView - android:layout_width="fill_parent" - android:layout_height="60dp" - android:layout_alignParentBottom="true" - android:scrollbars="none"> - - <LinearLayout android:id="@+id/favorite_list" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="horizontal"> - - <Button android:id="@+id/presets_button_1" - style="@style/ButtonStripLeft" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_2" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_3" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_4" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_5" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_6" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - <Button android:id="@+id/presets_button_7" - style="@style/ButtonStripRight" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> - - </LinearLayout> - - </HorizontalScrollView> - -</RelativeLayout> diff --git a/fmapp2/res/layout-800x480/station_info.xml b/fmapp2/res/layout-800x480/station_info.xml deleted file mode 100644 index 87a8f7e..0000000 --- a/fmapp2/res/layout-800x480/station_info.xml +++ /dev/null @@ -1,185 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2009, 2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * 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"> - - <LinearLayout android:id="@+id/station_info" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_weight="0" - android:orientation="vertical" - android:gravity="top"> - - <RelativeLayout android:id="@+id/top_most" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <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:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:visibility="gone" /> - - <TextView android:id="@+id/record_msg_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:drawableLeft="@drawable/recorder_start" - android:layout_marginLeft="20dp" - android:textSize="14sp" - android:textStyle="bold" - android:clickable="true" - android:visibility="invisible" - android:text="@string/default_record"/> - - - <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:layout_alignParentTop="true" - android:layout_alignParentRight="true" - android:layout_alignBaseline="@id/signal_level" - android:textSize="13sp" - android:text="@string/default_audio"/> - - </RelativeLayout> - - <LinearLayout android:id="@+id/station_frequency_row" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:paddingTop="5dp" - android:paddingBottom="5dp" - android:layout_alignWithParentIfMissing="true" - android:gravity="center"> - - <TextView android:id="@+id/call_sign_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="14sp" - android:paddingTop="2dp" - android:paddingRight="2dp" - android:paddingBottom="2dp" - android:paddingLeft="2dp" - android:text="@string/station_id_string" /> - - <TextView android:id="@+id/pty_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="14sp" - android:paddingTop="2dp" - android:paddingRight="2dp" - android:paddingBottom="2dp" - android:paddingLeft="2dp" - android:text="@string/pty_string" /> - - </LinearLayout> - - <RelativeLayout android:id="@+id/second_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="1dp" - android:layout_marginBottom="1dp" - android:layout_marginLeft="2dp" - android:layout_marginRight="2dp"> - - <TextView android:id="@+id/prog_frequency_tv" - android:textAppearance="?android:attr/textAppearanceLarge" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="25dp" - android:gravity="center" - android:clickable="true" - android:focusable="true" - android:layout_toLeftOf="@+id/btn_forward" - android:layout_toRightOf="@+id/btn_back" - android:text="@string/frequency_string"/> - - <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_alignParentLeft="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_left"/> - - <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_alignParentRight="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_right"/> - - </RelativeLayout> - - - <!-- Station Radio Text information display --> - <TextView android:id="@+id/radio_text_tv" - android:layout_width="fill_parent" - 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:paddingBottom="5dp" - android:paddingTop="20dp" - android:gravity="center_horizontal" - android:text="@string/radio_text_string"/> - - <TextView android:id="@+id/eradio_text_tv" - android:layout_width="fill_parent" - 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:paddingBottom="5dp" - android:gravity="center_horizontal" - android:text="@string/eradio_text_string"/> - - </LinearLayout> - -</merge> diff --git a/fmapp2/res/layout/action_bar.xml b/fmapp2/res/layout/action_bar.xml new file mode 100644 index 0000000..b4915ef --- /dev/null +++ b/fmapp2/res/layout/action_bar.xml @@ -0,0 +1,48 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:enabled="false" + android:gravity="center_vertical" + android:orientation="horizontal" > + + <ImageView android:id="@+id/btn_onoff" + android:src="@drawable/btn_onoff" + android:layout_alignParentLeft="true" + android:layout_marginLeft="15dp" + android:clickable="true" + android:focusable="true" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + <TextView android:id="@+id/title" + android:paddingLeft="10dp" + android:textSize="18sp" + android:textColor="#FFFFFF" + android:textAllCaps="true" + android:textStyle="bold" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + <Space + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1"/> + + <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" /> + + <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" /> + +</LinearLayout> diff --git a/fmapp2/res/layout/fmradio.xml b/fmapp2/res/layout/fmradio.xml index 4aef544..c78f563 100644 --- a/fmapp2/res/layout/fmradio.xml +++ b/fmapp2/res/layout/fmradio.xml @@ -26,9 +26,9 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fmradio" - android:background="@drawable/bg" + android:background="@color/background_color" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> @@ -37,17 +37,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:layout_marginTop="3dp" - android:layout_alignParentTop="true"> - - <ImageView android:id="@+id/btn_onoff" - android:src="@drawable/btn_onoff" - android:layout_alignParentLeft="true" - android:layout_marginLeft="15dp" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> + android:layout_marginTop="3dp"> <TextView android:id="@+id/sleep_msg_tv" android:textAppearance="?android:attr/textAppearanceMedium" @@ -66,6 +56,7 @@ 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" @@ -75,49 +66,40 @@ android:textStyle="bold" android:text="@string/prog_service_string"/> - <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" /> - - <ImageView android:id="@+id/btn_speaker_earphone" - android:src="@drawable/btn_earphone" - android:layout_alignParentRight="true" - android:layout_marginRight="15dp" - android:clickable="true" - android:focusable="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - </RelativeLayout> <LinearLayout android:id="@+id/stationinfo_layout" android:layout_width="fill_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:orientation="horizontal" - android:layout_marginTop="5dp" - android:layout_below="@+id/layout_on_off"> + android:layout_weight="1"> <!-- This included layout contains Station Information to display --> <include layout="@layout/station_info" /> </LinearLayout> - <com.caf.fmradio.HorizontalNumberPicker - android:id="@+id/fm_picker" - android:layout_width="fill_parent" - android:layout_height="200dp" - android:layout_marginBottom="50dp" - android:layout_below="@+id/stationinfo_layout"/> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="155dp"> + + <com.caf.fmradio.HorizontalNumberPicker + android:id="@+id/fm_picker" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/picker_background_color"/> + + <ImageView + android:src="@drawable/seeker" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + </RelativeLayout> + <HorizontalScrollView android:layout_width="fill_parent" android:layout_height="60dp" - android:layout_alignParentBottom="true" android:scrollbars="none"> <LinearLayout android:id="@+id/favorite_list" @@ -126,77 +108,28 @@ android:orientation="horizontal"> <Button android:id="@+id/presets_button_1" - style="@style/ButtonStripLeft" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_2" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_3" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_4" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_5" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_6" - style="@style/ButtonStripMiddle" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> <Button android:id="@+id/presets_button_7" - style="@style/ButtonStripRight" - android:text="@string/add_station" - android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" - android:singleLine="true" - android:layout_width="80dp" - android:layout_weight="1" - android:layout_height="wrap_content"/> + style="@style/ButtonStripButtons"/> </LinearLayout> </HorizontalScrollView> -</RelativeLayout> +</LinearLayout> diff --git a/fmapp2/res/layout/station_info.xml b/fmapp2/res/layout/station_info.xml index fc7d62e..404c6c8 100644 --- a/fmapp2/res/layout/station_info.xml +++ b/fmapp2/res/layout/station_info.xml @@ -33,9 +33,11 @@ android:layout_height="wrap_content" android:layout_weight="0" android:orientation="vertical" + android:layout_gravity="center" android:gravity="top"> <RelativeLayout android:id="@+id/top_most" + android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content"> @@ -48,34 +50,13 @@ android:layout_alignParentLeft="true" android:visibility="gone" /> - <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:textSize="14sp" - android:layout_marginLeft="25dp" - android:textStyle="bold" - android:visibility="invisible" - android:text="@string/default_sleep" /> - - <TextView android:id="@+id/record_msg_tv" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:drawableLeft="@drawable/recorder_start" - android:layout_marginLeft="20dp" - android:textSize="14sp" - android:textStyle="bold" - android:clickable="true" - android:visibility="invisible" - android:text="@string/default_record"/> <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:visibility="invisible" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_alignBaseline="@id/signal_level" @@ -84,87 +65,84 @@ </RelativeLayout> + <RelativeLayout android:id="@+id/second_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:layout_marginLeft="2dp" + android:layout_marginRight="2dp"> + + <TextView android:id="@+id/prog_frequency_tv" + android:textColor="@android:color/white" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="56sp" + android:textStyle="bold" + android:gravity="center" + android:clickable="true" + android:focusable="true" + android:text="@string/frequency_string"/> + + <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_alignParentLeft="true" + android:visibility="gone" + android:layout_alignWithParentIfMissing="true" + android:src="@drawable/btn_arrow_left"/> + + <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_alignParentRight="true" + android:visibility="gone" + android:layout_alignWithParentIfMissing="true" + android:src="@drawable/btn_arrow_right"/> + + </RelativeLayout> + <LinearLayout android:id="@+id/station_frequency_row" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingTop="5dp" - android:paddingBottom="5dp" - android:layout_alignWithParentIfMissing="true" android:gravity="center"> <TextView android:id="@+id/call_sign_tv" - android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="@android:color/white" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="14sp" - android:paddingTop="2dp" + android:textStyle="bold" + android:textSize="50sp" + android:alpha="0.5" android:paddingRight="2dp" - android:paddingBottom="2dp" android:paddingLeft="2dp" android:text="@string/station_id_string" /> <TextView android:id="@+id/pty_tv" - android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="@android:color/white" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="14sp" - android:paddingTop="2dp" + android:textSize="32sp" + android:textAllCaps="true" android:paddingRight="2dp" - android:paddingBottom="2dp" android:paddingLeft="2dp" android:text="@string/pty_string" /> </LinearLayout> - <RelativeLayout android:id="@+id/second_layout" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="2dp" - android:layout_marginBottom="2dp" - android:layout_marginLeft="2dp" - android:layout_marginRight="2dp"> - - <TextView android:id="@+id/prog_frequency_tv" - android:textAppearance="?android:attr/textAppearanceLarge" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textSize="25dp" - android:gravity="center" - android:layout_toLeftOf="@+id/btn_forward" - android:layout_toRightOf="@+id/btn_back" - android:text="@string/frequency_string"/> - - <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_alignParentLeft="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_left"/> - - <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_alignParentRight="true" - android:visibility="visible" - android:layout_alignWithParentIfMissing="true" - android:src="@drawable/btn_arrow_right"/> - - </RelativeLayout> - <!-- Station Radio Text information display --> <TextView android:id="@+id/radio_text_tv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="15sp" + android:textSize="16sp" android:singleLine="true" android:textStyle="bold" android:paddingLeft="2dp" @@ -178,6 +156,19 @@ android:layout_width="fill_parent" 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" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="15sp" android:singleLine="true" android:textStyle="bold" diff --git a/fmapp2/res/values/colors.xml b/fmapp2/res/values/colors.xml new file mode 100644 index 0000000..f143df1 --- /dev/null +++ b/fmapp2/res/values/colors.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="favorite_button_normal">#39BECB</color> + <color name="favorite_button_active">#CC39BECB</color> + <color name="background_color">#39BECB</color> + <color name="picker_background_color">#33AAB6</color> +</resources> diff --git a/fmapp2/res/values/styles.xml b/fmapp2/res/values/styles.xml index e9c9bcf..120c187 100644 --- a/fmapp2/res/values/styles.xml +++ b/fmapp2/res/values/styles.xml @@ -37,25 +37,46 @@ <item name="android:focusable">true</item> </style> + <style name="ButtonStripButtons"> + <item name="android:gravity">center</item> + <item name="android:layout_weight">1</item> + <item name="android:layout_width">80dp</item> + <item name="android:layout_height">match_parent</item> + <item name="android:textSize">18sp</item> + <item name="android:textColor">#9DFFFFFF</item> + <item name="android:background">@drawable/preset_button_background</item> + <item name="android:singleLine">true</item> + <item name="android:text">@string/add_station</item> + <item name="android:textStyle">bold</item> + </style> + <style name="ButtonStripLeft"> <item name="android:gravity">center</item> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> - <item name="android:background">@drawable/btn_strip_trans_left</item> - </style> + <item name="android:textSize">18sp</item> + <item name="android:textColor">#9DFFFFFF</item> + <item name="android:background">@drawable/preset_button_background</item> + <item name="android:singleLine">true</item> </style> <style name="ButtonStripMiddle"> <item name="android:gravity">center</item> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> - <item name="android:background">@drawable/btn_strip_trans_middle</item> + <item name="android:textSize">18sp</item> + <item name="android:textColor">#9DFFFFFF</item> + <item name="android:background">@drawable/preset_button_background</item> + <item name="android:singleLine">true</item> </style> <style name="ButtonStripRight"> <item name="android:gravity">center</item> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> - <item name="android:background">@drawable/btn_strip_trans_right</item> + <item name="android:textSize">18sp</item> + <item name="android:textColor">#9DFFFFFF</item> + <item name="android:background">@drawable/preset_button_background</item> + <item name="android:singleLine">true</item> </style> </resources> diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java index df97413..892fbef 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadio.java +++ b/fmapp2/src/com/caf/fmradio/FMRadio.java @@ -28,6 +28,7 @@ package com.caf.fmradio; +import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -85,9 +86,9 @@ import java.util.ArrayList; import com.caf.utils.FrequencyPicker; import com.caf.utils.FrequencyPickerDialog; + import android.content.ServiceConnection; import android.media.MediaRecorder; - import qcom.fmradio.FmConfig; import android.os.ServiceManager; @@ -96,6 +97,7 @@ import com.caf.fmradio.HorizontalNumberPicker.OnValueChangeListener; import com.caf.fmradio.HorizontalNumberPicker.Scale; import android.content.SharedPreferences; +import android.graphics.drawable.ColorDrawable; public class FMRadio extends Activity { @@ -284,6 +286,17 @@ public class FMRadio extends Activity mCommandActive = CMD_NONE; mCommandFailed = CMD_NONE; + getWindow().setBackgroundDrawableResource(R.color.background_color); + + // Set up your ActionBar + final ActionBar actionBar = getActionBar(); + actionBar.setDisplayShowHomeEnabled(false); + actionBar.setDisplayShowTitleEnabled(false); + actionBar.setDisplayShowCustomEnabled(true); + actionBar.setCustomView(R.layout.action_bar); + + ((TextView) findViewById(R.id.title)).setText(R.string.app_name); + Log.d(LOGTAG, "onCreate - Height : "+ getWindowManager().getDefaultDisplay().getHeight() + " - Width : "+ getWindowManager().getDefaultDisplay().getWidth()); @@ -1481,7 +1494,7 @@ public class FMRadio extends Activity showDialog(DIALOG_PRESET_OPTIONS); }else { addToPresets(); - view.startAnimation(mAnimation); + //view.startAnimation(mAnimation); } return true; } @@ -1780,7 +1793,7 @@ public class FMRadio extends Activity int durationInMins = FmSharedPreferences.getRecordDuration(); Log.e(LOGTAG, " Fected duration:" + durationInMins ); initiateRecordDurationTimer( durationInMins ); - setRecordingStopImage(); + //setRecordingStopImage(); invalidateOptionsMenu(); } @@ -1792,7 +1805,7 @@ public class FMRadio extends Activity } if(null != mRecordingMsgTV) { mRecordingMsgTV.setText(""); - setRecordingStartImage(); + //setRecordingStartImage(); } if (mService != null) { try { @@ -1876,9 +1889,9 @@ public class FMRadio extends Activity mRecordingMsgTV.setText(""); } if(isRecording()) { - setRecordingStopImage(); + //setRecordingStopImage(); }else { - setRecordingStartImage(); + //setRecordingStartImage(); } }else { if (mRadioTextScroller != null) { @@ -1889,12 +1902,12 @@ public class FMRadio extends Activity } } if (mForwardButton != null) { - mForwardButton.setVisibility(((bEnable == true) ? View.VISIBLE - : View.INVISIBLE)); + //mForwardButton.setVisibility(((bEnable == true) ? View.VISIBLE + // : View.INVISIBLE)); } if (mBackButton != null) { - mBackButton.setVisibility(((bEnable == true) ? View.VISIBLE - : View.INVISIBLE)); + //mBackButton.setVisibility(((bEnable == true) ? View.VISIBLE + // : View.INVISIBLE)); } if (mTuneStationFrequencyTV != null) { mTuneStationFrequencyTV.setVisibility(((bEnable == true) ? View.VISIBLE @@ -1926,11 +1939,11 @@ public class FMRadio extends Activity } if(mERadioTextTV != null) { mERadioTextTV.setVisibility(((bEnable == true) ? View.VISIBLE - : View.INVISIBLE)); + : View.GONE)); } if (mProgramServiceTV != null) { - mProgramServiceTV.setVisibility(((bEnable == true) ? View.VISIBLE - : View.INVISIBLE)); +// mProgramServiceTV.setVisibility(((bEnable == true) ? View.VISIBLE +// : View.INVISIBLE)); } if (!isAntennaAvailable()) { @@ -1969,8 +1982,8 @@ public class FMRadio extends Activity } if (mStereoTV != null) { - mStereoTV.setVisibility(((bEnable == true) ? View.VISIBLE - : View.INVISIBLE)); + //mStereoTV.setVisibility(((bEnable == true) ? View.VISIBLE + // : View.INVISIBLE)); } for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) { if (mPresetButtons[nButton] != null) { @@ -2059,7 +2072,7 @@ public class FMRadio extends Activity private void updateStationInfoToUI() { double frequency = mTunedStation.getFrequency() / 1000.0; - mTuneStationFrequencyTV.setText("" + frequency + "MHz"); + mTuneStationFrequencyTV.setText("" + frequency); if ((mPicker != null) && mUpdatePickerValue) { mPicker.setValue(((mTunedStation.getFrequency() - mPrefs.getLowerLimit()) / mPrefs.getFrequencyStepSize())); diff --git a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java index ac886bb..54b230a 100644 --- a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java +++ b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java @@ -30,6 +30,7 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; +import android.graphics.Typeface; import android.graphics.Paint.Align; import android.graphics.Rect; import android.graphics.drawable.Drawable; @@ -92,7 +93,7 @@ public class HorizontalNumberPicker extends LinearLayout { /** * The coefficient by which to adjust (divide) the max fling velocity. */ - private static final int SELECTOR_MAX_FLING_VELOCITY_ADJUSTMENT = 8; + private static final int SELECTOR_MAX_FLING_VELOCITY_ADJUSTMENT = 4; /** * The the duration for adjusting the selector wheel. @@ -247,7 +248,7 @@ public class HorizontalNumberPicker extends LinearLayout { /** * The height of the text. */ - private int mTextSize = 20; + private int mTextSize = 60; /** * The height of the gap between text elements if the selector wheel. */ @@ -346,7 +347,7 @@ public class HorizontalNumberPicker extends LinearLayout { /** * The colors alpha of selector text. */ - private static final int SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE = 255; + private static final int SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE = 76; private static float mDensity = 1.0f; private static final float LDPI = 0.75f; @@ -354,9 +355,9 @@ public class HorizontalNumberPicker extends LinearLayout { private static final float HDPI = 1.5f; private static final float XHDPI = 2.0f; - private float mScaleWidth = 2; + private float mScaleWidth = 5; private float mScaleLengthShort = 10; - private float mScaleLengthLong = 20; + private float mScaleLengthLong = 40; private float mGapBetweenNumAndScale = 18; private float mHdpiPositionAdjust = 18; @@ -899,19 +900,19 @@ public class HorizontalNumberPicker extends LinearLayout { setSelectorWheelState(SELECTOR_WHEEL_STATE_SMALL); return true; } -// VelocityTracker velocityTracker = mVelocityTracker; -// velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity); -// int initialVelocity=0; -// if(!mHorizontal){ -// initialVelocity = (int) velocityTracker.getYVelocity(); -// }else{ -// initialVelocity = (int)velocityTracker.getXVelocity(); -// } -// if (Math.abs(initialVelocity) > mMinimumFlingVelocity) { -// // fling after up -// fling(initialVelocity); -// onScrollStateChange(OnScrollListener.SCROLL_STATE_FLING); -// } else { + VelocityTracker velocityTracker = mVelocityTracker; + velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity); + int initialVelocity=0; + if(!mHorizontal){ + initialVelocity = (int) velocityTracker.getYVelocity(); + }else{ + initialVelocity = (int)velocityTracker.getXVelocity(); + } + if (Math.abs(initialVelocity) > mMinimumFlingVelocity) { + // fling after up + fling(initialVelocity); + onScrollStateChange(OnScrollListener.SCROLL_STATE_FLING); + } else { if (mAdjustScrollerOnUpEvent) { if (mFlingScroller.isFinished() && mAdjustScroller.isFinished()) { @@ -920,7 +921,7 @@ public class HorizontalNumberPicker extends LinearLayout { } else { postAdjustScrollerCommand(SHOW_INPUT_CONTROLS_DELAY_MILLIS); } -// } + } mVelocityTracker.recycle(); mVelocityTracker = null; break; @@ -1492,13 +1493,13 @@ public class HorizontalNumberPicker extends LinearLayout { .get(selectorIndex); if(i - mSelectorMiddleItemIndex > 0 ){ mSelectorWheelPaint.setColor(Color.WHITE); - mSelectorWheelPaint.setAlpha((2*mSelectorMiddleItemIndex - i) * SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE / mSelectorMiddleItemIndex); + mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE); }else if(i - mSelectorMiddleItemIndex < 0 ){ mSelectorWheelPaint.setColor(Color.WHITE); - mSelectorWheelPaint.setAlpha(i * SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE / mSelectorMiddleItemIndex); - }else{ - mSelectorWheelPaint.setColor(Color.RED); mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE); + }else{ + mSelectorWheelPaint.setColor(Color.WHITE); + mSelectorWheelPaint.setAlpha(0); } try { fNumber = Float.valueOf(scrollSelectorValue).floatValue(); @@ -1516,13 +1517,27 @@ public class HorizontalNumberPicker extends LinearLayout { bShowNumber = true; fScaleLength = mScaleLengthLong * mDensity; } + } else { + fWidthOfScale-=2; } if(bShowNumber){ - canvas.drawText(scrollSelectorValue, x, y, mSelectorWheelPaint); + float originalWidth = mSelectorWheelPaint.getStrokeWidth(); + int originalAlpha = mSelectorWheelPaint.getAlpha(); + mSelectorWheelPaint.setTypeface(Typeface.DEFAULT_BOLD); + mSelectorWheelPaint.setStrokeWidth(2); + mSelectorWheelPaint.setStyle(Paint.Style.FILL_AND_STROKE); + mSelectorWheelPaint.setAlpha(SELECTOR_TEXT_ALPHA_TRANSPARENT_NONE); + canvas.drawText(scrollSelectorValue, x, mTextSize * 2, mSelectorWheelPaint); + mSelectorWheelPaint.setStyle(Paint.Style.FILL); + mSelectorWheelPaint.setStrokeWidth(originalWidth); + mSelectorWheelPaint.setAlpha(originalAlpha); } - canvas.drawRect(x, y+fGapBetweenNumAndScale, x+fWidthOfScale, y + fGapBetweenNumAndScale + fScaleLength , mSelectorWheelPaint); -// } + float left = x; + float top = (mBottom - mTop) - fGapBetweenNumAndScale - fScaleLength; + float right = x+fWidthOfScale; + float bottom = (mBottom - mTop); + canvas.drawRect(left, top, right, bottom, mSelectorWheelPaint); if (mHorizontal) { x += mSelectorElementWidth; } else { |