android-holo-colors
android-holo-colors copied to clipboard
Add Borderless Button
Would like borderless buttons to be added.
At the moment I use
<Button
style="?android:attr/buttonBarButtonStyle"
... />
Which gives the default holo blue highlight
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
<style name="Widget.Holo.Light.Button.Borderless">
<item name="android:background">?android:attr/selectableItemBackground</item>
<item name="android:paddingStart">4dip</item>
<item name="android:paddingEnd">4dip</item>
</style>
What we need is new item in generated theme:
<item name="android:selectableItemBackground">@drawable/yellowtheme_selectable_background</item>
with content re-using already generated graphics:
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime" >
<item android:state_pressed="false" android:state_focused="true" android:drawable="@drawable/yellowtheme_list_focused_holo" />
<item android:state_pressed="true" android:drawable="@drawable/yellowtheme_list_pressed_holo_light" />
<item android:drawable="@android:color/transparent" />
</selector>
(example for API11+ and theme called "yellowtheme")