Clean up LatinIME java

- remove unused code
- add @Override
- change the inappropriate cast

Change-Id: Ib25b4939e5b4273794ab0f6349776b5b62d89894
main
satok 2010-08-24 12:38:39 +09:00
parent e07d6a776a
commit 525141a402
10 changed files with 4 additions and 18 deletions

View File

@ -16,7 +16,6 @@
package com.android.inputmethod.latin;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.nio.ByteBuffer;

View File

@ -36,7 +36,6 @@ public class Hints {
public void showHint(int viewResource);
}
private static final String TAG = "Hints";
private static final String PREF_VOICE_HINT_NUM_UNIQUE_DAYS_SHOWN =
"voice_hint_num_unique_days_shown";
private static final String PREF_VOICE_HINT_LAST_TIME_SHOWN =

View File

@ -40,7 +40,7 @@ public class InputLanguageSelection extends PreferenceActivity {
"ko", "ja", "zh", "el"
};
private static class Loc implements Comparable {
private static class Loc implements Comparable<Object> {
static Collator sCollator = Collator.getInstance();
String label;

View File

@ -24,7 +24,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.inputmethodservice.Keyboard;
import android.preference.PreferenceManager;
import android.view.InflateException;

View File

@ -398,7 +398,6 @@ public class LatinIME extends InputMethodService
static int[] getDictionary(Resources res) {
String packageName = LatinIME.class.getPackage().getName();
XmlResourceParser xrp = res.getXml(R.xml.dictionary);
int dictionaryCount = 0;
ArrayList<Integer> dictionaries = new ArrayList<Integer>();
try {

View File

@ -24,6 +24,7 @@ import android.app.backup.SharedPreferencesBackupHelper;
*/
public class LatinIMEBackupAgent extends BackupAgentHelper {
@Override
public void onCreate() {
addHelper("shared_pref", new SharedPreferencesBackupHelper(this,
getPackageName() + "_preferences"));

View File

@ -34,8 +34,6 @@ import android.view.View;
*/
public class Suggest implements Dictionary.WordCallback {
private static final String TAG = "Suggest";
public static final int APPROX_MAX_WORD_LENGTH = 32;
public static final int CORRECTION_NONE = 0;

View File

@ -17,7 +17,6 @@
package com.android.inputmethod.latin;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
@ -38,13 +37,9 @@ import java.util.List;
public class Tutorial implements OnTouchListener {
private List<Bubble> mBubbles = new ArrayList<Bubble>();
private long mStartTime;
private static final long MINIMUM_TIME = 6000;
private static final long MAXIMUM_TIME = 20000;
private View mInputView;
private LatinIME mIme;
private int[] mLocation = new int[2];
private int mBubblePointerOffset;
private static final int MSG_SHOW_BUBBLE = 0;
@ -167,8 +162,6 @@ public class Tutorial implements OnTouchListener {
mIme = ime;
int inputWidth = inputView.getWidth();
final int x = inputWidth / 20; // Half of 1/10th
mBubblePointerOffset = inputView.getContext().getResources()
.getDimensionPixelOffset(R.dimen.bubble_pointer_offset);
Bubble bWelcome = new Bubble(context, inputView,
R.drawable.dialog_bubble_step02, x, 0,
R.string.tip_to_open_keyboard, R.string.touch_to_continue);

View File

@ -374,8 +374,7 @@ public class UserBigramDictionary extends ExpandableDictionary {
c.close();
// insert new frequency
long s = db.insert(FREQ_TABLE_NAME, null,
getFrequencyContentValues(pairId, bi.frequency));
db.insert(FREQ_TABLE_NAME, null, getFrequencyContentValues(pairId, bi.frequency));
}
checkPruneData(db);
sUpdatingDB = false;

View File

@ -17,7 +17,6 @@
package com.android.inputmethod.latin;
import java.util.ArrayList;
import java.util.List;
/**
* A place to store the currently composing word with information such as adjacent key codes as well
@ -50,7 +49,7 @@ public class WordComposer {
}
WordComposer(WordComposer copy) {
mCodes = (ArrayList<int[]>) copy.mCodes.clone();
mCodes = new ArrayList<int[]>(copy.mCodes);
mPreferredWord = copy.mPreferredWord;
mTypedWord = new StringBuilder(copy.mTypedWord);
mCapsCount = copy.mCapsCount;