1package org.libreoffice;
3import android.view.KeyEvent;
4import android.view.View;
5import android.view.inputmethod.EditorInfo;
6import android.widget.EditText;
7import android.widget.ImageButton;
8import android.widget.TextView;
10import org.json.JSONException;
11import org.json.JSONObject;
23 activity.findViewById(
R.id.button_search_up).setOnClickListener(
this);
24 activity.findViewById(
R.id.button_search_down).setOnClickListener(
this);
26 ((EditText)
mActivity.findViewById(
R.id.search_string)).setOnEditorActionListener(
new TextView.OnEditorActionListener() {
28 public boolean onEditorAction(TextView
v,
int actionId, KeyEvent event) {
29 if (actionId == EditorInfo.IME_ACTION_SEARCH) {
32 String searchText = ((EditText)
mActivity.findViewById(
R.id.search_string)).getText().toString();
45 JSONObject rootJson =
new JSONObject();
47 addProperty(rootJson,
"SearchItem.SearchString",
"string", searchString);
55 }
catch (JSONException e) {
60 public static void addProperty(JSONObject json, String parentValue, String type, String value)
throws JSONException {
61 JSONObject child =
new JSONObject();
62 child.put(
"type",
type);
63 child.put(
"value",
value);
64 json.put(parentValue, child);
69 ImageButton button = (ImageButton) view;
72 if (button.getId() ==
R.id.button_search_up) {
76 String searchText = ((EditText)
mActivity.findViewById(
R.id.search_string)).getText().toString();
Events and data that is queued and processed by LOKitThread.
static final int UNO_COMMAND
Common static LOKit functions, functions to send events.
static void sendEvent(LOEvent event)
Make sure LOKitThread is running and send event to it.
static float getDpi(Context context)
Main activity of the LibreOffice App.
RectF getCurrentCursorPosition()
void search(String searchString, SearchDirection direction, float x, float y)
static void addProperty(JSONObject json, String parentValue, String type, String value)
final LibreOfficeMainActivity mActivity
static float pixelToTwip(float input, float dpi)