blob: 99e36cd88831c326895fdaf9a68be09f7ca7d7c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/*
********************************************************************************
* Copyright (c) 2012 Samsung Electronics, Inc.
* All rights reserved.
*
* This software is a confidential and proprietary information of Samsung
* Electronics, Inc. ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the terms
* of the license agreement you entered into with Samsung Electronics.
********************************************************************************
*/
package us.minak;
import java.util.LinkedList;
import java.util.Queue;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/**
* Represents the container for the drawing space and the two side panels.
*/
public class IMEView extends RelativeLayout {
private StringReciever mOnCharacterEnteredListener;
private final Queue<Character> mSymbolsQueue = new LinkedList<Character>();
public IMEView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onFinishInflate() {
IMEGestureOverlayView drawingSpaceView = (IMEGestureOverlayView) findViewById(R.id.drawing_space);
drawingSpaceView.setOnGestureRecognizedListener(new StringReciever() {
@Override
public void putString(String character) {
enterCharacter(character);
}
});
}
public void setOnCharacterEnteredListener(StringReciever onCharacterEnteredListener) {
mOnCharacterEnteredListener = onCharacterEnteredListener;
}
public Queue<Character> getSymbolsQueue() {
return mSymbolsQueue;
}
/**
* Passes the given character to the input service.
*
* @param character
* The character to enter
*/
private void enterCharacter(String character) {
mOnCharacterEnteredListener.putString(character);
}
}
|