summaryrefslogtreecommitdiffstats
path: root/tests/DpiTest
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-04-27 18:52:56 -0400
committerDianne Hackborn <hackbod@google.com>2011-05-09 17:03:24 -0700
commite2515eebf42c763c0a2d9f873a153711778cfc17 (patch)
treeee159940f05c439d0524771bfbfe6b551c82c2d4 /tests/DpiTest
parent158e3582c03ab9e0221718da20fc8854bb9216d0 (diff)
downloadframeworks_base-e2515eebf42c763c0a2d9f873a153711778cfc17.zip
frameworks_base-e2515eebf42c763c0a2d9f873a153711778cfc17.tar.gz
frameworks_base-e2515eebf42c763c0a2d9f873a153711778cfc17.tar.bz2
Better compat mode part one: start scaling windows.
First step of improving app screen size compatibility mode. When running in compat mode, an application's windows are scaled up on the screen rather than being small with 1:1 pixels. Currently we scale the application to fill the entire screen, so don't use an even pixel scaling. Though this may have some negative impact on the appearance (it looks okay to me), it has a big benefit of allowing us to now treat these apps as normal full-screens apps and do the normal transition animations as you move in and out and around in them. This introduces fun stuff in the input system to take care of modifying pointer coordinates to account for the app window surface scaling. The input dispatcher is told about the scale that is being applied to each window and, when there is one, adjusts pointer events appropriately as they are being sent to the transport. Also modified is CompatibilityInfo, which has been greatly simplified to not be so insane and incomprehendible. It is now simple -- when constructed it determines if the given app is compatible with the current screen size and density, and that is that. There are new APIs on ActivityManagerService to put applications that we would traditionally consider compatible with larger screens in compatibility mode. This is the start of a facility to have a UI affordance for a user to switch apps in and out of compatibility. To test switching of modes, there is a new variation of the "am" command to do this: am screen-compat [on|off] [package] This mode switching has the fundamentals of restarting activities when it is changed, though the state still needs to be persisted and the overall mode switch cleaned up. For the few small apps I have tested, things mostly seem to be working well. I know of one problem with the text selection handles being drawn at the wrong position because at some point the window offset is being scaled incorrectly. There are probably other similar issues around the interaction between two windows because the different window coordinate spaces are done in a hacky way instead of being formally integrated into the window manager layout process. Change-Id: Ie038e3746b448135117bd860859d74e360938557
Diffstat (limited to 'tests/DpiTest')
-rw-r--r--tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java b/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java
index 6192a3c..2a40c57 100644
--- a/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java
+++ b/tests/DpiTest/src/com/google/android/test/dpi/DpiTestActivity.java
@@ -62,7 +62,8 @@ public class DpiTestActivity extends Activity {
| ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS
| ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS
| ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES;
- app.getResources().setCompatibilityInfo(new CompatibilityInfo(ai));
+ app.getResources().setCompatibilityInfo(new CompatibilityInfo(ai,
+ getResources().getConfiguration().screenLayout, false));
}
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException("ouch", e);