Revert refactor setText() in ZimHostActivity

This commit is contained in:
Adeel Zafar 2019-08-12 18:09:06 +05:00
parent ebeff0abeb
commit eb109078c2

View File

@ -91,9 +91,10 @@ public class ZimHostActivity extends BaseActivity implements
setUpToolbar();
if (savedInstanceState != null) {
serverTextView.setText(R.string.server_started_message + " " + savedInstanceState.getString(
serverTextView.setText(
getString(R.string.server_started_message) + " " + savedInstanceState.getString(
IP_STATE_KEY));
startServerButton.setText(R.string.stop_server_label);
startServerButton.setText(getString(R.string.stop_server_label));
startServerButton.setBackgroundColor(getResources().getColor(R.color.stopServer));
}
@ -204,8 +205,8 @@ public class ZimHostActivity extends BaseActivity implements
if (isServerStarted) {
ip = getAddress();
ip = ip.replaceAll("\n", "");
serverTextView.setText(R.string.server_started_message + " " + ip);
startServerButton.setText(R.string.stop_server_label);
serverTextView.setText(getString(R.string.server_started_message) + " " + ip);
startServerButton.setText(getString(R.string.stop_server_label));
startServerButton.setBackgroundColor(getResources().getColor(R.color.stopServer));
}
}
@ -406,15 +407,15 @@ public class ZimHostActivity extends BaseActivity implements
@Override public void serverStarted(String ip) {
this.ip = ip;
serverTextView.setText(R.string.server_started_message + " " + this.ip);
startServerButton.setText(R.string.stop_server_label);
serverTextView.setText(getString(R.string.server_started_message) + " " + this.ip);
startServerButton.setText(getString(R.string.stop_server_label));
startServerButton.setBackgroundColor(getResources().getColor(R.color.stopServer));
isServerStarted = true;
}
@Override public void serverStopped() {
serverTextView.setText(R.string.server_textview_default_message);
startServerButton.setText(R.string.start_server_label);
serverTextView.setText(getString(R.string.server_textview_default_message));
startServerButton.setText(getString(R.string.start_server_label));
startServerButton.setBackgroundColor(getResources().getColor(R.color.greenTick));
isServerStarted = false;
}