Closed DatL4g closed 5 years ago
Sorry, it seems I have been overriding button background drawable programmatically. use:
dependencies {
implementation 'com.github.hedzr:android-file-chooser:1.2.0-SNAPSHOT'
}
and style:
<style name="buttonStyle" parent="FileChooserButtonStyle">
<item name="android:textColor">...</item>
<item name="android:background">...</item>
</style>
Beware though, if you set the background to be a static color, the button won't be highlighted when the user focuses on it. If you don't want to loose that, create a selector drawable:
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<item android:drawable="@color/selected" android:state_focused="true"/>
<item android:drawable="@color/not_selected" android:state_focused="false"/>
<item android:drawable="@color/not_selected"/>
</selector>
where not_selected is the color it will normally be and selected when the user focuses on that button with the dpad. then just <item name="android:background">@drawable/my_selector</item>
PS. alternatively, you can change the fileListItemFocusedDrawable attribute. By default, the buttons use the same background as the list items for consistency.
@Guiorgy @hedzr Does this SNAPSHOT support the MediaStore for Android Q?
Not yet. I'm not sure that picking a file in Q or higher is necessary. If so, that should be a legacy app.
I have to change the button background. Buttons on my AndroidTV need an accent background to see where you are.