Refactoring: Optimize code
This commit is contained in:
@@ -112,7 +112,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
// event==null for on screen keyboard
|
||||
// filter for key up from physical keyboard
|
||||
if (event == null || event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
onSearch(null);
|
||||
onSearch();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -288,15 +288,15 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public void onConfigurationHintClicked(View view) {
|
||||
public void onConfigurationHintClicked() {
|
||||
showSettingsDialog();
|
||||
}
|
||||
|
||||
public void onSynchronizeHintClicked(View view) {
|
||||
public void onSynchronizeHintClicked() {
|
||||
synchronizeWithServer();
|
||||
}
|
||||
|
||||
public void onSearch(View view) {
|
||||
public void onSearch() {
|
||||
EditText searchInput = findViewById(R.id.search_input);
|
||||
String query = searchInput.getText().toString();
|
||||
query = query.trim();
|
||||
@@ -316,7 +316,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
String url = getWikiserverSearchUrl(query);
|
||||
loadUrl(url);
|
||||
|
||||
// The wait dialoge is closed by closeProgressDialog() after the search result is shown
|
||||
// The wait dialog is closed by closeProgressDialog() after the search result is shown
|
||||
}
|
||||
|
||||
private void showSettingsDialog() {
|
||||
|
||||
Reference in New Issue
Block a user