Skip to content

Commit

Permalink
tweak how tor version number is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Oct 18, 2022
1 parent 0870b04 commit 314fea4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private void doLayout() {

lblStatus = findViewById(R.id.lblStatus);
lblStatus.setOnClickListener(v -> mDrawer.openDrawer(GravityCompat.END));
lblStatus.setText(String.format("Tor v%s", OrbotService.BINARY_TOR_VERSION));
lblStatus.setText(String.format("Tor v%s", getTorVersion()));

lblPorts = findViewById(R.id.lblPorts);

Expand Down Expand Up @@ -356,6 +356,9 @@ private void doLayout() {
findViewById(R.id.ivAppVpnSettings).setOnClickListener(v -> startActivityForResult(new Intent(OrbotMainActivity.this, AppManagerActivity.class), REQUEST_VPN_APPS_SELECT));
}

private String getTorVersion () {
return OrbotService.BINARY_TOR_VERSION.split("-")[0];
}
private void resetBandwidthStatTextviews() {
String zero = String.format("%s / %s", OrbotService.formatBandwidthCount(this, 0), formatTotal(0));
downloadText.setText(zero);
Expand Down Expand Up @@ -800,7 +803,7 @@ private void updateStatus(String torServiceMsg, String newTorStatus) {
break;

case STATUS_OFF:
lblStatus.setText(String.format("Tor v%s", OrbotService.BINARY_TOR_VERSION));
lblStatus.setText(String.format("Tor v%s", getTorVersion()));
imgStatus.setImageResource(R.drawable.toroff);
lblPorts.setText("");
mBtnStart.setText(R.string.menu_start);
Expand Down

0 comments on commit 314fea4

Please sign in to comment.