« first day (1656 days earlier)      last day (3517 days later) » 

20:00
-7
A: Why do people take downvotes so personally?

GoodbyeI don't take it personally, but the concept of anonymous votes is bad in general. It leads to "vigilant justice", "crowd cheering" and public humiliation. Just dare to ask a "wrong" question, especially a critical view on StackExchange: Within seconds, one of the "StackGods" makes out his mind,...

JPMorgan and Goldman Sachs have Android openings if anyone is interested
anyone use the circular reveal animations
no, but I use circular logic, if that helps
no, it doesn't help - thus your argument is circular?
You know what always helps me? circular logic
20:07
you and your FTL stuff have messed my brain enough today, stop.
is the logic really circular if it doesn't obey the laws of physics?
and it comes full circle, like the avatars of a fortnight ago
i come here for a break in programming. not to think more
warping spacetime as a means of propulsion is possible within the laws of physics, the math on the surface seems to line up carl
20:09
then codeMagic has you covered, jlin!
lol cM and i are gonna go hang out in our own corner of non-thinking.
No Thinking Zone please be respectful of that. K thx
is there a good way to determine how much space an ImageView will take up in a layout if I don't explicitly have dimensions for it?
what do you mean? what do you know if not the dimensions?
when do you need to know?
I think the earliest you get that information is onLayout, but you can also get it from onSizeChanged, or getMeasuredWidth once the view is laid out.
20:14
I'm about to download a thumbnail of an image
do you know the filesize?
I want to download one that will be the closest fit to what I'm about to show
with using specific ScaleType, you can define the image up to your needs -> e.g keep aspect ratio - resize etc
so, let's say I have pregenerated thumbnails at sizes 100x100, 200x200, etc
and I'm about to download it from our back-end
you should be able to infer the general size if the difference between pixel sizes are large enough
based on the file size when you start the download
20:16
that's not the issue dave
he wants to download the image that is closest to the size of the ImageView right?
so I might have an Image on the left, and some text on the right, with some sort of relative layout value such that the image takes up 1/3 of the space
yeah eski, exactly
right now, due to it not being written correctly the first time, I'm just downloading the highest quality image we have and downscaling automatically
yeah and if they fall into 3 categories, 100x100, 200x200, 300x300 he can choose from the 3 based on the # of bytes in the file
pops popcorn
Personally, I'd make a custom view that extends ImageView and overrides onSizeChanged.
20:18
or just use standard naming convention, just have the imageview scale up the to available space
then if the size changes it would also update if the closest resolution changes
since we don't support screen rotation, the image sizes never change ^_^
if you had a height/width of 0 and a weight of 1, with no other dynamic sizes in the layout you can have the imageview take up all available space and measure it
I guess my question is - when will I know how much space the item takes up? Doing the measurement in onCreate doesn't work, because at that point the width and height are zero
or get the screen dimensions of the phone and subtract the other ui elements
have you tried onResume?
20:21
onResume won't work either
you have to use this mess
You can always use ViewTreeObserver
yuck
unless you do the custom view approach, which I recommend :P
Be careful with VTO, it's good in theory
I have had issues with it and ImageViews in the past too
20:23
eski, I already have the custom view that extends ImageView so that part isn't hard
well, there's your answer then :D
onSizeChanged() { downloadImage(size) } roughly then?
yeah
it'll give you the width and height
I'll give it a shot, thanks
I originally wanted to just check the screen density and use that as a proxy,
but that ends up loading terribly grainy photos on poor quality tablets
I'm still looking for an alternative to VTO because it's the only thing holding me up from my printing feature. But it's on the back burner, atm
20:26
why not just use the actual pixel dimensions of the device?
Yeah density is bad because it doesn't reflect the actual size in pixels.
using the actual pixels instead of density will prevent the graininess
that is what he is going to do with onSizeChanged Dave
yeah ok
you could pre-load sooner in the life cycle since you always know the pixel size
define a level of quality in some singleton and just always know with lightweight logic rather than downloading on size changes
but you don't always know the pixel size
20:29
as long as you can call Display display = getWindowManager().getDefaultDisplay();
you can know the display size in pixels
that will give you the entire screen
not the view size
yeah but it you can infer from there
what category the thumbnail you want falls into
and just do it once
You could, but that isn't a general solution
if you want a general solution buy an iPhone
=p
lol
fortunately I only have about 2-3 different layouts, and they're shown repeatedly
so I could probably store the result and load the proper image sizes in onCreate or something after the first time the layout is shown
20:33
yeah that helps, I was thinking if you had the same view re-used N times based on dynamic content or something
it would be cheaper to know ahead of time and also give you the ability to pre-load
this should all happen on the order of ~1ms or less
unless you have an awful layout hierarchy or something
well...
lol
is this all in an adapter?
usually, yes
could you set the url in the tag of the image view in your adapter, then like eski suggested just wait for the resize or on measure and start downloading the proper image right after?
it gets measured after you return from getView, right?
20:44
0
A: How to read variable amount of json data from url?

