Feb 24 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Feb 24 | 4:10 PM |
Drasko | has entered the room |
Mark M. |
hello, Drasko
|
Mark M. |
how can I help you today?
|
Drasko |
Hi, Mark!
|
Drasko |
Well, I have this CardView (http://pastebin.com/83sSXacu)
|
Drasko |
And everything is nice when I click on it on Lollipop phones
|
Drasko |
But doesn't look good on pre-L phones.
|
Mark M. |
why is your foreground set to what it is?
|
Drasko |
It shows out-of-the-box ripple effect.
|
Mark M. |
but android:attr/selectableItemBackground is a background drawable
|
Feb 24 | 4:15 PM |
Mark M. |
regardless, what is the specific problem on pre-L phones?
|
Drasko |
well, it just color the whole area of cardview.
|
Drasko |
with transparent blue.
|
Mark M. |
have you tried removing the android:foreground attribute?
|
Drasko |
yes
|
Mark M. |
I haven't used android:attr/selectableItemBackground directly on a CardView yet
|
Drasko |
but with that I loose ripple effect.
|
Mark M. |
I figured it would interfere with the backport's fake elevation drop shadow
|
Mark M. |
the ripple effect comes from the background, not the foregroung
|
Mark M. |
er, foreground
|
Mark M. | |
Mark M. |
that link is to one of my RecyclerView examples from the next book update
|
Mark M. |
I wrapped my row LinearLayout in a CardView
|
Mark M. |
I put android:background="?android:attr/selectableItemBackground" on the LinearLayout
|
Mark M. |
seems to work fine with the ripple effect on 5.0 and standard blue on pre-5.0
|
Drasko |
hm, interesting.
|
Drasko |
great, I'll try that.
|
Feb 24 | 4:20 PM |
Drasko |
it works, thanks! can you tell me which attribute on my custom style should I set to change that blue color to other color?
|
Mark M. |
off the top of my head, I forget
|
Mark M. | |
Drasko |
ok. :)
|
Mark M. |
generate something there, asking for a custom list selector, and peek at what it gives you
|
Drasko |
yes, I figured it out, just by looking at it.
|
Feb 24 | 4:25 PM |
Mark M. |
if you have any other questions, go right ahead -- it's a slow chat day :-)
|
Drasko |
yes, I can see that.
|
Feb 24 | 4:30 PM |
Drasko |
I see that there is a hype around RxJava. did you try it?
|
Mark M. |
I read the initial documentation that the guy from Netflix wrote with the original release
|
Mark M. |
I found it to be incredibly difficult to follow
|
Mark M. |
and I haven't quite figured out what it solves that an event bus does not solve
|
Drasko |
Yes, documenat
|
Drasko |
Yes, documentation is very confusing.
|
Mark M. |
I'm not saying that RxJava is bad, but it failed to impress me, and I didn't have a compelling reason to try to wrestle my way through it
|
Drasko |
well, I stumbled today on some very fresh blog post about it and it was very easy to follow. Actually it is the first one that I understood easily from the beginning to the end.
|
Drasko |
Previous ones really confused me.
|
Feb 24 | 4:35 PM |
Mark M. |
do you have a link to it?
|
Drasko |
this one doesn't cover network stuff, but explains concept. Give me a sec to find it.
|
Drasko | |
Feb 24 | 4:40 PM |
Drasko |
if I set colors in my custom theme, for example android:windowBackground, does app do overdraw of that color, like paint it first with phone default and then with the given one in this item?
|
Mark M. |
AFAIK, it shouldn't
|
Drasko |
basically, can i reduce overdraw by setting new "default" values in my custom theme and style?
|
Mark M. |
well, "reduce" implies that you already have overdraw
|
Mark M. |
setting colors in a style/theme can reduce overdraw only if you can then get rid of something else that was contributing to the overdraw
|
Feb 24 | 4:45 PM |
Drasko |
i understood, that if i set some attribute, i.e. textColor in my layout, that I will have overdraw, since the default value would be painted and after that that same text would be repainted with color i set in layout. or did i missunderstand that?
|
Mark M. |
I am not aware that this is the case
|
Drasko |
ok.
|
Mark M. |
then again, I haven't looked at overdraw in a while
|
Drasko |
but if i set color in layout, and after that i change it in the java code, overdraw occurs, right?
|
Mark M. |
it shouldn't
|
Mark M. |
there is no real difference between android:textColor and the Java equivalent
|
Mark M. |
and if android:textColor triggers overdraw, that's a framework problem far more than it is an app developer problem
|
Drasko |
no, i mean, if i change it as a result of some action.
|
Mark M. |
if setTextColor() triggers overdraw, that's a framework problem far more than it is an app developer problem
|
Drasko |
i am new to overdraw problem, that's why i maybe ask some not very inteligent questions. :)
|
Mark M. |
TextView should be determining its color based on android:textColor/setTextColor(), falling back to the style/theme if a specific color was not set on the TextView instance
|
Mark M. |
and it should be drawing the text once
|
Drasko |
ok, thanks!
|
Feb 24 | 4:50 PM |
Mark M. |
I would use the tools available to help you identify overdraw, and worry about the hot spots
|
Mark M. |
the overdraw tinting that you can get just with Developer Mode is really handy
|
Drasko |
yes, i use that.
|
Drasko |
thank you very much, today i don't have any questions.
|
Mark M. |
OK
|
Drasko |
have a good day!
|
Mark M. |
you too!
|
Feb 24 | 5:00 PM |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Thursday at 7:30pm US Eastern
|
Mark M. |
have a pleasant day!
|
Drasko |
bye!
|
Drasko | has left the room |
Mark M. | turned off guest access |