summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-05-06 16:18:47 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-05-07 18:09:48 -0700
commit3a115628236ee9051518d4f96840cbb76070cf92 (patch)
tree6edb1a4c8eeb067ca87ec77976e8e89daa63ee02 /tools/layoutlib
parent2d3fa7ba782238afb891db38e29ef7ec755bfdf6 (diff)
downloadframeworks_base-3a115628236ee9051518d4f96840cbb76070cf92.zip
frameworks_base-3a115628236ee9051518d4f96840cbb76070cf92.tar.gz
frameworks_base-3a115628236ee9051518d4f96840cbb76070cf92.tar.bz2
Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]
Return the right value for presence of software navigation bar in BridgeWindowManager. This is required to render the overflow menu button correctly in the Action Bar. Change-Id: I73de3b299f6a3a113425c436a59e800cd1d6b97f
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java12
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java2
2 files changed, 8 insertions, 6 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
index 8ab875f..6f41f90 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowManager.java
@@ -35,11 +35,6 @@ import android.view.IOnKeyguardExitResult;
import android.view.IRotationWatcher;
import android.view.IWindowManager;
import android.view.IWindowSession;
-import android.view.InputChannel;
-import android.view.InputDevice;
-import android.view.InputEvent;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
import java.util.List;
@@ -52,6 +47,7 @@ public class BridgeWindowManager implements IWindowManager {
private final Configuration mConfig;
private final DisplayMetrics mMetrics;
private final int mRotation;
+ private boolean mHasNavBar;
public BridgeWindowManager(Configuration config, DisplayMetrics metrics, int rotation) {
mConfig = config;
@@ -64,6 +60,10 @@ public class BridgeWindowManager implements IWindowManager {
public DisplayMetrics getMetrics() {
return mMetrics;
}
+
+ public void setHasNavBar(boolean hasNavBar) {
+ mHasNavBar = hasNavBar;
+ }
// ---- implementation of IWindowManager that we care about ----
@@ -448,7 +448,7 @@ public class BridgeWindowManager implements IWindowManager {
@Override
public boolean hasNavigationBar() {
- return false; // should this return something else?
+ return mHasNavBar;
}
@Override
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 03e7132..1d1c73f 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -182,6 +182,8 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
SessionParams params = getParams();
BridgeContext context = getContext();
+ context.getIWindowManager().setHasNavBar(params.getHardwareConfig().hasSoftwareButtons());
+
RenderResources resources = getParams().getResources();
DisplayMetrics metrics = getContext().getMetrics();