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.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.ProgressDialog; | 8 import android.app.ProgressDialog; |
9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 }); | 186 }); |
187 | 187 |
188 NavigationMenuItem creditsItem = new NavigationMenuItem(R.menu.credits_l
ist_item, | 188 NavigationMenuItem creditsItem = new NavigationMenuItem(R.menu.credits_l
ist_item, |
189 new Runnable() { | 189 new Runnable() { |
190 @Override | 190 @Override |
191 public void run() { | 191 public void run() { |
192 startActivity(new Intent(Chromoting.this, CreditsActivit
y.class)); | 192 startActivity(new Intent(Chromoting.this, CreditsActivit
y.class)); |
193 } | 193 } |
194 }); | 194 }); |
195 | 195 |
196 NavigationMenuItem[] navigationMenuItems = { helpItem, creditsItem }; | 196 NavigationMenuItem openglItem = new NavigationMenuItem(R.menu.toggle_ope
ngl_list_item, |
| 197 new Runnable() { |
| 198 boolean mOpenglOn = true; |
| 199 final Toast mToast = Toast.makeText(Chromoting.this, "", Toa
st.LENGTH_SHORT); |
| 200 @Override |
| 201 public void run() { |
| 202 mOpenglOn = !mOpenglOn; |
| 203 JniInterface.useOpenGlRenderer(mOpenglOn); |
| 204 mToast.setText("Using OpenGL rendering: " + mOpenglOn); |
| 205 mToast.show(); |
| 206 } |
| 207 }); |
| 208 |
| 209 NavigationMenuItem[] navigationMenuItems = { helpItem, creditsItem, open
glItem }; |
197 NavigationMenuAdapter adapter = new NavigationMenuAdapter(this, navigati
onMenuItems); | 210 NavigationMenuAdapter adapter = new NavigationMenuAdapter(this, navigati
onMenuItems); |
198 navigationMenu.setAdapter(adapter); | 211 navigationMenu.setAdapter(adapter); |
199 navigationMenu.setOnItemClickListener(adapter); | 212 navigationMenu.setOnItemClickListener(adapter); |
200 return navigationMenu; | 213 return navigationMenu; |
201 } | 214 } |
202 | 215 |
203 /** | 216 /** |
204 * Called when the activity is first created. Loads the native library and r
equests an | 217 * Called when the activity is first created. Loads the native library and r
equests an |
205 * authentication token from the system. | 218 * authentication token from the system. |
206 */ | 219 */ |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 // Unreachable, but required by Google Java style and findbugs. | 721 // Unreachable, but required by Google Java style and findbugs. |
709 assert false : "Unreached"; | 722 assert false : "Unreached"; |
710 } | 723 } |
711 | 724 |
712 if (dismissProgress && mProgressIndicator != null) { | 725 if (dismissProgress && mProgressIndicator != null) { |
713 mProgressIndicator.dismiss(); | 726 mProgressIndicator.dismiss(); |
714 mProgressIndicator = null; | 727 mProgressIndicator = null; |
715 } | 728 } |
716 } | 729 } |
717 } | 730 } |
OLD | NEW |