Mar 29 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Mar 29 | 9:00 AM |
Jan | has entered the room |
Mark M. |
hello, Jan!
|
Mark M. |
how can I help you today?
|
Jan |
Hello!
|
Jan |
Well, I've been redoing my app
|
Ed T. | has entered the room |
Ed T. |
gm Mark
|
Jan |
and I'd like to ask you for an opinion
|
Mark M. |
(hello, Ed -- Jan got here first, so let me take that question, and I'll be with you shortly!)
|
Mark M. |
Jan: go ahead
|
Jan |
what is the best way how to decouple View, model and presenter/controler
|
Mark M. |
um, that's rather broad, and I doubt that I can answer it very well
|
Jan |
I found MVC, MVP and MVVM and I like MVP the most
|
Mark M. |
I cover MVI in *Android's Architecture Components*, with capsule summaries of the other MV* candidates
|
Mark M. |
but, I cannot claim MVI to be "best"
|
Mark M. |
so, I am not certain how to help you
|
Jan |
interesting, I didn't notice this, thanks. I'm going to check it out, bye
|
Mar 29 | 9:05 AM |
Mark M. |
OK
|
Mark M. |
let me take a question from Ed, and I'll return to you shortly
|
Mark M. |
Ed: your turn! do you have a question?
|
Ed T. |
I've got a few this AM, thanks. :-)
|
Ed T. |
Curious what the best way to do a FORM Layout. Your book recommended Grid
|
Ed T. |
curious your if you still feel the same way
|
Mark M. |
it did?
|
Ed T. |
I think you did... when you talked about it.. and Table
|
Mark M. |
TableLayout is something I can see recommending
|
Mark M. |
as you can line up columns, if that's the look that you want
|
Mark M. |
you'll be able to achieve a similar effect with ConstraintLayout with 1.1.0, when that (finally) ships, if I understand correctly
|
Jan | has left the room |
Ed T. |
you said that Grid was added as a way to make it easy to use a tool to 'drag n drop' ... I think... on my 2nd cup of coffee... watched Ready Player One last night. :-)
|
Mark M. |
I assume that you're referring to GridLayout
|
Mark M. |
I hope I never recommended it
|
Ed T. |
yes, where you set columns and rows and can do a span
|
Mark M. |
it was an option that Google introduced, that failed miserably in the court of public opinion
|
Ed T. |
I'm using a nested Linear Layout
|
Ed T. |
and having issues with spinners playing nicely
|
Mark M. |
if you do not need strict columns, then ConstraintLayout or your nested LinearLayout are typical choices
|
Mark M. |
if you want labels and the labeled widgets to be in separate columns, then it's TableLayout or the next version of ConstraintLayout
|
Mar 29 | 9:10 AM |
Ed T. |
I was afraid to use ConstraintLayout as I have 'dynamic' views
|
Ed T. |
I have a view where there may be no data and I set the view to GONE
|
Ed T. |
so that seemed like a dangerous path
|
Mark M. |
ConstraintLayout is pretty good about handling GONE
|
Ed T. |
as long as I don't remove something everything is using as an anchor point right?
|
Ed T. |
not sure if that is the correct terminology.... what I used to call it from Delphi and Visual C++ days... when Borland had a similar layout
|
Mark M. |
IIRC, it will treat a GONE widget as being there, with zero height/width, for the purposes of anchors targetign it
|
Mark M. |
er, targeting it
|
Ed T. |
that's very good to know
|
Ed T. |
what is your favorite layout for a nice looking form ?
|
Mark M. |
I never like the look of any forms
|
Mark M. |
so, it'
|
Mark M. |
so, it would be more of what the designer was aiming for
|
Mark M. |
with ties going to ConstraintLayout, as Google is pushing it hard
|
Ed T. |
lol. I'm in that mode now.... looking back on something and I'm like... ugh
|
Mark M. | |
Mar 29 | 9:15 AM |
Ed T. |
if I'm designing something that will only run on a phone do I still need to consider Fragments?
|
Mark M. |
that depends
|
Mark M. |
for example, nav drawers work easiest with a single activity
|
Ed T. |
Fragment seems to me, as a way to re-use for multiple display sizes
|
Mark M. |
so, for a nav drawer-centric app, I'd consider fragments as being what the nav drawer navigates to
|
Mark M. |
similarly, ViewPager works best with fragments, though I have been using RecyclerView more in this role recently
|
Mark M. |
so, if you're using one or both of those, fragments are well worth considering
|
Mark M. |
while the original vision of fragments was for multiple display sizes, fragments evolved into a general-purpose "smaller than an activity" unit of UI
|
Ed T. |
I'm surprised about some of the design choices for Android... honestly....
|
Mar 29 | 9:20 AM |
Ed T. |
I used the Calendar popup and it mixed base zero with base 1 params.... so I had a bug to track down...
|
Ed T. |
months are base zero and the rest is base 1
|
Ed T. |
some things seem 'patchy' while others are very impressive
|
Mark M. |
that's a java.util.Calendar thing
|
Ed T. |
the RecylerView and Androids Tree view with 2 levels
|
Ed T. |
and how many Open Source projects were created to fix that one? lol more than one
|
Ed T. |
I use LocalDate and it works fine for what I need
|
Mark M. |
note that LocalDate is new to API Level 26
|
Ed T. |
import org.joda.time.LocalDate;
|
Ed T. |
which is why I had to do it that way
|
Mark M. |
ah, OK, forgot that they used the same class name
|
Ed T. |
no worries
|
Ed T. |
my IDE has 'automagically' hosed me a few times by 'guessing' that for me. :)
|
Ed T. |
have you used AndroidAnnotations?
|
Mark M. |
no, sorry
|
Mar 29 | 9:25 AM |
Ed T. |
Lombok?
|
Mark M. |
also: no, sorry
|
Ed T. |
they are both annotations
|
Ed T. |
that do code for you
|
Ed T. |
View paste
|
Ed T. |
example
|
Ed T. |
it does all of the boiler plate for you... very nice
|
Mark M. |
in my case, I need to teach the boilerplate
|
Ed T. |
code generation
|
Ed T. |
very true
|
Ed T. | |
Ed T. | |
Ed T. |
those are two examples... keeps the code small
|
Ed T. |
makes it easy to see business logic from framework
|
Ed T. |
@Background @UiThread. take care of dealing with treading items nicely
|
Ed T. |
what are your thoughts for Kotlin?
|
Mark M. |
I think it starts with the letter 'K'!
|
Ed T. |
lol
|
Mark M. |
and, it ends in 'otlin'!
|
Mark M. |
overall, the language is an order of magnitude more complex than Java
|
Mark M. |
however, there is a ~20% subset of Kotlin that is all most developers will need, and that subset is relatively easy
|
Mar 29 | 9:30 AM |
Mark M. |
also, the runtime overhead is impressively lean
|
Ed T. |
IDEA does a lot of neat things but I'm not sure I want to trust them for my core language syntax
|
Ed T. |
Android Studio 3.1 is out
|
Mark M. |
yes, which means I have the honor and privilege of redoing a zillion screenshots
|
Mark M. |
doing that for *Exploring Android* is part of today's workload
|
Mark M. |
as I have Version 0.2 of that coming out shortly
|
Ed T. |
thanks for doing that. :)
|
Ed T. |
your section on icons in that book was a life saver
|
Ed T. |
they make that more 'magic' and if it doesn't work... it just doesn't work
|
Mark M. |
yeah, Google's priorities and mine often are not in alignment
|
Ed T. |
world domination isn't on the top of your list? lol
|
Mark M. |
I'll settle for "condo domination"
|
Mark M. |
frequently, the dust bunnies are winning
|
Ed T. |
I get so many mixed messages from Google
|
Mar 29 | 9:35 AM |
Ed T. |
they are so big... it gets confusing...
|
Ed T. | |
Ed T. |
so they want me to move to Kotlin and then they also tell me this is the future ?
|
Mark M. |
frequently, the right hand doesn't know what the left hand is doing, and those two are oblivious to the 28 other hands
|
Ed T. |
I don't understand the 'shinny new toy'
|
Ed T. |
Java has annoying parts, but if you use annotations.... you don't even have to type the boilerplate
|
Ed T. |
so Java + annotations is less code than Kotlin
|
Ed T. |
imho
|
Mark M. |
annotations can be very difficult to debug, though
|
Mark M. | |
Mark M. |
er, they tend to be "magic boxes"
|
Ed T. |
View paste
|
Mark M. |
when they work, they're fine
|
Ed T. |
from my AppManifest.xml file
|
Ed T. |
AndroidAnnotations generates all of the code into a "class"_.java file
|
Ed T. |
so you can see what is generated as well as debug it
|
Ed T. |
if you need to
|
Mark M. |
yes, compile-time annotations are better for debugging than are runtime annotations
|
Ed T. |
and for some items I don't use annotations... like the RecylerView
|
Mar 29 | 9:40 AM |
Ed T. |
the binding and wrapping the data... it didn't play nicely
|
Mark M. |
@Oh @There @Probably @IsA @RecyclerView @Annotation @Library @Somewhere
|
Ed T. |
lol
|
Ed T. |
you have any questions for me? :-)
|
Mark M. |
none come to mind, sorry
|
Ed T. |
thanks for your hard work on the book! has been a great resource
|
Mark M. |
I am glad that it is useful!
|
Ed T. |
I've found the new IDE to be much faster. Especially after updating to the newer version of Gradle
|
Ed T. |
for builds
|
Mark M. |
yes, they are making good strides in that area
|
Ed T. |
are you still keeping the lightening bolt feature turned off?
|
Mark M. |
Instant Run? yes
|
Mark M. |
see, for example, https://stackoverflow.com/a/49300152/115145
|
Mar 29 | 9:45 AM |
Ed T. |
Thanks for your time Mark! I'm the only dev on a startup project. Nice to have someone to bounce things off of. Cheers
|
Mark M. |
you're very welcome!
|
Mar 29 | 10:00 AM |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Saturday at 4pm US Eastern
|
Mark M. |
have a pleasant day!
|
Ed T. | has left the room |
Mark M. | turned off guest access |