diff options
-rw-r--r-- | remoting/android/java/src/org/chromium/chromoting/Chromoting.java | 31 | ||||
-rw-r--r-- | remoting/resources/android/layout/account_selected.xml | 2 | ||||
-rw-r--r-- | remoting/resources/android/layout/main.xml | 17 |
3 files changed, 16 insertions, 34 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java index ebf826c..05523c7 100644 --- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java +++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java @@ -26,7 +26,6 @@ import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; -import android.widget.TextView; import android.widget.Toast; import org.chromium.chromoting.jni.JniInterface; @@ -70,18 +69,12 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe /** Refresh button. */ private MenuItem mRefreshButton; - /** Main view of this activity */ - private View mMainView; + /** Host list as it appears to the user. */ + private ListView mHostListView; - /** Progress view shown instead of the main view when the host list is loading. */ + /** Progress view shown instead of the host list when the host list is loading. */ private View mProgressView; - /** Greeting at the top of the displayed list. */ - private TextView mGreeting; - - /** Host list as it appears to the user. */ - private ListView mList; - /** Dialog for reporting connection progress. */ private ProgressDialog mProgressIndicator; @@ -128,7 +121,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe /** Shows or hides the progress indicator for loading the host list. */ private void setHostListProgressVisible(boolean visible) { - mMainView.setVisibility(visible ? View.GONE : View.VISIBLE); + mHostListView.setVisibility(visible ? View.GONE : View.VISIBLE); mProgressView.setVisibility(visible ? View.VISIBLE : View.GONE); } @@ -145,10 +138,9 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe mHostListLoader = new HostListLoader(); // Get ahold of our view widgets. - mMainView = findViewById(R.id.hostList_main); + mHostListView = (ListView)findViewById(R.id.hostList_chooser); + mHostListView.setEmptyView(findViewById(R.id.hostList_empty)); mProgressView = findViewById(R.id.hostList_progress); - mGreeting = (TextView)findViewById(R.id.hostList_greeting); - mList = (ListView)findViewById(R.id.hostList_chooser); // Bring native components online. JniInterface.loadLibrary(this); @@ -175,6 +167,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe if (mAccounts.length == 1) { getActionBar().setDisplayShowTitleEnabled(true); + getActionBar().setTitle(R.string.mode_me2me); getActionBar().setSubtitle(mAccount.name); } else { AccountsAdapter adapter = new AccountsAdapter(this, mAccounts); @@ -374,17 +367,9 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe private void updateUi() { mRefreshButton.setEnabled(mAccount != null); - if (mHosts.length == 0) { - mGreeting.setText(getString(R.string.host_list_empty_android)); - mList.setAdapter(null); - return; - } - - mGreeting.setText(getString(R.string.mode_me2me)); - ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, R.layout.host, mHosts); Log.i("hostlist", "About to populate host list display"); - mList.setAdapter(displayer); + mHostListView.setAdapter(displayer); } @Override diff --git a/remoting/resources/android/layout/account_selected.xml b/remoting/resources/android/layout/account_selected.xml index cbf523a..5eae097 100644 --- a/remoting/resources/android/layout/account_selected.xml +++ b/remoting/resources/android/layout/account_selected.xml @@ -15,7 +15,7 @@ android:layout_marginTop="@dimen/action_bar_title_top_margin" android:singleLine="true" android:ellipsize="end" - android:text="@string/product_name" + android:text="@string/mode_me2me" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/action_bar_title_text_size"/> <TextView android:id="@+id/account_name" diff --git a/remoting/resources/android/layout/main.xml b/remoting/resources/android/layout/main.xml index 25a958b..b3a6754 100644 --- a/remoting/resources/android/layout/main.xml +++ b/remoting/resources/android/layout/main.xml @@ -8,17 +8,14 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> - <LinearLayout android:id="@+id/hostList_main" - android:orientation="vertical" + <ListView android:id="@+id/hostList_chooser" android:layout_height="match_parent" - android:layout_width="match_parent"> - <TextView android:id="@+id/hostList_greeting" - android:layout_height="wrap_content" - android:layout_width="match_parent"/> - <ListView android:id="@+id/hostList_chooser" - android:layout_height="match_parent" - android:layout_width="match_parent"/> - </LinearLayout> + android:layout_width="match_parent"/> + <TextView android:id="@+id/hostList_empty" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:text="@string/host_list_empty_android" + android:visibility="gone"/> <ProgressBar android:id="@+id/hostList_progress" android:layout_height="wrap_content" android:layout_width="wrap_content" |