Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Android Chromoting: Remove title and add navigation button to disconnect
Browse files Browse the repository at this point in the history
BUG=430328

Review URL: https://codereview.chromium.org/943103002

Cr-Commit-Position: refs/heads/master@{#317489}
(cherry picked from commit 01f8886)

Review URL: https://codereview.chromium.org/955843002

Cr-Commit-Position: refs/branch-heads/2311@{#22}
Cr-Branched-From: 09b7de5-refs/heads/master@{#317474}
  • Loading branch information
Lambros Lambrou committed Feb 24, 2015
1 parent f5e34b3 commit 30b5cac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions remoting/android/java/AndroidManifest.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
</activity>
<activity android:name="org.chromium.chromoting.Desktop"
android:configChanges="orientation|screenSize"
android:theme="@style/BaseTheme.Desktop"
android:windowSoftInputMode="adjustResize"/>
<activity android:name="org.chromium.chromoting.HelpActivity"
android:configChanges="orientation|screenSize"
Expand Down
7 changes: 7 additions & 0 deletions remoting/android/java/res/values-v17/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<item name="windowActionBar">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
<style name="BaseTheme.Desktop" parent="@style/BaseTheme">
<item name="actionBarStyle">@style/ActionBar.Desktop</item>
</style>

<style name="ActionBar.Desktop" parent="@style/Widget.AppCompat.ActionBar">
<item name="displayOptions">homeAsUp</item>
</style>

<style name="EmptyStateText" parent="@android:style/TextAppearance.Large">
<item name="android:textColor">#888</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public void onCreate(Bundle savedInstanceState) {
mOverlayButton = (ImageButton) findViewById(R.id.desktop_overlay_button);
mRemoteHostDesktop.setDesktop(this);

// Ensure the button is initially hidden.
// For this Activity, the home button in the action bar acts as a Disconnect button, so
// set the description for accessibility/screen readers.
getSupportActionBar().setHomeActionContentDescription(R.string.disconnect_myself_button);

// Ensure the overlay button is initially hidden.
showActionBar();

View decorView = getWindow().getDecorView();
Expand Down Expand Up @@ -193,7 +197,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
hideActionBar();
return true;
}
if (id == R.id.actionbar_disconnect) {
if (id == R.id.actionbar_disconnect || id == android.R.id.home) {
JniInterface.disconnectFromHost();
return true;
}
Expand Down

0 comments on commit 30b5cac

Please sign in to comment.