Nov 14 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Nov 14 | 4:05 PM |
Susheel | has entered the room |
Susheel |
Hi Mark!
|
Mark M. |
hello, Susheel!
|
Mark M. |
how can I help you today?
|
Susheel |
I have a layout file that uses weights in a vertical linearlayout to set percentage for height attributes for it's children. It works as desired but I'm wondering if I can do the same using constraintlayout. Is that possible?
|
Mark M. |
sure
|
Susheel |
I was wondering how I can achieve that
|
Mark M. |
guidelines is one approach, putting the guidelines at the appropriate percentages
|
Susheel |
Ah!
|
Mark M. |
the still-in-progress 1.1 offers another option, with app:layout_constraintWidth_default="percent" and app:layout_constraintHeight_default="percent"
|
Mark M. |
see https://developer.android.com/reference/android... for that latter one
|
Mark M. |
I demonstrate the guidelines approach in the book, in the chapter on ConstraintLayout basics
|
Susheel |
I didn't even realize I could place guidelines at a certain percentage.
|
Nov 14 | 4:10 PM |
Mark M. | |
Susheel |
just constraint the guideline's left and right and then give the percentage for horizontal case
|
Mark M. |
app:layout_constraintGuide_percent
|
Susheel |
yep
|
Susheel |
constraintlayout is amazing. I am able to do a lot of tasks in a declarative way.
|
Mark M. |
it's a jack-of-all-trades, which IMHO makes it terribly complex to explain
|
Mark M. |
but, more people use ConstraintLayout than have to explain it
|
Susheel |
At droidconSF the team that worked on constraintlayout demosntrated how to implement a bunch of cool animations using constraintlayout.
|
Susheel |
So that's a good thing I guess?
|
Mark M. |
if you're into animations, sure
|
Susheel |
Have you looked into Epoxy by AirBnB? Not sure if I asked you about this before. But apparently, it's an amazing library for building complex layouts using recyclerview.
|
Mark M. |
Lisa Wray did a presentation on RecyclerView at last year's droidcon NYC, and she demoed Epoxy in that
|
Susheel |
Yeah. Radical Recyclerview.
|
Mark M. |
right
|
Nov 14 | 4:15 PM |
Susheel |
Loved that talk.
|
Susheel |
Do you plan to cover 3rd party stuff like that in your book?
|
Mark M. |
I cover a variety of third-party libraries already
|
Mark M. |
there are thousands
|
Mark M. |
I will not cover them all
|
Susheel |
True! I was being greedy :)
|
Susheel |
But you're right. Lisa's talk is good.
|
Mathias | has entered the room |
Mathias |
Evening
|
Susheel |
HI Mathias.
|
Mark M. |
Mathias: hi! Susheel has already asked a couple of questions, so it's your turn -- do you have a question?
|
Susheel |
Mark, I'm good. You can get his question
|
Nov 14 | 4:20 PM |
Mathias |
cool
|
Mathias |
i have a strange google play issue:
|
Mathias |
View paste
|
Mark M. |
my guess would be a third-party library
|
Mark M. |
what all are you using?
|
Mathias |
my thought too, but i cant see what it would be
|
Mathias |
i can list them hangon
|
Mathias |
View paste
(14 more lines)
|
Mathias |
stickylistheaders - small library for nice listview sections. tapadoo - nice alert dropdown. hitgif - nice looking text fields
|
Nov 14 | 4:25 PM |
Mark M. |
the only things in there that might be using AlarmManager/JobScheduler would be Play Services and Firebase
|
Mathias |
exactly!
|
Mathias |
my thought too. so i simply cannot understand why the console is warning
|
Mark M. |
you might run a Gradle dependencies report and see if there is some transitive dependency that looks odd
|
Mathias |
ah! good idea
|
Mark M. |
you might also use the APK Analyzer to see if there are references from your release APK to AlarmManager or JobScheduler
|
Mark M. |
on Android Studio 3.0, you can right-click over a method reference in the analyzer and find usages
|
Mark M. |
from there, you might be able to (painfully) back-track and figure out where this is coming from
|
Mathias |
checked the dependency tree. none of my smaller libraries have any dependencies at all. Only one with transitives are the google and firebase stuff, basically
|
Mathias |
and retrofix -> okhttp
|
Mark M. |
that's not surprising, though it doesn't really help :-(
|
Nov 14 | 4:30 PM |
Mathias |
no, unfortunately not
|
Mark M. |
I don't have any other ideas for you, unfortunately
|
Mathias |
ok, it was worth a shot
|
Mark M. |
let me switch back to Susheel, and I'll return to you in a bit
|
Mathias |
np
|
Mark M. |
Susheel: back to you -- do you have another question?
|
Susheel |
Actually Mark I am good for now. I got the help I wanted. Thank you. Have a pleasant evening :)
|
Mark M. |
OK -- you too!
|
Mark M. |
Mathias: back to you!
|
Susheel | has left the room |
Mathias |
well. I do have geofences and things set up, that would of course wake up my app. But then the play console warning should write that, one would assume...
|
Nov 14 | 4:35 PM |
Mathias |
oh well, i guess i'll leave it be for now and revisit at another time
|
Mark M. |
OK
|
Mathias |
take care, talk to you another day :)
|
Mark M. |
have a pleasant evening!
|
Mathias | has left the room |
Nov 14 | 4:55 PM |
Susheel | has entered the room |
Susheel |
Do you have time for a quick one Mark?
|
Mark M. |
sure
|
Susheel |
I have a textview with a layout weight attribute. But I want only the text to be clickable. How can I do that?
|
Mark M. |
um
|
Mark M. |
ClickableSpan, perhaps
|
Susheel |
Cool I will look into it.
|
Mark M. |
it'd be simpler to change the TextView to wrap_content and put it in a FrameLayout that has your weight
|
Susheel |
Probably. The idea is to reduce view hierarchies. But I've heard framelayout is not bad perfornance wise
|
Susheel |
Am I right?
|
Susheel |
performance*
|
Mark M. |
as I think I've said a few times: beware premature optimization
|
Mark M. |
for example, using spans isn't free
|
Susheel |
Haha! I remember you saying that.
|
Susheel |
Oh I see.
|
Susheel |
I do not know the inner workings of spans.
|
Susheel |
But that's good to know
|
Nov 14 | 5:00 PM |
Mark M. |
so unless you're going to do serious performance analysis to determine which of the two is faster, go with whatever you feel is more maintainable
|
Mark M. |
then, if later you determine that you have performance issues, revisit the decision perhaps
|
Susheel |
Cool thank you Mark!
|
Mark M. |
that's a wrap for today's chat -- tomorrow's is at 9am US Eastern
|
Mark M. |
the transcript will go up on https://commonsware.com/office-hours/ shortly
|
Mark M. |
have a pleasant day!
|
Susheel |
And as usual I want to thank you for all you do. Earlier, I didn't mean to bother you with the Epoxy example in your book. I just had no idea how much work goes into everything from your end.
|
Susheel |
Thanks you too
|
Mark M. |
no worries
|
Mark M. |
see ya!
|
Susheel | has left the room |
Mark M. | turned off guest access |