Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/Desktop.java

Issue 655243004: Chromoting Android: Fix getActionBar() NullPointerException (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.content.res.Configuration; 8 import android.content.res.Configuration;
9 import android.os.Build; 9 import android.os.Build;
10 import android.os.Bundle; 10 import android.os.Bundle;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 private int getSystemUiFlags() { 135 private int getSystemUiFlags() {
136 int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE; 136 int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
137 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { 137 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
138 flags |= View.SYSTEM_UI_FLAG_FULLSCREEN; 138 flags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
139 } 139 }
140 return flags; 140 return flags;
141 } 141 }
142 142
143 public void showActionBar() { 143 public void showActionBar() {
144 mOverlayButton.setVisibility(View.INVISIBLE); 144 mOverlayButton.setVisibility(View.INVISIBLE);
145 getActionBar().show(); 145 getSupportActionBar().show();
146 146
147 View decorView = getWindow().getDecorView(); 147 View decorView = getWindow().getDecorView();
148 decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); 148 decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
149 } 149 }
150 150
151 @SuppressLint("InlinedApi") 151 @SuppressLint("InlinedApi")
152 public void hideActionBar() { 152 public void hideActionBar() {
153 mOverlayButton.setVisibility(View.VISIBLE); 153 mOverlayButton.setVisibility(View.VISIBLE);
154 getActionBar().hide(); 154 getSupportActionBar().hide();
155 155
156 View decorView = getWindow().getDecorView(); 156 View decorView = getWindow().getDecorView();
157 157
158 // LOW_PROFILE gives the status and navigation bars a "lights-out" appea rance. 158 // LOW_PROFILE gives the status and navigation bars a "lights-out" appea rance.
159 // FULLSCREEN hides the status bar on supported devices (4.1 and above). 159 // FULLSCREEN hides the status bar on supported devices (4.1 and above).
160 int flags = getSystemUiFlags(); 160 int flags = getSystemUiFlags();
161 161
162 // HIDE_NAVIGATION hides the navigation bar. However, if the user touche s the screen, the 162 // HIDE_NAVIGATION hides the navigation bar. However, if the user touche s the screen, the
163 // event is not seen by the application and instead the navigation bar i s re-shown. 163 // event is not seen by the application and instead the navigation bar i s re-shown.
164 // IMMERSIVE(_STICKY) fixes this problem and allows the user to interact with the app while 164 // IMMERSIVE(_STICKY) fixes this problem and allows the user to interact with the app while
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_SHIFT_LEFT, pressed); 284 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_SHIFT_LEFT, pressed);
285 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_EQUALS, pressed); 285 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_EQUALS, pressed);
286 return true; 286 return true;
287 287
288 default: 288 default:
289 // We try to send all other key codes to the host directly. 289 // We try to send all other key codes to the host directly.
290 return JniInterface.sendKeyEvent(keyCode, pressed); 290 return JniInterface.sendKeyEvent(keyCode, pressed);
291 } 291 }
292 } 292 }
293 } 293 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698