hedzr / android-file-chooser

a lightweight file/folder chooser or picker
Apache License 2.0
284 stars 62 forks source link

如何设置这里的字体和颜色? #64

Closed hegelsu closed 5 years ago

hegelsu commented 5 years ago

1

Guiorgy commented 5 years ago

you can either try to modify it through a custom theme:

    <style name="FileChooserPathViewStyle">
        <item name="android:textColor">#40ff0000</item>
        <item name="android:textSize">16sp</item>
        <item name="fileChooserPathViewDisplayRoot">false</item>
    </style>

please, check the styles.xml file for an example in the demo app.

another one would be using the public ChooserDialog customizePathView(CustomizePathView callback) method:

dialog.customizePathView(textView -> {
    textView.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
})...
hedzr commented 5 years ago

well done. and @Guiorgy have u ever study chinese?

Guiorgy commented 5 years ago

nope, google sensei comes for the rescue :)

hegelsu commented 5 years ago

thx.

hegelsu commented 5 years ago

上图中的“Choose a file"的字体大小和颜色可以设置么?

Guiorgy commented 5 years ago

yes, a lot of things can be customized through custom themes:

<style name="FileChooserTitleStyle_Dark" parent="FileChooserTitleStyle">
    <item name="android:textAppearance">@style/TextAppearance.AppCompat.Title.Inverse</item>
    <item name="android:textColor">@android:color/holo_blue_light</item>
    <item name="android:textSize">8sp</item>
</style>

Screenshot_1557319870

refere to the demo app for an example of a 'Dark' theme

hegelsu commented 5 years ago

OK