diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2015-07-06 18:27:00 -0700 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2015-07-06 18:27:00 -0700 |
commit | 295ef6be084d1c2f22ef25a87e508c1f5c14ee5a (patch) | |
tree | 68126e176948deabb5b1c19901c176202033d9c0 | |
parent | d7b846c1814de34f2cea8507907f70618ec7cae0 (diff) | |
download | frameworks_base-295ef6be084d1c2f22ef25a87e508c1f5c14ee5a.zip frameworks_base-295ef6be084d1c2f22ef25a87e508c1f5c14ee5a.tar.gz frameworks_base-295ef6be084d1c2f22ef25a87e508c1f5c14ee5a.tar.bz2 |
Add roundess to configuration
Change-Id: Icc85b38dd091fc5aa13092d6abb06ac169f7b0b5
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java index de77d57..9380ca7 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java @@ -27,6 +27,7 @@ import com.android.layoutlib.bridge.android.BridgeContext; import com.android.resources.Density; import com.android.resources.ResourceType; import com.android.resources.ScreenOrientation; +import com.android.resources.ScreenRound; import com.android.resources.ScreenSize; import android.content.res.Configuration; @@ -378,6 +379,25 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso config.orientation = Configuration.ORIENTATION_UNDEFINED; } + try { + ScreenRound roundness = hardwareConfig.getScreenRoundness(); + if (roundness != null) { + switch (roundness) { + case ROUND: + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_YES; + break; + case NOTROUND: + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_NO; + } + } else { + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_UNDEFINED; + } + } catch (NoSuchMethodError ignored) { + // getScreenRoundness was added in later stages of API 15. So, it's not present on some + // preview releases of API 15. + // TODO: Remove the try catch around Oct 2015. + } + // TODO: fill in more config info. return config; |