Jan 26 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jan 26 | 7:30 PM |
roberto | has entered the room |
Mark M. |
hello, roberto!
|
Mark M. |
how can I help you today?
|
roberto |
Hi Mark, how are you doing today ?.
|
roberto |
A kind of conceptual question...
|
Mark M. |
OK, and yourself?
|
roberto |
Fine, thks
|
roberto |
I've an app that has a good number of forms to add data to a database (remote)
|
roberto |
and for each form, I need to do an screen showing the data
|
roberto |
most of the app is about it... but the number of forms/screens displaying data is big
|
roberto |
questino
|
jth | has entered the room |
roberto |
would you use databinding for an app like that ?
|
Mark M. |
(jth: hi! I'll be with you shortly!)
|
jth |
sure
|
roberto |
Do you think data binding is stable a good library to use
|
Mark M. |
roberto: um, well, I do not see where the number of layouts matters as to whether or not you would use the data binding framework
|
roberto |
Or the price of saving some findViewById might be too expensive
|
Mark M. |
my #1 problem with the data binding framework right now is that it does not work with Jack/Java 8
|
Mark M. |
which makes things like RxJava messy (no lambda expressions)
|
Mark M. |
if you're willing to live without Java 8 features, then I haven't seen too many problems with the data binding framework
|
roberto |
No RxJava
|
Mark M. |
with respect to findViewById, again, that has little to do with the *number* of layouts
|
Mark M. |
findViewById gets more expensive with *big* layouts
|
Jan 26 | 7:35 PM |
Mark M. |
and you have plenty of options for caching those, whether manually, automatically via data binding, or automatically via the seemingly infinite number of libraries that offer that sort of thing via annotations and stuff
|
Mark M. |
so, I would not necessarily fear data binding in your case, from a runtime standpoint
|
Mark M. |
I don't have a good sense for how much overhead builds incur due to data binding code generation, though
|
Mark M. |
you might work up a script that wraps your layouts in <layout> tags, and see how the build goes, without doing anything else
|
Mark M. |
if the build now takes forever... that may make your decision much easier :-)
|
roberto |
Makes sense
|
Mark M. |
let me take a question from jth, and I'll be back with you in a bit
|
Mark M. |
jth: your turn! do you have a question?
|
roberto |
Sure, thanks
|
jth |
Yes First one
|
Mark M. |
go right ahead
|
jth |
I have a Fragment with a ListView. On that fragment there is a filter button. When the user clicks the filter button I need a full screen view to show with filter/options. And when the user select one of those, another view needs to show full screen with a list of options based on that choice
|
Jan 26 | 7:40 PM |
jth |
Right now I am using 2 PopupWindows
|
jth |
Is that a good idea, or should those be separate activities. There is just a lot of objects/data that need to be passed back and forth
|
Mark M. |
I would argue "neither"
|
jth |
what would you use?
|
Mark M. |
use fragments or some other replaceable UI
|
jth |
Well the issue is that the user can cancel at each step and I do not want to redraw the listview unless the user selects apply
|
Mark M. |
fragments do not preclude that
|
Mark M. |
personally, this sounds like a wizard-style UI
|
jth |
yes it is
|
Mark M. |
so, use a wizard :-)
|
Mark M. |
there's some libraries for that out in the Android Arsenal
|
jth |
ok
|
Mark M. |
I recently yanked the standard Android setup wizard bar out of the AOSP and used that in a project
|
Mark M. |
even if you decide that you do need floating things (e.g., it won't be full-screen on tablet-sized screens), I'd lean towards dialogs than PopupWindow
|
jth |
And that still should work if the original fragment with the listview has an toolbar and menu, and the "wizard" views need to be full screen
|
Mark M. |
um
|
Mark M. |
well, let's roll back to a comment I just made: what are you doing on tablets?
|
jth |
same thing
|
Mark M. |
really?
|
jth |
phone and tablet will have the same UI
|
Mark M. |
ok
|
Jan 26 | 7:45 PM |
jth |
yes :(
|
jth |
not my call
|
Mark M. |
ah
|
Mark M. |
ok, you mentioned "lots of objects/data being passed" -- is that between pages of the wizard, or is it also to/from the list?
|
Mark M. |
IOW, is the pair of PopupWindows that you're using now tightly coupled to each other but loosely coupled to the rest of this chunk of the UI?
|
jth |
to/from the list to the first page of the filter, and then to the 2nd page of the filter
|
Mark M. |
hmmmmm
|
Mark M. |
I agree that having something float probably results in a cleaner UI than having to hide/show the action bar
|
Mark M. |
I'd lean towards dialogs over PopupWindow, but that's more "personal preference" than anything else
|
jth |
I get the list of objects to display in the listview call from an API, that also returns the filter data in the same call, so I have to store the filter data and pass it
|
Mark M. |
the tight coupling does suggest that you should aim to keep this all in one activity
|
jth |
ok
|
roberto |
That was all from me, thanks a lot. Be back soon for sure!
|
Mark M. |
so, in absence of any other criteria, I'd be seeing if a full screen DialogFragment would work, where that hosted the two-page wizard
|
Mark M. |
roberto: OK -- you're welcome!
|
jth |
and just transition between the two fragments. And they can be on top of the original view?
|
Jan 26 | 7:50 PM |
Mark M. |
a DialogFragment is (mostly) just a Dialog that uses a Fragment for defining its contents
|
Mark M. |
and the dialog floats over top of the main activity content
|
jth |
ok I have used DialogFragments before, but just for Yes/No alerts etc
|
Mark M. |
this is definitely pushing the boundaries of it
|
Mark M. |
and I haven't really run into a scenario like yours in my own work, so I might have different ideas when truly faced with the problem
|
jth |
yeah its not great, because I have to handle the back button, which cancels what "view" you are on
|
jth |
again PM and UX people designing, I am implementing
|
jth |
when I have the dialogfragment in view, will each step be its own fragment?
|
Mark M. |
possibly, using nested fragments
|
Mark M. |
though nested fragments make me queasy
|
Mark M. |
I'd lean more towards a single fragment, using something else (ViewPager, ViewFlipper) to switch between the two steps
|
Jan 26 | 7:55 PM |
jth |
ah ok
|
jth |
next question, hopefully easier
|
jth |
The app uses some xml layouts, but since most data is from APIs and dynamic, much of the layouts are programmatically created
|
jth |
is there an issue besides readability in doing layout not in xml?
|
Mark M. |
less tooling support (e.g., GUI designer, data binding code generation)
|
Mark M. |
more difficulty in dealing with configuration changes
|
Mark M. |
those would be the big ones
|
jth |
ok, in the new code I am trying to use xml layouts when I can, but sometimes I still have to inflate the layout and then findbyid and objects to modify them
|
Mark M. |
sure, that's normal
|
Jan 26 | 8:00 PM |
roberto | has left the room |
jth |
ok
|
jth |
thank you, I am off to try switch to a dialogfragment and viewPager/flipper
|
Mark M. |
OK
|
Jan 26 | 8:20 PM |
jth | has left the room |
Jan 26 | 8:30 PM |
Mark M. | turned off guest access |