00:01.48 | jasta | but you could add them dynamically by using addView |
00:01.56 | jasta | and you can remove them with, uhm, removeChild i think? |
00:01.59 | jasta | look at the documentation. |
00:18.53 | *** join/#android trigatch4 (n=chatzill@static-66-16-244-12.dsl.cavtel.net) |
00:20.22 | *** part/#android der_maddi1 (n=der_madd@dslb-088-067-235-162.pools.arcor-ip.net) |
00:28.00 | jasta | maybe setOnClickListener doesn't do what I think it does. |
00:28.56 | jasta | oh duh, textview's aren't clickable :) |
00:30.22 | jasta | i wish i could see the style definition for a button now ;) |
00:37.00 | f00f- | ok jasta so i'll use android:visibility :) |
00:37.01 | f00f- | thanks |
00:50.58 | jasta | romainguy_: why is it insufficient to call setClickable(true) on a TextView to make it clickable? What is the critical style difference between a button and a textview that makes a button clickable? |
00:58.04 | Dan_U | jasta: Try setting focusable to true |
01:02.25 | jasta | that did it |
01:03.30 | jasta | yay, my bar works now! |
01:04.51 | *** join/#android Dan_U (n=Dan@70-41-192-219.cust.wildblue.net) |
01:08.10 | jasta | sort of annoyingly, though. setSelection maybe could stand be a bit more flexible ;P |
01:14.16 | romainguy_ | more flexible than selecting the given position? |
01:15.51 | jasta | the idea of positioning the list should be more flexible, at least. not appropriate for setselection,. |
01:15.55 | jasta | erm setselection. |
01:16.48 | jasta | my purpose obviously doesn't want to center the separator bar. it should be at the very top of the list |
01:19.28 | *** join/#android The_PHP_Jedi (n=ThePHPJe@66-50-125-149.prtc.net) |
01:21.24 | jasta | it's ok for my purposes, i can work around it by just measure a few views until i get to the approximate center and call setSelection on that position. still, i think you will find a lot of applications wanting more options to control the viewport. |
01:22.26 | jasta | perhaps setSelectionFromTop could be useful for that |
01:22.56 | romainguy_ | we'll see |
01:23.15 | jasta | i coudl of course just extend ListView and get what i need from it that way |
01:23.36 | romainguy_ | I don't know if we expose enough to do that from a subclass |
01:24.14 | jasta | actually wait, setSelectionFromTop behaves much different than I expected |
01:25.03 | jasta | setSelectionFromTop(selectorPos, 0) seems to behave much like I'd want. |
01:25.09 | jasta | but I did not expect that ;) |
01:28.26 | romainguy_ | jasta: the doc is pretty obvious to me though |
01:50.49 | *** join/#android TimRiker (n=timr@rikers.org) |
02:07.40 | *** join/#android icecubed (n=ishan@59.94.115.133) |
02:08.16 | icecubed | hi |
03:24.52 | *** join/#android eton (n=eton@ppp-58-8-3-72.revip2.asianet.co.th) |
03:46.06 | *** join/#android jjt001 (n=james@c-98-207-50-162.hsd1.ca.comcast.net) |
03:46.19 | jjt001 | ello to all |
03:46.23 | jjt001 | ello to one and all |
03:47.05 | jjt001 | anyone here? |
03:47.11 | jjt001 | by and large |
03:47.25 | jjt001 | viscosity and vehemence to all |
03:47.25 | jasta | sort of |
03:47.40 | jjt001 | jasta:you a bot? |
03:47.55 | jjt001 | jasta: you a bot |
03:48.37 | jasta | no |
03:52.02 | *** join/#android duey (n=Nick@203.96.223.40) |
03:53.12 | jjt001 | jasta: ello |
03:53.26 | jjt001 | jaaaaaaaaaaaaaaaasta: |
03:53.28 | *** join/#android pandora-- (n=pandora-@cpe-76-172-208-63.socal.res.rr.com) |
03:53.43 | jjt001 | pandora: hello |
03:53.55 | jjt001 | pandora: quick ques |
03:54.33 | pandora-- | hey hey |
05:02.22 | *** join/#android dragor43 (n=asdf@pool-151-199-245-93.phil.east.verizon.net) |
05:24.25 | *** join/#android kurzum (n=opera@chello084112021199.32.11.tuwien.teleweb.at) |
05:31.16 | *** join/#android Cybergeek2021 (n=cybergee@d149-67-39-135.col.wideopenwest.com) |
05:51.42 | *** join/#android Dralspire2 (n=dralspir@unaffiliated/dralspire) |
06:25.09 | *** part/#android kurzum (n=opera@chello084112021199.32.11.tuwien.teleweb.at) |
06:55.02 | thedaniel` | hey guys, i'm coming to java by way of android - i've done plenty in python, etc, even written some small c embedded programs, but don't know much about java. I'm curious what this syntax means (you can just point me in the direction of docs, but punctuation is hard to google): |
06:55.06 | thedaniel` | mTitleText = (EditText) findViewById(R.id.title); |
06:55.16 | thedaniel` | specifically, the parens around the EditText class |
07:05.44 | *** join/#android jota- (n=jota@190.6.0.180) |
07:23.51 | *** join/#android matt_c (n=mcroydon@137.147.45.66.cm.sunflower.com) |
07:38.56 | *** join/#android Zoolooc (n=fredsiba@nrbg-4dbfa789.pool.einsundeins.de) |
08:12.43 | *** join/#android chaosvoyager (n=Miranda@pool-72-80-180-212.nycmny.fios.verizon.net) |
08:20.52 | *** join/#android davidw (n=davidw@chello212186016224.tirol.surfer.at) |
08:45.55 | *** join/#android LWT001 (n=lwt@121.15.101.61) |
08:50.11 | *** part/#android LWT001 (n=lwt@121.15.101.61) |
08:55.54 | *** join/#android jeddy3 (n=mattiast@81-237-230-160-no83.tbcn.telia.com) |
08:57.03 | *** join/#android mypapit (n=mypapit@pdpc/supporter/active/mypapit) |
09:12.05 | *** join/#android tmarble (n=tmarble@195.65.142.1) |
09:25.37 | *** join/#android illustir (n=alper@s5590818c.adsl.wanadoo.nl) |
09:39.11 | *** join/#android Azalar_ (n=Azalar@cpc2-acto9-0-0-cust415.brnt.cable.ntl.com) |
09:41.02 | *** join/#android danmulvey (n=polx@adsl-68-125-24-255.dsl.irvnca.pacbell.net) |
10:09.03 | *** join/#android acsia (n=acsia@host86-161-118-239.range86-161.btcentralplus.com) |
10:25.45 | *** join/#android [AD]Turbo (n=turbo@host131-128-dynamic.57-82-r.retail.telecomitalia.it) |
10:48.57 | *** join/#android grah (n=grah@58.161.241.86) |
11:14.38 | acsia | has anyone used the IDL ? |
11:17.42 | acsia | I guess I ll wait til the states gets online... |
11:29.22 | mypapit | w00f w00f! |
11:37.49 | *** join/#android Mathiasdm (n=Mathias@d54C597B6.access.telenet.be) |
11:42.54 | chaosvoyager | IDL? No. |
11:51.10 | acsia | android description language for inter process communication |
11:51.41 | acsia | i will probably need it so I am wondering if anybody has played with it yet |
11:53.21 | chaosvoyager | I'm under the impression that it's still buggy as hell, and to be honest I REALLY hope they replace it with something else before Android is released anyway. |
11:54.20 | acsia | how do you know? |
11:55.20 | chaosvoyager | Android developer group forum. |
11:56.18 | acsia | arf |
11:56.25 | acsia | should I or should I not |
11:56.57 | chaosvoyager | At this point, if you want inter-process communication, you have to. |
11:58.33 | chaosvoyager | Ypou should be safe if you're just sending over ints and strings. It's when you attempt to send over more complicated Parcels that the trouble begins. But as I said, haven't actually used it. |
12:00.20 | chaosvoyager | anddev.org is usually a good site for this kind of information. |
12:02.55 | acsia | I ll need to read it up |
12:03.14 | acsia | I feared the response |
12:03.26 | acsia | I don t want to spend endless night again |
12:03.32 | acsia | and then change design |
12:03.53 | chaosvoyager | I know what you mean. |
12:16.40 | *** join/#android kurzum (n=opera@chello084112021199.32.11.tuwien.teleweb.at) |
12:24.28 | *** join/#android mystic_cat (n=jarek@ata216.neoplus.adsl.tpnet.pl) |
12:24.33 | *** part/#android mystic_cat (n=jarek@ata216.neoplus.adsl.tpnet.pl) |
12:37.59 | *** join/#android Mathiasdm2 (n=Mathias@vpne056.ugent.be) |
13:03.45 | *** join/#android morrildl_ (n=chatzill@nat/google/x-6236ef78ed7823bc) |
13:03.46 | *** join/#android markf_ (n=markf@nat/google/x-8d2d5788f3625300) |
13:06.00 | *** join/#android Mathias (n=Mathias@d54C597B6.access.telenet.be) |
13:07.28 | *** join/#android Mathiasdm (n=Mathias@vpna106.ugent.be) |
13:23.48 | *** join/#android Mathias (n=Mathias@d54C597B6.access.telenet.be) |
13:24.44 | *** part/#android chaosvoyager (n=Miranda@pool-72-80-180-212.nycmny.fios.verizon.net) |
14:34.01 | acsia | can you do Class instantiation with the android sdk? |
14:34.18 | acsia | like aBar = (Bar) Class.forName(barClassName).newInstance(); |
14:38.22 | davidw | acsia, yes |
15:07.25 | *** join/#android dragor43 (n=asdf@151.199.245.93) |
15:19.54 | davidw | hrm hrm hrm hrm hrm hrmmmmmmmmmmmmmmmm |
15:34.59 | acsia | is that the sound of a motorcycle? |
15:55.06 | davidw | it's me thinking |
16:11.15 | *** join/#android Lede (n=lede@85.148.228.92) |
16:11.40 | Lede | hello |
16:12.44 | davidw | hi |
16:19.05 | *** join/#android illustir (n=alper@s5590818c.adsl.wanadoo.nl) |
16:19.34 | *** join/#android Mathiasdm (n=Mathias@d54C597B6.access.telenet.be) |
16:20.02 | chomchom | f |
16:21.40 | chomchom | f |
16:21.57 | chomchom | whoops |
16:22.21 | chomchom | was just doing searches through my irc logs! hence the f's |
16:22.39 | chomchom | Hello everyone! I'm just back from a nice skiing holiday |
16:23.22 | chomchom | Hope everyone has been hard at work on their applications |
16:45.52 | acsia | is it possible from application A to load a class from application B with loadClass? |
16:47.15 | *** join/#android muthu (n=sara@59.92.80.186) |
16:50.27 | *** join/#android Kraln (n=Kuja@pool-71-191-36-254.washdc.fios.verizon.net) |
16:51.26 | davidw | acsia, my guess is: probably not |
17:02.23 | davidw | dammit |
17:02.37 | davidw | it uses the package as a unique identifier:-/ |
17:04.50 | *** join/#android The_PHP_Jedi (n=ThePHPJe@66-50-125-149.prtc.net) |
17:42.31 | *** join/#android grah_ (n=grah@CPE-58-161-241-86.nsw.bigpond.net.au) |
17:47.39 | *** part/#android chomchom (n=chomchom@78.32.95.81) |
17:57.30 | *** join/#android [jarek] (n=jarek@atd228.neoplus.adsl.tpnet.pl) |
18:01.11 | *** join/#android chomchom (n=chomchom@78.32.95.81) |
18:05.34 | *** part/#android muthu (n=sara@59.92.80.186) |
18:24.26 | *** join/#android plusminus (i=590f5db3@gateway/web/ajax/mibbit.com/x-0e43d2160d85f96c) |
19:07.41 | jasta | davidw: yeah, isn't that annoying? |
19:10.03 | davidw | very much so |
19:10.38 | davidw | On J2ME (sorry, Java ME), you can just change a few things and you have a new app. This is very useful for Hecl |
19:11.02 | jasta | also, there is a goofy "feature" that causes apk files with different filenames but from the same java package scope to not be installable. |
19:11.08 | jasta | the stack just ignores it |
19:14.12 | davidw | yeah... I'm fooling around with that right now |
19:14.20 | davidw | you have to completely change the package |
19:17.55 | davidw | wow....got it to work finally |
19:18.05 | jasta | yeah, it's especially lame because this way you can't version your fucking apk files. |
19:18.20 | jasta | foo-0.0.2.apk will not replace foo-0.0.1.apk when installed. very bad ;) |
19:19.21 | zhobbs | yeah, that'll need to change |
19:25.09 | romainguy_ | remember it's just a pre-alpha version of a 1.0 platform :) |
19:30.48 | jasta | it'll probably be like all the google apps. Android BETA until 2010 :) |
19:39.57 | *** join/#android jeddy3 (n=mattiast@81-237-230-160-no83.tbcn.telia.com) |
19:40.08 | *** join/#android Mathiasdm (n=Mathias@vpna083.ugent.be) |
19:40.41 | *** join/#android igandroid (n=igandroi@c-75-69-236-102.hsd1.ma.comcast.net) |
19:46.47 | chomchom | I have a question about the UI threading. As far as I have seen all of the threading to be done on the GUI has been done within each actual activities class. I have been trying to move as much functionality as possible out of my activity classes and instead call a controller. Is it preferable to actually have the code for those threading calls within the implementing Actions class or move it into a controller and use the |
19:46.47 | chomchom | <PROTECTED> |
19:48.44 | romainguy_ | It does not matter in which class the code lives |
19:48.53 | romainguy_ | As long as it is executed on the UI thread |
19:49.01 | romainguy_ | if you don't spawn threads, you have nothing to do |
19:49.29 | chomchom | cool thats fine then. |
19:51.00 | *** join/#android bladezor (n=bladezor@c-98-196-112-154.hsd1.tx.comcast.net) |
19:59.31 | jasta | I see this a lot :) |
20:00.06 | *** join/#android Beryllium (n=berylliu@S01060018f8f93bda.gv.shawcable.net) |
20:00.14 | jasta | chomchom: A thread of execution is merely analogous to a person walking a path. The code is the path, but any person can walk any path should you schedule them to do so. |
20:02.13 | jasta | UIThreadUtilities in this sense is unusual. Programs don't normally offer a way to detect what thread is running since they ought to know that by how the thread was scheduled. |
20:02.39 | chomchom | Unless you are doing eclipse RCP development |
20:02.53 | chomchom | which also has a ui thread access thing |
20:02.59 | romainguy_ | Unless you are doing Swing development |
20:03.01 | chomchom | but its called a UIJob |
20:03.15 | romainguy_ | but it's called SwingUtilities |
20:03.17 | jasta | chomchom: Most UI toolkits have a single UI thread. |
20:03.30 | jasta | For Linux, even X itself is not thread-safe. |
20:03.47 | romainguy_ | writing a thread-safe UI toolkit is both very hard and very inefficient |
20:04.07 | jasta | Still, offering utilities to determine the running thread is merely a convenience to guard against sloppy programming. |
20:04.48 | romainguy_ | jasta: and to avoid having a Handler around |
20:04.57 | chomchom | Well I guess it must just be down to my inexperience in UI toolkits, will have to look for some recommended resources |
20:05.05 | romainguy_ | it has nothing to do with sloppy programming |
20:06.07 | jasta | chomchom: It is perhaps more to your inexperience with threading. |
20:06.25 | chomchom | maybe indeed |
20:07.06 | jasta | The UI model is actually one of the simplest threading models to adhere to. The rule is simple: manipulation of the UI happens in just one thread, and it's the first thread of execution your program is given. |
20:07.41 | romainguy_ | "and it's the first thread of execution your program is given." << not necessarily :) |
20:07.44 | romainguy_ | for instance in Swing |
20:08.07 | jasta | Really? I thought that was so common as to be considered a rule? |
20:08.21 | chomchom | Ah, so if I name the thread I can find it in the scheduler? |
20:08.38 | jasta | Oh well now that I think about it I suppose you're right. It's wherever you scheduled the event loop :) |
20:09.43 | jasta | chomchom: There is no need to name the thread at all in Android. Android, as most UI toolkits do, offer a simple way to schedule code to run in the UI thread using an event loop. |
20:10.41 | jasta | That is, the UI thread is forever consuming events and responding to them. Firing callbacks for user input like button clicks, keyboard input, etc, handling drawing/layout updates, and whatever else it is designed to do. |
20:11.13 | jasta | That includes running your scheduled code. In Android, your interface to schedule into that event loop is through a Handler, which need only be constructed in the UI thread. |
20:11.28 | jasta | Then, it is a thread-safe handle to schedule events in any thread. |
20:12.03 | jasta | The common usage is documented somewhere in Android's documentation. Can't remember where exactly :) |
20:13.59 | acsia | what would you use if you want to have a textView with paragraph styling? |
20:14.13 | acsia | TextView has not enought options IMO |
20:14.30 | jasta | what do you mean paragraph styling? |
20:14.40 | zhobbs | indentation and stuff? |
20:14.50 | acsia | more or less, a bit like html |
20:15.04 | jasta | Oh. I would recommend a WebView but they are so heavy right now |
20:15.08 | zhobbs | can you indent with \t ? |
20:15.26 | acsia | yes I used webView but as you say it is heavy and just doesn't seem right |
20:16.08 | acsia | there is a new class called Html |
20:16.15 | jasta | it might be most sensible to extend TextView if it truly doesn't offer a way to do this |
20:16.16 | acsia | does not seem to be implemented thought |
20:16.33 | jasta | but that could be an enormous task |
20:16.42 | zhobbs | yeah, could extend textview and format the text in there |
20:16.49 | acsia | yes, I just want an about page/view |
20:17.06 | acsia | a bit to much to extend TextView ;) |
20:17.08 | jasta | you realize of course that you could do that with just multiple textviews instead, yeah? |
20:17.09 | *** join/#android TimRiker (n=timr@rikers.org) |
20:17.18 | acsia | but again, could add it to my utility package |
20:17.46 | acsia | hum, I actually did not think about that... |
20:17.49 | zhobbs | I have a textview with multiple paragraphs and I just use \n\n and it looks fine |
20:18.12 | acsia | I want a text-align: justify |
20:18.17 | acsia | so it looks square |
20:18.41 | zhobbs | yeah, I was thinking justify would be good also |
20:19.02 | acsia | o well not really important, was just wondering if there were something that I did not see in the doc |
20:19.04 | jasta | i'm gonna try to release my alphabet list widget today :) |
20:19.20 | jasta | it works perfectly. |
20:19.33 | jasta | and i can't wait for setSelection() to have a fling animation associated with it. |
20:20.44 | zhobbs | jasta: license? |
20:20.48 | jasta | GPL |
20:21.08 | jasta | well, maybe a BSD license for this particular thing. |
20:21.11 | jasta | the rest of my code of course is GPL |
20:21.43 | jasta | is of course* |
20:22.07 | zhobbs | yeah |
20:22.17 | jasta | i'm mostly just hoping someone will help me improve it a bit aesthetically |
20:22.28 | jasta | and maybe improve precision a bit for touch-screen devices |
20:22.33 | jasta | so it can react to more fudged input |
20:22.40 | jasta | right now i suspect it's very hard to operate with your finger |
20:31.18 | jasta | sweet, android provides a UNICODE collator for SQLite3 |
20:35.51 | zhobbs | also would be nice to be able to format specific words in a TextView somehow |
20:36.09 | jasta | you sort of can with resources |
20:37.49 | zhobbs | what you mean? |
20:39.57 | jasta | CharSequence can hold formatting |
20:40.10 | jasta | look at the ApiDemos content/StyledText.java |
20:40.25 | zhobbs | ok, thanks |
20:41.40 | jasta | seems somewhat limited, but still |
20:42.14 | zhobbs | ahh, simple as <b>, <i>, etc |
20:42.40 | jasta | but remember that a String will lose that formatting. |
20:42.51 | zhobbs | hmm... |
20:43.04 | jasta | CharSequence seems to have some magic, I don't know |
20:44.42 | kurzum | hmm im wondering if theres some java bb code lib out there |
20:45.09 | kurzum | which converts bb code into html |
20:45.10 | jasta | that could be somewhat useful |
20:46.14 | kurzum | https://javabbcode.dev.java.net/ :) |
20:55.50 | *** join/#android duey (n=nick@ip-58-28-159-211.static-xdsl.xnet.co.nz) |
20:57.19 | plusminus | new AndNav! version. Now recalculates the route being "off-route" for X seconds. |
20:57.22 | plusminus | Flash-Video: http://www.anddev.org/images/tut/map/andnav/screencast.htm |
20:57.32 | plusminus | Any feedback is appreciated |
20:57.34 | plusminus | :) |
20:58.06 | plusminus | (Video is 4 MBytes) |
21:00.52 | zhobbs | pretty cool |
21:03.11 | plusminus | thx :) |
21:03.51 | jasta | a skateboarding android? |
21:03.54 | plusminus | i'd love to test this in real... |
21:03.55 | plusminus | ^^ |
21:04.10 | jasta | why is the video so clunky? |
21:04.23 | plusminus | looking up "clunky"... |
21:04.34 | jasta | the framerate is very low |
21:04.52 | plusminus | Its just a series of screenshots |
21:05.09 | plusminus | created with "wink" |
21:05.20 | plusminus | btw: skateboard-droid: http://code.google.com/android/goodies/wallpaper/android-wallpaper6_1024x768.jpg |
21:05.36 | jasta | lol awesome, google produced that!? |
21:05.50 | plusminus | the skateboarder ? yes |
21:05.58 | plusminus | http://code.google.com/android/goodies/index.html |
21:07.19 | plusminus | damn I love .svg graphics. Especially inkscape. I just could extract the vectors of the Boarding-Droid with I click and the modify it ... |
21:07.28 | romainguy_ | you love inkscape? |
21:08.03 | plusminus | sometimes the selection is shitty, but imo it is basically pretty good |
21:08.22 | plusminus | You know a better tool ? |
21:08.24 | romainguy_ | have you tried potrace? |
21:08.34 | plusminus | I'll have a look... |
21:08.45 | romainguy_ | ah apparently Inkscape uses potrace |
21:08.47 | romainguy_ | nevermind :) |
21:08.59 | romainguy_ | so then you can try autotrace |
21:09.29 | davidw | "I AM MARVIN THE MOBILE GARBAGE CAN" |
21:09.31 | jasta | i can't believe google made a crummy skateboarding android |
21:09.32 | jasta | that is so great |
21:09.34 | plusminus | davidw: which logo ? |
21:09.51 | davidw | the android one |
21:10.32 | jasta | oh my god i want that so bad |
21:10.40 | jasta | i mean, not *YOUR* t-shirt, that would be creepy |
21:10.43 | plusminus | :( I want such a shirt too |
21:10.49 | plusminus | ^^ |
21:10.51 | davidw | I want a skateboarding android |
21:11.00 | plusminus | romainguy_: you should be sellign them ^^ |
21:11.04 | davidw | I think that would be slightly cooler than a shirt! |
21:11.05 | romainguy_ | lol |
21:11.11 | plusminus | or make more codedays... |
21:11.16 | plusminus | davidw: |
21:11.19 | plusminus | lol |
21:14.43 | *** join/#android eton_ (n=eton@ppp-58-8-1-181.revip2.asianet.co.th) |
21:15.05 | zhobbs | you should be able to cash in X ammount of helpful posts on android-developers for a t-shirt |
21:15.43 | plusminus | like ~200 :P ... |
21:16.18 | jasta | helpful? Awwww! :) |
21:17.13 | zhobbs | haha, nothing wrong with being helpful jasta |
21:17.29 | jasta | i'm just saying i have a lot of posts, but perhaps not a lot of helpful posts ;) |
21:17.39 | jasta | and i really want a skateboarding android t-shit |
21:17.41 | jasta | t-shirt* |
21:21.36 | *** join/#android illustir (n=alper@s55912056.adsl.wanadoo.nl) |
21:23.11 | *** join/#android lindever__ (n=eton@ppp-58-8-1-111.revip2.asianet.co.th) |
21:28.51 | *** join/#android Marv|LG (n=Marv|TF@ip70-190-12-40.ph.ph.cox.net) |
21:35.33 | jasta | alright, time to correctly implement onmeasure and onlayout for this custom widget of mine |
21:35.43 | romainguy_ | good luck :) |
21:37.09 | jasta | my only concern is how to adjust the size of the alphabet labels accordingly. how does fontsize relate to the height of the drawn letters? |
21:37.56 | jasta | i can easily calculate the size that each label must be, but i'm not sure how to select a font size from that that will ensure it fits nicely. |
21:40.05 | jasta | i suppose i could just do something really awful like make a guess and loop onMeasure until I get a size i like :) |
21:40.31 | plusminus | anyone knows, whether on the CeBit (Germany) there will also be Android Devices? |
21:42.52 | duey | there is no info on that |
21:47.28 | plusminus | OHA Members: HTC, Motorola, T-Mobile |
21:47.39 | plusminus | we'll see :) |
22:02.20 | *** join/#android loic-pointgphone (n=sexystif@ill67-1-82-231-213-14.fbx.proxad.net) |
22:11.55 | *** join/#android dragor43 (n=asdf@pool-151-199-245-93.phil.east.verizon.net) |
22:11.56 | f00f- | how do i make a TextView span its width, but be 'constrained' between two other views in a RelativeLayout? |
22:12.20 | f00f- | like if the text is too much to fit, i've set scrollHorizontally to true |
22:12.22 | jasta | f00f-: you can use a linearlayout for that, and set the "contrained" widget's weight property to 1 (or anything higher) |
22:12.57 | jasta | <LinearLayout> <TextView/> <TextView layout_width="0px" layout_weight="1"/> <TextView/> </LinearLayout> |
22:13.11 | f00f- | is there a way to do it with relative? |
22:13.17 | jasta | by that i mean you do not need to use a relativelayout at all. |
22:13.25 | jasta | f00f-: Yes, it will work the same in a relativelayout i believe. |
22:13.31 | *** join/#android Kriyasurfer (n=Akashakr@dsl027-162-152.atl1.dsl.speakeasy.net) |
22:13.45 | jasta | let me confirm though, hang on |
22:14.00 | jasta | i am probably wrong. relativelayout will not do it. |
22:14.05 | f00f- | i don't see a weight or constrained property :( |
22:14.16 | jasta | that said, a similar effect can be found by aligning the widgets to the left and right with alignRight/Left... |
22:15.06 | jasta | though it is more cumbersome for sure. |
22:15.20 | jasta | i did it this way once with a relativelayout a long time ago before i realized you could just use a linearlayout |
22:16.18 | jasta | i seem ot have used some strange combination of POSITION_TO_LEFT/RIGHT and ALIGN_WITH_PARENT_LEFT/RIGHT. |
22:16.37 | f00f- | hmm okay let me see |
22:16.52 | jasta | but i strongly recommend looking at a linearlayout and just nesting some other type of layout as necessary |
22:21.23 | dragor43 | yesterday i asked about sending data back to the calling activity without having to close the child activity... someone said to use setResult(), however that didn't work for me |
22:21.34 | jasta | then you didnt use it right |
22:21.49 | jasta | did you use startSubActivity? |
22:21.54 | dragor43 | yep |
22:22.10 | dragor43 | and in the sub activity I called setResult() and didn't call finish(); |
22:22.12 | jasta | actually i dont know that to be true tha setResult has any effect without finish |
22:22.19 | dragor43 | yeah... |
22:22.22 | dragor43 | it doesn't. |
22:22.26 | jasta | try calling finish() after setResult just to make sure that your setup is correct |
22:25.47 | dragor43 | yeah, when i call finish() it hits onActivityResult with the correct requestCode, data in the bundle etc. |
22:26.01 | jasta | then i don't know ;) |
22:26.06 | dragor43 | but calling setResult() without calling finish() doesn't do anything. |
22:26.07 | dragor43 | k |
22:26.11 | *** join/#android edcba (i=edcba@nor75-17-82-67-199-204.fbx.proxad.net) |
22:26.55 | dragor43 | so.. sorta related question |
22:28.32 | dragor43 | I'm going back in my code and thinking about the correct way of passing data from a child activity to the parent activity |
22:29.02 | dragor43 | Have you guys had success with using Parcelable to serialize the objects and send them back, or are you using Strings and primitive data types in the Bundle to pass back data? |
22:29.24 | jasta | the technical arrangement here doesn't suggest that finish() is necessary to communicate the data. perhaps there is just some API or approach being used that we don't know about? |
22:33.53 | dragor43 | yeah, my thought was that the Maps application is using some hack involving a handler and Runnable object in order to communicate between the two activities. |
22:34.21 | jasta | you know, they may have just sent an IBinder to the subactivity and communicate through that. |
22:34.40 | jasta | we know that IBinder references can be serialized and sent to even multiple processes for IPC. |
22:34.47 | *** join/#android chaosvoyager (n=Miranda@pool-72-80-180-212.nycmny.fios.verizon.net) |
22:34.56 | dragor43 | hmm |
22:35.58 | dragor43 | well, i know one hack you could do for sure is to have the view of the child activity be a custom view, and pass the runnable object/handler to that view in the constructor. |
22:36.14 | dragor43 | that way you can invoke the handler from within the child activity. very hacky way of doing it. |
22:45.23 | f00f- | i can't seem to get relative layouts to work properly without speciyfing a margin |
22:45.40 | f00f- | it's not using my layout_toLeft or layout_toRight etc. |
22:45.51 | f00f- | or alignRight |
22:46.02 | jasta | i used them and accomplished the effect you're looking for |
22:46.21 | f00f- | did you have to call measure() or those functions |
22:46.22 | jasta | but again, i strongly recommend using linearlayout with a weighted child for your outer layout to accomplish this effect. |
22:46.25 | f00f- | i'm doing this all in XML |
22:46.33 | jasta | f00f-: No, and I did it all in code. |
22:46.34 | f00f- | i need relativelayout for other things |
22:46.36 | f00f- | so i'm using it |
22:46.39 | jasta | You've got a losing strategy this way. |
22:46.47 | jasta | You can mix layouts. |
22:46.57 | f00f- | doing it in code is pretty bad |
22:47.06 | jasta | an outer linearlayout with an inner relativelayout or something |
22:47.13 | jasta | doing layouts in code is miserable. i don't recommend it ever. |
22:47.31 | jasta | just call ViewInflate.from(context).inflate() and save yourself the pain. |
22:47.32 | f00f- | yet you use it? |
22:47.42 | jasta | I *used* it, once, a long time ago before I knew better. |
22:47.53 | jasta | That code is in the public domain too if you really want to see it |
22:48.19 | f00f- | so i can't setContentView(R.layout.x) ? |
22:48.25 | jasta | sure you could. |
22:48.36 | f00f- | that's what i'm doing and it works, i'm just having trouble with the layout itself |
22:48.50 | jasta | but i did my relativelayout trick inside an extended relativelayout. i had eventually replaced that code with inflating a view from XML. |
22:49.20 | f00f- | ok, i guess it complicates it more that i'm using a cursor view adapter |
22:49.27 | jasta | not at all |
22:49.31 | f00f- | right |
22:49.36 | jasta | you're making this hard on yourself, trust me. |
22:50.04 | f00f- | ok how do i make an imageview to the left and textview to the right |
22:50.04 | jasta | the layout system in android is easily over-complicated. there's usually a simple way to do just about anything though. |
22:50.15 | f00f- | it seems like i need to specify a margin for it to work |
22:50.19 | jasta | how do you mean to the left and right? |
22:50.20 | f00f- | otherwise everything is 'bunched up' together |
22:50.29 | f00f- | <IMAGE> <TEXT...........> |
22:50.33 | f00f- | without specifying absolute margins |
22:50.40 | f00f- | assuming image is parentleft |
22:50.49 | davidw | hrm... anyone know how to make a tempdir in Java? |
22:50.51 | jasta | simple, <LinearLayout> <ImageView/> <TextView layout_weight="1"/> </LinearLayout> |
22:51.04 | f00f- | with a RelativeLayout ? |
22:51.10 | jasta | do it with a linearlayout. |
22:51.26 | jasta | like i said, you can combine layouts to your hearts content. |
22:51.30 | f00f- | why doesn't a RelativeLayout work? |
22:51.36 | jasta | it does, it's just harder to do this very simple thing. |
22:51.47 | f00f- | what's the secret? |
22:52.08 | jasta | there is no secret. alignWithParentLeft for the ImageView then POSITION_TO_LEFT for the textview |
22:52.39 | jasta | like i said, you're making this hard on yourself for no reason :) |
22:52.49 | jasta | i wouldn't use a relativelayout at all. i'd next a relativelayout some other way. |
22:53.15 | jasta | err, i'd embed* :) |
22:55.03 | f00f- | okay so i get the image to show up (it has alignparentleft) but when i add layout_toLeft="the-image" to the textView it doesn't show up |
22:55.12 | f00f- | the latter 'it' is the TextView |
22:55.15 | f00f- | i can only see the image now |
22:55.23 | jasta | maybe i meant toRight, i'm not sure, read the docs. |
22:55.56 | jasta | the view that i had originally constructed doing this was <IMG> <TEXT ......> <TEXT> |
22:55.59 | jasta | and it worked fine. |
22:56.09 | jasta | but it's totally stupid, because a linearlayout can do it simpler. |
23:02.25 | f00f- | ok with a LinearLayout it only appears to 'stretch' it out (with weight = 1) if the text is longer than its given area |
23:02.47 | jasta | not true. |
23:02.58 | jasta | what did you specify for layout_width? |
23:03.05 | f00f- | wrap_content |
23:03.09 | jasta | use 0px |
23:03.10 | f00f- | for the layout and all its children |
23:03.29 | f00f- | set to 0px for the LinearLayout or its children? |
23:03.35 | jasta | the layout itself should be layout_width="fill_parent" almost certainly |
23:03.39 | jasta | f00f-: the child that has weight=1 |
23:03.59 | jasta | can you just show me your entire layout at some pastebin somewhere? it sounds like you've got lots of problems. |
23:06.14 | *** join/#android illustir (n=alper@s55912056.adsl.wanadoo.nl) |
23:06.24 | *** join/#android ersi_ (n=ersi@81-237-203-165-no38.tbcn.telia.com) |
23:09.22 | f00f- | jasta: i think i got it working sort of... is there a way to make the 'squished' textview now 'scroll' itself automatically when it is selected? |
23:09.34 | f00f- | like left-right scrolling automatically.. |
23:11.41 | jasta | presumably, yes |
23:11.49 | jasta | i'll leave that as an exercise for you |
23:11.57 | jasta | i'm wrestling with onMeasure right now |
23:12.17 | f00f- | okay, i thought it was a ssimple as scrollHorizontally="true" but i'll dig more |
23:12.23 | f00f- | thanks |
23:15.14 | romainguy_ | what are you trying to do? |
23:17.25 | f00f- | who? |
23:17.30 | romainguy_ | you |
23:18.03 | f00f- | well i want a textview to scroll it's contents left-to-right when there is not enough room to fit the text, while still take up only one line |
23:18.30 | f00f- | like on many phones you see a list that has items |
23:18.41 | f00f- | some text doesn't fit so when you scroll to it, it scrolls |
23:18.46 | romainguy_ | singleLine="true" |
23:19.17 | romainguy_ | but obviously that works only with EditText |
23:19.22 | romainguy_ | a regular TextView doesn't get focus |
23:19.27 | romainguy_ | so you cannot scroll it |
23:19.34 | f00f- | ooh right |
23:19.44 | romainguy_ | you could try to set the TextView focusable |
23:19.51 | romainguy_ | I don't know if it will work though |
23:20.18 | f00f- | hmm, i'd still need to scrolling code though? |
23:20.22 | jasta | hmm, damn, my onMeasure implementation did not work :( |
23:20.24 | f00f- | or would it automatically scroll |
23:20.33 | romainguy_ | f00f-: it scrolls if the user makes it scroll |
23:20.34 | f00f- | well it's not a big deal either way |
23:20.37 | romainguy_ | if won't behave like a ticker |
23:20.38 | f00f- | ok |
23:20.41 | romainguy_ | use a ticker for that :) |
23:20.47 | f00f- | oh TICKER!!! |
23:20.47 | f00f- | lol |
23:20.48 | f00f- | thanks |
23:43.13 | jasta | romainguy_: my girlfriend *really* wants a skateboarding android t-shirt :P |
23:43.24 | romainguy_ | ^^ |
23:43.30 | jasta | i showed her hehe |
23:43.36 | jasta | are you guys giving them away at code days? |
23:43.42 | romainguy_ | I have no idea |
23:43.44 | romainguy_ | probably |
23:43.50 | jasta | boo, you should find out :) |
23:43.52 | romainguy_ | we got loads of tshirts, hoodies, stickers, etc. |
23:44.01 | romainguy_ | but I don't know if we give them away at code days |
23:44.16 | romainguy_ | there's even a Dalvik tshirt :p |
23:47.06 | chaosvoyager | Now that you mention it, what are the rights granted on the Android logo? Can someone use it royalty free on their own, say, mousepads, buttons, and ties? |
23:48.01 | romainguy_ | "Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License." |
23:48.04 | jasta | grr, this is so frustrating. now that i've overridden onMeasure the textviews don't center correctly. |
23:48.11 | romainguy_ | chaosvoyager: http://creativecommons.org/licenses/by/3.0/ |
23:50.13 | chaosvoyager | Excellent. Thanks. |
23:53.55 | *** join/#android Yeggstry (n=mind@cpc1-rdng14-0-0-cust946.winn.cable.ntl.com) |
23:58.39 | *** join/#android rch850 (n=rch850@c220090.ppp.asahi-net.or.jp) |