diff options
| author | Felix Bechstein <f@ub0r.de> | 2017-07-25 15:23:50 +0200 |
|---|---|---|
| committer | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2017-07-25 14:23:50 +0100 |
| commit | 5da9e67545644925902b04a11306289add29c033 (patch) | |
| tree | de8ec31c4fe216157b7680a4defdee86429a4122 /app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java | |
| parent | 5cba6c62d7b4628dfaf482dd883e333f93d323d4 (diff) | |
| download | HardenedPass-5da9e67545644925902b04a11306289add29c033.tar.gz HardenedPass-5da9e67545644925902b04a11306289add29c033.zip | |
Fix lint warnings (#319)
* Fix lint errors/warnings
Fix a lot of lint errors and warnings.
Most things are automatically applied fixes done with android studio:
* externalize strings
* remove unused code / classes / layouts / imports
* migrate some fields to local variables
* Remove dead code from comments
Removed code that is commented out long ago.
* remove unused resources
* colors
* strings
* drawables
* layouts
* menus
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index 66e308b9..6314a4b3 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -32,8 +32,6 @@ import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; -// TODO move the messages to strings.xml - public class GitActivity extends AppCompatActivity { private static final String TAG = "GitAct"; private static final String emailPattern = "^[^@]+@[^@]+$"; @@ -46,7 +44,6 @@ public class GitActivity extends AppCompatActivity { private File localDir; private String hostname; - private String port; private SharedPreferences settings; @@ -158,13 +155,6 @@ public class GitActivity extends AppCompatActivity { final EditText server_user = ((EditText) findViewById(R.id.server_user)); final EditText server_uri = ((EditText) findViewById(R.id.clone_uri)); - View.OnFocusChangeListener updateListener = new View.OnFocusChangeListener() { - @Override - public void onFocusChange(View view, boolean b) { - updateURI(); - } - }; - server_url.setText(settings.getString("git_remote_server", "")); server_port.setText(settings.getString("git_remote_port", "")); server_user.setText(settings.getString("git_remote_username", "")); @@ -307,7 +297,7 @@ public class GitActivity extends AppCompatActivity { if (server_port.getText().toString().equals("22")) { hostname += server_path.getText().toString(); - ((TextView) findViewById(R.id.warn_url)).setVisibility(View.GONE); + findViewById(R.id.warn_url).setVisibility(View.GONE); } else { TextView warn_url = (TextView) findViewById(R.id.warn_url); if (!server_path.getText().toString().matches("/.*") && !server_port.getText().toString().isEmpty()) { @@ -329,7 +319,7 @@ public class GitActivity extends AppCompatActivity { if (server_port.getText().toString().equals("443")) { hostname.append(server_path.getText().toString()); - ((TextView) findViewById(R.id.warn_url)).setVisibility(View.GONE); + findViewById(R.id.warn_url).setVisibility(View.GONE); } else { hostname.append("/"); hostname.append(server_port.getText().toString()) @@ -417,6 +407,7 @@ public class GitActivity extends AppCompatActivity { /** * Saves the configuration found in the form */ + @SuppressWarnings("BooleanMethodIsAlwaysInverted") private boolean saveConfiguration() { // remember the settings SharedPreferences.Editor editor = settings.edit(); @@ -432,7 +423,7 @@ public class GitActivity extends AppCompatActivity { // 'save' hostname variable for use by addRemote() either here or later // in syncRepository() hostname = ((EditText) findViewById(R.id.clone_uri)).getText().toString(); - port = ((EditText) findViewById(R.id.server_port)).getText().toString(); + String port = ((EditText) findViewById(R.id.server_port)).getText().toString(); // don't ask the user, take off the protocol that he puts in hostname = hostname.replaceFirst("^.+://", ""); ((TextView) findViewById(R.id.clone_uri)).setText(hostname); |