greenappsInputStream in = new BufferedInputStream(conn.getInputStream()); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder sb = new StringBuilder(); String newLine = System.getProperty("line.separator"); String line; while ((line = reader.readLine()) != null) { sb....

code only answer from a 3K+ user...
I think, since my layouts are static and reused frequently that I can probably get away with calculating at app startup based on the device properties
20:57
is this acceptable in SO?
0
A: Service gets restarted when app i reopened

Daniel TungTest to see if the service is already running. I expect somewhere in the Android SDK you can interrogate the running services and see if it's already running. Someone else will likely have a better idea though, sorry.

It's an answer, just a poor one
21:49
it would be really awesome if the Android documentation, when discussing things like "size of view" was specific about whether it was in terms of dpi or px, so that I don't have to actually do the math myself to answer the question
I think sizes are in px, right?
the onSizeChanged function in View doesn't have units listed
is there a key / legend somewhere Emm that says that?
or is it just something you have to figure out and remember?
I am just going from memory from some method inside of View
but I am not 100% sure
I think in onMeasure() you get passed the measureSpec value or something like that
and I think I remember those are in px
onSizeChanged is pixels
nothing you get programmatically will ever be in dp. And onMeasure is a bit different because it munges the data: developer.android.com/reference/android/view/…
That was it, MeasureSpec is a size/mode combo
22:03
Guess what :) This magazine insert with a color display also has a Micro USB port so I can upload custom videos (by taking it apart...) hehe
It can hold 4 videos, 3 for buttons and one for startup
Memory can hold half a gigabyte
@nana @McAdam331 @codeMagic @DaveS just saying I'll be on for a bit. If you care :P
hey Tristan
22:18
Hey Dave
aww
not a good time?
22:46
0
Q: Android studio cannot resolve symbols

DTVI have bought app ,everything works fine. But when I try to add new code to java file it show errors "cannot resolve symbol" . if java files stay untouched everything works fine.and i need to extract app again so files could be untouched.

LOLOLOLOL
> Also, when I get on my bike, it's totally fine, until I start pushing the pedals, and then it starts moving!
Please, I beg you to post that comment
no, one meta post about me a year, please.
Also, when I get on my bike, it's totally fine, until I start pushing the pedals, and then it starts moving! — Emmanuel 15 secs ago
It had to be done
he complained about my your sarcasm
@DanielNugent you've got write access, please read the room rules
23:01
I am too slow...
@Emmanuel and rightly so, which is why I didn't post it on his question ;-)
@CarlAnderson Thank you!
No problem, welcome.
ROFL @CarlAnderson
well if you want tell me your contacts i could contact you or tell me what details do you need and i will give you — DTV 10 mins ago
23:17
yeah, I read that some time ago
right before my interview with Trello, lol
well, unfortunately you don't have to pass a programming test before posting a question to SO
LOL, I would not be able to post then...based on my past experience
I'm talking about something trivial, like FizzBuzz
hopefully you can write a solution to FizzBuzz on your own by now ;-)
yeah, I was able to do it twice now on interviews, lol
did dan lew interview you?
23:22
no
some other guy
the Mobile lead at NYC
ah
just him?
yeah, I did not even make it past the first round
what kind of questions were there?
they just asked me to ping an API
I used Retrofit and RxJava and stuff
it was easy
what didn't they like?
23:24
I do not know, they did not tell me
I told him I was not an RxJava expert
damn, no feedback? that's lame
don't use something you're not comfortable with in an interview lol
they told me they give no feedback due to legal issues
really? tripadvisor gave me feedback
well, they sort of required RxJava knowledge
ah, I see
23:30
@screenmutt Even though you do not have answers on the Android tag, we trust you. You have write access. Please read and follow the rules.
Thanks!
I have to admit, that I really need help on an issue I'm having. I'm on a crunch here and haven't been able to find info. Details are here. I thought I would ask here to see if you all had any ideas.
if you post the share link on a single line it will one-box it for you
0
Q: Fragments not being displayed until touch

screenmuttI have an application where I am trying to dynamically load and display posts. I have this in the onPostExecute method of an ASyncTask. Log.i("Posts", "Displaying Posts"); // Add a new layout to the top of the posts final LinearLayout refreshLayout = new LinearLayout(HomeScreenActivity.this); r...

@Emmanuel what was the newer replacement for LocationManager called? I can't remember or google it.
Fused Location Provider
it is part of Google Play Services
o/
Have I missed anything exciting?
@CarlAnderson Thanks for the tip.
23:41
@DaveS back
time for me to head home
catch you guys later
later
See ya, Carl
Hey @codeM
yo, tristan
23:48
What's up?
Not much. Just got home from my kid's baseball practice so deciding what to do before bed (actually before the Cubs start)
Nice :) Sounds like fun
How were you able to sneak away to the digital world?
For now, yes
Cubs != fun
23:54
Cubs = much fun
ohhh I forgot you were a masochist
@nana I got my circle transparent :)

« first day (1656 days earlier)      last day (3517 days later) »