Android 为CheckBoxPreference Preference 控件添加样式
来源:互联网 发布:淘宝小额红包 编辑:程序博客网 时间:2024/05/29 13:34
楼主最近在Mms的新功能以及布局,找了好久的好东西,在此分享,原文链接:http://blog.csdn.net/chenshijun0101/article/details/8191429
- <CheckBoxPreference
- android:key="enable_adb"
- android:layout="@layout/static_background"
- android:widgetLayout="@layout/accelerometer_checkbox"
- android:title="@string/enable_adb"
- android:summary="@string/enable_adb_summary"/>
- <PreferenceCategory
- android:key="location_category"
- android:layout="@layout/category_null"
- android:title="@null" >
- </PreferenceCategory>
- <Preference
- android:key="verifier_device_identifier"
- android:layout="@layout/static_background"
- android:widgetLayout="@layout/pref_widget_more"
- style="?android:attr/preferenceInformationStyle"
- android:title="@string/verifier_device_identifier"
- android:summary="@string/verifier_device_identifier_not_available"
- android:persistent="false" />
- <PreferenceCategory
- android:key="location_category"
- android:layout="@layout/category_null"
- android:title="@null" >
- </PreferenceCategory>
- <CheckBoxPreference
- android:key="keep_screen_on"
- android:layout="@layout/schpwr_background_double_top"
- android:widgetLayout="@layout/accelerometer_checkbox"
- android:title="@string/keep_screen_on"
- android:summary="@string/keep_screen_on_summary"/>
- <CheckBoxPreference
- android:key="allow_mock_location"
- android:layout="@layout/schpwr_background_double_bottom"
- android:widgetLayout="@layout/accelerometer_checkbox"
- android:title="@string/allow_mock_location"
- android:summary="@string/allow_mock_location_summary"/>
- <PreferenceCategory
- android:key="location_category"
- android:layout="@layout/category_null"
- android:title="@null" >
- </PreferenceCategory>
- <ListPreference
- android:layout="@layout/schpwr_background_double_top"
- android:widgetLayout="@layout/pref_widget_more"
- android:key="hdcp_checking"
- android:title="@string/hdcp_checking_title"
- android:dialogTitle="@string/hdcp_checking_dialog_title"
- android:entries="@array/hdcp_checking_titles"
- android:entryValues="@array/hdcp_checking_values" />
- <PreferenceScreen
- android:key="local_backup_password"
- android:layout="@layout/schpwr_background_double_bottom"
- android:widgetLayout="@layout/pref_widget_more"
- android:title="@string/local_backup_password_title"
- android:summary="@string/local_backup_password_summary_none"
- android:persistent="false" >
- <intent
- android:action="android.settings.privacy.SET_FULL_BACKUP_PASSWORD"
- android:targetPackage="com.android.settings"
- android:targetClass="com.android.settings.SetFullBackupPassword" />
- </PreferenceScreen>
- <PreferenceCategory android:key="debug_ui_category"
- android:layout="@layout/category_normal"
- android:title="@string/debug_ui_category">
- <CheckBoxPreference
- android:key="strict_mode"
- android:layout="@layout/schpwr_background_double_top"
- android:widgetLayout="@layout/accelerometer_checkbox"
- android:title="@string/strict_mode"
- android:summary="@string/strict_mode_summary"/>
R/layout/static_background.xml
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/roundcornerfull"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:maxHeight="40dp">
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="6.0dip"
- android:layout_marginLeft="15.0dip"
- android:layout_marginRight="6.0dip"
- android:layout_marginTop="6.0dip"
- android:layout_weight="1.0" >
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <TextView
- android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:singleLine="true"
- android:textColor="#ff000000"
- android:textSize="18.0sp" />
- <TextView
- android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:singleLine="true"
- android:textColor="#ff000000"
- android:textSize="12.0sp" />
- </LinearLayout>
- </RelativeLayout>
- <LinearLayout
- android:id="@android:id/widget_frame"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:gravity="center_vertical"
- android:orientation="vertical" />
- </LinearLayout>
- <CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/checkbox"
- android:layout_width="80dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginRight="4.0dip"
- android:button="@drawable/schpwr_alarm_clock_background"
- android:clickable="false"
- android:focusable="false"/>
R/drawable/schpwr_alarm_clock_background.xml
- <?xml version="1.0" encoding="utf-8"?>
- <selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true" android:drawable="@drawable/auto_on_blue"/>
- <item android:state_checked="false" android:drawable="@drawable/auto_off"/>
- <item android:drawable="@drawable/auto_off"/>
- </selector>
R/layout/pref_widget_more.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_marginRight="22.0dip"
- android:layout_gravity="center_vertical"
- android:src="@drawable/arrow_select" />
R/drawable/arrow_select.xml
- <?xml version="1.0" encoding="utf-8"?>
- <selector
- xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_focused="true" android:drawable="@drawable/listarrowblue" />
- <item android:state_pressed="true" android:drawable="@drawable/listarrowblue" />
- <item android:drawable="@drawable/listarrow" />
- </selector>
其他以此类推
0 0
- Android 为CheckBoxPreference Preference 控件添加样式
- Android 为CheckBoxPreference Preference 控件添加样式
- Android 为CheckBoxPreference Preference 控件添加样式
- android添加控件selector样式
- Android preference 自定义控件
- Android中preference 自定义样式
- android Preference相关样式修改
- android为RadioButton动态添加style样式
- 为android系统控件设置样式
- Android自定义控件——自定义Preference
- 为select添加样式
- 为<hr>添加样式
- Android为自定义控件添加事件
- 为 android的系统控件添加属性
- Android为控件之间添加分割线
- 为android自定义控件添加自定义属性
- Android为自定义控件添加事件
- Android编程心得-为TextView添加各种样式
- itext生成pdf加了iTextAsian.jar还是报“Font 'STSong-Light' with 'UniGB-UCS2-H' is not re“
- 搭建最简单的Nginx/Tengine tcp反向代理
- hbase0.96.1 hmaster启动过程分析
- Maven学习:常用mvn命令
- Android中gravity与layout_gravity的区别, Padding 与 margin 区别
- Android 为CheckBoxPreference Preference 控件添加样式
- JDK的动态代理机制
- Java数据类型详解
- 笨小五工作笔录之-场景切换
- 裸设备
- C++PRIMER PLUS第六版课后编程答案 4.1-4.5
- ToString方法大全
- ubuntu下软件安装卸载与查看
- 翡翠等级