January 2018

S M T W T F S
  123456
78910111213
14151617181920
21222324252627
28293031   

Style Credit

Expand Cut Tags

No cut tags
Tuesday, November 2nd, 2010 02:25 pm
Today's hack is up. It's to the flashlight app again; now the UI stays in portrait orientation no matter how you rotate the phone. This prevents the pause/resume/create cycle that was killing my Activity and causing the light to go out. Most of yesterday's code is no longer needed and has been taken out again, but that's a good thing, right? :-)

Sideload the app (if you care - HTC Sense has such a thing built-in) from here.

Anyway, the way you do this is by adding the attribute android:screenOrientation="portrait" to the activity element in your manifest. This tip came from this StackOverflow post: I tried the more complicated "add a configChanges attribute and override onConfigurationChanged" approach described there, but that resulted in the LED wedging in whatever state it was in when you rotated the phone and not accepting any further changes. God knows what was going on there.

By the way, does anyone use git add -p much? I tried the "edit this hunk" feature a couple of times, but it told me that it my patch wouldn't apply cleanly, and then rejected the whole thing. Also, I'm having trouble uploading files to GitHub's "download" section.

Edit: and I've had a documentation patch accepted into Idris. Go me!
Tuesday, November 2nd, 2010 04:37 pm (UTC)
The terminology thing got me, as did the whole "different philosophy" thing. Particularly as I'd got my head round distributed repos, and had nowhere to put a central repo, so kept forgetting which one of my repos I was designating as the "central" one...

The project was/is huge, in terms of total file size - I can't remember how huge, and I can't check it atm, due to job move chaos. But basically, it was too big for darcs, and I hit some sort of out-of-memory or infinite loop issue. That's why I went for git - my project was huge but not as huge as Linux ;)
Tuesday, November 2nd, 2010 04:51 pm (UTC)
Particularly as I'd got my head round distributed repos, and had nowhere to put a central repo, so kept forgetting which one of my repos I was designating as the "central" one...

What you need to do here is set the origin remote up so that git remembers the central repo for you. See here (http://help.github.com/creating-a-repo/) and here (http://help.github.com/remotes/).

I think that git probably has equal ability to handle distributed repos, but darcs certainly makes it easier.