**** BEGIN LOGGING AT Mon Dec 29 02:59:56 2008 Dec 29 07:59:25 hi. is there a user interface guidelines doc for Android somewhere? Dec 29 12:29:08 it isn't possible to embed views in Tabs, am i right? Dec 29 12:31:24 hi Dec 29 17:01:42 I have two different views: a WebView and a SurfaceView. The WebView is shown at the start of my app and should be invisible/destroyed/... whenever the user clicks a button on that view. I already have the javascript calling a java method in my code. Now I am searching for the correct way to switch to the other view. Dec 29 17:02:48 look at View.setVisibility() Dec 29 17:02:56 you can also look at ViewSwitcher Dec 29 17:03:03 you can also add/remove the views Dec 29 17:03:40 thx Dec 29 17:04:03 is it possible to handle it in the webview thread or do i need to pass a message to the main thread? Dec 29 17:04:27 anything that touches views must happen on the main thread Dec 29 18:16:17 hello hello Dec 29 18:16:33 a great android app idea Dec 29 18:16:37 i bring Dec 29 18:16:44 phone soundboards Dec 29 18:21:29 this conversation might be more fruitful in #android... Dec 29 18:21:53 * michaelnovakjr agrees Dec 29 18:22:39 * sysrpl agrees too Dec 29 18:52:13 what´s the best way to paint on screen.... I´m using bitmaps (canvas.drawBitmap(Bitmap bitmap, float left, float right, Paint paint)) but it´s too slow if i have a lot "bitmaps" in memory... Dec 29 18:52:34 * the faster Dec 29 19:26:31 warptrosse_w: well, what are you trying to draw? Dec 29 19:27:06 if you are actually drawing pictures and not primitives like rectangles and lines, then you of course would need a bitmap in memory. consider this, if you didn't have it in memory, each time you draw you'd have to read it from disk which would be expensive Dec 29 19:27:31 a compromise might be to keep it in memory only so long as your view is attached to the screen, then free it when it isn't. Dec 29 19:27:51 but in general, this is not necessarily a good idea. Dec 29 19:29:02 i´m drawing rgb images Dec 29 19:29:44 http://www.mibbit.com/pb/hj51jc Dec 29 19:30:16 let me explain better... Dec 29 19:30:39 painting step takes only 10 ms with OpenGL es Dec 29 19:30:53 bitmaps creation takes 200 ms at less.... Dec 29 19:31:42 and i´m using a dobble buffer.. Dec 29 19:32:40 so i paint all in the buffer... then on screen with --> canvas.drawBitmap(buffer.getBitmap(), 0, 0, null); Dec 29 19:34:37 best to talk to romain about this. i'm sure he can recommend an ideal solution. Dec 29 19:34:38 jasta i need to create some bitmaps in every loop.... becouse i must refresh the game map... Dec 29 19:34:51 oh, well do not perform frequent allocations. Dec 29 19:35:09 the garbage collector is stop the world, and you will have terrible performance implications if you use it in any tight loop or critical path. Dec 29 19:35:21 re-use your allocated bitmap where posssible Dec 29 19:36:48 but check if a pixel has changed should take time? Dec 29 19:39:55 why don't you just maintain a map of all dirty rectangles? Dec 29 19:39:58 and only redraw those? Dec 29 19:41:42 i try that... i put all in buffers... but i can´t reduce form 500 ms to 150 ms Dec 29 19:41:52 (game loop) Dec 29 19:42:46 can you show me the code then? Dec 29 19:43:15 what part? Dec 29 19:43:27 because is too bug.... Dec 29 19:45:00 im just not getting a good sense of exactly what your game loop looks like. Dec 29 19:45:12 i suspect that you are performing large allocations often and you shouldn't be, but i need to confirm. Dec 29 19:45:18 well you have a map Dec 29 19:45:39 composed by tiles Dec 29 19:45:47 that tiles are rgb images Dec 29 19:46:07 suppose putting all in buffers... Dec 29 19:46:32 so i create all bitmaps and i put all in buffers... Dec 29 19:46:35 then Dec 29 19:46:52 i paint some off those tiles Dec 29 19:46:54 on screen Dec 29 19:47:28 seems sensible. Dec 29 19:47:33 sorry, put all those buffers on a single image... then paint on screen Dec 29 19:47:34 that's like how the Snake game is built Dec 29 19:47:42 see, why would you combine them to pain ton screen? Dec 29 19:48:46 becouse i put tiles in different positions Dec 29 19:48:54 inside "main" image... Dec 29 19:49:06 so draw them at those positions manually Dec 29 19:49:14 there is no need to combine them into a larger bitmap. Dec 29 19:50:45 you can composite directly from the tiled bitmaps to the screen, using canvas.translate and canvas.drawBitmap. Dec 29 19:51:32 and as i said, do not perform allocations in the drawing loop. or excesive allocations anywhere else in your game loop. allocations are very expensive. Dec 29 19:51:48 sounds good Dec 29 19:51:49 more accurately, the garbage collector is damaging to responsiveness. Dec 29 19:54:33 but i need to put canvas.translate and canvas.drawBitmap in whole game... Dec 29 19:54:55 i can't understand you. if you can't show me some code, i don't know that i can help you further. Dec 29 21:56:41 I'm using a LayoutAnimation with a ListView, and it does use the LayoutAnimation the first time I setAdapter() on the ListView... Dec 29 21:57:09 but I then setAdapter(null), do some work, and then set a new adapter...I'd like it to animate the children in everytime I do this... Dec 29 21:58:09 don't have the source on this box yet...d/ling it now Dec 29 22:00:02 cant you just force a layout? Dec 29 22:00:19 i thought layoutanimations occurred anytime a layout pass is made. oh wait, that makes no sense actually Dec 29 22:00:22 what a poorly named class then Dec 29 22:00:45 now im curious, im looking in the source Dec 29 22:01:06 yeah, with a ListView it would then have to execute the layout animation each time it scrolled if that was the case Dec 29 22:02:29 I'm just now doing a "repo sync"...so i won't have the source for a while Dec 29 22:03:00 im looking for you Dec 29 22:03:09 btw, long time no see. what have you eben up to? Dec 29 22:03:44 moving + holidays Dec 29 22:03:50 almost settled in now though Dec 29 22:04:32 i looks like the animation is controlled by a simple flag on the ViewGroup Dec 29 22:04:51 when a layout animation is set, it sets FLAG_RUN_ANIMATION, which is then reset by dispatchDraw which runs the animation Dec 29 22:05:02 so...try just using setLayoutAnimation again. Dec 29 22:05:18 ok, thanks Dec 29 22:05:42 that's my crude 5 minutes looking at it understanding though. so who knows what will actually happen :) Dec 29 22:08:18 you might also need to invalidate the listview, because you gotta trigger dispatchDraw to run. Dec 29 22:08:32 actually no, because setAdapter(null) will do that. Dec 29 22:09:00 or rather, setAdapter will do it regardless. Dec 29 22:10:25 nice, resetting the LayoutAnimation works Dec 29 22:10:27 thanks Dec 29 22:13:22 no problem Dec 29 23:18:16 anyone using cupcake?? do any of the drivers work now? Dec 30 02:19:35 Ok, so I've got my nifty ListView items looking the way I want it: http://pastebin.com/m6f8bdb99, but now I'm trying to figure out how I can make the entire item clickable, so that when it is clicked, it gets the "hilight" effect and the checkbox is clicked. How do I do this? Dec 30 02:39:11 anyone using cupcake?? do any of the drivers work now? **** ENDING LOGGING AT Tue Dec 30 02:59:56 2008