Improve encapsulation
Change-Id: I30d28c3a62cc5de3432f04b6469eca077ee3eff6
This commit is contained in:
@@ -75,9 +75,7 @@ public class UserDictionaryAddWordActivity extends Activity {
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(final Bundle outState) {
|
||||
outState.putString(
|
||||
UserDictionaryAddWordContents.EXTRA_WORD, mContents.mEditText.getText().toString());
|
||||
outState.putString(UserDictionaryAddWordContents.EXTRA_LOCALE, mContents.mLocale);
|
||||
mContents.saveStateIntoBundle(outState);
|
||||
}
|
||||
|
||||
public void onClickCancel(final View v) {
|
||||
|
@@ -70,6 +70,11 @@ public class UserDictionaryAddWordContents {
|
||||
mLocale = null == locale ? Locale.getDefault().toString() : locale;
|
||||
}
|
||||
|
||||
/* package */ void saveStateIntoBundle(final Bundle outState) {
|
||||
outState.putString(EXTRA_WORD, mEditText.getText().toString());
|
||||
outState.putString(EXTRA_LOCALE, mLocale);
|
||||
}
|
||||
|
||||
/* package */ void apply(final Context context) {
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
if (UserDictionaryAddWordContents.MODE_EDIT == mMode && !TextUtils.isEmpty(mOldWord)) {
|
||||
|
Reference in New Issue
Block a user