Move TypefaceUtils and ViewUtils to utils package
Change-Id: Iccd47c27670248c43de9a539c1951111d7733111
This commit is contained in:
parent
4be6198cb7
commit
ccf4a31027
7 changed files with 12 additions and 8 deletions
|
@ -37,6 +37,7 @@ import com.android.inputmethod.latin.LatinImeLogger;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.define.ProductionFlag;
|
import com.android.inputmethod.latin.define.ProductionFlag;
|
||||||
import com.android.inputmethod.latin.utils.CollectionUtils;
|
import com.android.inputmethod.latin.utils.CollectionUtils;
|
||||||
|
import com.android.inputmethod.latin.utils.TypefaceUtils;
|
||||||
import com.android.inputmethod.research.ResearchLogger;
|
import com.android.inputmethod.research.ResearchLogger;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
|
@ -70,7 +70,9 @@ import com.android.inputmethod.latin.utils.CoordinateUtils;
|
||||||
import com.android.inputmethod.latin.utils.ResourceUtils;
|
import com.android.inputmethod.latin.utils.ResourceUtils;
|
||||||
import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
|
import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
|
||||||
import com.android.inputmethod.latin.utils.StringUtils;
|
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.UsabilityStudyLogUtils;
|
||||||
|
import com.android.inputmethod.latin.utils.ViewLayoutUtils;
|
||||||
import com.android.inputmethod.research.ResearchLogger;
|
import com.android.inputmethod.research.ResearchLogger;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
||||||
import com.android.inputmethod.keyboard.internal.MoreKeySpec;
|
import com.android.inputmethod.keyboard.internal.MoreKeySpec;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.utils.StringUtils;
|
import com.android.inputmethod.latin.utils.StringUtils;
|
||||||
|
import com.android.inputmethod.latin.utils.TypefaceUtils;
|
||||||
|
|
||||||
public final class MoreKeysKeyboard extends Keyboard {
|
public final class MoreKeysKeyboard extends Keyboard {
|
||||||
private final int mDefaultKeyCoordX;
|
private final int mDefaultKeyCoordX;
|
||||||
|
|
|
@ -24,13 +24,13 @@ import android.graphics.drawable.Drawable;
|
||||||
import com.android.inputmethod.keyboard.Key;
|
import com.android.inputmethod.keyboard.Key;
|
||||||
import com.android.inputmethod.keyboard.Keyboard;
|
import com.android.inputmethod.keyboard.Keyboard;
|
||||||
import com.android.inputmethod.keyboard.KeyboardActionListener;
|
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.KeyboardBuilder;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.SuggestedWords;
|
import com.android.inputmethod.latin.SuggestedWords;
|
||||||
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
||||||
|
import com.android.inputmethod.latin.utils.TypefaceUtils;
|
||||||
|
|
||||||
public final class MoreSuggestions extends Keyboard {
|
public final class MoreSuggestions extends Keyboard {
|
||||||
public static final int SUGGESTION_CODE_BASE = 1024;
|
public static final int SUGGESTION_CODE_BASE = 1024;
|
||||||
|
|
|
@ -45,12 +45,12 @@ import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.ViewLayoutUtils;
|
|
||||||
import com.android.inputmethod.latin.AutoCorrection;
|
import com.android.inputmethod.latin.AutoCorrection;
|
||||||
import com.android.inputmethod.latin.LatinImeLogger;
|
import com.android.inputmethod.latin.LatinImeLogger;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.SuggestedWords;
|
import com.android.inputmethod.latin.SuggestedWords;
|
||||||
import com.android.inputmethod.latin.utils.ResourceUtils;
|
import com.android.inputmethod.latin.utils.ResourceUtils;
|
||||||
|
import com.android.inputmethod.latin.utils.ViewLayoutUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
|
@ -14,15 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.inputmethod.keyboard;
|
package com.android.inputmethod.latin.utils;
|
||||||
|
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
|
|
||||||
import com.android.inputmethod.latin.utils.CollectionUtils;
|
|
||||||
|
|
||||||
public final class TypefaceUtils {
|
public final class TypefaceUtils {
|
||||||
private TypefaceUtils() {
|
private TypefaceUtils() {
|
||||||
// This utility class is not publicly instantiable.
|
// This utility class is not publicly instantiable.
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.inputmethod.keyboard;
|
package com.android.inputmethod.latin.utils;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -27,7 +27,8 @@ public final class ViewLayoutUtils {
|
||||||
// This utility class is not publicly instantiable.
|
// 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) {
|
if (placer instanceof FrameLayout) {
|
||||||
return new FrameLayout.LayoutParams(width, height);
|
return new FrameLayout.LayoutParams(width, height);
|
||||||
} else if (placer instanceof RelativeLayout) {
|
} 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();
|
final ViewGroup.LayoutParams lp = view.getLayoutParams();
|
||||||
if (lp instanceof MarginLayoutParams) {
|
if (lp instanceof MarginLayoutParams) {
|
||||||
final MarginLayoutParams marginLayoutParams = (MarginLayoutParams)lp;
|
final MarginLayoutParams marginLayoutParams = (MarginLayoutParams)lp;
|
Loading…
Reference in a new issue