Create com.android.inputmethod.keyboard.emoji package

Change-Id: Idd12c2fa4f5add7bb50bd7349ff9a74fffe82cfd
This commit is contained in:
Tadashi G. Takaoka 2014-05-14 19:32:00 +09:00
parent 71f4c6b8ea
commit 9f4d62cc42
10 changed files with 24 additions and 31 deletions

View file

@ -18,7 +18,7 @@
*/ */
--> -->
<com.android.inputmethod.keyboard.internal.EmojiPageKeyboardView <com.android.inputmethod.keyboard.emoji.EmojiPageKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/emoji_keyboard_page" android:id="@+id/emoji_keyboard_page"
android:layoutDirection="ltr" android:layoutDirection="ltr"

View file

@ -18,7 +18,7 @@
*/ */
--> -->
<com.android.inputmethod.keyboard.EmojiPalettesView <com.android.inputmethod.keyboard.emoji.EmojiPalettesView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/emoji_keyboard_view" android:id="@+id/emoji_keyboard_view"
android:orientation="vertical" android:orientation="vertical"
@ -78,7 +78,7 @@
android:id="@+id/emoji_keyboard_pager" android:id="@+id/emoji_keyboard_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<com.android.inputmethod.keyboard.EmojiCategoryPageIndicatorView <com.android.inputmethod.keyboard.emoji.EmojiCategoryPageIndicatorView
android:id="@+id/emoji_category_page_id_view" android:id="@+id/emoji_category_page_id_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -109,4 +109,4 @@
android:gravity="center" android:gravity="center"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>
</com.android.inputmethod.keyboard.EmojiPalettesView> </com.android.inputmethod.keyboard.emoji.EmojiPalettesView>

View file

