Loading core/java/com/tmobile/preferences/ToggleButtonPreference.java 0 → 100644 +33 −0 Original line number Diff line number Diff line package com.tmobile.preferences; import android.content.Context; import android.preference.CheckBoxPreference; import android.util.AttributeSet; import com.android.internal.R; /** * Essentially the same as CheckBoxPreference except for using a toggle button in place of a check box * * @hide */ public class ToggleButtonPreference extends CheckBoxPreference { public ToggleButtonPreference(Context context) { super(context, null); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } // This is the constructor called by the inflater public ToggleButtonPreference(Context context, AttributeSet attrs) { super(context, attrs); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } public ToggleButtonPreference(Context context, AttributeSet attrs, int defStyle){ super(context, attrs, defStyle); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } } core/res/res/layout/tmobile_preference_widget_toggle.xml 0 → 100644 +12 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Layout used by CheckBoxPreference for the toggle style. This is inflated inside android.R.layout.preference. --> <com.tmobile.widget.ToggleButton xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="4dip" android:layout_gravity="center_vertical" android:focusable="false" android:clickable="false" /> Loading
core/java/com/tmobile/preferences/ToggleButtonPreference.java 0 → 100644 +33 −0 Original line number Diff line number Diff line package com.tmobile.preferences; import android.content.Context; import android.preference.CheckBoxPreference; import android.util.AttributeSet; import com.android.internal.R; /** * Essentially the same as CheckBoxPreference except for using a toggle button in place of a check box * * @hide */ public class ToggleButtonPreference extends CheckBoxPreference { public ToggleButtonPreference(Context context) { super(context, null); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } // This is the constructor called by the inflater public ToggleButtonPreference(Context context, AttributeSet attrs) { super(context, attrs); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } public ToggleButtonPreference(Context context, AttributeSet attrs, int defStyle){ super(context, attrs, defStyle); setWidgetLayoutResource(R.layout.tmobile_preference_widget_toggle); } }
core/res/res/layout/tmobile_preference_widget_toggle.xml 0 → 100644 +12 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Layout used by CheckBoxPreference for the toggle style. This is inflated inside android.R.layout.preference. --> <com.tmobile.widget.ToggleButton xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="4dip" android:layout_gravity="center_vertical" android:focusable="false" android:clickable="false" />