| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 long id) { | 237 long id) { |
| 238 onHostClicked(position); | 238 onHostClicked(position); |
| 239 } | 239 } |
| 240 }); | 240 }); |
| 241 | 241 |
| 242 mProgressView = findViewById(R.id.hostList_progress); | 242 mProgressView = findViewById(R.id.hostList_progress); |
| 243 | 243 |
| 244 findViewById(R.id.host_setup_link_android).setOnClickListener(this); | 244 findViewById(R.id.host_setup_link_android).setOnClickListener(this); |
| 245 | 245 |
| 246 mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); | 246 mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); |
| 247 mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, | 247 mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar,
0, 0) { |
| 248 R.string.open_navigation_drawer, R.string.close_navigation_drawe
r) { | |
| 249 @Override | 248 @Override |
| 250 public void onDrawerClosed(View drawerView) { | 249 public void onDrawerClosed(View drawerView) { |
| 251 super.onDrawerClosed(drawerView); | 250 super.onDrawerClosed(drawerView); |
| 252 runPendingDrawerCloseTask(); | 251 runPendingDrawerCloseTask(); |
| 253 } | 252 } |
| 254 }; | 253 }; |
| 255 mDrawerLayout.addDrawerListener(mDrawerToggle); | 254 mDrawerLayout.addDrawerListener(mDrawerToggle); |
| 256 | 255 |
| 257 // Disable the hamburger icon animation. This is more complex than it ou
ght to be. | 256 // Disable the hamburger icon animation. This is more complex than it ou
ght to be. |
| 258 // The animation can be customized by tweaking some style parameters - s
ee | 257 // The animation can be customized by tweaking some style parameters - s
ee |
| (...skipping 21 matching lines...) Expand all Loading... |
| 280 } | 279 } |
| 281 } | 280 } |
| 282 }); | 281 }); |
| 283 | 282 |
| 284 // Set the three-line icon instead of the default which is a tinted arro
w icon. | 283 // Set the three-line icon instead of the default which is a tinted arro
w icon. |
| 285 getSupportActionBar().setDisplayHomeAsUpEnabled(true); | 284 getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
| 286 Drawable menuIcon = ContextCompat.getDrawable(this, R.drawable.ic_menu); | 285 Drawable menuIcon = ContextCompat.getDrawable(this, R.drawable.ic_menu); |
| 287 DrawableCompat.setTint(menuIcon.mutate(), | 286 DrawableCompat.setTint(menuIcon.mutate(), |
| 288 ChromotingUtil.getColorAttribute(this, R.attr.colorControlNormal
)); | 287 ChromotingUtil.getColorAttribute(this, R.attr.colorControlNormal
)); |
| 289 getSupportActionBar().setHomeAsUpIndicator(menuIcon); | 288 getSupportActionBar().setHomeAsUpIndicator(menuIcon); |
| 289 getSupportActionBar().setHomeActionContentDescription(R.string.actionbar
_menu); |
| 290 | 290 |
| 291 mAccountSwitcher = AccountSwitcherFactory.getInstance().createAccountSwi
tcher(this, this); | 291 mAccountSwitcher = AccountSwitcherFactory.getInstance().createAccountSwi
tcher(this, this); |
| 292 mAccountSwitcher.setNavigation(NavigationMenuAdapter.createNavigationMen
u(this)); | 292 mAccountSwitcher.setNavigation(NavigationMenuAdapter.createNavigationMen
u(this)); |
| 293 LinearLayout navigationDrawer = (LinearLayout) findViewById(R.id.navigat
ion_drawer); | 293 LinearLayout navigationDrawer = (LinearLayout) findViewById(R.id.navigat
ion_drawer); |
| 294 mAccountSwitcher.setDrawer(navigationDrawer); | 294 mAccountSwitcher.setDrawer(navigationDrawer); |
| 295 View switcherView = mAccountSwitcher.getView(); | 295 View switcherView = mAccountSwitcher.getView(); |
| 296 switcherView.setLayoutParams(new LinearLayout.LayoutParams( | 296 switcherView.setLayoutParams(new LinearLayout.LayoutParams( |
| 297 LinearLayout.LayoutParams.MATCH_PARENT, | 297 LinearLayout.LayoutParams.MATCH_PARENT, |
| 298 LinearLayout.LayoutParams.WRAP_CONTENT)); | 298 LinearLayout.LayoutParams.WRAP_CONTENT)); |
| 299 navigationDrawer.addView(switcherView, 0); | 299 navigationDrawer.addView(switcherView, 0); |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 // Unreachable, but required by Google Java style and findbugs. | 730 // Unreachable, but required by Google Java style and findbugs. |
| 731 assert false : "Unreached"; | 731 assert false : "Unreached"; |
| 732 } | 732 } |
| 733 | 733 |
| 734 if (dismissProgress && mProgressIndicator != null) { | 734 if (dismissProgress && mProgressIndicator != null) { |
| 735 mProgressIndicator.dismiss(); | 735 mProgressIndicator.dismiss(); |
| 736 mProgressIndicator = null; | 736 mProgressIndicator = null; |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 } | 739 } |
| OLD | NEW |