From dcc6b286ea58bca21fd6a85fde2bffa2cce8d564 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Sat, 7 May 2022 23:03:20 +0200 Subject: 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 --- android/source/src/java/org/libreoffice/SearchController.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'android') 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(); -- cgit