Nov 19 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Nov 19 | 3:55 PM |
rillig | has entered the room |
rillig |
Hi, thanks for providing this opportunity.
|
Mark M. |
hello, rillig!
|
Mark M. |
how can I help you today?
|
rillig |
View paste
|
Mark M. |
yes, that's a bit sloppy
|
Mark M. |
it's one of those things where I'm making a sacrifice of reliability for readability of a book example
|
rillig |
View paste
|
Mark M. |
in later examples, I use Question for something else
|
rillig |
ah, ok
|
Mark M. |
onEventMainThread() is always called on the main application thread, by definition
|
Nov 19 | 4:00 PM |
rillig |
by what definition? by its name?
|
Nov 19 | 4:00 PM |
Mark M. |
the definition of the API as documented by the library
|
rillig |
I didn't read the chapter of the book, I just had a look at the code, by the way.
|
Mark M. |
the library documentation says that onEventMainThread() is called on the main application thread
|
rillig |
I was just wondering because IntelliJ marks that method as unused.
|
Mark M. |
that's because it is called by reflection
|
Mark M. |
the IDE does not know about that
|
Mark M. |
I could add an annotation that says "this method really is used", but it's debatable which approach is uglier :-)
|
rillig |
Ah, now it gets clearer. I thought it was the Guava EventBus, but it's another library.
|
Mark M. |
greenrobot's EventBus is derived from Guava's, with more Android-isms
|
Nov 19 | 4:05 PM |
rillig |
View paste
|
Mark M. |
the book app was written because EPUB readers sucked years ago
|
Mark M. |
I keep it around, but I cannot afford to invest more time in features
|
Mark M. |
I just update the content
|
rillig |
ok, that's probably work enough :)
|
Mark M. |
with regards to the search result, pressing BACK should revert that fragment transaction and remove the search results, IIRC
|
rillig |
I was pretty impressed by the 4000+ pages
|
Mark M. |
there are also the other two books, neither of which are available in app form
|
Mark M. |
but, yes, the main book is large
|
rillig |
ok, the BACK makes sense. I just didn't think of it because I could do all other navigation stuff by swiping.
|
Nov 19 | 4:10 PM |
rillig |
On another note, somewhere in the book you mention that the `targetSdkVersion` isn't that important. But still you use all from the following list: 4|6|11|13|14|15|16|17|18|19|21|22|23|24|25. Is there a particular reason for that?
|
Mark M. |
as you noted, it's a 4000+ page book
|
Mark M. |
that's rather difficult to maintain
|
Mark M. |
while compileSdkVersion changes do not affect functionality, targetSdkVersion changes do
|
Mark M. |
hence, I only change that when I am updating that particular sample for some other reason
|
rillig |
oh, so you would have to test all 100+ apps
|
rillig |
I can understand that. :)
|
Mark M. |
so, I update some things automatically, such as the Gradle plugin version
|
Mark M. |
think of my targetSdkVersions as layers of sediment in the geological record
|
Mark M. |
targetSdkVersion 4 is from the Pliocene era, for example :-)
|
rillig |
:)
|
Nov 19 | 4:15 PM |
rillig |
Wow, the greenrobot library is really minimalistic in terms of size and classes. I just had a look whether there was an interface EventReceiver<T> so that the `onEventMainThread` could be marked as used.
|
rillig |
But there isn't anything. So the book just has to explain that magic. :)
|
Mark M. |
EventBus 3.x uses annotations
|
Mark M. |
more of the samples go that route
|
Mark M. |
in fact, I'm not sure if the particular sample that you looked at is used in the book anymore -- I have some stuff floating around the repo that aren't used
|
Mark M. |
but, no, there's no explicit interface or abstract class to use for event receivers
|
rillig |
of course. :) Keeping track of 7 versions of the book and 200+ apps and the chapters is a lot of work.
|
Mark M. |
7?
|
rillig |
oh
|
Mark M. |
many more than that
|
rillig |
2 months/book * 4 years = 24 versions
|
rillig |
wow
|
Mark M. |
well, it's been closer to 10 years
|
rillig |
yeah, but I thought versions older than 4 years would be "unsupported". But "free" apparently means something else. :)
|
Mark M. |
if you are referring to Four-to-Free, free means available under a Creative Commons license
|
rillig |
yes, I was.
|
Nov 19 | 4:20 PM |
Mark M. | |
Nov 19 | 4:30 PM |
rillig |
Thank you for your time. Have a nice afternoon. :)
|
Mark M. |
you too!
|
rillig | has left the room |
Nov 19 | 4:55 PM |
Mark M. | turned off guest access |