Skip to content

Commit

Permalink
FloatingJapaneseDictionaryService - add mode CLEAR_TEXT
Browse files Browse the repository at this point in the history
Right now CLEAR_TEXT does nothing as the display
is cleared before processing the received data.
  • Loading branch information
ispedals committed Nov 13, 2013
1 parent 2783ee7 commit d3b783f
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
public class FloatingJapaneseDictionaryService extends StandOutWindow {

public static final int DISPLAY_TEXT = 0, DISPLAY_DEFINITION = 1,
DISPLAY_SEARCH = 2;
DISPLAY_SEARCH = 2, CLEAR_TEXT = 3;
public static final String SUBMITTED = "SUBMITTED";

private static final String APP_NAME = "Floating Japanese Dictionary";
Expand Down Expand Up @@ -291,9 +291,18 @@ public void onReceiveData(int id, int requestCode, Bundle data,
break;
case DISPLAY_SEARCH:
displaySearch(window, data.getString("TEXT"));
break;
case DISPLAY_TEXT:
default:
displayText(window, data.getString("TEXT"));
break;
/*
* Right now we clear the window before processing the data. so
* instead of updating the UI twice, just do nothing. This should
* change if we do not clear the window at the beginning.
*/
case CLEAR_TEXT:
default:
// clearText(window);
}

}
Expand Down

0 comments on commit d3b783f

Please sign in to comment.