danimahardhika / cafebar

An upgraded Snackbar for Android that provides more options and easy to use
Apache License 2.0
145 stars 23 forks source link

.buttonColor(int color) dont change buttom color #5

Open almaz010891 opened 6 years ago

almaz010891 commented 6 years ago

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

danimahardhika commented 6 years ago

It's working just fine, check demo app.

almaz010891 commented 6 years ago

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

danimahardhika commented 6 years ago

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

almaz010891 commented 6 years ago

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

danimahardhika commented 6 years ago

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

almaz010891 commented 6 years ago

.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 commented 6 years ago

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?

danimahardhika commented 6 years ago

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

almaz010891 commented 6 years ago

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

almaz010891 commented 6 years ago

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

almaz010891 commented 6 years ago

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

danimahardhika commented 6 years ago

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