@ -28,6 +28,7 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.compat.InputMethodServiceCompatUtils; import com.android.inputmethod.compat.InputMethodServiceCompatUtils;
import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException; import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException;
import com.android.inputmethod.keyboard.emoji.EmojiPalettesView;
import com.android.inputmethod.keyboard.internal.KeyboardState; import com.android.inputmethod.keyboard.internal.KeyboardState;
import com.android.inputmethod.keyboard.internal.KeyboardTextsSet; import com.android.inputmethod.keyboard.internal.KeyboardTextsSet;
import com.android.inputmethod.latin.InputView; import com.android.inputmethod.latin.InputView;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.emoji;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.text.TextUtils; import android.text.TextUtils;
@ -35,8 +35,7 @@ import java.util.List;
/** /**
* This is a Keyboard class where you can add keys dynamically shown in a grid layout * This is a Keyboard class where you can add keys dynamically shown in a grid layout
*/ */
// TODO: Move this class to com.android.inputmethod.emoji package. final class DynamicGridKeyboard extends Keyboard {
public class DynamicGridKeyboard extends Keyboard {
private static final String TAG = DynamicGridKeyboard.class.getSimpleName(); private static final String TAG = DynamicGridKeyboard.class.getSimpleName();
private static final int TEMPLATE_KEY_CODE_0 = 0x30; private static final int TEMPLATE_KEY_CODE_0 = 0x30;
private static final int TEMPLATE_KEY_CODE_1 = 0x31; private static final int TEMPLATE_KEY_CODE_1 = 0x31;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.emoji;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
@ -39,8 +39,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
// TODO: Move this class to com.android.inputmethod.emoji package. final class EmojiCategory {
public final class EmojiCategory {
private final String TAG = EmojiCategory.class.getSimpleName(); private final String TAG = EmojiCategory.class.getSimpleName();
private static final int ID_UNSPECIFIED = -1; private static final int ID_UNSPECIFIED = -1;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard; package com.android.inputmethod.keyboard.emoji;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
@ -24,7 +24,6 @@ import android.graphics.Paint;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.widget.LinearLayout; import android.widget.LinearLayout;
//TODO: Move this class to com.android.inputmethod.emoji package.
public final class EmojiCategoryPageIndicatorView extends LinearLayout { public final class EmojiCategoryPageIndicatorView extends LinearLayout {
private static final float BOTTOM_MARGIN_RATIO = 1.0f; private static final float BOTTOM_MARGIN_RATIO = 1.0f;
private final Paint mPaint = new Paint(); private final Paint mPaint = new Paint();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.emoji;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.ResourceUtils; import com.android.inputmethod.latin.utils.ResourceUtils;
@ -24,8 +24,7 @@ import android.support.v4.view.ViewPager;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
//TODO: Move this class to com.android.inputmethod.emoji package. final class EmojiLayoutParams {
public final class EmojiLayoutParams {
private static final int DEFAULT_KEYBOARD_ROWS = 4; private static final int DEFAULT_KEYBOARD_ROWS = 4;
public final int mEmojiPagerHeight; public final int mEmojiPagerHeight;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.emoji;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
@ -26,16 +26,14 @@ import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.PointerTracker;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
/** /**
* This is an extended {@link KeyboardView} class that hosts an emoji page keyboard. * This is an extended {@link KeyboardView} class that hosts an emoji page keyboard.
* Multi-touch unsupported. No {@link PointerTracker}s. No gesture support. * Multi-touch unsupported. No gesture support.
*/ */
// TODO: Move this class to com.android.inputmethod.emoji package.
// TODO: Implement key popup preview. // TODO: Implement key popup preview.
public final class EmojiPageKeyboardView extends KeyboardView implements final class EmojiPageKeyboardView extends KeyboardView implements
GestureDetector.OnGestureListener { GestureDetector.OnGestureListener {
private static final long KEY_PRESS_DELAY_TIME = 250; // msec private static final long KEY_PRESS_DELAY_TIME = 250; // msec
private static final long KEY_RELEASE_DELAY_TIME = 30; // msec private static final long KEY_RELEASE_DELAY_TIME = 30; // msec

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.emoji;
import android.support.v4.view.PagerAdapter; import android.support.v4.view.PagerAdapter;
import android.util.Log; import android.util.Log;
@ -29,8 +29,7 @@ import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.CollectionUtils; import com.android.inputmethod.latin.utils.CollectionUtils;
// TODO: Move this class to com.android.inputmethod.emoji package. final class EmojiPalettesAdapter extends PagerAdapter {
public final class EmojiPalettesAdapter extends PagerAdapter {
private static final String TAG = EmojiPalettesAdapter.class.getSimpleName(); private static final String TAG = EmojiPalettesAdapter.class.getSimpleName();
private static final boolean DEBUG_PAGER = false; private static final boolean DEBUG_PAGER = false;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.keyboard; package com.android.inputmethod.keyboard.emoji;
import static com.android.inputmethod.latin.Constants.NOT_A_COORDINATE; import static com.android.inputmethod.latin.Constants.NOT_A_COORDINATE;
@ -40,10 +40,10 @@ import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener; import android.widget.TabHost.OnTabChangeListener;
import android.widget.TextView; import android.widget.TextView;
import com.android.inputmethod.keyboard.internal.EmojiCategory; import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.internal.EmojiLayoutParams; import com.android.inputmethod.keyboard.KeyboardActionListener;
import com.android.inputmethod.keyboard.internal.EmojiPageKeyboardView; import com.android.inputmethod.keyboard.KeyboardLayoutSet;
import com.android.inputmethod.keyboard.internal.EmojiPalettesAdapter; import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.internal.KeyDrawParams; import com.android.inputmethod.keyboard.internal.KeyDrawParams;
import com.android.inputmethod.keyboard.internal.KeyVisualAttributes; import com.android.inputmethod.keyboard.internal.KeyVisualAttributes;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
@ -65,7 +65,6 @@ import java.util.concurrent.TimeUnit;
* </ol> * </ol>
* Because of the above reasons, this class doesn't extend {@link KeyboardView}. * Because of the above reasons, this class doesn't extend {@link KeyboardView}.
*/ */
// TODO: Move this class to com.android.inputmethod.emoji package.
public final class EmojiPalettesView extends LinearLayout implements OnTabChangeListener, public final class EmojiPalettesView extends LinearLayout implements OnTabChangeListener,
ViewPager.OnPageChangeListener, View.OnClickListener, View.OnTouchListener, ViewPager.OnPageChangeListener, View.OnClickListener, View.OnTouchListener,
EmojiPageKeyboardView.OnKeyEventListener { EmojiPageKeyboardView.OnKeyEventListener {
@ -317,7 +316,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
/** /**
* Called from {@link EmojiPageKeyboardView} through * Called from {@link EmojiPageKeyboardView} through
* {@link com.android.inputmethod.keyboard.internal.EmojiPageKeyboardView.OnKeyEventListener} * {@link com.android.inputmethod.keyboard.emoji.EmojiPageKeyboardView.OnKeyEventListener}
* interface to handle touch events from non-View-based elements such as Emoji buttons. * interface to handle touch events from non-View-based elements such as Emoji buttons.
*/ */
@Override @Override
@ -328,7 +327,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
/** /**
* Called from {@link EmojiPageKeyboardView} through * Called from {@link EmojiPageKeyboardView} through
* {@link com.android.inputmethod.keyboard.internal.EmojiPageKeyboardView.OnKeyEventListener} * {@link com.android.inputmethod.keyboard.emoji.EmojiPageKeyboardView.OnKeyEventListener}
* interface to handle touch events from non-View-based elements such as Emoji buttons. * interface to handle touch events from non-View-based elements such as Emoji buttons.
*/ */
@Override @Override