summaryrefslogtreecommitdiffstats
path: root/core/jni/android_util_AssetManager.cpp
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-03-30 16:20:26 -0700
committerDianne Hackborn <hackbod@google.com>2011-04-06 11:00:37 -0700
commit3fc982f41fda1f254bfbc35490d81cd82a0ed90a (patch)
tree6f9ba92dc2c9001a156f298c37dcdef9c9552600 /core/jni/android_util_AssetManager.cpp
parentfb84ce0df6b2db84981e4efa4530397a85240d4a (diff)
downloadframeworks_base-3fc982f41fda1f254bfbc35490d81cd82a0ed90a.zip
frameworks_base-3fc982f41fda1f254bfbc35490d81cd82a0ed90a.tar.gz
frameworks_base-3fc982f41fda1f254bfbc35490d81cd82a0ed90a.tar.bz2
Add new resource configurations for screen width/height in "dp".
You can now specify resource configuration variants "wNNNdp" and "hNNNdp". These are the minimum screen width/height in "dp" units. This allows you to do things like have your app adjust its layout based only on the about of horizontal space available. This introduces a new configuration change flag for screen size. Note that this configuration change happens each time the orientation changes. Applications often say they handle the orientation change to avoid being restarted at a screen rotation, and this will now cause them to be restarted. To address this, we assume the app can handle this new config change if its target SDK version is < ICS. Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
Diffstat (limited to 'core/jni/android_util_AssetManager.cpp')
-rw-r--r--core/jni/android_util_AssetManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index fdb7fda..65b5990 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -532,6 +532,7 @@ static void android_content_AssetManager_setConfiguration(JNIEnv* env, jobject c
jint keyboard, jint keyboardHidden,
jint navigation,
jint screenWidth, jint screenHeight,
+ jint screenWidthDp, jint screenHeightDp,
jint screenLayout, jint uiMode,
jint sdkVersion)
{
@@ -555,6 +556,8 @@ static void android_content_AssetManager_setConfiguration(JNIEnv* env, jobject c
config.navigation = (uint8_t)navigation;
config.screenWidth = (uint16_t)screenWidth;
config.screenHeight = (uint16_t)screenHeight;
+ config.screenWidthDp = (uint16_t)screenWidthDp;
+ config.screenHeightDp = (uint16_t)screenHeightDp;
config.screenLayout = (uint8_t)screenLayout;
config.uiMode = (uint8_t)uiMode;
config.sdkVersion = (uint16_t)sdkVersion;
@@ -1693,7 +1696,7 @@ static JNINativeMethod gAssetManagerMethods[] = {
(void*) android_content_AssetManager_setLocale },
{ "getLocales", "()[Ljava/lang/String;",
(void*) android_content_AssetManager_getLocales },
- { "setConfiguration", "(IILjava/lang/String;IIIIIIIIIII)V",
+ { "setConfiguration", "(IILjava/lang/String;IIIIIIIIIIIII)V",
(void*) android_content_AssetManager_setConfiguration },
{ "getResourceIdentifier","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I",
(void*) android_content_AssetManager_getResourceIdentifier },