From ccf4a310279b13bbf0b6aac76a0878178c1dfb7d Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 5 Jul 2013 18:57:07 +0900 Subject: [PATCH] Move TypefaceUtils and ViewUtils to utils package Change-Id: Iccd47c27670248c43de9a539c1951111d7733111 --- .../com/android/inputmethod/keyboard/KeyboardView.java | 1 + .../android/inputmethod/keyboard/MainKeyboardView.java | 2 ++ .../android/inputmethod/keyboard/MoreKeysKeyboard.java | 1 + .../inputmethod/latin/suggestions/MoreSuggestions.java | 2 +- .../latin/suggestions/SuggestionStripLayoutHelper.java | 2 +- .../{keyboard => latin/utils}/TypefaceUtils.java | 4 +--- .../{keyboard => latin/utils}/ViewLayoutUtils.java | 8 +++++--- 7 files changed, 12 insertions(+), 8 deletions(-) rename java/src/com/android/inputmethod/{keyboard => latin/utils}/TypefaceUtils.java (97%) rename java/src/com/android/inputmethod/{keyboard => latin/utils}/ViewLayoutUtils.java (86%) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 4cee4cfa6..254b20b87 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -37,6 +37,7 @@ import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.TypefaceUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.HashSet; diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 0af05b895..f85e60449 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -70,7 +70,9 @@ import com.android.inputmethod.latin.utils.CoordinateUtils; import com.android.inputmethod.latin.utils.ResourceUtils; import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper; import com.android.inputmethod.latin.utils.StringUtils; +import com.android.inputmethod.latin.utils.TypefaceUtils; import com.android.inputmethod.latin.utils.UsabilityStudyLogUtils; +import com.android.inputmethod.latin.utils.ViewLayoutUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java index 51f5446db..d29e6382c 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java @@ -29,6 +29,7 @@ import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.keyboard.internal.MoreKeySpec; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.utils.StringUtils; +import com.android.inputmethod.latin.utils.TypefaceUtils; public final class MoreKeysKeyboard extends Keyboard { private final int mDefaultKeyCoordX; diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java index ff24e2d2c..e97069dff 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java +++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java @@ -24,13 +24,13 @@ import android.graphics.drawable.Drawable; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; -import com.android.inputmethod.keyboard.TypefaceUtils; import com.android.inputmethod.keyboard.internal.KeyboardBuilder; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.utils.TypefaceUtils; public final class MoreSuggestions extends Keyboard { public static final int SUGGESTION_CODE_BASE = 1024; diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 99372c3bf..ce340b666 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -45,12 +45,12 @@ import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; -import com.android.inputmethod.keyboard.ViewLayoutUtils; import com.android.inputmethod.latin.AutoCorrection; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.utils.ResourceUtils; +import com.android.inputmethod.latin.utils.ViewLayoutUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java b/java/src/com/android/inputmethod/latin/utils/TypefaceUtils.java similarity index 97% rename from java/src/com/android/inputmethod/keyboard/TypefaceUtils.java rename to java/src/com/android/inputmethod/latin/utils/TypefaceUtils.java index c3b952037..544e4d201 100644 --- a/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/TypefaceUtils.java @@ -14,15 +14,13 @@ * limitations under the License. */ -package com.android.inputmethod.keyboard; +package com.android.inputmethod.latin.utils; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; import android.util.SparseArray; -import com.android.inputmethod.latin.utils.CollectionUtils; - public final class TypefaceUtils { private TypefaceUtils() { // This utility class is not publicly instantiable. diff --git a/java/src/com/android/inputmethod/keyboard/ViewLayoutUtils.java b/java/src/com/android/inputmethod/latin/utils/ViewLayoutUtils.java similarity index 86% rename from java/src/com/android/inputmethod/keyboard/ViewLayoutUtils.java rename to java/src/com/android/inputmethod/latin/utils/ViewLayoutUtils.java index dc12fa468..f9d853493 100644 --- a/java/src/com/android/inputmethod/keyboard/ViewLayoutUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ViewLayoutUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.keyboard; +package com.android.inputmethod.latin.utils; import android.view.View; import android.view.ViewGroup; @@ -27,7 +27,8 @@ public final class ViewLayoutUtils { // This utility class is not publicly instantiable. } - public static MarginLayoutParams newLayoutParam(ViewGroup placer, int width, int height) { + public static MarginLayoutParams newLayoutParam(final ViewGroup placer, final int width, + final int height) { if (placer instanceof FrameLayout) { return new FrameLayout.LayoutParams(width, height); } else if (placer instanceof RelativeLayout) { @@ -40,7 +41,8 @@ public final class ViewLayoutUtils { } } - public static void placeViewAt(View view, int x, int y, int w, int h) { + public static void placeViewAt(final View view, final int x, final int y, final int w, + final int h) { final ViewGroup.LayoutParams lp = view.getLayoutParams(); if (lp instanceof MarginLayoutParams) { final MarginLayoutParams marginLayoutParams = (MarginLayoutParams)lp;