jrvansuita / MaterialAbout

🔖 It's a material-design about screen to use on your Android apps. A developer profile and application information easy to integrate.
MIT License
1.53k stars 208 forks source link

Adapting MaterialAbout background to Material Dark Theme #99

Closed ankandrew closed 2 years ago

ankandrew commented 2 years ago

When using Material theme rather than AppCompat one, I get different a different color in the FrameLayout background than in in the main view background, i.e.

photo_2022-07-24_12-37-20

Note: I'm using the latest version of MaterialAbout (0.3.0).

To reproduce this I just changed:

from

https://github.com/jrvansuita/MaterialAbout/blob/f8bd427bbbaf8a9f41d8b533a7f2bef8b57d6627/app/src/main/res/values-v21/styles.xml#L3

to

<style name="AppThemeDark" parent="Theme.MaterialComponents.NoActionBar">

How can I set the MaterialAbout view to have the same background color as the one observed in the outer view of the image?

ankandrew commented 2 years ago

My current workaround is to use setBackgroundColor and pass the value returned by this method:

    private int getThemeBackgroundColor() {
        TypedValue outValue = new TypedValue();
        getTheme().resolveAttribute(android.R.attr.windowBackground, outValue, true);
        return outValue.data;
    }

I guess this is not ideal, because I should also pass the text color (also seems different in AppCompat theme and Material* themes)