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