summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-05-07 23:03:20 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-05-08 08:28:38 +0200
commitdcc6b286ea58bca21fd6a85fde2bffa2cce8d564 (patch)
tree5fbcab0985906f3414edb6c3ee9e5e023bcd3b0d /android
parent1c5a8b5eafd67001875a0270459a1a9dd7b605d8 (diff)
android: Don't use res ID in switch-case (SearchController)
Addresses this Lint warning: > ../../src/java/org/libreoffice/SearchController.java:73: Resource IDs > will be non-final by default in Android Gradle Plugin version 8.0, avoid > using them in switch case statements There's no need to explicitly set `SearchDirection.DOWN` for `R.id.button_search_down` since it has previously been set as default value anyway. Change-Id: I283c00b97e1417f5dc3a48922238df7a29032137 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133998 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/SearchController.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/android/source/src/java/org/libreoffice/SearchController.java b/android/source/src/java/org/libreoffice/SearchController.java
index 8bdf42e8be8c..6095e1fd2afe 100644
--- a/android/source/src/java/org/libreoffice/SearchController.java
+++ b/android/source/src/java/org/libreoffice/SearchController.java
@@ -69,15 +69,8 @@ public class SearchController implements View.OnClickListener {
ImageButton button = (ImageButton) view;
SearchDirection direction = SearchDirection.DOWN;
- switch(button.getId()) {
- case R.id.button_search_down:
- direction = SearchDirection.DOWN;
- break;
- case R.id.button_search_up:
- direction = SearchDirection.UP;
- break;
- default:
- break;
+ if (button.getId() == R.id.button_search_up) {
+ direction = SearchDirection.UP;
}
String searchText = ((EditText) mActivity.findViewById(R.id.search_string)).getText().toString();