Loading res/layout/battery_saver_settings_button.xml→res/layout/two_state_button.xml +2 −4 Original line number Diff line number Diff line Loading @@ -25,23 +25,21 @@ android:layout_height="match_parent"> <Button android:id="@+id/battery_saver_on_button" android:id="@+id/state_on_button" style="@style/ActionPrimaryButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/battery_saver_button_turn_on" android:paddingEnd="8dp" /> <Button android:id="@+id/battery_saver_off_button" android:id="@+id/state_off_button" style="@style/ActionSecondaryButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/battery_saver_button_turn_off" android:paddingEnd="8dp" /> </LinearLayout> No newline at end of file res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -162,4 +162,12 @@ <attr name="showPercentString" format="boolean" /> <attr name="thickness" format="dimension" /> </declare-styleable> <!-- For TwoStatesButtonPreference --> <declare-styleable name="TwoStateButtonPreference"> <attr name="textOn" format="reference" /> <attr name="textOff" format="reference" /> </declare-styleable> <attr name="twoStateButtonPreferenceStyle" format="reference" /> </resources> res/values/styles_preference.xml +4 −0 Original line number Diff line number Diff line Loading @@ -36,4 +36,8 @@ <item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item> </style> <style name="TwoStateButtonPreference" parent="Preference.SettingsBase"> <item name="android:layout">@layout/two_state_button</item> </style> </resources> No newline at end of file res/values/themes.xml +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ <item name="preferenceFragmentStyle">@style/SettingsPreferenceFragmentStyle</item> <item name="apnPreferenceStyle">@style/ApnPreference</item> <item name="seekBarPreferenceStyle">@style/SettingsSeekBarPreference</item> <item name="twoStateButtonPreferenceStyle">@style/TwoStateButtonPreference</item> </style> <style name="PreferenceTheme.SetupWizard" parent="PreferenceTheme"> Loading res/xml/battery_saver_settings.xml +3 −2 Original line number Diff line number Diff line Loading @@ -33,10 +33,11 @@ android:max="75" android:min="5"/> <com.android.settings.applications.LayoutPreference <com.android.settings.widget.TwoStateButtonPreference android:key="battery_saver_button_container" android:selectable="false" android:layout="@layout/battery_saver_settings_button"/> settings:textOn="@string/battery_saver_button_turn_on" settings:textOff="@string/battery_saver_button_turn_off"/> <PreferenceCategory android:key="battery_saver_footer"> Loading Loading
res/layout/battery_saver_settings_button.xml→res/layout/two_state_button.xml +2 −4 Original line number Diff line number Diff line Loading @@ -25,23 +25,21 @@ android:layout_height="match_parent"> <Button android:id="@+id/battery_saver_on_button" android:id="@+id/state_on_button" style="@style/ActionPrimaryButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/battery_saver_button_turn_on" android:paddingEnd="8dp" /> <Button android:id="@+id/battery_saver_off_button" android:id="@+id/state_off_button" style="@style/ActionSecondaryButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/battery_saver_button_turn_off" android:paddingEnd="8dp" /> </LinearLayout> No newline at end of file
res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -162,4 +162,12 @@ <attr name="showPercentString" format="boolean" /> <attr name="thickness" format="dimension" /> </declare-styleable> <!-- For TwoStatesButtonPreference --> <declare-styleable name="TwoStateButtonPreference"> <attr name="textOn" format="reference" /> <attr name="textOff" format="reference" /> </declare-styleable> <attr name="twoStateButtonPreferenceStyle" format="reference" /> </resources>
res/values/styles_preference.xml +4 −0 Original line number Diff line number Diff line Loading @@ -36,4 +36,8 @@ <item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item> </style> <style name="TwoStateButtonPreference" parent="Preference.SettingsBase"> <item name="android:layout">@layout/two_state_button</item> </style> </resources> No newline at end of file
res/values/themes.xml +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ <item name="preferenceFragmentStyle">@style/SettingsPreferenceFragmentStyle</item> <item name="apnPreferenceStyle">@style/ApnPreference</item> <item name="seekBarPreferenceStyle">@style/SettingsSeekBarPreference</item> <item name="twoStateButtonPreferenceStyle">@style/TwoStateButtonPreference</item> </style> <style name="PreferenceTheme.SetupWizard" parent="PreferenceTheme"> Loading
res/xml/battery_saver_settings.xml +3 −2 Original line number Diff line number Diff line Loading @@ -33,10 +33,11 @@ android:max="75" android:min="5"/> <com.android.settings.applications.LayoutPreference <com.android.settings.widget.TwoStateButtonPreference android:key="battery_saver_button_container" android:selectable="false" android:layout="@layout/battery_saver_settings_button"/> settings:textOn="@string/battery_saver_button_turn_on" settings:textOff="@string/battery_saver_button_turn_off"/> <PreferenceCategory android:key="battery_saver_footer"> Loading