summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authoraleksandar-stefanovic <theonewithideas@gmail.com>2017-01-12 17:59:01 +0100
committerjan iversen <jani@documentfoundation.org>2017-01-16 08:04:15 +0000
commit15c97b28aa058006a66a17b1305c16dc7480f8af (patch)
tree80d7efc119216d3c84e340d879b6d3f610e3a24f /android
parenta2945d837b7026f764ac5269c4d2453eb0862ee6 (diff)
Fixed typo in SearchController
Fixed typo in SearchController (SearchDriection -> SearchDirection) Also tightened up the code. Change-Id: Iedb6f95c9d8ed04cc166638250c2d565e92d79ff Reviewed-on: https://gerrit.libreoffice.org/33011 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/SearchController.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/android/source/src/java/org/libreoffice/SearchController.java b/android/source/src/java/org/libreoffice/SearchController.java
index 026a75327101..03a98d993340 100644
--- a/android/source/src/java/org/libreoffice/SearchController.java
+++ b/android/source/src/java/org/libreoffice/SearchController.java
@@ -7,26 +7,26 @@ import android.widget.ImageButton;
import org.json.JSONException;
import org.json.JSONObject;
-public class SearchController implements View.OnClickListener {
+class SearchController implements View.OnClickListener {
private LibreOfficeMainActivity mActivity;
- private enum SearchDriection {
+ private enum SearchDirection {
UP, DOWN
- };
+ }
- public SearchController(LibreOfficeMainActivity activity) {
+ SearchController(LibreOfficeMainActivity activity) {
mActivity = activity;
- ((ImageButton) activity.findViewById(R.id.button_search_up)).setOnClickListener(this);
- ((ImageButton) activity.findViewById(R.id.button_search_down)).setOnClickListener(this);
+ activity.findViewById(R.id.button_search_up).setOnClickListener(this);
+ activity.findViewById(R.id.button_search_down).setOnClickListener(this);
}
- private void search(String searchString, SearchDriection direction, float x, float y) {
+ private void search(String searchString, SearchDirection direction, float x, float y) {
try {
JSONObject rootJson = new JSONObject();
addProperty(rootJson, "SearchItem.SearchString", "string", searchString);
- addProperty(rootJson, "SearchItem.Backward", "boolean", direction == SearchDriection.DOWN ? "true" : "false");
+ addProperty(rootJson, "SearchItem.Backward", "boolean", direction == SearchDirection.DOWN ? "true" : "false");
addProperty(rootJson, "SearchItem.SearchStartPointX", "long", String.valueOf((long) UnitConverter.pixelToTwip(x, LOKitShell.getDpi())));
addProperty(rootJson, "SearchItem.SearchStartPointY", "long", String.valueOf((long) UnitConverter.pixelToTwip(y, LOKitShell.getDpi())));
addProperty(rootJson, "SearchItem.Command", "long", String.valueOf(0)); // search all == 1
@@ -49,13 +49,13 @@ public class SearchController implements View.OnClickListener {
public void onClick(View view) {
ImageButton button = (ImageButton) view;
- SearchDriection direction = SearchDriection.DOWN;
+ SearchDirection direction = SearchDirection.DOWN;
switch(button.getId()) {
case R.id.button_search_down:
- direction = SearchDriection.DOWN;
+ direction = SearchDirection.DOWN;
break;
case R.id.button_search_up:
- direction = SearchDriection.UP;
+ direction = SearchDirection.UP;
break;
default:
break;