blob: 06bdfc41b96b19d1ac3a8dd06d740ebe94e7cc0b (
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.inputmethod.keyboard.internal;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.MoreKeysPanel;
import com.android.inputmethod.keyboard.PointerTracker;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface DrawingProxy {
/**
* Called when a key is being pressed.
* @param key the {@link Key} that is being pressed.
* @param withPreview true if key popup preview should be displayed.
*/
public void onKeyPressed(@Nonnull Key key, boolean withPreview);
/**
* Called when a key is being released.
* @param key the {@link Key} that is being released.
* @param withAnimation when true, key popup preview should be dismissed with animation.
*/
public void onKeyReleased(@Nonnull Key key, boolean withAnimation);
/**
* Start showing more keys keyboard of a key that is being long pressed.
* @param key the {@link Key} that is being long pressed and showing more keys keyboard.
* @param tracker the {@link PointerTracker} that detects this long pressing.
* @return {@link MoreKeysPanel} that is being shown. null if there is no need to show more keys
* keyboard.
*/
@Nullable
public MoreKeysPanel showMoreKeysKeyboard(@Nonnull Key key, @Nonnull PointerTracker tracker);
/**
* Start a while-typing-animation.
* @param fadeInOrOut {@link #FADE_IN} starts while-typing-fade-in animation.
* {@link #FADE_OUT} starts while-typing-fade-out animation.
*/
public void startWhileTypingAnimation(int fadeInOrOut);
public static final int FADE_IN = 0;
public static final int FADE_OUT = 1;
/**
* Show sliding-key input preview.
* @param tracker the {@link PointerTracker} that is currently doing the sliding-key input.
* null to dismiss the sliding-key input preview.
*/
public void showSlidingKeyInputPreview(@Nullable PointerTracker tracker);
/**
* Show gesture trails.
* @param tracker the {@link PointerTracker} whose gesture trail will be shown.
* @param showsFloatingPreviewText when true, a gesture floating preview text will be shown
* with this <code>tracker</code>'s trail.
*/
public void showGestureTrail(@Nonnull PointerTracker tracker, boolean showsFloatingPreviewText);
/**
* Dismiss a gesture floating preview text without delay.
*/
public void dismissGestureFloatingPreviewTextWithoutDelay();
}
|