Loading java/res/layout/dictionary_line.xml +17 −13 Original line number Diff line number Diff line Loading @@ -52,23 +52,27 @@ android:ellipsize="marquee" android:fadingEdge="horizontal" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="5dip"> <TextView android:id="@+android:id/summary" android:layout_marginLeft="5dip" android:layout_marginStart="5dip" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorSecondary" android:maxLines="1" /> <!-- <ProgressBar --> <!-- android:id="@+id/dictionary_line_progress_bar" --> <!-- style="@android:style/Widget.Holo.ProgressBar.Horizontal" --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="match_parent" --> <!-- android:gravity="center" /> --> <ProgressBar android:id="@+id/dictionary_line_progress_bar" style="@android:style/Widget.Holo.ProgressBar.Horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" /> </FrameLayout> </LinearLayout> <com.android.inputmethod.dictionarypack.ButtonSwitcher Loading java/src/com/android/inputmethod/dictionarypack/DictionarySettingsFragment.java +3 −1 Original line number Diff line number Diff line Loading @@ -285,6 +285,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment final int localeIndex = cursor.getColumnIndex(MetadataDbHelper.LOCALE_COLUMN); final int descriptionIndex = cursor.getColumnIndex(MetadataDbHelper.DESCRIPTION_COLUMN); final int statusIndex = cursor.getColumnIndex(MetadataDbHelper.STATUS_COLUMN); final int filesizeIndex = cursor.getColumnIndex(MetadataDbHelper.FILESIZE_COLUMN); do { final String wordlistId = cursor.getString(idIndex); final int version = cursor.getInt(versionIndex); Loading @@ -294,6 +295,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment final int status = cursor.getInt(statusIndex); final int matchLevel = LocaleUtils.getMatchLevel(systemLocaleString, localeString); final String matchLevelString = LocaleUtils.getMatchLevelSortedString(matchLevel); final int filesize = cursor.getInt(filesizeIndex); // The key is sorted in lexicographic order, according to the match level, then // the description. final String key = matchLevelString + "." + description + "." + wordlistId; Loading @@ -301,7 +303,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment if (null == existingPref || hasPriority(status, existingPref.mStatus)) { final WordListPreference pref = new WordListPreference(activity, mDictionaryListInterfaceState, mClientId, wordlistId, version, locale, description, status); description, status, filesize); prefList.put(key, pref); } } while (cursor.moveToNext()); Loading java/src/com/android/inputmethod/dictionarypack/WordListPreference.java +15 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import com.android.inputmethod.latin.R; Loading Loading @@ -59,6 +61,8 @@ public final class WordListPreference extends Preference { public final int mVersion; // The status public int mStatus; // The size of the dictionary file private final int mFilesize; private final DictionaryListInterfaceState mInterfaceState; private final OnWordListPreferenceClick mPreferenceClickHandler = Loading @@ -69,13 +73,14 @@ public final class WordListPreference extends Preference { public WordListPreference(final Context context, final DictionaryListInterfaceState dictionaryListInterfaceState, final String clientId, final String wordlistId, final int version, final Locale locale, final String description, final int status) { final String description, final int status, final int filesize) { super(context, null); mContext = context; mInterfaceState = dictionaryListInterfaceState; mClientId = clientId; mVersion = version; mWordlistId = wordlistId; mFilesize = filesize; setLayoutResource(R.layout.dictionary_line); Loading Loading @@ -189,6 +194,15 @@ public final class WordListPreference extends Preference { protected void onBindView(final View view) { super.onBindView(view); ((ViewGroup)view).setLayoutTransition(null); final ProgressBar progressBar = (ProgressBar)view.findViewById(R.id.dictionary_line_progress_bar); final TextView status = (TextView)view.findViewById(android.R.id.summary); progressBar.setMax(mFilesize); final boolean showProgressBar = (MetadataDbHelper.STATUS_DOWNLOADING == mStatus); status.setVisibility(showProgressBar ? View.INVISIBLE : View.VISIBLE); progressBar.setVisibility(showProgressBar ? View.VISIBLE : View.INVISIBLE); final ButtonSwitcher buttonSwitcher = (ButtonSwitcher)view.findViewById(R.id.wordlist_button_switcher); if (mInterfaceState.isOpen(mWordlistId)) { Loading Loading
java/res/layout/dictionary_line.xml +17 −13 Original line number Diff line number Diff line Loading @@ -52,23 +52,27 @@ android:ellipsize="marquee" android:fadingEdge="horizontal" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="5dip"> <TextView android:id="@+android:id/summary" android:layout_marginLeft="5dip" android:layout_marginStart="5dip" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorSecondary" android:maxLines="1" /> <!-- <ProgressBar --> <!-- android:id="@+id/dictionary_line_progress_bar" --> <!-- style="@android:style/Widget.Holo.ProgressBar.Horizontal" --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="match_parent" --> <!-- android:gravity="center" /> --> <ProgressBar android:id="@+id/dictionary_line_progress_bar" style="@android:style/Widget.Holo.ProgressBar.Horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" /> </FrameLayout> </LinearLayout> <com.android.inputmethod.dictionarypack.ButtonSwitcher Loading
java/src/com/android/inputmethod/dictionarypack/DictionarySettingsFragment.java +3 −1 Original line number Diff line number Diff line Loading @@ -285,6 +285,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment final int localeIndex = cursor.getColumnIndex(MetadataDbHelper.LOCALE_COLUMN); final int descriptionIndex = cursor.getColumnIndex(MetadataDbHelper.DESCRIPTION_COLUMN); final int statusIndex = cursor.getColumnIndex(MetadataDbHelper.STATUS_COLUMN); final int filesizeIndex = cursor.getColumnIndex(MetadataDbHelper.FILESIZE_COLUMN); do { final String wordlistId = cursor.getString(idIndex); final int version = cursor.getInt(versionIndex); Loading @@ -294,6 +295,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment final int status = cursor.getInt(statusIndex); final int matchLevel = LocaleUtils.getMatchLevel(systemLocaleString, localeString); final String matchLevelString = LocaleUtils.getMatchLevelSortedString(matchLevel); final int filesize = cursor.getInt(filesizeIndex); // The key is sorted in lexicographic order, according to the match level, then // the description. final String key = matchLevelString + "." + description + "." + wordlistId; Loading @@ -301,7 +303,7 @@ public final class DictionarySettingsFragment extends PreferenceFragment if (null == existingPref || hasPriority(status, existingPref.mStatus)) { final WordListPreference pref = new WordListPreference(activity, mDictionaryListInterfaceState, mClientId, wordlistId, version, locale, description, status); description, status, filesize); prefList.put(key, pref); } } while (cursor.moveToNext()); Loading
java/src/com/android/inputmethod/dictionarypack/WordListPreference.java +15 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import com.android.inputmethod.latin.R; Loading Loading @@ -59,6 +61,8 @@ public final class WordListPreference extends Preference { public final int mVersion; // The status public int mStatus; // The size of the dictionary file private final int mFilesize; private final DictionaryListInterfaceState mInterfaceState; private final OnWordListPreferenceClick mPreferenceClickHandler = Loading @@ -69,13 +73,14 @@ public final class WordListPreference extends Preference { public WordListPreference(final Context context, final DictionaryListInterfaceState dictionaryListInterfaceState, final String clientId, final String wordlistId, final int version, final Locale locale, final String description, final int status) { final String description, final int status, final int filesize) { super(context, null); mContext = context; mInterfaceState = dictionaryListInterfaceState; mClientId = clientId; mVersion = version; mWordlistId = wordlistId; mFilesize = filesize; setLayoutResource(R.layout.dictionary_line); Loading Loading @@ -189,6 +194,15 @@ public final class WordListPreference extends Preference { protected void onBindView(final View view) { super.onBindView(view); ((ViewGroup)view).setLayoutTransition(null); final ProgressBar progressBar = (ProgressBar)view.findViewById(R.id.dictionary_line_progress_bar); final TextView status = (TextView)view.findViewById(android.R.id.summary); progressBar.setMax(mFilesize); final boolean showProgressBar = (MetadataDbHelper.STATUS_DOWNLOADING == mStatus); status.setVisibility(showProgressBar ? View.INVISIBLE : View.VISIBLE); progressBar.setVisibility(showProgressBar ? View.VISIBLE : View.INVISIBLE); final ButtonSwitcher buttonSwitcher = (ButtonSwitcher)view.findViewById(R.id.wordlist_button_switcher); if (mInterfaceState.isOpen(mWordlistId)) { Loading