summaryrefslogtreecommitdiffstats
path: root/remoting/android
diff options
context:
space:
mode:
authorlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-26 05:22:05 +0000
committerlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-26 05:22:05 +0000
commit522a5bb8e2e22bb226f6c882839c37324e7c76d2 (patch)
treea47f275bdd4a476e3b423ca81d70f87cd26a0da9 /remoting/android
parent53ff96387648c419d79e139dc622d83c79c26458 (diff)
downloadchromium_src-522a5bb8e2e22bb226f6c882839c37324e7c76d2.zip
chromium_src-522a5bb8e2e22bb226f6c882839c37324e7c76d2.tar.gz
chromium_src-522a5bb8e2e22bb226f6c882839c37324e7c76d2.tar.bz2
Add empty host-list screen to Android Chromoting app
This shows a nicer-looking screen with an icon, some text, and some hyperlink text. The hyperlink opens the Help activity with a web-site that helps the user set up their hosts for remote access. NOTRY=true Review URL: https://codereview.chromium.org/210223008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259510 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/android')
-rw-r--r--remoting/android/java/src/org/chromium/chromoting/Chromoting.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
index 05523c7..8727d95 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -38,8 +38,8 @@ import java.util.Arrays;
* also requests and renews authentication tokens using the system account manager.
*/
public class Chromoting extends Activity implements JniInterface.ConnectionListener,
- AccountManagerCallback<Bundle>, ActionBar.OnNavigationListener,
- HostListLoader.Callback {
+ AccountManagerCallback<Bundle>, ActionBar.OnNavigationListener, HostListLoader.Callback,
+ View.OnClickListener {
/** Only accounts of this type will be selectable for authentication. */
private static final String ACCOUNT_TYPE = "com.google";
@@ -51,6 +51,10 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
private static final String HELP_URL =
"http://support.google.com/chrome/?p=mobile_crd_hostslist";
+ /** Web page to be displayed when user triggers the hyperlink for setting up hosts. */
+ private static final String HOST_SETUP_URL =
+ "https://support.google.com/chrome/answer/1649523";
+
/** User's account details. */
private Account mAccount;
@@ -123,6 +127,11 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
private void setHostListProgressVisible(boolean visible) {
mHostListView.setVisibility(visible ? View.GONE : View.VISIBLE);
mProgressView.setVisibility(visible ? View.VISIBLE : View.GONE);
+
+ // Hiding the host-list does not automatically hide the empty view, so do that here.
+ if (visible) {
+ mHostListView.getEmptyView().setVisibility(View.GONE);
+ }
}
/**
@@ -142,6 +151,8 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
mHostListView.setEmptyView(findViewById(R.id.hostList_empty));
mProgressView = findViewById(R.id.hostList_progress);
+ findViewById(R.id.host_setup_link_android).setOnClickListener(this);
+
// Bring native components online.
JniInterface.loadLibrary(this);
@@ -230,6 +241,12 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
}
}
+ /** Called when the user touches hyperlinked text. */
+ @Override
+ public void onClick(View view) {
+ HelpActivity.launch(this, HOST_SETUP_URL);
+ }
+
/** Called when the user taps on a host entry. */
public void connectToHost(HostInfo host) {
mProgressIndicator = ProgressDialog.show(this,