Kaydet (Commit) 920370f7 authored tarafından Artur Dryomov's avatar Artur Dryomov

Add computer name as a subtitle to the connection activity.

Change-Id: I3df33faef2004107cd2a806e536efb63517a18c7
üst cfe24b09
...@@ -24,6 +24,7 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity { ...@@ -24,6 +24,7 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setUpHomeButton(); setUpHomeButton();
setUpTitle();
setUpFragment(); setUpFragment();
} }
...@@ -31,17 +32,23 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity { ...@@ -31,17 +32,23 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
} }
private void setUpFragment() { private void setUpTitle() {
Server aComputer = extractReceivedComputer(); String aComputerName = extractReceivedComputer().getName();
Fragment aFragment = ComputerConnectionFragment.newInstance(aComputer);
FragmentOperator.addFragment(this, aFragment); getSupportActionBar().setSubtitle(aComputerName);
} }
private Server extractReceivedComputer() { private Server extractReceivedComputer() {
return getIntent().getParcelableExtra(Intents.Extras.SERVER); return getIntent().getParcelableExtra(Intents.Extras.SERVER);
} }
private void setUpFragment() {
Server aComputer = extractReceivedComputer();
Fragment aFragment = ComputerConnectionFragment.newInstance(aComputer);
FragmentOperator.addFragment(this, aFragment);
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem aMenuItem) { public boolean onOptionsItemSelected(MenuItem aMenuItem) {
switch (aMenuItem.getItemId()) { switch (aMenuItem.getItemId()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment