**** BEGIN LOGGING AT Sun Jan 25 02:59:59 2015 Jan 25 03:00:06 t0astt: ah, yeah, they do require that now don't they? Jan 25 03:00:13 probably have for a while... Jan 25 03:10:24 Ever since firesheep and stuff got popularized Jan 25 03:11:23 firesheep is like the best thing ever. finally got people to say "wtf why aren't you all https" Jan 25 03:11:45 though personally I find it literally insane that wifi doesn't have an open + encrypted mode. Jan 25 03:12:09 yeah, and that places still use WEP Jan 25 03:12:16 shit can be cracking in 30seconds w/ aircrack Jan 25 03:17:33 groxx but what's weird is it works through a web browser with http. Strange :P But now I'm having a problem with image resolution. The image it's retrieving is kinda low-quality Jan 25 03:17:39 higher quality on the web browser tho Jan 25 03:18:10 t0astt: same exact url, or did you drop type=square for the browser? Jan 25 03:18:10 ah, might just need to tweak some settings. Jan 25 03:18:11 In OkHttp, what's the best way to determine how long a cache should last? In my case, the server does not send any cache-related headers at all. (Should I rewrite the server's response and add cache headers?) Jan 25 03:19:13 TacticalJoke: hm. if you control the server, probably either never or forever. e.g. most rails servers I've dealt with will add a random param to the end to bust caches for that purpose. Jan 25 03:19:29 Oh, this is reddit. :) Jan 25 03:19:50 well... arguably no-cache is correct. otherwise a mad F5 spree wouldn't find anything new :) Jan 25 03:20:39 http://stackoverflow.com/questions/24471109/recyclerview-onclick#comment42500098_26196831 Jan 25 03:20:51 dunno how to e.g. force a cache lifetime onto okhttp though. I'd be interested if you find a way, I might have to use that soon. Jan 25 03:21:02 Yeah, a Refresh tap will always skip the cache, but I do want to cache some stuff for a short time. Jan 25 03:21:14 Okay, I'll let you know. :) Jan 25 03:21:27 yeah, that's probably a happy middle-ground Jan 25 03:22:03 I'll probably cache post/comment listings for five minutes or something. Maybe three. Just enough to catch that situation where they accidentally Back out of something and go straight back. Jan 25 03:22:31 But, outside of that, caching reddit is probably pointless. Jan 25 03:22:45 The client I (used to) use caches for something like 24 hours by default. Jan 25 03:22:47 Crazy. Jan 25 03:23:12 yeah, certainly crazy for most of reddit :) Jan 25 03:23:48 Also, I'll use the cache for the saved-instance-state thing. Jan 25 03:24:14 Which I guess means I can't commit to N minutes. Jan 25 03:25:03 I'm not sure whether I'll end up writing the cache stuff myself. Jan 25 03:26:23 TacticalJoke: maybe always load the previous state, and refresh in the background if > N minutes old? it does have the downside of the views "jumping", but ¯\_(ツ)_/¯ just to give another idea. Jan 25 03:26:43 That'd certainly be more efficient than storing the enormous responses that reddit gives. Hmm. Jan 25 03:26:53 In terms of disk space, CPU cycles, and RAM use. Jan 25 03:27:01 I'm doing something similar, but for my side project I'm being very aggressive about "must work offline" Jan 25 03:27:14 Yeah, I was thinking of doing that. :) Jan 25 03:27:15 so pretty much everything is a read-through cache + refresh in the background Jan 25 03:27:34 It could be nice, especially if the UI makes it obvious what's going on. Jan 25 03:28:01 There could be a "you're viewing a cached copy" hint combined with a progress bar, maybe. Jan 25 03:28:09 yeah, that can be tricky :) and that's what's going to end up making me tear apart ViewPager and get rid of its whole crazy "adapter" base. I want to just give it new pages (or not) as people try to page. Jan 25 03:28:13 Or just the former if they're not re-downloading. Jan 25 03:29:01 might be easier to build it from scratch, but at the moment I'm feeling kinda lazy on that front. Jan 25 03:29:21 Interesting. I still haven't used ViewPager. Jan 25 03:31:12 Hmm, I just thought -- I'm gonna want Picasso to use its own cache and to use my OkHttpClient instance. Jan 25 03:31:20 But I might not want the OkHttpClient to cache stuff in general. Jan 25 03:31:25 I hope that's possible. lol Jan 25 03:31:55 (I haven't tried Picasso yet.) **** BEGIN LOGGING AT Sun Jan 25 03:37:33 2015 Jan 25 03:37:40 Doh. Got disconnected. Did my JakeWharton ping go thruogh? Jan 25 03:37:44 through* Jan 25 03:38:05 No Jan 25 03:38:57 Oh, hi. Is it possible to use caching for Picasso (when giving it an OkHttpClient) without using caching for the OkHttpClient in general? Jan 25 03:39:47 Just use different instances of the client. Jan 25 03:39:56 Clone the client and enable the cache only in the instance you give to picasso Jan 25 03:40:01 Okay, thanks. Jan 25 03:40:02 Then they'll share everything else. Jan 25 03:40:07 Alright, question time. Jan 25 03:40:34 I started with the sample navigation drawer thing android studio makes for you, and swapped it out for a recyclerview Jan 25 03:40:55 To do the clicks now I set up the handler in the viewholder and let that call getPosition() which works Jan 25 03:41:19 Before it had a NavigationDrawerCallbacks thing with a function that could be called in the activity. Jan 25 03:41:35 I'm having trouble getting that callback to pass from the activity->adapter->view handler Jan 25 03:41:39 JakeWharton: Also, if I *were* to use OkHttpClient caching in general, what would be the best way to ask it to keep caches for, say, five minutes? Should I simply rewrite the server responses to add the relevant cache headers? Jan 25 03:41:42 Or is there a better way to handle this? Jan 25 03:41:50 (Note that the server in question {reddit} does not add any cache-related headers.) Jan 25 03:42:09 Sure Jan 25 03:42:28 All right, thanks. Jan 25 03:45:08 Right now I set a field when I create the viewholder that has the adapter, but it might not have been set yet if it isn't attached. How do I update its reference, or can I have it talk to the adapter somehow? Jan 25 03:46:55 I suppose I could have a double callback, when the viewholder calls a adapter function which will then call the activity function if it has been set yet (through a setting in the adapter), but that feels pretty clunky Jan 25 03:47:14 through a setter* Jan 25 03:48:46 groxx, I extended BaseAdapter and relatively quickly got a filterable autocomplete. =D Much easier than using cursors. I do have to traverse the cursor though - but that's kind of a necessary evil. Jan 25 03:49:40 Smasher816: It may be because I'm not really awake, but I don't understand what you're asking. Can you give a TL;DR? Jan 25 03:50:30 How do I get a recyclerview onclick to execute a callback from the main activity? Jan 25 03:50:45 hesperaux: pretty much, yeah. glad it's working though :) Jan 25 03:50:53 ;D Jan 25 03:51:18 Right now I am defining the onclick in the view handler, where it can call getPosition and stuff Jan 25 03:51:31 but getting from their to the activity is what I am not sure about Jan 25 03:52:52 I'm using ListView, but my activity asks the adapter to set the handler, and then my adapter passes that handler to the custom ViewGroup. Seems the most sensible option to me. Jan 25 03:53:14 I'm guessing that could be translated to the RecyclerView system. (I haven't used it yet, though, so I'm not sure.) Jan 25 03:54:02 I made a function in the adapter to set the callback Jan 25 03:54:47 "convert to dollar-slashy string" and "convert to gstring". hm. http://cl.ly/image/1q2c3r3J341G Jan 25 03:55:11 But the adapter doesn't have a way to get access to the view handler's, which contain the desired view Jan 25 03:55:30 You have to set the onclick on each view individually, there is no more listview onclick that works for everything anymore :( Jan 25 03:55:57 I'm autocorrecting your 'view handler' to 'ViewHolder'. Hope that's right. Jan 25 03:56:22 yeah, sorry. Wrong word in my head Jan 25 03:56:27 That is what I meant :) Jan 25 03:56:28 the view handler/holder has access to the adapter though, yes? it could call adapter.onItemClick(etc) which calls activity.onItemClick(etc) Jan 25 03:56:56 groxx: I guess. I was just wondering if there is a better way Jan 25 03:57:36 Not sure whether this is good: http://stackoverflow.com/questions/26889361/getting-a-reference-to-viewholder-on-recyclerview-click Jan 25 03:57:52 dunno. for maximum separation, that's probably what I'd do. otherwise I have lots of adapters defined in the activity/fragment that uses them, in which case the callback is easier to make just reference the activity directly Jan 25 03:58:23 I've actually used View.setTag for this kinda thing with ListView, but I always feel slightly dirty after. Jan 25 03:58:49 I actually like the sound of groxx's idea. Jan 25 03:59:08 (I keep saying 'actually' for some reason.) Jan 25 03:59:15 I actually do the same thing Jan 25 03:59:46 groxx: same as what you told me, or same as TacticalJoke does? Jan 25 04:01:37 Smasher816: I've done the adapter-callback thing I mentioned, or things very similar (passing a callback to the adapter, views call the callback directly instead of "proxying" through the adapter) Jan 25 04:01:41 and also what TacticalJoke does Jan 25 04:02:57 So I'm using a recyclerview, and that recyclerview has "anonymous" LinearLayouts as rows as children. Right now I grab the LinearLayout with child = recyclerView.findChildViewUnder, but is there a way I can go even deeper than that? Child is the LinearLayout, so I want to get the content of the LinearLayout Jan 25 04:05:07 child.getChildAt(int) or child.findViewById(R.id.whatev_yo) may work Jan 25 04:05:35 I found that, but it doesn't work (won't apply that method to the object). Here is how I grab the child from the recyclerView: View child = recyclerView.findChildViewUnder(motionEvent.getX(), motionEvent.getY()); Jan 25 04:05:43 Thanks, I got it working now. Was forgetting to set the value in the constructor after it was passed in :P Jan 25 04:05:49 Now to make it close again and to style the click Jan 25 04:05:59 Smasher816 what are you working on? Jan 25 04:06:13 that's because View doesn't have children, but the linearlayout you're finding is a ViewGroup, which does. cast it to ViewGroup or LinearLayout, but watch out if you ever change the layout :) Jan 25 04:06:48 I can't wait to try RecyclerView. Kinda hate ListView and ListAdapter now. Jan 25 04:07:07 tbh, a Pandora app. I wrote one a little over a year ago, and still have my java library for talking to their servers Jan 25 04:07:19 I stopped caring about it after Xposed had a modified app for me Jan 25 04:07:26 TacticalJoke: unless you're doing fancy stuff, recyclerview doesn't really simplify normal use :) Jan 25 04:07:40 But now on lollipop the app looks bad, and there is no way to stop it without unlocking the phone since google killed the lockscreen music controlls Jan 25 04:07:47 Smash816 how are you styling your clicks? Because that's what I'm trying to do on my recyclerview right now hehe Jan 25 04:07:52 Yeah. I might end up wanting custom-drawing of borders for reddit comments, though. So it might be worthwhile. Jan 25 04:08:00 s/borders/dividers/ Jan 25 04:08:08 So I will give it a nice material overhaul (my first dabble in that), add controls to the notification, etc Jan 25 04:08:26 t0astt: I am not yet. I just got the click handler set up :P Jan 25 04:08:27 e.g., I might have dividers only draw from the beginning of a comment (rather than from the edge of the screen). Jan 25 04:08:49 groxx, cast it like (ViewGroup)child.getChildAt()? Jan 25 04:08:51 TacticalJoke: you making a new reddit app, or are you a contributer/dev of one that already exists? Jan 25 04:08:55 ah, right, there maybe some use there. fwiw I've had crap-tons of problems with expandable listviews, so I might recommend skipping straight to recyclerview (or rolling your own by hand) if you start expand/collapsing comment threads :) Jan 25 04:08:59 Making a new one. Jan 25 04:09:27 t0astt: probably ViewGroup child = (ViewGroup) recyclerview.findChildView... Jan 25 04:09:28 expandableListView always seemed like a hack Jan 25 04:09:39 g00s_: add a fast scroller, and watch the fun begin :| Jan 25 04:09:43 I've done collapsing with ListView. I just called PresentableComment.toggledCollapsed and then BaseAdapter.notifyDataSetChanged. Jan 25 04:09:46 Ah, ok Jan 25 04:10:11 Though I guess RecyclerView might give me the possibility to animate. Jan 25 04:10:37 (If I do animate any such thing, it'd be very fast and non-annoying. More of an affordance thing.) Jan 25 04:10:45 Yay, cyclic inheritance Jan 25 04:10:49 yeah, that it may do better. Jan 25 04:10:55 Smasher816: w00t Jan 25 04:11:36 groxx: The collapsing thing turned out very neat. I just made a CollapsingList class. Jan 25 04:12:01 aah. sounds like a good idea Jan 25 04:12:14 Annonymous inner classes ftw? :P Jan 25 04:13:06 I've done what's probably the reverse of that - nestable indexes, so you can get indexes at each level + a "combined" level for reaching into a flat list Jan 25 04:13:06 my phone is messed up. Keeps going into car mode >_< Jan 25 04:13:43 TacticalJoke: I might like your idea better. Jan 25 04:13:49 * groxx ganks it Jan 25 04:14:12 This is it: http://pastebin.com/fXB3FkDG Jan 25 04:14:25 Though some of that code weirds me out. Needs better names or something. Jan 25 04:14:27 Whew, what inderection Jan 25 04:14:44 I made it generic enough to unit test on the JVM. Jan 25 04:14:55 ViewHolder -> Navigation Drawer Fragment (closes it) -> Main Activity (to change the content fragment) Jan 25 04:15:24 w/ a possible Adapter call inbetween the viewholder and navdrawer fragment (but it doesn't seem neccisary) Jan 25 04:17:15 Smasher816: be sure to toss in dependency injection, an event bus, some rxjava observables, and maybe a few Object.wait() calls for good measure. Jan 25 04:24:31 It's funny. I created this class that calculates the different between two milliseconds-since-the-epoch values, and it was just a temporary hack until I moved to Joda-Time or something. Jan 25 04:24:44 But, the more I think about it, the more I want to keep this code. Might end up being permanent. Jan 25 04:25:02 Because it's being called in Adapter.getView and has to be super-fast (which this is). Jan 25 04:25:15 It's not accurate for months or years, though. Jan 25 04:25:20 TacticalJoke: https://plus.google.com/104711040110222472212/posts/f1s2akwYuYT Jan 25 04:25:27 At worst, I think it can be off by a day or two. Jan 25 04:25:43 Smasher816: haha Jan 25 04:26:07 "Temporary Hack", suuuuure :P Jan 25 04:26:22 In my case, seconds, minutes, hours, days, and weeks are 100% accurate. Jan 25 04:26:27 That's probably sufficient for a reddit client. Jan 25 04:26:39 Yeah, after that it would probably say "5 years old" Jan 25 04:26:55 not 5 years, 3 months, 2 days, 11 hours, 15 minutes, and 10 seconds old Jan 25 04:27:06 So I think you can get away with a little rounding errors or whatever Jan 25 04:27:16 Yeah, I just show two figures: stuff like "2 mins, 5 secs" and "5 years, 4 months". Jan 25 04:27:36 Even that could be considered a little overkill, lol Jan 25 04:27:41 Actually, I'm not showing months yet (just weeks), which looks kinda weird. I'll probably show months, though. Jan 25 04:27:48 Yeah, maybe. But it's nice to have two figures all the time. :) Jan 25 04:28:14 reddit itself shows only "one hour ago". I don't like that. Jan 25 04:28:28 "one day ago" Jan 25 04:28:35 Fair enough. I think most people are ok with it Jan 25 04:28:43 But feel free to add features :) Jan 25 04:29:06 There is a reddit app I know of that shows milliseconds. Jan 25 04:29:09 Like anyone cares. Jan 25 04:29:25 I wonder why he drew the line at milliseconds and not nanoseconds. Jan 25 04:30:05 Then again, the server sends milliseconds since the epoch, so I guess he didn't have a choice. Jan 25 04:30:33 on reddit, nanos is best Jan 25 04:31:29 On this general topic, I have no idea what to do about an icon. I was hoping to avoid the alien thing. Jan 25 04:31:38 He has a name, lol Jan 25 04:31:39 The app is called 'Aqua', and I was hoping for some water theme. But I am terrible at drawing stuff. Jan 25 04:31:53 Snoo. :D Jan 25 04:32:00 Big 'A' with a shadow :P Jan 25 04:32:06 i'd call it bacon salad Jan 25 04:32:09 but probably already taken by something Jan 25 04:32:13 aqua a reddit client ? Jan 25 04:32:23 The logo I suggested Jan 25 04:32:24 Yeah. Just because I like the word. lol Jan 25 04:32:32 * Smasher816 is not a graphics designer either Jan 25 04:32:42 * g00s_ smacks TacticalJoke with branding wand Jan 25 04:33:05 I know it doesn't mesh with the concept of reddit... Jan 25 04:33:12 ...but it gives me a colour theme, nice imagery, and so on. Jan 25 04:33:20 oh boy Jan 25 04:34:09 Do you think it's a bad idea? Jan 25 04:34:17 I felt that using reddit-specific naming was too limited. Jan 25 04:34:24 And too lame. Jan 25 04:34:32 "Bacon" and "narwhals" and "aliens" and stuff. Jan 25 04:34:52 I guess the idea is that my app will be refreshing, like a glass of water on a hot day, or like a dip in a cool ocean. Jan 25 04:34:59 Narwhals love alient bacon Jan 25 04:35:21 * BrainStyle considers opening photoshop after checking quality of another roadside monitor Jan 25 04:36:10 ^ what he said Jan 25 04:36:12 So I guess I can't have an image of a waterfall as an icon. Jan 25 04:36:14 reddit sync is a lame name too Jan 25 04:36:18 Yeah, I agree. Jan 25 04:36:26 But I do like it as an app :) Jan 25 04:36:31 g00s_: Honestly, do you think I should switch name? Jan 25 04:36:33 Like, is it lame? Jan 25 04:36:39 yeah Jan 25 04:36:46 What kinda thing would you advise? Jan 25 04:36:56 So, I have my custom listview item thing. I set its background to a selector drawable that has a different color for state_selected Jan 25 04:37:19 and in my adapter I call view.setSelected(true) Jan 25 04:37:20 that it? Jan 25 04:37:27 Note that it'll use the 'for Reddit' thing in public. Jan 25 04:37:31 But privately be just 'Aqua'. Jan 25 04:37:48 Ahh internal codenames Jan 25 04:38:00 oh internal name? who cares then :) Jan 25 04:38:02 Yeah, ' for reddit' sounds pretty awful. Jan 25 04:38:18 And I also will capitalise the 'R' in 'Reddit' just because. :D Jan 25 04:38:26 i'd still put 'for reddit' in the title for discoverability though Jan 25 04:38:39 somethingawesome for reddit Jan 25 04:38:40 Yeah, I'll do that on Google Play. I might also refer to it as 'Aqua for Reddit' always in public. Jan 25 04:38:42 http://www.amazon.com/Hello-My-Name-Awesome-Business-ebook/dp/B00JH0HGVA Jan 25 04:38:44 In case of copyright/whatever issues. Jan 25 04:39:09 g00s_: That could actually be a great name. Jan 25 04:39:34 i mean (insert some awesome name) for reddit ha :) Jan 25 04:39:47 Yeah. Lol. But the templated kinda worked. Jan 25 04:39:51 template* Jan 25 04:40:15 I guess part of the reason I chose that name is that every app I've ever released has a gem name. Jan 25 04:40:18 maybe you can just name it "for reddit" Jan 25 04:40:27 Emerald was an IRC client. Sapphire was a text editor. Jan 25 04:40:35 lol groxx Jan 25 04:41:05 I kinda like that naming pattern... calculator app -> "for calculation" Jan 25 04:41:27 for browsing the web Jan 25 04:41:31 Sounds like an art movement. Jan 25 04:41:33 hehe Jan 25 04:43:09 So, artistic guys Jan 25 04:43:13 What would you name a pandora app? Jan 25 04:43:14 That book looks good. Jan 25 04:43:24 Obviously, it won't go on the market or it would get pulled fast Jan 25 04:43:30 The "Emotional" criterion is kinda what I was going for with this name (but it probably fails). Jan 25 04:43:36 The emotion of seeing a waterfall and stuff. Jan 25 04:43:40 but online I think it should be ok as there is already other stuff like pianobar, pithos, elpis, etc Jan 25 04:44:03 Is that the radio app? Jan 25 04:44:07 s/app/thing/ Jan 25 04:44:15 yeah Jan 25 04:44:22 Completely 3rd party, but whatever :) Jan 25 04:44:32 Are you gonna use "for Pandora" naming? Jan 25 04:44:43 You could go with groxx's idea. ;D Jan 25 04:44:51 I don't think I will put it on the market Jan 25 04:45:04 Ah, okay. Jan 25 04:45:09 But regardless, you can't have " for Pandora". Need to figure out the part. Jan 25 04:45:18 "Crescendo" is nice. Jan 25 04:45:28 Maybe. Jan 25 04:45:42 Glissando. Jan 25 04:45:59 Arpeggio. I like music terms. :) Jan 25 04:46:17 Well it is a music app :P Jan 25 04:46:19 Or something like 'Nocturne'. Jan 25 04:46:26 * Smasher816 doesn't play an instrument, but I sang some Jan 25 04:47:03 Ooh, that could work for a reddit app: Nocturne. Jan 25 04:47:15 Because a lot of people read at night or use a dark theme (or something; I just like the word). Jan 25 04:47:26 Yeah, it's not bad Jan 25 04:47:29 not aqua themed though :P Jan 25 04:47:32 But "Nocturne for reddit" starts to sound awkward. Jan 25 04:47:40 Kind of forces you into making a dark ui Jan 25 04:47:45 The good thing about 'Aqua' is that I can make the whole app blue *and* use water-based theme names. Jan 25 04:47:47 or atleast having the option Jan 25 04:47:51 The dark theme could be "rain cloud" or something. Jan 25 04:47:54 The light theme, "ocean". Jan 25 04:48:09 Yeah, I'll definitely have dark. Jan 25 04:48:59 It's a shame reddit isn't a pro-fishing site or something. Jan 25 04:49:13 lol. I'm sure they have a fishing subreddit Jan 25 04:49:30 Maybe I could just make /r/waterporn the default-selected subreddit and thereby justify the name choice. Jan 25 04:49:48 (Which is SFW, of course.) Jan 25 04:50:05 Why won't my selectable background reset? After I touch them all then they are all grey. Jan 25 04:50:13 I call setSelected(false) in my code Jan 25 04:50:14 In a ListView? Jan 25 04:50:20 Same idea :P Jan 25 04:52:19 'Waterfall' is kinda nice as a name. Three syllables, though. Jan 25 04:52:31 And 'Waterfall for Reddit' is just too weird. Jan 25 04:52:42 I could never count syllables for english class, still can't Jan 25 04:52:51 I just say it out loud (in my mind). Jan 25 04:53:01 But it's not Water-Fall? :P Jan 25 04:53:06 Wall-ter-fall. Jan 25 04:53:07 wat-ter-fall? Jan 25 04:53:08 votemonster for reddit Jan 25 04:53:11 haha Jan 25 04:53:19 That's not bad. Jan 25 04:53:24 of course, you need an adorable monster logo Jan 25 04:53:36 so I have this - http://ix.io/fXw Jan 25 04:53:40 Something like that is definitely memorable. Jan 25 04:53:53 and this - http://ix.io/fXx Jan 25 04:54:05 It will change to the selected color, but not back Jan 25 04:54:09 What am I doing wrong? :( Jan 25 04:55:05 Ahhhhhhh Jan 25 04:55:19 What was it? Jan 25 04:55:21 I forget to call notifyItemChanged on the previously selected one to force it to redraw Jan 25 04:55:24 Ah. Jan 25 04:56:53 Who was the dude that needed help with the background? Jan 25 04:57:12 t0astt: I got it :) Jan 25 04:58:05 Quick question. Can I use a selector as a text color or should I do it progmattically? Jan 25 05:02:12 i love this changelog from latest Play Books update "fixed occasionally missing book pages" Jan 25 05:02:32 lol google, a book reader only needs to do one thing ... Jan 25 05:02:54 still want android in your car ? :P Jan 25 05:03:43 Smasher816: Sorry, I was fixing my phone (the car home bug thing). How did you do the styling? I'm trying to highlight a list item only if it's fragment is on screen Jan 25 05:03:50 >) Jan 25 05:04:01 Best way to create a unique String in Java? Maybe get the latest time and convert it to a string? Jan 25 05:04:07 t0astt: right Jan 25 05:04:15 oddalot make a random uuid Jan 25 05:04:25 did you use the layout android studio makes for you or something similar? Jan 25 05:04:34 if it's random though, couldn't two strings share the same value? Jan 25 05:04:45 Ehh, I'm using a custom material design-style navigation drawer. Lemme show you the link Jan 25 05:05:05 http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html Jan 25 05:05:11 well I took the stock one and made it all material, lol. Jan 25 05:05:20 Got a pic? Interested to see how it looks Jan 25 05:05:39 I used that guide. It's good! Jan 25 05:05:54 I just changed the individual rows to fit the guidelines, my post is the last at the bottom Jan 25 05:05:59 anyways, to have the selecting... Jan 25 05:06:01 I'll give it a look Jan 25 05:06:19 Ah, sweet. Didn't know that page existed :D Jan 25 05:06:34 you modify the adapter to have a variable for the selected position, and a setter function for it Jan 25 05:07:17 Then in the bindView thingy where you set all your values call do view.setSelected(true/false) depending on if that position equals the one that is saved as the "selected" one Jan 25 05:07:51 Then set your background or whatever to be a "selector" with a state_selected="true" color, and a default color. You can google that part. It's similar to the listview Jan 25 05:08:13 finally just call your adapters setSelected function from the drawer fragment or whatever you are using Jan 25 05:08:20 When you say modify the adapter, do you mean add another parameter to the constructor for it? Jan 25 05:08:28 oddalot not likely Jan 25 05:08:30 Make a new function Jan 25 05:09:10 Here is mine http://ix.io/fXz Jan 25 05:10:36 so you add that to the adapter, along with defining "mSelectedPosition". Then just call it from whatever you do when you select an item. Jan 25 05:10:36 woah, there i a whole wikipedia article on this subject: http://en.wikipedia.org/wiki/Universally_unique_identifier#Random_UUID_probability_of_duplicates Jan 25 05:10:39 ah ok, so whenever you grab the item position in the addOnItemTouchListener, you do a selectPosition with the item position clicked and set a field variable to that? Jan 25 05:10:59 pretty much Jan 25 05:11:02 nice! Jan 25 05:11:12 Then in the draw you do holder.myview.setSelected(true/false) Jan 25 05:11:27 depending on if the position is the selected one or not Jan 25 05:12:19 oddalot if you really need some unique ID, you can always use primary key of database too Jan 25 05:12:24 I'm going to give that a try Jan 25 05:12:42 Then if you set your background of the items to use a selector it will automatically choose between the two colors Jan 25 05:12:52 If you need an example I can show you my xml Jan 25 05:12:56 Yeah, I was actually just going to ask about that haha Jan 25 05:13:01 Sure, if you don't mind! Jan 25 05:13:39 i feel so dirty when i do new Thread() { }.start() :| Jan 25 05:13:48 so you put this in res/drawable as drawer_background.xml or something http://ix.io/fXB Jan 25 05:13:49 You dirty man Jan 25 05:13:58 heh Jan 25 05:14:08 so if state_selected=true then it uses color/primary, otherwise color/black Jan 25 05:14:13 Sweet Jan 25 05:14:18 I had no idea about selectors like this Jan 25 05:14:24 Then in your item's xml say background="@drawable/drawer_background" or whatever Jan 25 05:14:30 I could use a cat-related name. Jan 25 05:14:38 KittyReader (just kidding) Jan 25 05:14:51 Feel free to google the selector part, its the same for listviews and everything else Jan 25 05:15:04 I actually use mine to change the foreground color. But at that point it's all xml styling Jan 25 05:15:13 all the java has to do is set that it is selected Jan 25 05:15:25 why does the new google maps need bluetooth connection information ? Jan 25 05:15:31 Right Jan 25 05:15:33 why not :) Jan 25 05:15:47 So I'm guessing the @color/primary you have in there is if the selector is true, black if false? Jan 25 05:16:27 yeah Jan 25 05:16:37 Smasher you are awesome. Thanks for that help Jan 25 05:16:45 It defaults to the last thing without any qualifiers Jan 25 05:16:49 I'm going to try and implement this now. I'll let you know how it goes Jan 25 05:16:54 if it finds something else like the state_selected=true then it will use that Jan 25 05:17:02 Good luck. I just figured it out a little bit ago Jan 25 05:17:12 "BaconReader" is such a horrible name. Jan 25 05:17:19 agreed Jan 25 05:17:26 Though it was my first reddit app Jan 25 05:17:28 Don't use it anymore Jan 25 05:17:30 "What's the worst possible name for a reddit app?" Jan 25 05:17:31 Same here Jan 25 05:17:33 That's what it makes me think. Jan 25 05:17:52 Smasher816: Just curious, are you styling the whole LinearLayout of the item, or do you style just the imageview and textview? Jan 25 05:17:53 Which apps do you use now? Jan 25 05:19:02 For bg, the whole thing. For text, just the text view Jan 25 05:19:15 I think I will do both now after looking at the play store Jan 25 05:19:38 Without the grey background it is hard to tell the blue-grey color from the default black Jan 25 05:19:48 When I add items to a List, do they auto incriment Jan 25 05:19:48 yeah Jan 25 05:19:50 kingdom of narwhal reader Jan 25 05:19:54 hehe Jan 25 05:19:56 Or do i have to add the position myslef Jan 25 05:20:03 for what drose379? Jan 25 05:20:05 ListView? Jan 25 05:20:07 Like will the first item I add in a loop be at 0? Jan 25 05:20:12 drose379: They add to the end. Jan 25 05:20:16 Depends on the current size. Jan 25 05:20:37 So in my for loop where "i" is the position Jan 25 05:20:45 should I add(i,...) Jan 25 05:20:47 No. Jan 25 05:20:53 or just add(content) and it will be stored at Jan 25 05:20:54 0 Jan 25 05:20:54 1 Jan 25 05:20:54 2 Jan 25 05:20:55 3 Jan 25 05:21:07 just add(content) Jan 25 05:21:14 I believe, it's been a while Jan 25 05:21:16 and ill be able to access it later Jan 25 05:21:32 http://developer.android.com/reference/java/util/ArrayList.html#add(E) Jan 25 05:21:34 List names = new ArrayList<>(); names.add("John"); // always added at position 0 Jan 25 05:21:35 Adds the specified object at the end of this ArrayList. Jan 25 05:21:48 " ... " Jan 25 05:21:52 then on the next item in the for loop Jan 25 05:22:00 it would be at 1 Jan 25 05:22:03 and so on.. right? Jan 25 05:22:04 Mhmm. Jan 25 05:22:12 Ok, cool, thanks. Jan 25 05:22:17 Making that seperate getter class now Jan 25 05:23:26 What case should variables be in Jan 25 05:23:29 likeThis Jan 25 05:23:33 or LikeThis Jan 25 05:23:46 at the end of the day it comes down to personal preference Jan 25 05:23:56 Sweet Jan 25 05:23:56 They should be likeThis. Jan 25 05:24:08 But there is an official style if you want to contribute to the actual android projects code Jan 25 05:24:18 Ok, I know camelcase Jan 25 05:24:23 is that LikeThis Jan 25 05:24:27 whats thisCalled? Jan 25 05:24:33 https://source.android.com/source/code-style.html#follow-field-naming-conventions Jan 25 05:24:52 Smasher816: I would say that some practices are good and some are bad, even if we're talking local variables. Jan 25 05:24:58 For example, IMO, using 'm' as a field prefix is bad. Jan 25 05:24:59 Objectively. Jan 25 05:25:14 I don't like it either but it's in all the boiler plate code android studio made for me :P Jan 25 05:25:15 On the basis that it makes code harder to read for basically any human. Jan 25 05:25:28 comes back from the c days where ide's wouldn't help you out Jan 25 05:25:39 (Though in some cases they're used to it and the effect is different {but only temporarily :D}.) Jan 25 05:25:52 its a good thing AS code templates dont have 3-space indents Jan 25 05:26:07 I hate how XML is auto-generated. So ugly. Jan 25 05:26:16 They could really use some material templates Jan 25 05:26:24 changing everything to a new style is a lot of work Jan 25 05:26:41 Especially when some of the design decisions it makes are completely wrong now Jan 25 05:26:59 like nav drawer should be 240-340dp. NOPE, it should be 56dp short of the right now Jan 25 05:27:09 I think it's a really bad idea that IntelliJ adds something like "Created by on ." when someone creates a class. Jan 25 05:27:12 should hide the menu items, not anymore Jan 25 05:27:14 That info should be in the revision-control system. Jan 25 05:27:24 What if you don't have revision controll :P Jan 25 05:27:35 Then you should. :D Jan 25 05:27:36 Or just want to laugh at some old code and are curious when you did it :) Jan 25 05:27:39 I know... Jan 25 05:27:48 I got a private repo I have been commiting to since the start of this app Jan 25 05:27:50 The thing is that code can get littered with stuff so easily. Jan 25 05:27:52 Thanks github student pack Jan 25 05:28:18 drose379: some people will call both camel case. I don't think there are accepted names for both Jan 25 05:28:31 There's lowerCamelCase and UpperCamelCase (AKA PascalCase). Jan 25 05:28:41 Ok got it Jan 25 05:28:51 But a lot of people just say camelCase and PascalCase. Jan 25 05:29:07 There's snake_case. Jan 25 05:29:16 I think train-case? Jan 25 05:29:21 Or maybe Train-Case. Jan 25 05:29:44 I'v never seen anyone use train-case Jan 25 05:29:48 I hate Java's constant convention. Jan 25 05:29:50 would be like two variables getting subtracted Jan 25 05:30:02 I guess you could use it in CSS. Jan 25 05:30:11 they really need a better prefix than having to write "public static final ..." Jan 25 05:30:29 Lisp too. Jan 25 05:30:38 Yeah, C# has 'const'. Jan 25 05:30:46 what a crazy idea Jan 25 05:30:47 TacticalJoke: the "created on" stuff annoys me too. fwiw you can delete the #parse("File Header.java") from the "files and code templates" entries Jan 25 05:30:52 Ya. Jan 25 05:30:52 for a modern language to have Jan 25 05:31:23 C# also doesn't have type erasure. ;| Jan 25 05:31:40 And you can specify primitives as type parameters. Jan 25 05:31:54 And you can create custom value types. Jan 25 05:31:55 Okay, I'll stop. Jan 25 05:32:00 and you can (╯°□°)╯︵ #ɔ and use F# Jan 25 05:32:09 Yeah, that's neat. Jan 25 05:32:09 Don't mention php Jan 25 05:32:22 so in getView the ViewGroup is the parent element that the listView is stored in? Jan 25 05:32:33 No, it's the ListView. Jan 25 05:32:39 Smasher, where do you put the selectPosition again? I put it in my onBindViewHolder(MyAdapter.ViewHolder holder, int position) and my app crashed Jan 25 05:32:43 A ListView is a ViewGroup, believe it or not. Jan 25 05:33:01 Ok im getting a NullPointerException on my inflater.inflate line Jan 25 05:33:09 and the only thing that could be null is the parent Jan 25 05:33:11 I'm guessing you didn't define 'inflater'. Jan 25 05:33:25 protected LayoutInflater inflater; Jan 25 05:33:31 inflater = ? Jan 25 05:33:42 t0astt: the bindviewholder is what sets all the text, images, and everything once the view is shown. That is where you call setSelected on the view... Jan 25 05:33:54 you call selectPosition whenenver you want, ex: when an item is clicked Jan 25 05:34:01 TacticalJoke what did I forget Jan 25 05:34:09 inflater = LayoutInflater.from(context); Jan 25 05:34:22 ノ┬─┬ノ ︵ ( \o°o)\ Jan 25 05:34:24 BTW, use 'private', not 'protected'. Jan 25 05:34:28 Oh I cant do it the other way? Jan 25 05:34:30 And why? Jan 25 05:34:37 Using 'protected' suggests that you're creating a class intended to be subclassed. Jan 25 05:34:43 oh ok Jan 25 05:35:08 Hows this? inflater = LayoutInflater.from(getContext()); Jan 25 05:35:53 Smasher816: This method, right? http://pastebin.com/pu8Fx7d8 Jan 25 05:35:54 Who owns 'getContext'? Jan 25 05:36:01 ?? Jan 25 05:36:09 yeah Jan 25 05:36:18 Does that compile, drose379? lol Jan 25 05:36:32 Here is mine, it's like yours but you need to add the last line - http://ix.io/fXD Jan 25 05:36:43 Yeah, it works Jan 25 05:36:54 the setSelected thing. That is what will cause the xml to choose the different background Jan 25 05:37:16 Ok Jan 25 05:37:19 drose379: If you go to 'getContext' and press Cmd+Q, what does it say? Jan 25 05:37:20 TacticalJoke is getContext from a View class? Jan 25 05:37:24 Did you set v as a field variable? Jan 25 05:37:28 Lemme check Jan 25 05:37:36 yeah Jan 25 05:37:40 Ah ok :D Jan 25 05:37:43 I saved the v that was passed into the ViewHolder Jan 25 05:38:00 So that way I can select the whole row thing, not just one of the pieces of text Jan 25 05:38:02 Shit CMD+Q quits the app Jan 25 05:38:07 How the hell could I forget that Jan 25 05:38:13 Oh, sorry. It's Ctrl+Q on Windows. Jan 25 05:38:14 xD Jan 25 05:38:19 god damnit Jan 25 05:38:24 lol Jan 25 05:38:25 Sorry. Jan 25 05:38:31 Its alright Jan 25 05:38:36 It's like that old trick: "Press Ctrl+F4 for hax!!!" Jan 25 05:38:39 Alt* Jan 25 05:38:45 And like 10 people drop from the server. Jan 25 05:39:00 hahah Jan 25 05:39:07 Delete System32 to make your game run faster. It's all unneeded stuff Jan 25 05:39:10 so is there a Matierial Design way to make a ListView now? Jan 25 05:39:31 afaik RecyclerView Jan 25 05:39:51 Then you can populate that with whatever you want. Normal linearlayouts like a list view, or cardviews for something more material Jan 25 05:39:56 or "save on your electric bill with this one weird trick!" -> whatever the windows-key-to-shut-down command is Jan 25 05:40:04 Okay, I think it's Cmd+J. Jan 25 05:40:06 Or middle click. Jan 25 05:40:13 It's pretty flexible. Lets you do different view types for stuff like the header in their nav drawers Jan 25 05:40:23 Smasher816: Here is my MyAdapter.java. I added View v as a field variable first for the MyAdapter class, and then stuff stopped working. Moved it to the ViewHolder class and other stuff stopped working :P http://pastebin.com/Jf7UB33N Jan 25 05:40:43 Wait, Apple mice don't have a middle button. Jan 25 05:40:52 I don't think you set v equal to anything in your holder Jan 25 05:40:54 I have a regular mouse Jan 25 05:41:00 say "v = itemView" in the constructor Jan 25 05:41:12 So is there any certain way I should design my listviews? Jan 25 05:41:18 I suck at design Jan 25 05:41:28 Its something Id really like to get good at too Jan 25 05:42:01 Smasher816: putting v = itemView in the ViewHolder constructor can't find it now :( Jan 25 05:42:10 t0astt: ohh and I forgot, you need to do position+1 in the selectPosition, otherwise it tries selecting the header. Jan 25 05:42:12 drose379: Could you try Cmd+J? I'm really curious about what you're calling 'getContext' on. Jan 25 05:42:30 Yeah, just waiting for AS to get going Jan 25 05:43:01 Imagine if Cmd+J were the shortcut for restarting the OS or something. Jan 25 05:43:11 hahaha Jan 25 05:43:26 CMD+J just says "No tempates defined from this context" Jan 25 05:43:35 t0astt: Here you go http://pastebin.com/pqXs08V0 Jan 25 05:43:38 You'd have to place the caret on 'getContext'. Jan 25 05:43:40 Line 55 in particular Jan 25 05:43:46 I modified your program for you :) Jan 25 05:43:48 The editor caret. Jan 25 05:43:55 right it is Jan 25 05:44:09 Okay, try View > Quick Documentation. Jan 25 05:45:02 t0astt: sorry, here is the one with the fixed selectPosition - - - http://pastebin.com/QBsN3WE9 Jan 25 05:45:14 From ArrayAdapter Jan 25 05:45:57 Oh. Jan 25 05:45:58 Smasher816: The 'v' on lines 82 and 88 can't be resolved now Jan 25 05:46:16 I guess it stores the Context passed into the constructor. Jan 25 05:46:18 s Jan 25 05:46:30 t0astt: I didn't touch that, should have been broken before. lol Jan 25 05:46:40 So is there like a material layout i should be using for my listviews? Jan 25 05:46:49 I am trying to parse JSON containing a map to Map ... will this work ? http://pastebin.com/gM9DRcPS Jan 25 05:47:05 t0astt: Put "View v;" at line 80 so it is a local variable for the function Jan 25 05:47:15 It's a seperate thing from the holder since they are different classes Jan 25 05:47:32 Look at 91 and 101 in the android4devs thing Jan 25 05:47:43 View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_row,parent,false); //Inflating the layout Jan 25 05:47:47 View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.header,parent,false); //Inflating the layout Jan 25 05:48:01 You are missing that "View " in front Jan 25 05:48:56 That will fix your 82 and 88 Jan 25 05:49:47 TacticalJoke how do you design your listviews? Jan 25 05:50:13 Smasher816: Did that. App runs now, but it's only changing the color on the first item lol Jan 25 05:50:28 This isn't bad drose379 https://developer.android.com/training/material/lists-cards.html Jan 25 05:50:34 ie. only the first item (right below the header) gets changed Jan 25 05:50:39 t0astt: that is progress :P Jan 25 05:50:49 It colors the first one no matter which one you click? Jan 25 05:51:00 Nope, only colors it if I pick it Jan 25 05:51:15 Hmm Jan 25 05:51:27 Do the other items work? Like clicking them does something? Jan 25 05:51:33 Yep, clicking them works Jan 25 05:51:44 and then it changes the app title or whatever you want to do Jan 25 05:51:55 Yeah it changes the fragment in the activity Jan 25 05:52:00 cool Jan 25 05:52:09 Can I change the color of the label at the top of my app? Jan 25 05:52:11 and you call adapter.selectPosition() somewhere over there? Jan 25 05:52:27 Its the default ugly black with white writing, can I change the background collor of that? Jan 25 05:52:37 Smaher816: I do this: int itemClicked = recyclerView.getChildPosition(child); Jan 25 05:52:37 if (itemClicked == 1) { Jan 25 05:52:37 fm.beginTransaction().replace(R.id.container, HomeFragment.newInstance("Test", "HomeFragment")).commit(); Jan 25 05:52:37 } Jan 25 05:52:39 I added mine to selectItem() in NavigationDrawerFragment.java (if you are using the android studio base) Jan 25 05:52:41 oops, sorry for that Jan 25 05:52:56 Your fine Jan 25 05:53:10 That's in the main activity. I followed the original tutorial straight through Jan 25 05:53:32 I didn't look at the origianl tutorial. I figured that part out on my own, lol. So it is a little different Jan 25 05:53:38 Let me look at it real quick Jan 25 05:54:27 This? http://www.android4devs.com/2014/12/how-to-make-material-design-app.html Jan 25 05:55:10 Ohh no, you mean the next one - http://www.android4devs.com/2015/01/recycler-view-handling-onitemtouch-for.html Jan 25 05:56:36 Mind pasting that file for me? Jan 25 05:57:03 drose379: yes, there is a toolbar theme thing. Read this http://www.android4devs.com/2014/12/how-to-make-material-design-app.html Jan 25 05:57:58 Hey does anyone know a way of adding a horizontal scroll bar to a ViewPager. Not tabs, but rather a smooth scrolling bar so that the very left would be the first page of the ViewPager, and the very right would be the last page. Jan 25 05:59:06 Thanks Smasher816 Jan 25 06:00:03 np Jan 25 06:00:49 Smasher816 what you working on? Jan 25 06:01:03 3rd party pandora app Jan 25 06:01:23 Lollipop themed, real notification w/ controls (since they killed the old lockscreen playback thing), etc Jan 25 06:01:39 Sweet, something I will use :) Jan 25 06:01:56 I had an older ICS one for personal use I stopped working on since xposed did all that, but now it is gone Jan 25 06:02:15 So I already have all the java code to talk to pandora and send/receive it's JSON messages Jan 25 06:02:19 anythhing on the market? Jan 25 06:02:31 I just need the new UI and hopefully a better way to talk to the service Jan 25 06:02:39 No, I have a feeling they would kill me if I did Jan 25 06:02:49 and the old one wasn't finished enough anyways Jan 25 06:03:02 Hopefully I can get something good enough that I would be happy to publish it Jan 25 06:03:15 Would atleast put it up online since there are other programs and they haven't been sued yet :P Jan 25 06:03:18 Like pianobar, elpis, etc Jan 25 06:03:31 Maybe make XDA news or something, lol :) Jan 25 06:03:40 Sweet, goodluck Jan 25 06:03:50 Im tyrying to make a span in XML and its saying span must be declared/ Jan 25 06:04:03 no spans in android Jan 25 06:04:12 You probably want a linearlayout Jan 25 06:04:18 How come the tutorial tells me to use it? Jan 25 06:04:31 Ohh Jan 25 06:04:36 You know what, I have no idea Jan 25 06:04:46 So I cant follow that tutorial? Jan 25 06:04:58 I didn't follow the guide. I scrounged google and stack overflow and figured it out eventually. The guide seemed much more to the point Jan 25 06:05:12 Ok Jan 25 06:05:13 Just ignore the span lines, probably something from their hosting messing stuff up Jan 25 06:05:20 like they literally wanted the text on the page to be smaller Jan 25 06:05:36 hahah, ok Jan 25 06:05:45 I already had a colors.xml, so you can add it in there Jan 25 06:05:58 maybe I did create it, can't remember Jan 25 06:06:18 But yeah, the resource files just start with hte xml declaration line Jan 25 06:07:00 I got the main content view, and the navigation drawer done. Just took me two days :P Jan 25 06:07:23 Does anyone know how to do one of the slide up things from the bottom of an app, like in Play Music (I'm also doing a music app) Jan 25 06:07:30 Smasher816: Sorry, was in a different room. I'll push this to github and show you my repo Jan 25 06:07:42 That works too Jan 25 06:09:45 Smasher816: Can I PM you? Jan 25 06:09:49 go for it Jan 25 06:10:03 PM'd Jan 25 06:10:25 MainActivity.java is where I get the selected item and instantiate a new fragment Jan 25 06:10:30 Got it Jan 25 06:10:37 MyAdapter.java is the drawer stuff Jan 25 06:11:09 where do you call the adapter.selectPosition? Jan 25 06:11:34 github's search says you don't call it... Jan 25 06:11:41 Line 106 of MainActivity, I don't call adapter.selectPosition Jan 25 06:11:47 I get the position from the click Jan 25 06:11:58 and then do an action on that Jan 25 06:12:00 githubs search is pretty bad imo Jan 25 06:12:06 cavity: true.. Jan 25 06:12:15 t0astt: line 106 just gets the index Jan 25 06:12:20 It doesn't tell the adapter to do anything Jan 25 06:12:40 I don't think I call that then... oops Jan 25 06:12:54 So add a call right below like 106 :) Jan 25 06:13:09 speaking of github, can you guys possibly link me to a good source of open source android apps? Jan 25 06:13:13 thanks Jan 25 06:13:23 mAdapter.selectPosition(itemClicked) Jan 25 06:13:34 cavity: i don't know of any. Sorry Jan 25 06:13:51 I do sometimes look at stuff built into android like settings, or some of Cyanogenmod's stuff like Eleven Jan 25 06:13:57 since I know all that is always open source and easy to find Jan 25 06:14:04 I don't know about random small debs Jan 25 06:14:07 devs* Jan 25 06:14:53 Smasher816: I do mAdapter = new MyAdapter(blah blah); then mAdapter.selectPosition() later on, but it can't resolve the method Jan 25 06:15:12 I mean, there has to be more open source android apps out there than the 12 on wikipedia, right? Jan 25 06:15:27 Change 46 to be MyAdapter type instead of RecyclerView.Adapter Jan 25 06:15:39 JakeWharton: Do you happen to know whether the Android Gradle plugin supports incremental building (I guess I'm asking about both Java compiling and dexing). Jan 25 06:15:45 s/./?/ Jan 25 06:15:45 Everything else should still work since its an instance of the adapter. It will keep all the old functions Jan 25 06:15:51 yes Jan 25 06:15:55 Alright, here goes! Jan 25 06:16:17 I noticed tonight that all of my .class files are updated when I compile, even if I change only one. Are they simply being touched? Jan 25 06:16:45 Haha Smasher816: it works! I just need to remove the +1 now, since it colors the next item :D Jan 25 06:16:48 Thanks for the help! Jan 25 06:16:53 big thanks Jan 25 06:17:42 No problem Jan 25 06:17:52 I needed the plus 1 for my header, ohh well Jan 25 06:17:54 You get the idea :) Jan 25 06:18:26 I know why, because the thing you are calling it with starts at 1 for the first fragment. Not 0 like my click code... Jan 25 06:18:36 I am handling the clicks in a different way Jan 25 06:18:53 Yep Jan 25 06:19:04 How long have you been doing Android dev? Jan 25 06:19:23 Ummm. Made my first app back when ics was new Jan 25 06:19:28 Then didn't do anything for a few years Jan 25 06:19:47 Made the pandora app thing a little over a year ago, and worked with that for a few months. Then stopped Jan 25 06:19:58 Ah ok. I'm just starting. I've been wanting to do it for quite some time and now my school is having a mobile app development contest Jan 25 06:19:58 and now I am working on a new version of that pandora app w/ material design Jan 25 06:20:22 I have to say, there is tons of googling to do seemingly simple things Jan 25 06:20:24 t0astt what you making for the contest? Jan 25 06:20:26 It's pretty annoying Jan 25 06:20:55 Smasher816: Agreed... :P Jan 25 06:21:10 It takes a while to figure out how all the little pieces they make for you fit together Jan 25 06:21:17 drose379: will you be offended if I keep it a secret for now? just because I haven't found anything like it on the play store yet Jan 25 06:21:18 so that way you can modify it and add in your own stuff Jan 25 06:21:34 Nice, I'm terrible at coming up with ideas Jan 25 06:21:48 no prob t0astt Jan 25 06:21:52 Original things are hard to come by Jan 25 06:22:05 drose379: sorry about that. If you're still on here in a month or two when I'm done I'll show you it though! Jan 25 06:22:20 Sounds good, good luck Jan 25 06:22:54 Smasher816: Yeah. I thought of this one day, checked for something like it on the play store, and no hits. So I really want to get this done because I think it'll be pretty cool Jan 25 06:25:40 Google makes me feel so not unique. Almost everything I type into Google is auto-suggested at times. Jan 25 06:25:59 Not from my history, either. Jan 25 06:26:02 Tactical (auto-suggest TacticalJoke) Jan 25 06:26:04 Except for some fun cryptic erros Jan 25 06:26:05 lol Jan 25 06:26:15 That's true, Smasher816. lol Jan 25 06:28:08 TacticalJoke are you using Matieral design in your project? Jan 25 06:28:21 I will be very soon. Jan 25 06:28:30 I've put almost no thought into the UI so far. Jan 25 06:28:40 ahh ok Jan 25 06:28:55 I'm probably gonna switch to Toolbar (and maybe RecyclerView). Jan 25 06:29:06 Yeah im messing with Toolbar right now Jan 25 06:29:18 Toolbar is cool since its part of the whole view thing now Jan 25 06:29:29 Which allows for stuff like the drawer to be drawn over it Jan 25 06:29:37 It's no longer this thing above anything you can touch Jan 25 06:30:12 I wonder whether it entails more lag (because it's another View). Then again, the ActionBar was essentially that (just with different semantics). Jan 25 06:30:44 t0astt: To change my nav drawer's listview to a material recyclerview w/ clicks and all that was "21 files changed, 270 insertions, 60 deletions" Jan 25 06:31:24 So if I use ToolBar my activities should not extend AcitonBarActivity anymore? Jan 25 06:31:27 Just Activity Jan 25 06:31:41 Do ActionbarActivity Jan 25 06:31:49 Ok why Jan 25 06:31:52 you need it for setSupportActionBar() Jan 25 06:31:59 oh ok Jan 25 06:32:06 I'm pretty sure it errored saying it didn't exist in the stock activity Jan 25 06:32:29 * Smasher816 is by no means an expert, but I happen to be using it like that right now fwiw Jan 25 06:32:38 On the blog post it says "All of your Activities must extend from ActionBarActivity". Jan 25 06:32:45 http://android-developers.blogspot.co.uk/2014/10/appcompat-v21-material-design-for-pre.html Jan 25 06:32:48 well there you go Jan 25 06:33:14 I remember when I did that I had some other issue I needed to cast to fix or something Jan 25 06:33:17 It's been a while Jan 25 06:35:27 So in this Tutorial it looks like they set their ToolBar background to a color and then the devices notification bar to another color, can i do that? Jan 25 06:35:36 yup Jan 25 06:35:48 It's common in new material apps Jan 25 06:36:05 You can even color the onscreen button bar at the bottom, but reddit sync is the only app I know of that does it Jan 25 06:36:06 Where would I do that? I may have missed it in the tutorial but I dont know Jan 25 06:36:19 (The notification bar) Jan 25 06:36:44 @color/ColorPrimaryDark Jan 25 06:36:52 I don't think it's in the guide but google will find it quickly Jan 25 06:37:20 The next step of the guide with the drawer actually has you set it transparent, and to color it another way so that the drawer can go behind the status bar like the gmail and playstore apps Jan 25 06:38:01 Sweet thank you Jan 25 06:38:16 bottom bar is android:navigationBarColor Jan 25 06:38:21 It's cool that Gradle makes it so easy to use v7 now. Jan 25 06:38:24 It was so horrible in Eclipse. Jan 25 06:38:36 haven't tried eclipse, but I do love how easy it is to add libraries Jan 25 06:38:47 just add the name to the build.gradle and it finds and does it all for you Jan 25 06:39:02 In Eclipse, you had to import it as a project, basically. Then you had to have the project sticking around in your workspace the whole time. Jan 25 06:39:08 drose379: Can look something like this http://www.androidpolice.com/wp-content/uploads/2014/11/nexus2cee_Screenshot_2014-11-18-14-46-43-351x625.png Jan 25 06:39:09 And Eclise's concept of a workspace is insane. Jan 25 06:39:17 Eclipse's* Jan 25 06:39:33 Do you know if you can add your own local dependency? Jan 25 06:39:46 My pandora API is plain java and could be used on desktop, phone, etc. Jan 25 06:39:56 So I would prefer to keep it a seperate "library" that the app just uses Jan 25 06:40:17 instead of having to copy over the files and try figuring out version controll that way Jan 25 06:44:26 So if I have a style in my Style.xml page, do I have to apply that to the activity Jan 25 06:44:35 Sorry, I cant help you with your question above :( Jan 25 06:45:04 The default android studio thing will automatically use the "AppTheme" in your style.xml Jan 25 06:45:18 you can check in the manifest for android:theme="@theme/AppTheme" Jan 25 06:45:36 Right, it does that, but do i need to apply that theme to my activity_main.xml? Jan 25 06:45:54 nope, it's application wide. For all activities Jan 25 06:46:09 I think you can override it in an activity if you want to, but I haven't found a reason to Jan 25 06:46:28 How can i test if it works? Jan 25 06:46:46 Cause i tried the statusBarColor and it didnt work Jan 25 06:47:16 What is your targetApi version? Jan 25 06:48:04 My min is 9 Jan 25 06:48:15 I guess it wont work, only works on 5.0+ Jan 25 06:48:23 Your minSdkVersion is 9? Jan 25 06:48:26 you can have two seperate folders Jan 25 06:48:29 ya Jan 25 06:48:31 one "values" for general stuff Jan 25 06:48:41 and a "values-21" for api 21 specific stuff (lollipop) Jan 25 06:48:48 drose379: Why not 15? Jan 25 06:48:52 (Or 16.) Jan 25 06:48:59 set build and target versions to the highest = 21 Jan 25 06:49:04 and set min to something sane like 15 Jan 25 06:49:05 Dont know, my phone is 4.2.2 so what is that? Jan 25 06:49:10 No one wants pre ics... Jan 25 06:49:30 I think that's 17. Jan 25 06:49:42 Setting it to 9 will only make your life harder with no real benefit. Jan 25 06:49:49 http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels Jan 25 06:49:56 Ok, dont know why I did that Jan 25 06:50:01 I think 15 is an absolute minimum for new apps (unless there's a really good reason to go lower). Jan 25 06:50:17 Some say 16. Jan 25 06:50:25 9 is the first version of gingerbread. ouch Jan 25 06:50:33 No holo or anything. Completely different UI back then Jan 25 06:50:57 When android studio asks you to make your app it says that by targeting ics you get 86% market share or something Jan 25 06:51:13 also keep in mind your audience, geeky people who use reddit/irc/whatever are more likely to be on a new version Jan 25 06:51:17 Do you think there is a ICS update for my galaxy s4 mini Jan 25 06:51:20 Yeah, here are the stats: https://developer.android.com/about/dashboards/index.html Jan 25 06:51:33 than your grandma who has never bothered to update, but would also never find your app Jan 25 06:51:48 4.2.2 is Jellybean. It's after ICS...... Jan 25 06:52:02 So ics isn't much of an update for you :P Jan 25 06:52:11 Look at that table, newest is at top, oldest at bottm :) Jan 25 06:52:30 I'm thinking of switching from 15 to 16 mainly so that I can use parentActivityName. I'm so lazy. Jan 25 06:52:39 so how come the setting notification bar color didnt work for my phone Jan 25 06:52:46 Does it work pre-5.0? Jan 25 06:52:50 It's not in that version of android :) Jan 25 06:52:57 Try on the 5.0 emulator. Jan 25 06:52:59 It's a new lollipop thing. Sorry :( Jan 25 06:53:06 But you can still get most of the other looks Jan 25 06:53:16 Like the new toolbar and the vivid colors and stuff Jan 25 06:53:34 Right Jan 25 06:54:08 It carries back as much as it can, but some stuff just isn't possible with the old system Jan 25 06:58:48 Still trying to think up a better name for my app. Jan 25 06:58:54 Something relating to being up to date. Jan 25 06:59:08 Relating to the word 'latest' or something. Jan 25 06:59:34 Speaking of that, need to check the new nightly on my phone. Jan 25 06:59:37 * Smasher816 used to be a crack flasher Jan 25 06:59:49 smoking is better Jan 25 07:06:08 This is so nice https://github.com/umano/AndroidSlidingUpPanel Jan 25 07:11:38 cool Smasher816 nice find Jan 25 07:12:15 Was easy to google. Just said android pull up layout, or something like that Jan 25 07:12:29 instantly works like google play, will show the top of your view, and when you pull it show the rest Jan 25 07:12:32 Just what I wanted Jan 25 07:12:32 that android arsenal site has so much crap now, its useless Jan 25 07:13:40 top of the morning to you! Jan 25 07:13:50 good morning thepoosh Jan 25 07:14:07 i hope you aren't sprinting :) Jan 25 07:16:23 still sprinting Jan 25 07:16:27 need to make a tooltip Jan 25 07:29:04 thepoosh you're going to open source it right ? :)D Jan 25 07:31:46 g00s_: I might be using a library Jan 25 07:31:52 found one that might be goof Jan 25 07:31:53 good Jan 25 07:32:01 https://github.com/rharter/android-tooltips Jan 25 08:10:01 Goodnight everyone. Take care Jan 25 08:15:54 What causes exclipse to sometimes run so slow its like almost silly to try use it ? Jan 25 08:17:40 Unknown0BC: eclipse is a resource guzzler Jan 25 08:17:45 a known one Jan 25 08:17:56 * Unknown0BC blinks Jan 25 08:18:41 Yeah but on this project and its nothing big its suddenly slower than usual. I have not checked if it has decided to do that with all projects now. Jan 25 08:20:39 close other resource hogs, ie browsers etc...and upgrade or renew your pc Jan 25 08:20:57 lol Jan 25 09:32:40 Anyone happen to know how ai floating split keyboard manages to float its keyboard view? Jan 25 10:12:12 Google Goggles is using openCV for their OCR, aren't they Jan 25 10:12:29 yesterday I was surprised when I took a picture of something that had a lot of text in it, the text was extracted instantly Jan 25 10:14:21 people on #opencv would probably know for sure Jan 25 10:16:16 um Jan 25 10:16:21 OpenCV has no OCR capability Jan 25 10:16:52 yea it does Jan 25 10:16:59 * regan reaches for the Orielly ‘Learning OpenCV’ book Jan 25 10:17:05 well, JakeWarthon said it did when I asked here for good OCR lib Jan 25 10:17:19 it's damn instantaneous Jan 25 10:17:40 I tried another lib, AABBY for OCR, it had me wait to upload the image to their servers, do the processing and send me back the results Jan 25 10:17:45 like 2 minute process Jan 25 10:17:54 Odaym, Google has their own OCR lib with opensource Jan 25 10:18:01 Odaym, the same OpenCV has bindings for Jan 25 10:18:07 OpenCV itself has no OCR libraries. Jan 25 10:18:55 so we're talking 2 months of work Jan 25 10:19:00 lol, yea, fuck that feature Jan 25 10:20:12 yeah, you're gonna have to train your own recogniser Jan 25 10:20:22 noone is going to give you commercial grade training files for free :P Jan 25 10:20:32 there are training files? Jan 25 10:21:07 *reverberating from way off in the distance* M A C H I N E L E A R N I N G Jan 25 10:21:19 nah my purposes are way too humble to get into that Jan 25 11:08:54 Does anyone here use Realm.io? Jan 25 11:28:23 any of you using IntelliJ CE and getting "Out of java heap" errors with the latest update? Haven't a clue how to address it. Jan 25 11:32:41 rgr: try increasing your java heap size Jan 25 11:41:46 i want make android app? then how can i do? Jan 25 11:44:43 AirStar: http://developer.android.com/training/index.html Jan 25 11:44:51 Start reading :) Jan 25 11:44:57 thanks SimonVT Jan 25 11:45:16 SimonVT: Jan 25 11:45:22 i will make game app Jan 25 11:45:26 then how can i do? Jan 25 11:46:39 If you're completely new to Android, you should still go through the training docs Jan 25 11:46:56 Then you can decide if you want to write your game in java, using the ndk, or use some third party product Jan 25 11:47:02 /library Jan 25 11:50:19 for some reason these questions make me think that it's going to be too difficult for you at this time Jan 25 11:50:42 but if you persevere for a few years, there's a chance ;) Jan 25 11:56:46 thanks for help Zharf and SimonVT Jan 25 11:59:38 android studion vs eclipse ? which is better? Jan 25 11:59:53 AirStar: they're different Jan 25 12:00:00 most google code is going towards AS Jan 25 12:00:09 and most samples are being written for AS Jan 25 12:00:17 AS? what is AS? Jan 25 12:00:20 google endorses AS Jan 25 12:00:27 AndroidStudio Jan 25 12:00:34 oh Jan 25 12:00:45 then i must use AS instead of eclipse? Jan 25 12:00:51 not must Jan 25 12:00:58 better? Jan 25 12:01:01 but if you're starting now, you should start with AS Jan 25 12:01:04 probably Jan 25 12:01:07 i use eclipse Jan 25 12:01:11 me too Jan 25 12:01:13 but never used AS Jan 25 12:01:20 try it out Jan 25 12:01:20 me too Jan 25 12:01:24 and see for yourself Jan 25 12:01:42 i restart android app after 2 years. Jan 25 12:01:54 thanks Jan 25 12:18:31 eclipse vs AS, which is better? Jan 25 12:19:05 intellij idea Jan 25 12:19:21 there is no problem if i use eclipse? Jan 25 12:19:33 no clue Jan 25 12:19:46 it's a matter of preference Jan 25 12:20:07 oh i use eclipse 3 years before. Jan 25 12:20:29 but it is written to use AS in site. Jan 25 12:33:52 AirStar: try both Jan 25 12:34:02 I use eclipse, but that's just because I can use vim as editor Jan 25 12:34:18 thanks Darkwater Jan 25 13:02:37 hey, i have one edittext in my layout that i get its content and post it. how can i show stuff like apostrophe s? Jan 25 13:08:17 You post it where? Jan 25 13:08:41 Hello. Is there a way to add this to a layout through xml? https://code.google.com/p/range-seek-bar/ Jan 25 13:09:10 skulltower: to show it in a textview Jan 25 13:09:42 for example, "it's for test" becomes "it&#039;s for test" Jan 25 13:10:33 omid8bimo, quick way would probably be: setText(Html.fromHtml(String)); Jan 25 13:14:29 Android Studio was unable to find a valid JVM. how can i do? Jan 25 13:16:23 javac 1.8.0_05 Jan 25 13:19:07 AirStar: android runs on Java 1.7 if I remember correctly Jan 25 13:19:16 1.7? Jan 25 13:19:20 i have 1.8 Jan 25 13:19:25 how can i do? Jan 25 13:20:37 hmmm Jan 25 13:20:42 i think i'm wrong Jan 25 13:20:43 skulltower: even if its not intended for html use, will this work ? Jan 25 13:20:47 http://tools.android.com/tech-docs/configuration/osx-jdk Jan 25 13:21:20 You can build android apps with jdk8 just fine, you just can't use jdk8 language features in your app Jan 25 13:22:32 i don’t know Jan 25 13:22:36 thanks any way Jan 25 13:22:54 Hej everyone, could someone tell me a good way to handle many countdown timers ? :) Jan 25 13:25:37 Open the application package for Android Studio in finder, and edit the Info.plist file. Change the key JVMversion. Put 1.6+ instead of 1.6*. That worked for me!. Jan 25 13:25:40 i find it Jan 25 13:25:53 http://stackoverflow.com/questions/27369269/android-studio-was-unable-to-find-a-valid-jvm-related-to-mac-os Jan 25 13:40:19 Is starting a handler for every timer a good way yo deal with mutliple countdowns ? Jan 25 13:42:46 wat?! Jan 25 13:42:55 Hyrixo: what are you trying to do? Jan 25 13:49:16 thepoosh: i want to make mutiple countdown timers who countdown at the same time and update on the sceen Jan 25 13:49:40 so why Handler? they already have hooks to the UI Jan 25 13:49:47 the onTick is on the UI Jan 25 13:49:52 if I remember correctly Jan 25 13:50:41 So with the onTick i could say for instance count 1 sec and update them all Jan 25 13:57:46 Thepoosh , they also have to run in the background if the acitivity is paused or the app is closed Jan 25 14:23:58 hi Jan 25 14:24:16 i am having a lot of code written for an older RenderScript version, I don't exactly know which one it is Jan 25 14:24:34 Classes like RenderScriptGL and GLSurfaceView are used here, but they don't exist at the latest releases Jan 25 14:24:48 in android studio, is it possible to use an "older" renderscript version just to get this code run again? Jan 25 14:25:12 renderscriptTargetApi 19 renderscriptSupportModeEnabled true Jan 25 14:25:13 Right now, i use Jan 25 14:25:19 the above here :) Jan 25 14:36:58 Hello, i'm trying to make a alarmclock that mutiple timers. What i wonder is how do i best handle this if i wan them to presist trough app killed but yet make a notification when time ended Jan 25 14:37:14 you set an alarm Jan 25 14:37:44 as in the AlarmClock class ? Jan 25 14:37:47 https://developer.android.com/training/scheduling/alarms.html Jan 25 14:41:54 osxorgate, would this also be decent to also update sort of textviews with the time left ? Jan 25 14:42:11 no i dont think so Jan 25 14:42:23 i'd use an animation for that maybe Jan 25 14:42:31 where on each tick of the anim, update the view Jan 25 14:42:40 hmm need that aswell, gonna have to keep looking thanks anyway Jan 25 14:42:55 aha can look Jan 25 14:43:19 might have a look at .post(Runnable) but i think it might not be the right thing Jan 25 14:48:37 hello developers Jan 25 14:48:49 hows doing Jan 25 14:49:02 koi india se hai Jan 25 14:49:05 bhai Jan 25 14:49:55 osxorgate, would a service do the trick with a countdown timer and broadcasting to the acitivty ? Jan 25 14:50:32 Hyrixo: i think it would not be the right way to do it. you only want to process things when the app is visible Jan 25 14:50:39 so might as well do it in the foreground Jan 25 14:51:07 osxorgate, well i do want the timers to keep running background even tho the app is closed Jan 25 14:51:20 and warn when it's over Jan 25 14:51:34 i would think something like, if the app is in foreground, kill alarms and keep track of time and gfx, if app goes to background set an alarm Jan 25 14:52:20 I am working on this simple app Jan 25 14:52:27 but stuck Jan 25 14:52:31 need help Jan 25 14:53:46 oh, AS is not bad. Jan 25 14:54:16 AS is better than eclipse in aspect something. Jan 25 14:55:41 i.e. in IDE listing alphabetically - as comes before eclipse Jan 25 15:04:39 Hi, I'm looking at a fairly large amount of model code that implements Parcelable. My big concern is that to parcel- and unparcel- the object, the code is reliant on the the fields being written and read in the same order. Which has me worried about long-term maintainability, issues with merging changes to source control, etc. Jan 25 15:05:20 Any pro-tips for adding some additional reliability to parcelable implementations, to guard against developer error? Jan 25 15:16:10 hi guys, I have this activity that I've declared to have meta-data name "android.app.default_searchable" and value "SearchResults_Activity". SearchResults_Activity in turn has intent filter action SEARCH and meta-data resource searchable Jan 25 15:17:03 as a result, placing this http://pastie.org/9859323 inside the first activity MyListOfData will cause the search button in the action bar to open up a textfield where I can search for things inside that activity and send the results of that search to the SearchResultsActivity Jan 25 15:17:52 I do not start SearchResultsActivity anywhere (with startActivity). When "Go" on the keyboard is pressed, the SearchResultsActivity is opened automatically Jan 25 15:18:18 I want to search according to an ID that I have in MylistOfData Activity and I find no way to send that ID over to the SearchResultsActivity Jan 25 15:19:32 because I'm inside an activity that displays many results based on a given ID of an object in the previous activity Jan 25 15:19:51 so whatever I want to search for, it's still going to be from the dataset belonging to that ID, not just arbitrary search everything Jan 25 15:20:10 pm2 - I don't quite see the problem. Parceled objects shouldn't live long, and their implementations should, of course, be kept updated. How's that a problem with long-term maintainability? Jan 25 15:23:05 flan3002, forgetting to update your parcelable method as class changes Jan 25 15:23:45 Mavrik - Keep them close together. Otherwise... generate them and have tests for them. Anyways... I'm away now. Jan 25 15:24:08 last I check there was no good way of testing parcelable Jan 25 15:24:15 JUnit has only stubs there Jan 25 15:24:24 pm2, good unit tests Jan 25 15:24:33 pfn: yeah, that's about the best I can come up with Jan 25 15:24:38 Mavrik, robolectric or instrumented tests Jan 25 15:24:45 flan3002: "Parceled objects shouldn't live long"? Jan 25 15:24:47 robolectric supports that now? Jan 25 15:24:53 few months ago it didn't :/ Jan 25 15:25:02 Mavrik, it didn't? Jan 25 15:25:30 * pfn doesn't use robolectric Jan 25 15:25:30 I think this is my asnwer http://enjoysmile.com/blog/28/passing-extra-variables-to-search-activity-invoked-by-a-search-widget/ Jan 25 15:25:41 nop, IIRC the parcel stuff was shimmed out in a way it just ended up not outputting anytihng Jan 25 15:25:47 we had huge problems with that Jan 25 15:25:55 that's lame... Jan 25 15:26:02 but I haven't been using it for the last few versions, so maybe they fixed it Jan 25 15:35:47 do you guy use android studio VCS feature with git ? Jan 25 15:37:11 i use all command line Jan 25 15:37:21 I have a project I'm working on, I created a git repository (git init) on a dedicated server, I added on my laptop the remote branch and pushed everything. But when a clone from studio (import project with VCS), cloning is working, files are downloaded on the file system, but no project on android studio (like if no project were found, but only files) Jan 25 15:37:26 what did I do wrong ? Jan 25 15:37:39 siegs: maybe I should have done that :) Jan 25 15:37:47 i trust way too much IDE :) Jan 25 15:38:33 blusky: I had issues with VCS before and decided to make the switch Jan 25 15:50:54 hey all X) Jan 25 15:51:19 o/ Jan 25 15:52:17 can you apply background colours to PreferenceScreen/PreferenceCategory in XML? Jan 25 15:52:56 no idea Jan 25 15:53:11 X) Jan 25 15:57:21 If im using a setOnItemClickListener on a listview, do I have to use an innerclass? Jan 25 15:57:28 Or can i create my own class to deal with clicks Jan 25 15:57:44 any class will do Jan 25 15:57:59 that mplements OnItemClickListener Jan 25 15:58:31 Ok, and I dont .setOnItemClickListener in my adapter right? Jan 25 15:58:42 in listView Jan 25 15:59:02 Do i do lv.setOnItemClickListener after .setAdapter()? Jan 25 16:00:14 i think it doesnt matter Jan 25 16:00:36 lacx: wouldnt android:background="xxx" suffice in preferenceScreen? Jan 25 16:02:10 doesnt offer it as a context option in Android Studio, but it does in the preferences temselves Ashiren Jan 25 16:02:57 eclipse doesnt suggest much for preferences as well Jan 25 16:03:20 ie. edittextpreference can take inputType as normal edittext would. but eclipse doesnt suggest it :c Jan 25 16:08:14 I dont even... Im following some yt videos and nothing is the same as on the video Jan 25 16:08:18 using android studio... Jan 25 16:08:25 hmm yea it doesnt break if i use background in the PreferenceScreen, but it ignores the color too Jan 25 16:08:37 same with the individual prefs themselves Jan 25 17:22:41 JakeWharton: !!! Jan 25 17:37:53 someone sure us excited Jan 25 17:38:41 yes!!! Jan 25 17:38:45 i mean Jan 25 17:38:46 yes Jan 25 17:51:14 Hey, Im trying to set up an appbar but now im getting this: http://i.imgur.com/Ivbwzr7.png Jan 25 17:51:20 I was following some slidenerd guide... Jan 25 17:52:42 You're putting it inside a ViewGroup that has padding. Jan 25 17:54:21 pm2 - Yes, that's my expectation at least. For anything else... one should probably use something more stable or more fancy. Like... writing to persistent storage as JSON/XML/$fancy_format, or inserting into an SQLite database. However... that's still just my opinion. How long do you intend your Parcels to live? Jan 25 17:54:39 TacticalJoke, oh, thanks Jan 25 17:54:46 Moter8: I haven't used Toolbar yet, but I guess you'll have to remove padding from that parent RelativeLayout and put the TextView into its own RelativeLayout/whatever that has padding. Jan 25 17:54:47 pm2 - From the documentation: "Parcel is not a general-purpose serialization mechanism. This class (and the corresponding Parcelable API for placing arbitrary objects into a Parcel) is designed as a high-performance IPC transport. As such, it is not appropriate to place any Parcel data in to persistent storage: changes in the underlying implementation of any of the data in the Parcel can render older Jan 25 17:54:49 data unreadable." Jan 25 17:54:58 Or, I guess, you could just give the TextView padding. Jan 25 18:10:44 Hello. Jan 25 18:10:57 good evening Jan 25 18:11:32 I have successfully followed this: https://developers.facebook.com/docs/android/login-with-facebook/v2.2 to add a facebook login button to my app. My question is this: where is the function that gets called once the login is successful? Jan 25 18:13:51 OK I found it. Jan 25 18:15:08 Hi, how do i delete the title bar at the top that contains the name of the app and an icon or change it's color in Android Studio ? Jan 25 18:19:13 Nightwalkerkg, what are you talking about exactly? O.o Jan 25 18:21:29 I get this weird message in LogCat: "I/ufoGralloc﹕ Hello, this is UFO GRALLOC/Intel Corporation" Jan 25 18:21:30 Hi, I guess. Jan 25 18:23:37 does anyone know the default elevation of the toolbar in the ActionBarActivity? Jan 25 18:26:40 TacticalJoke: i read FU Gralloc Jan 25 18:26:43 was thinking Jan 25 18:26:46 this is weird Jan 25 18:27:19 :D Jan 25 18:27:26 Omg, I came up with the best name for my app. Jan 25 18:27:42 I can't really say in case it gets copied before release (unlikely, but I don't want to take any risk). Jan 25 18:28:02 my contract forbids me of working on anything else Jan 25 18:28:06 But it's perfect: relevant, memorable, emotive. It's everything. Jan 25 18:28:06 pm me the name! Jan 25 18:34:37 Hi, i'm sorry about this question but i'm new in android dev, is the R.id object linked to a context, i"m asking this question because i have two buttons with the same id in two activities and everything seems to work fine Jan 25 18:37:07 soulisson: "An ID need not be unique throughout the entire tree, but it should be unique within the part of the tree you are searching (which may often be the entire tree, so it's best to be completely unique when possible)." Jan 25 18:37:10 http://developer.android.com/guide/topics/ui/declaring-layout.html#id Jan 25 18:37:20 In other words, you can use the same ID in multiple layouts, but it may or may not be a good idea. Jan 25 18:40:08 TacticalJoke: ok, so best to have a unique id for each widget :) Jan 25 18:40:30 TacticalJoke: thank you Jan 25 18:41:07 Oops, I misread the end of that article (skim-read). It's not talking about multiple layouts at all. Jan 25 18:41:52 So, yeah, as long as it's unique in the context of a lookup you're good to go. :) Jan 25 18:42:04 I wonder whether it's good or bad practice to use the same ID in multiple layout files. Jan 25 18:42:30 it's probably good practice to name them accordingly to their use Jan 25 18:50:14 Anyone know of a way to track HTTP get/post calls in Android? Jan 25 18:50:34 generally if you have seperate layouts for portrait and landscape, you want the 'ok' button to have the same id in both layouts. Simplifies the coding Jan 25 18:51:32 t0astt: In what situation? Jan 25 18:51:55 soulisson: R.id is not really an object. It's an array of integers created at compile time to keep track of ids of view-widgets Jan 25 18:58:17 could someone give me some pointers on how to implement this layout? http://novaember.com/s/420159885.png Jan 25 18:58:34 I currently have a custom drawable but I'm having some real issues with interactivity Jan 25 18:58:51 the user needs to be able to press the events to go to another screen Jan 25 19:00:52 TacticalJoke, nevermind actually. I thought it was a problem with my HTTP calls going to an incorrect route, but it's how my variables are being set by the response actually. I have a field variable, "String myFName" that gets set in my onCreate method of my MainActivity by an HTTP call. However, the field variable isn't being set which is why it's returning null. Jan 25 19:01:07 I'm guessing I need to mess with linearlayouts but maybe there's a better way? Jan 25 19:02:32 Darkwater: calendar would be a prime candidate for a complex custom view Jan 25 19:03:00 complex being, better think this shit through Jan 25 19:03:17 dealing with date&time is horrible, imho Jan 25 19:03:23 what do you mean? Jan 25 19:03:42 and yeah time is annoying to work with as programmer Jan 25 19:04:26 especially as java one Jan 25 19:04:38 at least jodatime eases the pain Jan 25 19:04:55 but yeah I don't know of a better way to visualize this Jan 25 19:05:11 it's a week schedule for a school Jan 25 19:05:15 for a class Jan 25 19:07:33 t0astt: You can usually use Log.i or whatever to see what's going on under the hood. Jan 25 19:07:58 Darkwater maybe start off just grabbing the CalendarView from aosp ? Jan 25 19:08:10 hm, I'll take a look Jan 25 19:08:46 g00s: I came up with an awesome name for my app (inspired by your suggestion). I don't wanna post it just in case, but just wanted to say. :D Jan 25 19:08:57 It's way less lame than my last idea. Jan 25 19:09:25 :D Jan 25 19:09:39 TacticalJoke: Yep, just did that. Turns out my async HTTP call is happening after I'm needing to use stuff. I'm thinking I should put the parts where I need that inside my onSuccess method callback of the async call :P Jan 25 19:09:47 hope it is sticky TacticalJoke :D Jan 25 19:13:51 TacticalJoke: the name is something like you'd get from http://www.wordlab.com/gen/drug-o-matic.php isn't it? Jan 25 19:14:10 haha Jan 25 19:14:31 http://quaap.com/D/drug-names is kinda fun too :) Jan 25 19:15:28 That drug-name generator is really convincing. Jan 25 19:16:29 I'd call it RedEyez Jan 25 19:16:45 Not bad. :) Jan 25 19:17:30 god damn why is python2 vs 3 a thing and why do tools like repo just use 'python' instead of specifically targeting 'python2' Jan 25 19:17:42 Everything is a thing with humans. Jan 25 19:17:52 baconreader was one you disliked, right? would you accept BaconBaconReader? http://www.baconbaconsf.com/ Jan 25 19:18:33 That name seems to violate DRY. Jan 25 19:18:49 xD Jan 25 19:19:15 'Offifical Kingdom of Narwhal Reader' Jan 25 19:19:28 I wonder whether reddit would care if I reserved the /r/name thing even though I won't release for months. Jan 25 19:19:29 just joking :D Jan 25 19:20:02 I suppose you could go for NarwhalBaconsReader Jan 25 19:21:42 crazy http://knowyourmeme.com/memes/the-narwhal-bacons-at-midnight Jan 25 19:22:00 TacticalJoke you could add a feature to your app that was like those dating apps Jan 25 19:22:22 if you are around a someone who subscribes to the same channels, and you are in the same location Jan 25 19:22:23 knowyourmeme is one of my favorite sites ever Jan 25 19:22:31 God, redditors are so weird. Jan 25 19:22:33 Which feature? Jan 25 19:22:38 Oh, just read. Jan 25 19:22:52 is that what tinder does ? Jan 25 19:22:57 Damn, that sounds creepy. haha Jan 25 19:23:28 I have an async HTTP call happening on line 70 and I need the results of it (the variables being set) at line 99. For some reason the HTTP call doesn't actually happen until the very end of my onCreate, however (2. Post-async declarations, 1. Variables set). Am I doing something fundamentally incorrect here? Or is it the Async library I'm using? Jan 25 19:23:35 01-25 13:20:57.280 22592-22592/com.mikerinehart.navdrawertest2 I/MainActivity﹕ 2. Post-async declarations Jan 25 19:23:35 01-25 13:20:57.350 22592-22592/com.mikerinehart.navdrawertest2 W/Settings﹕ Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. Jan 25 19:23:35 01-25 13:20:57.461 22592-22592/com.mikerinehart.navdrawertest2 I/MainActivity﹕ 1. Variables set Jan 25 19:23:37 carp Jan 25 19:23:38 crap* Jan 25 19:23:42 obviosly, to not be creepy, people have to want that enabled Jan 25 19:23:42 http://pastebin.com/7qt25k2N Jan 25 19:23:44 that link Jan 25 19:23:53 (very sorry for that spam) Jan 25 19:23:55 it does sound like those things you see when you turn off adblock, yeah. "sext for free with HotLocalSignle12" Jan 25 19:24:36 toastcfh: that's not spam, it's flood ;) Jan 25 19:24:45 same horrible-ness :'( Jan 25 19:24:51 Ya. It could be cool if consensual. Jan 25 19:25:16 t0astt: that's because it's asynchronous. that's how it's supposed to work. Jan 25 19:25:30 oops I meant t0astt Jan 25 19:25:54 Yeah, you might want to show a ProgressBar or something until onSuccess happens. Jan 25 19:25:58 groxx: So I'd want it thread blocking? Is there a better way to do that? Jan 25 19:26:31 t0astt: no, you just want to wait to do X that depends on Y until Y happens. if you block the main thread, you lock up the phone (until the system decides your app can be killed) Jan 25 19:27:18 t0astt: The idea behind callbacks (such as onSuccess) is that you *don't* block. You just don't do stuff until the callback happens. Jan 25 19:27:19 you've basically told RestClient "do this thing, and tell me when you're done". when it's done, it calls onSuccess, which could be practically any amount of time later. Jan 25 19:27:32 Ok Jan 25 19:27:59 Are there any progress bars or simple ways to do the "don't do x until y happens"? Jan 25 19:28:13 I'm going to google it obviously, but if you know an easy way that could save me time that'd be awesome Jan 25 19:28:25 ProgressBars suggest "Downloading..." or something. Jan 25 19:28:33 They make it clear to the user that the data isn't ready yet. Jan 25 19:28:49 Sorry, I'm skim-reading everything tonight. Totally misread you. :D Jan 25 19:29:00 ? Jan 25 19:29:44 t0astt: have you used asynctask? Jan 25 19:29:53 groxx: I have not Jan 25 19:30:21 It looks like the JsonHttpResponseHandler thing is already async. Jan 25 19:30:35 TacticalJoke: correct Jan 25 19:30:58 hm. well, the thing is, async programming (and/or threading) is kinda a big area that takes some time to understand fully :| Jan 25 19:31:31 t0astt: In onSuccess, you'll want to post a runnable to the main thread. Jan 25 19:31:35 This runnable creates the adapter or whatever. Jan 25 19:31:59 at the moment, I'd probably recommend you make an empty adapter to start, and in onSuccess you change the adapter's contents and .notifyDataSetChanged. Jan 25 19:32:10 Posting a runnable to the main thread means two things: (1) You can touch Views. (2) You don't have to worry about multithreading issues (such as stale data). Jan 25 19:33:34 TacticalJoke, that sounds like a good way to do it Jan 25 19:33:36 and also that you spend some time to think about what "do this thing and tell me when you're done" implies, because it's bigger than it seems at first. e.g. if they leave the activity before it finishes, it'll be telling the now-gone activity to do things, which could crash. if it takes a long time, you might want a progress bar of some kind. if it fails, Jan 25 19:33:37 you may have to retry. Jan 25 19:34:18 (onsuccess is probably on the main thread already) Jan 25 19:34:51 Isn't that async? Jan 25 19:34:55 http://loopj.com/android-async-http/ Jan 25 19:35:19 Is that what you're using, t0astt? Jan 25 19:36:47 hm, could be. if it is, then it's on the main thread. most async network things come back to the main thread for simplicity's sake Jan 25 19:37:06 TacticalJoke, that is what I'm using Jan 25 19:37:10 I just got it working though :) Jan 25 19:37:13 I'm an idiot Jan 25 19:37:17 ah, yeah, I see the loopj in the imports now. derp. Jan 25 19:37:46 so I copied lines 91-166 into the onSuccess Jan 25 19:38:02 then I changed the this on (old) line 153 to MainActivity.this Jan 25 19:38:08 to get the current activity Jan 25 19:38:37 It's working now, and seems to be OK Jan 25 19:38:44 I'll show you the new code Jan 25 19:39:04 http://pastebin.com/xD8RMtU7 Jan 25 19:39:43 Hmm. But now you're not showing the Toolbar until the response has been received. Jan 25 19:39:46 Is that really what you want? Jan 25 19:39:59 If the HTTP request fails, for example, they'll not see the Toolbar. Jan 25 19:40:15 If it's slow, the Toolbar won't appear for a while. Jan 25 19:40:43 its that boring time now, when nothing happens until the next I/O Jan 25 19:41:00 between CES and I/O ZZZzzzzzz Jan 25 19:41:21 not that mobile was even much of a thing this year at CES, i think they were bored too Jan 25 19:41:26 g00s: not totally nothing: http://store.steampowered.com/app/244160/ Jan 25 19:41:50 i think what google should have done, is saved all the Material presentations for 2015 Jan 25 19:42:52 i am looking forward to ARA though Jan 25 19:43:50 they would have to step up their QA considerabley once you have interchangeable components like that though Jan 25 19:44:08 google doesn't have a great track record with QA ;) Jan 25 19:44:33 TacticalJoke, true. I'll see what happens with no data and mobile data vs wifi Jan 25 19:45:12 Brb, gonna make some mac n' cheese Jan 25 19:45:31 You're right, groxx. onSuccess seems to happen on the main thread. Jan 25 19:45:39 t0astt: So what I said about posting Runnables isn't needed. Jan 25 19:45:52 TacticalJoke: Ok. Is it bad that the onSuccess runs on the main thread? Jan 25 19:45:59 No, it's what you want. Jan 25 19:46:12 The slow stuff happens on a background thread; the UI stuff happens on the UI thread. Jan 25 19:46:16 Awesome Jan 25 19:46:27 What kind of app are you making? Just curious. Jan 25 19:48:05 TacticalJoke: I dunno if there have been substantial updates to loopj since the version I deal with, but I'm regrettably quite familiar with its internals :( it's a bit weird. avoid if you're starting something new. Jan 25 19:48:42 Yeah, I'm using OkHttp. They both look decent, but OkHttp looks more flexible from what I've seen. Jan 25 19:49:05 e.g., if I use OkHttp's async model I can still do stuff in the background in its callbacks. Jan 25 19:49:21 Although auto-posting to the main thread is handy for people who don't need anything else. Jan 25 19:49:32 why not just use normal thread with handler ? Jan 25 19:51:00 Yeah, you can do that. Then you manage the thread-pool yourself. Jan 25 19:51:16 the problem with asynctask is well it's like it's not guaranteed to be stable for tasks that take longer than what ? Jan 25 19:51:26 3 seconds ? Jan 25 19:51:54 not even sure but it sounds janky at that point Jan 25 19:52:01 tasks that need to happen (write to db) if in bg should be in service Jan 25 19:52:48 interestingt though how android handles the commit to preferences case Jan 25 19:52:58 How does it handle that? Jan 25 19:53:12 I think Napalm said that time, but I forgot. :D Jan 25 19:53:23 in that case, they have a work queue and each entry is a countdownlatch. in onStop they iterate through that queue and wait for the latch Jan 25 19:53:29 Ah. Jan 25 19:53:53 another queue actually runs the job. when the job is finished, it removes its receipt from the first queue Jan 25 19:54:22 so Onstop actually blocks until all those things are done Jan 25 19:54:27 I looked into OkHTTP, but it looks like there's a little more work for each call Jan 25 19:54:51 So I guess, in our code, any use of threads should be restricted to stuff that depends on the UI being there. Jan 25 19:55:21 (Since if the UI goes down then our Threads might die.) Jan 25 19:55:54 threads in activities / fragments - for the most part, yeah Jan 25 19:56:28 you could do something important like write to the db in a bg thread in an activity, but then you would have to do what preferences does and block in onStop if that is still in flight (for max reliability) Jan 25 19:56:48 Right. Jan 25 19:57:39 "Because a process running a service is ranked higher than a process with background activities, an activity that initiates a long-running operation might do well to start a service for that operation, rather than simply create a worker thread—particularly if the operation will likely outlast the activity." Jan 25 19:57:41 http://developer.android.com/guide/components/processes-and-threads.html Jan 25 19:58:07 I guess I'd use a service if the data were important (in my case, it's just writing to a throw-away cache, so I kinda don't care). Jan 25 19:59:10 or spin up a service until the write completes Jan 25 19:59:15 then you don't have to block Jan 25 20:03:20 christ how big is the aosp source Jan 25 20:03:43 been downloading for almost an hour now Jan 25 20:04:10 I guess you said that, g00s Jan 25 20:04:15 Darkwater, 50gb Jan 25 20:04:48 ..there go my intentions to do anything productive Jan 25 20:04:52 and my disk space, rip Jan 25 20:08:07 and it's about 100gb after building Jan 25 20:08:39 or I might be forgetting, maybe 30gb source and 50 after building Jan 25 20:10:40 Darkwater: mine takes about 60gb on disk Jan 25 20:10:41 What's the name of this encoding that looks like this: \u003cb\u003e Jan 25 20:10:46 with the "\u"s Jan 25 20:10:48 unicode probably Jan 25 20:11:10 ah. anyone know an easy way to decode them in JS? Jan 25 20:11:36 Darkwater: the good news is that it updates reasonably quickly once it's all downloaded :) Jan 25 20:11:37 eval! :v Jan 25 20:11:41 groxx: yay Jan 25 20:14:12 Hi. I want to make a circular button that, when pressed, resizes to take up the entire screen. Similar to the Google Dialer App on Android 5 when making a call. I've figured out to make a circular button with ripple effect. But how do I make the button-to-full-screen-transition? Jan 25 20:14:38 yeah looks like eval is the ticket Jan 25 20:14:51 Don't use eval. There has to be a better way. Jan 25 20:14:55 Levite: don't actually use eval lol Jan 25 20:15:17 I know, I'm not. Just going to inject a script to do it Jan 25 20:16:13 Not sure what the character is supposed to be.. but you can try JSON.parse('"\u003cb"') Jan 25 20:16:21 the json parser should know how to handle it. Jan 25 20:17:10 or even better maybe decodeURIComponent Jan 25 20:18:14 it's a Jan 25 20:18:55 i just needed to know what to type into google tho Jan 25 20:19:32 ah k Jan 25 20:20:37 So I'm kind of an Android noob, trying to set up a Volley HttpRequestQueue. I read that the best way to do this is to set up a singleton for the app, but the code in the docs doesn't compile. Does anybody happen to have a gist that does this? Jan 25 20:24:20 I've been reading a lot of people extend app.. but I'd rather not do that unless there really is a reason to not set up a module to handle that Jan 25 20:24:48 vintz_: it looks like it's probably correct - what error do you get? Jan 25 20:25:29 God, the Jackson documentation is bad. Jan 25 20:25:32 All over the place. Jan 25 20:25:47 'class' or 'interface' is expected Jan 25 20:25:51 "Wanna do X? Here's five contradictory articles about doing something like X." Jan 25 20:25:51 and everything is red Jan 25 20:25:55 :P Jan 25 20:26:17 vintz_: where did you paste the snippet? Jan 25 20:26:38 oh wait, lol, it's missing the first line of text Jan 25 20:26:42 I didnt Jan 25 20:26:48 but im using this from the docs: http://developer.android.com/training/volley/requestqueue.html#singleton Jan 25 20:26:58 vintz_: add `public class MySingleton {` to the top of what you pasted Jan 25 20:27:05 ah k Jan 25 20:31:50 sweet thanks groxx. I thought it'd be something like that. Is that truly better than extending app though? Jan 25 20:32:38 vintz_: there are other reasons to extend Application. it's basically unrelated. and in some niche areas, this is better. Jan 25 20:32:38 Also in my readings I've found stuff about doing double check synchronization with a Java singleton. do i really need to worry about this with android? Jan 25 20:33:04 vintz_: the synchronized keyword on the 'getInstance' method will handle that correctly for you. Jan 25 20:33:32 sweet okay. Jan 25 20:33:37 double checked locking sucks on the jvm, and dalvik/art is not documented to behave any differently in this regard Jan 25 20:33:46 double-checked synchronization is a performance trick, where you check, then synchronize, then check again - it only works in some languages, and it depends on the type of synchronization you're doing. tl;dr never do it, just synchronize the whole thing. Jan 25 20:34:00 it doesn't work on the jvm Jan 25 20:34:08 not some languages Jan 25 20:34:24 dalvik/art may or may not behave differently Jan 25 20:34:27 it works if you make an intermediate final variable, and it works if the thing being checked has only final fields. Jan 25 20:34:38 pfn: source is 33G Jan 25 20:34:40 finally done yay Jan 25 20:34:42 but yes, the basic technique all over the internet does NOT work, in any language. Jan 25 20:35:03 Darkwater, then built is roughly 50 Jan 25 20:35:05 well, basically any language. Jan 25 20:35:16 lol the internet is such a untrustworthy place :) Jan 25 20:35:22 groxx question. if i have: volatile int x; and thread one is *in* a synchronized (x) { ... }, will thread 2 doing x = 5 wait for the sync barrier ? Jan 25 20:35:48 ah, it may be volatile, not final, that makes it work. right. Jan 25 20:36:01 oh i'm asking Jan 25 20:36:03 heh Jan 25 20:36:11 g00s: if thread 2 is not synchronized, no. Jan 25 20:36:14 i think this is called 'cheap locking' Jan 25 20:36:23 ohoh Jan 25 20:37:28 in most languages, volatile just guarantees "complete" variable writes (e.g you won't read half of the old value, half of the new). in java it also implies a memory barrier, so you'll always get an up-to-date version (unless it's currently being modified, in which case you'll get the old one, but that's always possible with any synchronization system) Jan 25 20:38:19 Hmm. Just realised something -- my app could probably use JSON streaming after all. Jan 25 20:38:30 hm found it http://www.ibm.com/developerworks/java/library/j-jtp06197/index.html Jan 25 20:38:30 which also means using a volatile variable isn't particularly cheap. cheaper than a synchronized block, but nowhere near as fast as a normal variable check. Jan 25 20:38:37 "Pattern #5: The cheap read-write lock trick" Jan 25 20:39:09 I was assuming it couldn't because reddit gives 'type' and 'data' for comment-listing items, but it makes the mistake of not presenting them in any particular order. Jan 25 20:39:28 But my app could simply process everything, pull out what it wants, and then later see what it pulled out. Then it could avoid looking at 'type' at all. Jan 25 20:39:29 interesting. though for pattern #5 I'd say just use an atomic integer :) Jan 25 20:39:41 actually this is good too https://www.securecoding.cert.org/confluence/display/jg/66.+Do+not+assume+that+declaring+a+reference+volatile+guarantees+safe+publication+of+the+members+of+the+referenced+object Jan 25 20:39:55 safety first, don't micro-optimize threading stuff until you know a) it's the primary bottleneck, and b) you know _exactly_ what it'll do Jan 25 20:42:06 The Jackson team simply needs to delete so much of its "documentation". Jan 25 20:42:42 fwiw the "status flags" thing on that first link is just about the only thing I'd say you can do with volatile variables without having to know a lot more about java's memory behavior. and also important, don't ever "toggle" the variable - it should only ever move in one direction, or you can't know if you have an up to date value, or if some other thread Jan 25 20:42:43 has modified it. Jan 25 20:43:45 _then_ it's one of the cheapest ways you can "unblock" something in another thread. or flip a "cancelled" boolean. Jan 25 20:45:01 ah: and only ever with primitives. never objects. Jan 25 20:52:25 is there an elegant way to create an 'empty view' for a SwipeRefreshLayout without using two SwipRefreshLayouts? Jan 25 20:55:49 This "DecisionActivity" activity is my launcher activity. It decides where to route a user. If there is no network connection, I tell it to pop up an alert dialog stating that a network connection is needed, however it isn't doing so. I suspect it may need a layout? Here is the code: http://pastebin.com/M9K0i073 Jan 25 20:55:57 dynmeth: if you have a listview inside it, they have an "empty view" thing built in Jan 25 20:56:22 because users love modal alerts Jan 25 20:56:40 groxx: sorry, using RecyclerView (an extended one that adds an empty view) but then you cannot pull to refresh Jan 25 20:56:54 dynmeth: ah, I was wondering if that would work at all :| Jan 25 20:57:02 Levite was that directed to me? Jan 25 20:57:13 does recyclerview have an "overscroll" handler? you could probably forward that to the swiperefreshlayout... Jan 25 20:57:15 yeah, sorry for the snark. frustrated here Jan 25 20:57:28 Didn't really take it as snarky, no problem. Jan 25 20:57:36 groxx: yeah, think I need to override the canChildScroll or something Jan 25 20:57:37 i'd choose an alternative personally Jan 25 20:58:22 t0astt: I'd probably do a normal activity w/ fragments, tbh. Modal launch dialogs are a bit odd and rarely seen Jan 25 20:58:34 t0astt: it's possible alertdialog requires an activity to have a parent view, yeah. fwiw you can style an activity _as_ a dialog though, and you'll get transparent background and everything Jan 25 20:58:42 t0astt: or a landing page with some sort of empty content and then a modal on top of that w/ a standard alertdialog Jan 25 21:00:46 God, I'm dumb. Turns out I didn't have a .show() at the end of it xD Jan 25 21:00:50 dynmeth: dunno :| probably I'd just replace the contents when it's empty. in principle I'd say use two fragments, one with the list, one when empty. Jan 25 21:01:19 groxx: yep. leaning towards that too... Jan 25 21:01:56 Styling my app to look a little nicer will come after all the functionality is complete. I need to have it done for a contest, and deadlines scare me a bit (even though the contest isn't until april) Jan 25 21:02:54 dynmeth: ah, canChildScrollUp is on the swipe layout. hm. that does sound promising, just return false when it's at the top... Jan 25 21:03:07 no idea if it works in practice though :) never used it. Jan 25 21:03:29 t0astt what contest? Jan 25 21:08:15 groxx: non-related question, but do you know the default elevation of the toolbar in the ActionBarActivity? Jan 25 21:08:28 no clue :| Jan 25 21:08:41 darn :) Jan 25 21:09:08 you should be able to read the value though. if you can't find a direct handle on its view, you should still be able to walk through all views attached to the window. Jan 25 21:09:55 why didn't I think of that... Jan 25 21:11:53 on a different note: does anyone know if there are any decent UI-physics libraries for java? I found Facebook's "rebound", which won't work unmodified, so I'm hoping there are alternatives. Jan 25 21:21:14 ooh. not quite, but interesting: https://github.com/daimajia/AnimationEasingFunctions Jan 25 21:53:15 Im following some yt video but im getting http://i.imgur.com/DEDd3zN.png now Jan 25 21:53:28 Doing things exactly as the guy is doing Jan 25 21:55:15 Are there any tools that you can provide an XXHDPI image to and it scales them down to the other resolutions? I don't want to have to manually do it in Photoshop for each resolution :P Jan 25 21:55:43 Hi! I am trying to run Studio on Mac but I get "Android studio was unable to find a valid JVM" I tried setting STUDIO_JDK in zshrc, but it didnt work. I am using latest Studio and JDK 1.7 Jan 25 21:56:46 http://makeappicon.com/ t0astt Jan 25 21:57:03 Moter8: Awesome, I'll give it a try. Thanks! Jan 25 21:57:16 I saved "/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/" in rc file, thats the right path, right? Jan 25 21:57:47 prob rather the bin folder Jan 25 21:59:08 Moter8: You mean "/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/" ? Jan 25 21:59:29 the bin folder where the executable is in Jan 25 21:59:56 "/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/bin/"? Jan 25 22:00:32 Executables of what? Both path have some execuatbles Jan 25 22:01:37 Ah, darn. That service generates app icons. I need just normal images but in different resolutions. Jan 25 22:07:31 I had looked for something similar but ended up just buying some of those icon packs Jan 25 22:07:40 Would be a great idea for an app Jan 25 22:18:45 What is the easiest way I can call a method so it runs roughly every frame? Jan 25 22:18:59 t0astt: don't suppose you have imagemagick installed? Jan 25 22:19:21 Is it a good idea to keep calling sleep(15); mymethod(); in a loop? Jan 25 22:19:35 AKK9: not particularly :) is it for animating? Jan 25 22:20:17 groxx, well i need a view in my activity to keep updating while my recyclerview itemanimator is running an animation Jan 25 22:20:27 there is a animStarted and animFinished on the itemAnimator Jan 25 22:20:41 so i was hoping i could just start a loop and end a loop with my method in it Jan 25 22:20:52 why aren't you hooking up an animation step listener? Jan 25 22:21:38 Mavrik, I've not heard of this? Jan 25 22:22:41 there's also postOnAnimation Jan 25 22:23:01 the animation listener is start and end only Jan 25 22:23:21 but i need to run my code every frame during the animation Jan 25 22:23:55 oh wait postOnAnimation Jan 25 22:23:58 ill try this Jan 25 22:33:17 groxx: I do not. BUT! I found a great tool: http://romannurik.github.io/AndroidAssetStudio/nine-patches.html Jan 25 22:33:28 How can I get a view from a view holder? Jan 25 22:34:13 t0astt: :'( that it doesn't include xxxhdpi Jan 25 22:34:33 my N6 graphics will forever be ever so slightly fuzzy when viewed under a microscope. Jan 25 22:34:53 I demand more apk bloat to fix this! Jan 25 22:35:02 just the icon ;) Jan 25 22:35:20 groxx: Dang, I thought it just went to xxhdpi :P Jan 25 22:35:58 xxxhdpi is weird. it's 3.5x scale. Jan 25 22:36:23 I feel like they did that on purpose with the N6, to cause minor UI calculation bugs in developer's apps. Jan 25 22:37:00 e.g. if you ever add together a few dp-converted-to-px values, each will be floored, so you may be a pixel or two off by the end. Jan 25 22:42:45 anyone had any luck implementing aoa v2 using pyusb? Jan 25 22:44:09 or any other language? im wanting to force my device to act as a HID but for some reason when i send the control request for ACCESSORY_REGISTER_HID it Pipe Errors Jan 25 22:51:58 hehe http://www.reddit.com/r/Jokes/comments/2tm2ub/heisenberg_schrodinger_and_ohm_are_in_a_car/ Jan 25 22:53:06 dat comment thread :E Jan 25 22:53:18 Hi Jan 25 22:54:42 How to get access to SharedPreferences from MyFragmentPagerAdapter (extends FragmentPagerAdapter)? getActivity(), getApplicationContext() doesn't work. Jan 25 22:55:56 pass the context to the adapter when you create it Jan 25 22:56:23 technically the adapter shouldn't have to know about sharedprefs though Jan 25 22:57:11 i want to put Integer in sharedpreferences where someone swipescreen on ViewPager Jan 25 22:57:29 add a listener to the adapter higher up Jan 25 22:58:02 onPageSelected Jan 25 22:58:54 Stream-parsing JSON is so fiddly. Jan 25 22:59:02 A thousand ways to go wrong; one way to get it right. Jan 25 23:15:35 So if I'm going to show a list (not wanting to do RecyclerView right now, just want to test my API first), do I want a scrollView with a listView inside it? Or just a listView? Jan 25 23:15:59 Just ListView. Jan 25 23:16:05 ListView handles scrolling itself. Jan 25 23:16:06 okeedokes Jan 25 23:16:45 Okay, so I did a test: I switched my JSON code from DOM parsing to stream parsing and looked at it with AS's memory manager. Jan 25 23:16:49 The difference is huge. Jan 25 23:17:12 The DOM thing uses around 2MB for 200 reddit comments. Stream-parsing uses around 0.3MB. Jan 25 23:17:37 And the code isn't hugely more complex with stream parsing. Jan 25 23:18:39 hey guys, does navigationDrawerFragment require ActionBarActivity? Jan 25 23:19:23 I think I owe it to users to do the hard work myself here. Jan 25 23:19:30 Being kind to their batteries. Jan 25 23:20:01 Only assumption I'm making is this: I'll never need random stream access. Jan 25 23:21:52 yeah. not sure what you'd use it for though. Jan 25 23:23:23 I thought I needed it (because 'kind' isn't guaranteed to come before 'data'), but actually I wasn't thinking straight. I can just ignore 'kind' and determine the kind by seeing what values are actually available. Jan 25 23:23:57 am i the only one that doesnt like json much Jan 25 23:23:58 s/values/names/ Jan 25 23:24:11 I guess this can go wrong only if I can't tell which 'type' I have by the available names. Jan 25 23:24:22 I'm not a huge fan. It's okayish. Jan 25 23:28:13 I have put integer to SharedPreferences in onPageSelected() but i now want to change text on a fragment that I created for that ViewPager Jan 25 23:29:23 g00s: know of something more readable? obviously it's sub-optimal for most other things, but it gzips pretty well. Jan 25 23:29:56 Calendar.getInstance().get(Calendar.MONTH + 1); returns "5" i dont get why.... Jan 25 23:30:53 which fragment method is executed when onPageSelected is called ? Jan 25 23:30:56 i`m pretty sure its january, because its very cold ;) Jan 25 23:31:13 adkins: probably because .get(Calendar.MONTH + 1) means you're not getting the month Jan 25 23:31:28 you're getting whatever field is MONTH's internal value, +1, and it just happens to land on something else Jan 25 23:31:43 groxx: why not? i`m using the same line at some other part of my code where it returns 1 Jan 25 23:31:53 you probably want .get(Calendar.MONTH) + 1 Jan 25 23:32:14 that'll add 1 to the month's value, instead of getting something unrelated Jan 25 23:32:17 use JodeTime! Jan 25 23:32:22 JodaTime* Jan 25 23:32:28 damn ;) Jan 25 23:32:46 you dont need JodaTime to add amonth Jan 25 23:33:10 Narzew not a fragment method, you add http://developer.android.com/reference/android/support/v4/view/ViewPager.OnPageChangeListener.html Jan 25 23:33:25 you create your calendar , then say .add(Month, 1) Jan 25 23:33:56 Levite: I add this, but I need to update TextView inside fragment Jan 25 23:34:10 So I started out with a normal Fragment, and then converted that to a ListFragment. The Fragment already had it's own layout, fragment_home.xml, that has a listView inside of it. I got an error about "your content must have a ListView whose id attribute is 'android.R.id.list'". I set the id of the listView in fragment_home.xml to "list", as per http://stackoverflow.com/questions/17907122/java-lang-runtimeexception-your-content-must-have-a-listview-w Jan 25 23:35:02 t0astt are you using "android:id" not "id" Jan 25 23:35:20 android:id="@id/android:list" Jan 25 23:35:41 Ah, ok. I'll try that. Thanks! Jan 25 23:35:51 Narzew where is your reference to the view pager Jan 25 23:35:52 groxx: thank you so much. didnt notice that ;) Jan 25 23:36:09 Awesome, worked perfectly. Thanks Levite! Jan 25 23:36:51 Levite: in main activity class Jan 25 23:37:02 I'm not good at fragments Jan 25 23:37:19 so when main activity gets the message pass it to the fragment Jan 25 23:37:27 I made PlanFragment() where I have method onCreateView() that returns modified view Jan 25 23:37:45 and MyViewPagerAdapter class that have onPageSelected() method Jan 25 23:38:08 you don't want to put the listener in the adapter itself Jan 25 23:38:23 main activity should coordinate everything Jan 25 23:38:55 google needs to put more design principles in their docs like apple does Jan 25 23:40:08 you can keep a reference to the fragment in an instance variable or you can use the android:switcher trick Jan 25 23:43:14 how can I display a View object created in an isolatedProcess? Jan 25 23:43:40 how to find main fragment view in onCreate() method in that fragment? onCreateView return that view Jan 25 23:45:00 i think you should be inflating the view in oncreateview Jan 25 23:45:23 do you think there's a big different between using the Java DateFormat and the Android DateFormat? Jan 25 23:45:23 yes i inflate that view Jan 25 23:45:46 so call findViewWithId on the view Jan 25 23:45:54 findViewById Jan 25 23:46:12 Levite: symbol not found findViewById() on method onCreate() Jan 25 23:46:48 see if this helps http://stackoverflow.com/questions/17599450/how-to-inflate-view-inside-fragment Jan 25 23:47:12 "IBM is about to get hit with a massive reorg and layoffs" Jan 25 23:47:34 ~ 111800 people Jan 25 23:50:07 it must be easier way :/ i must made a mistake before Jan 25 23:51:52 it's ok, fragments are a disaster Jan 25 23:55:23 g00s: layoff of that many, or that many in the company? Jan 25 23:55:35 layoff that many Jan 25 23:55:35 If you have a TextView whose content is only set by java, do you tend to set a text value in XML or not? it would make it easier to use the XML Design tab Jan 25 23:55:44 but seems kinda wrong Jan 25 23:55:45 g00s: that's pretty massive. biggest I've heard of D: Jan 25 23:56:22 g00s: e.g. a quick google says Microsoft's biggest layoff was ~18,000: http://www.reuters.com/video/2014/07/17/microsoft-announces-largest-layoff-ever?videoId=324266406 Jan 25 23:56:52 duncannz: I don't. Jan 25 23:57:12 duncannz: if you want to use the xml design tab, you can add a tools:text attribute Jan 25 23:57:27 groxx: Thanks for this, that's exactly what I need Jan 25 23:57:31 http://tools.android.com/tech-docs/tools-attributes Jan 25 23:57:33 IBM's greatest achievement was in like 1982 Jan 25 23:57:37 :) Jan 25 23:57:54 ty sabton Jan 26 00:14:16 how can I display a View object created in an isolatedProcess? Jan 26 00:14:35 >.> Jan 26 00:17:46 has anyone used isolated process here? Jan 26 00:18:12 I want to use it to release some sensitive data to a class that can do computations on it and display it. Jan 26 00:25:38 hey people, is there a way to determine overscroll for RecyclerView? Jan 26 00:28:11 tez: RemoteViews Jan 26 00:43:56 hehe, this cracks me up : throw new IllegalStateException("connectPermit invalid; Semaphore is not fair"); Jan 26 01:21:49 How would you get something looking like what's below "WHICH IS" in this screenshot? https://i.imgur.com/vLDNUD5.png Html? Different TextViews in a RelativeLayout? Jan 26 01:22:28 you mean the content? Jan 26 01:22:38 a bunch of relativelayouts nested in a vertical linearlayout I suppose Jan 26 01:23:07 alright thanks Jan 26 01:26:34 hey guys :) whats up Jan 26 01:28:34 This is awesome. Previously, my app was getting a GC_FOR_ALLOC message once every three comment-listing downloads. Now it's about once every 20-30. Stream-parsing FTW. :) Jan 26 01:29:16 i'm trying to show an Activity as a Dialog. i already set the theme to "Holo.Light.Dialog.NoActionBar" on manifest but i wanna make the layout fill 90~80% of the screen! How can i do the trick? Jan 26 01:29:21 TacticalJoke when is the release date ? Jan 26 01:29:48 gotta make sure you're seeing the forest from the trees :) Jan 26 01:29:51 Not sure. So much to do. Hoping to release in about three months. Jan 26 01:31:05 dragorn have you done any btle lately ? Jan 26 02:13:11 there a good repo of android icons out there? Jan 26 02:14:31 https://github.com/google/material-design-icons Jan 26 02:14:36 Preview: http://google.github.io/material-design-icons/ Jan 26 02:15:15 thx Jan 26 02:16:12 Jackson streaming is way less memory intensive than Gson streaming for my app. Jan 26 02:16:19 I'm kinda bummed out; I prefer Gson's API. Jan 26 02:23:01 ugh. attempted to rewrite one of the nastier pieces of code in my app - came out _nearly_ as nasty as before :( Jan 26 02:24:18 needs more factories Jan 26 02:24:44 if that still doesn't do it, then you need some factory factories. Jan 26 02:25:29 not sure factories would help, sadly. it's a piece of touch-handling code. Jan 26 02:26:07 AbstractTouchHandlerImplementationFactory! Jan 26 02:26:31 trying to combine single + double tap, + zooming and panning, + sane behavior in a viewpager (so when you pan all the way to an edge and then try to go further, it pages), + a viewpager "gutter" so swiping from the edge will always page. Jan 26 02:27:34 it would be easier if viewpager had a better 'fake drag' thing - it's stuttery as hell, so I'm doing gymnastics to avoid it. Jan 26 02:28:03 * JesusFreke is glad he rare touches UI code Jan 26 02:28:06 rarely* Jan 26 02:28:12 heh Jan 26 02:28:34 I tried a few "gallery" implementations, as far as I've seen they're all bad. including the stock one. I like mine better. Jan 26 02:29:05 I just don't see why it has to be this complex :( **** ENDING LOGGING AT Mon Jan 26 02:59:59 2015