Strangely, this only happened on the Droid -- it didn't happen in the emulator. (One difference might be that the emulator was running Android 2.0.1 and the Droid was running 2.2.)
I isolated the offending code by the time-honored technique of shotgun debugging: removing everything from the program until the problem went away, then adding thing until I found the culprit. I had thrown away just about everything when I landed on this code in K9Activity.java.
public void onCreate(Bundle icicle, boolean useTheme)
// Gesture detection
gestureDetector = new GestureDetector(new MyGestureDetector());
Commenting out setLanguage fixed the problem. That was odd, I thought, what would i18n have to do with screen scaling? Here's setLanguage:
The last line is the key. It appears to retrieve a DisplayMetrics object from the context (whatever is subclassing K9Activity, in this case) and then passes it back to the context a second time. Somewhere in that reapplication, a scaling factor is getting applied iteratively, because each time a new actvitiy opens, onCreate gets invoked and the widgets get smaller.
public static void setLanguage(Context context, String language)
if (language == null || language.equals(""))
locale = Locale.getDefault();
else if (language.length() == 5 && language.charAt(2) == '_')
// language is in the form: en_US
locale = new Locale(language.substring(0, 2), language.substring(3));
locale = new Locale(language);
Configuration config = new Configuration();
config.locale = locale;
I don't know if this is a bug in the k9mail trunk or just an odd interaction with my phone---I'm using an older version of k9mail that I patched for my purposes and am disinclined to replace it just to test this.