cafebar icon indicating copy to clipboard operation
cafebar copied to clipboard

.buttonColor(int color) dont change buttom color

Open almaz010891 opened this issue 6 years ago • 12 comments

Also reproduce with .neutralColor/.positiveColor and etc. library version 1.3.2 Code sample:

public static void actionBar(Activity activity, String text, String actionText, CafeBarCallback cafeBarCallback){
        CafeBar.builder(activity)
                .content(text)
                .to(activity.findViewById(R.id.coordinator))
                .floating(true)
                .fitSystemWindow()
                .buttonColor(R.color.color_yellow)
                .neutralText(actionText)
                .onNeutral(cafeBarCallback)
                .show();
    }


colors.xml
    <color name="color_yellow">#ffca28</color>

Result: device-2017-11-30-002321

almaz010891 avatar Nov 29 '17 22:11 almaz010891

It's working just fine, check demo app.

danimahardhika avatar Nov 29 '17 22:11 danimahardhika

I've tried all the ways to set the color. Checked on Android 6.0 and 7.0. Nothing works. I use implementation 'com.github.danimahardhika: cafebar: 1.3.1' , 1.3.2, 1.3.0

almaz010891 avatar Nov 29 '17 22:11 almaz010891

Check the demo app first Check another app using CafeBar too https://play.google.com/store/apps/details?id=com.lc.mywalls

danimahardhika avatar Nov 30 '17 00:11 danimahardhika

in Demo app all ok, i use library project in my app, and this problem ONLY in my app. Its mystic...

almaz010891 avatar Nov 30 '17 13:11 almaz010891

Try to parse the color neutralColor(Color.parse("#ffca28")

danimahardhika avatar Nov 30 '17 13:11 danimahardhika

.neutralColor, .buttonColor with R.color and Color.parseColor not working... I clean, rebuild, read Your docs. Code is all right... But color dont change. Maybe its depends on Activity theme or style?

almaz010891 avatar Nov 30 '17 13:11 almaz010891

I see this commit: https://github.com/danimahardhika/cafebar/commit/d652fedf49ebd46103759150e7b145ea35dea7a4

i use in my build.gradle compileOptions { targetCompatibility 1.8 sourceCompatibility 1.8 }

Maybe this is cause of problem?

almaz010891 avatar Nov 30 '17 13:11 almaz010891

No, It doesn't. This is strange, I will take a look into this issue.

By default (button color not set), neutral button text color should be the same with colorAccent

danimahardhika avatar Nov 30 '17 13:11 danimahardhika

Thanks! I change to 1.7 and write to you about the result

almaz010891 avatar Nov 30 '17 13:11 almaz010891

Problem in compileOptions { targetCompatibility 1.8 sourceCompatibility 1.8 } if I delete this color is changed!

almaz010891 avatar Nov 30 '17 13:11 almaz010891

But I want to use 1.8 in my project, can You fix this issue?

almaz010891 avatar Nov 30 '17 14:11 almaz010891

I'm using Java 8 too, but with retrolambda, try with that.

danimahardhika avatar Nov 30 '17 14:11 danimahardhika