Android之收音机UI实现
Android之收音机UI实现
最近在研究收音机的源码,本来想把收音机从源码中提取出来,做成一个单独的应用,但是,收音机需要底层的支持,所以,就有点无能为力了,不过发现UI做得比较有个性(如下图所示),图片比较丑(这是做图片MM的责任哦,哈哈),就单独拿出来跟大家分享一下,顺便自己也学习一下自定义view。
代码下载:
免费下载地址在 http://linux.bkjia.com/
用户名与密码都是www.bkjia.com
具体下载目录在 /2012年资料/11月/26日/Android之收音机UI实现
- <?xml version="1.0" encoding="utf-8"?>
- <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@drawable/background_main"
- android:orientation="vertical" >
- <RelativeLayout
- android:layout_width="320dip"
- android:layout_height="113dip"
- android:layout_x="0dip"
- android:layout_y="180dip"
- android:background="@drawable/led_disabled" />
- <RelativeLayout
- android:id="@+id/led_background"
- android:layout_width="320dip"
- android:layout_height="113dip"
- android:layout_x="0dip"
- android:layout_y="180dip"
- android:background="@drawable/led_enabled" >
- <ImageView
- android:id="@+id/fm_indicator"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="14dip"
- android:layout_marginTop="12dip"
- android:src="@drawable/fm" />
- <ImageView
- android:id="@+id/headset_indicator"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dip"
- android:layout_toRightOf="@id/fm_indicator"
- android:src="@drawable/headset_indicator" />
- <TextView
- android:id="@+id/text_hour_type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_marginRight="13dip"
- android:layout_marginTop="10dip"
- android:textColor="#000000" />
- <com.way.view.DigitalTextView
- android:id="@+id/digital_clock"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_marginTop="13dip"
- android:layout_toLeftOf="@+id/text_hour_type" />
- <ImageView
- android:id="@+id/searching_indicator"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="13dip"
- android:layout_toLeftOf="@id/digital_clock"
- android:src="@drawable/searching" />
- <com.way.view.DigitalTextView
- android:id="@+id/digital_freq"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_marginRight="84dip"
- android:layout_marginTop="15dip" />
- <SeekBar
- android:id="@+id/freq_indicator"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_marginBottom="12dip"
- android:layout_marginLeft="7dip"
- android:layout_marginRight="7dip"
- android:progressDrawable="@drawable/blank"
- android:thumb="@drawable/pointer"
- android:thumbOffset="0dip" />
- </RelativeLayout>
- <FrameLayout
- android:layout_width="220dip"
- android:layout_height="30dip"
- android:layout_x="50dip"
- android:layout_y="291dip"
- android:background="@drawable/scroller_bg" >
- <com.way.view.TuneWheel
- android:id="@+id/tune_wheel"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
- <ImageView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:src="@drawable/tune_wheel_highlight" />
- </FrameLayout>
- <ImageButton
- android:id="@+id/add_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="39dip"
- android:layout_y="332dip"
- android:background="#00000000"
- android:src="@drawable/add_button" />
- <ImageButton
- android:id="@+id/prev_station_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="108dip"
- android:layout_y="332dip"
- android:background="#00000000"
- android:src="@drawable/prev_station_button" />
- <ImageButton
- android:id="@+id/search_prev_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="176dip"
- android:layout_y="332dip"
- android:background="#00000000"
- android:src="@drawable/search_prev_button" />
- <com.way.view.CheckableImageButton
- android:id="@+id/headset_toggle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="255dip"
- android:layout_y="332dip"
- android:background="#00000000" />
- <com.way.view.CheckableImageButton
- android:id="@+id/power_toggle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="0dip"
- android:layout_y="403dip"
- android:background="#00000000" />
- <ImageButton
- android:id="@+id/radio_list_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="80dip"
- android:layout_y="402dip"
- android:background="#00000000"
- android:src="@drawable/radio_list_button" />
- <ImageButton
- android:id="@+id/next_station_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="146dip"
- android:layout_y="404dip"
- android:background="#00000000"
- android:src="@drawable/next_station_button" />
- <ImageButton
- android:id="@+id/search_next_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_x="215dip"
- android:layout_y="402dip"
- android:background="#00000000"
- android:src="@drawable/search_next_button" />
- </AbsoluteLayout>
|
评论暂时关闭