Nov 2 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Nov 2 | 9:10 AM |
Mathias | has entered the room |
Mathias |
Heyhey
|
Mark M. |
whoops -- hello, Mathias!
|
Mark M. |
how can I help you today?
|
Mathias |
Did you spill your coffee? :)
|
Nov 2 | 9:15 AM |
Mark M. |
no, but I got distracted and hadn't noticed that you entered the chat
|
Mark M. |
sorry for any delay
|
Mathias |
oh i came in 5 secs before literally
|
Mathias |
Hope all is well! Anyways, i have a quick question about PreferenceScreen
|
Mark M. |
go right ahead
|
Mathias |
View paste
|
Mark M. |
um, if you're willing to post the code somewhere that can be linked to from the chat, I can do a quick code review
|
Mathias |
i can paste here if you want, it's not much
|
Mark M. |
OK
|
Mathias |
View paste
|
Mathias |
View paste
(40 more lines)
|
Nov 2 | 9:20 AM |
Mark M. |
¯\_(ツ)_/¯
|
Mathias |
so basically i want to check with the expert (that's you!) if you can see any problem with storing away the preference in a class variable like this, or if you can see any other issue
|
Mathias |
heh, ok
|
Mark M. |
nothing leaps out at me, other than perhaps 1-2 superfluous methods (e.g., onViewCreated())
|
Mark M. |
I don't know what a PreferenceScreen all holds, but technically you're not leaking anything, so long as this fragment eventually goes away
|
Mathias |
you're right i will remove. I was experimenting with handling the back stack.
|
Mathias |
allright, cool. That's all i had!
|
Mark M. |
this is roughly equivalent to inflating a layout in onCreateView(), stashing it somewhere, and inflating a second layout in onCreateView(), returning that one, and later using the first layout
|
Mark M. |
so long as your UI is doing what you want (i.e., hiding and showing the relevant widgets), there's nothing intrinsically wrong with that
|
Mathias |
yeah, i do that in a mapfragment, moving back and forth with viwe overlays
|
Mark M. |
I'm not completely sold on the benefit of this approach versus just having separate fragments and ordinary back stack behavior
|
Mark M. |
but, if you like what you have, and things like LeakCanary aren't yelping about, roll with it!
|
Nov 2 | 9:25 AM |
Mathias |
Well, the benefit would be that the OS-level back would work. Since i don't have back stack when the user clicks the different tabs either, i thought it'd be confusing. But perhaps i'll revisit later. As a sidenote, the os-level back button is my #1 grudge with Android (along with all the stuttering)
|
Mark M. |
ah, right, I forgot about the tabs
|
Mark M. |
I'm not a huge fan of navigation within tabs, whether via an OS-level BACK button or your own
|
Mark M. |
I would try to do all of this in a single PreferenceScreen as a result, or not have the preferences be in a tab
|
Mark M. |
stuttering nowadays is mostly from self-inflicted wounds, such as disk I/O on the main application thread, the sorts of things that StrictMode can help identify
|
Mathias |
yes, i did not mean my app specifically, more in general as a user.
|
Mathias |
but you're right
|
Mark M. |
ah, OK
|
Mathias |
Well, i gotta continue coding, gots to finish this before i get the iphone X tomorrow ,and start updating the IOS app for the darn notch :)
|
Nov 2 | 9:30 AM |
Mathias |
see you around and thanks for the input
|
Mark M. |
happy to be useful!
|
Mathias | has left the room |
Nov 2 | 10:00 AM |
Mark M. | turned off guest access |