| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| 11 import android.os.Bundle; | 11 import android.os.Bundle; |
| 12 import android.view.KeyEvent; | 12 import android.view.KeyEvent; |
| 13 import android.view.Menu; | 13 import android.view.Menu; |
| 14 import android.view.MenuItem; | 14 import android.view.MenuItem; |
| 15 import android.view.View; | 15 import android.view.View; |
| 16 import android.view.inputmethod.InputMethodManager; | 16 import android.view.inputmethod.InputMethodManager; |
| 17 import android.widget.ImageButton; | 17 import android.widget.ImageButton; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // set) when the user swipes the edge to reveal the bars temporarily. Wh
en this happens, | 81 // set) when the user swipes the edge to reveal the bars temporarily. Wh
en this happens, |
| 82 // the action-bar should remain hidden. | 82 // the action-bar should remain hidden. |
| 83 int fullscreenFlags = getSystemUiFlags(); | 83 int fullscreenFlags = getSystemUiFlags(); |
| 84 if ((visibility & fullscreenFlags) != 0) { | 84 if ((visibility & fullscreenFlags) != 0) { |
| 85 hideActionBar(); | 85 hideActionBar(); |
| 86 } else { | 86 } else { |
| 87 showActionBar(); | 87 showActionBar(); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 @TargetApi(Build.VERSION_CODES.JELLY_BEAN) | 91 @SuppressLint("InlinedApi") |
| 92 private int getSystemUiFlags() { | 92 private int getSystemUiFlags() { |
| 93 int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE; | 93 int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE; |
| 94 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | 94 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { |
| 95 flags |= View.SYSTEM_UI_FLAG_FULLSCREEN; | 95 flags |= View.SYSTEM_UI_FLAG_FULLSCREEN; |
| 96 } | 96 } |
| 97 return flags; | 97 return flags; |
| 98 } | 98 } |
| 99 | 99 |
| 100 public void showActionBar() { | 100 public void showActionBar() { |
| 101 mOverlayButton.setVisibility(View.INVISIBLE); | 101 mOverlayButton.setVisibility(View.INVISIBLE); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 break; | 216 break; |
| 217 | 217 |
| 218 default: | 218 default: |
| 219 // We try to send all other key codes to the host directly. | 219 // We try to send all other key codes to the host directly. |
| 220 JniInterface.sendKeyEvent(event.getKeyCode(), depressed); | 220 JniInterface.sendKeyEvent(event.getKeyCode(), depressed); |
| 221 } | 221 } |
| 222 | 222 |
| 223 return super.dispatchKeyEvent(event); | 223 return super.dispatchKeyEvent(event); |
| 224 } | 224 } |
| 225 } | 225 } |
| OLD | NEW |