summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorTobias Haamel <haamel@google.com>2010-02-09 23:09:17 +0100
committerTobias Haamel <haamel@google.com>2010-02-11 21:25:58 +0100
commit27b28b3f62bd3b54fa13acd5d035940b9be464f3 (patch)
treed1f44096f7071bbc53e5bc979117be8e0f4aa55c /tools/layoutlib
parentd5663a108760de672b130ffabd4f6632982f75e5 (diff)
downloadframeworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.zip
frameworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.tar.gz
frameworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.tar.bz2
Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of precedence for the resources now in such a way that the ui mode needs to be specified after the orientation and before the density. The ui mode can be set, like it is done for the locale, as follows: IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY; am.updateConfiguration(config); To allow users to disable the car mode and set the night mode the IUiModeManager interface is used. The automatic night mode switching will be added in a separate change.
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeAssetManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeAssetManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeAssetManager.java
index 6c1b5b3..43ff424 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeAssetManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeAssetManager.java
@@ -59,7 +59,7 @@ public class BridgeAssetManager extends AssetManager {
public void setConfiguration(int mcc, int mnc, String locale,
int orientation, int touchscreen, int density, int keyboard,
int keyboardHidden, int navigation, int screenWidth, int screenHeight,
- int screenLayout, int version) {
+ int screenLayout, int uiMode, int version) {
Configuration c = new Configuration();
c.mcc = mcc;
@@ -71,5 +71,6 @@ public class BridgeAssetManager extends AssetManager {
c.navigation = navigation;
c.orientation = orientation;
c.screenLayout = screenLayout;
+ c.uiMode = uiMode;
}
}