Loading res/layout/profile_name_dialog.xml +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/rename_dialog_hint" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceMedium" /> Loading res/values/cm_strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ <string name="rename_dialog_message">Enter a new name</string> <string name="duplicate_profile_name">Duplicate profile name!</string> <string name="duplicate_appgroup_name">Duplicate app group name!</string> <string name="rename_dialog_hint">Enter profile name</string> <!-- Reset Profiles --> <string name="profile_reset_title">Reset</string> Loading src/com/android/settings/profiles/SetupActionsFragment.java +26 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ import android.os.Bundle; import android.provider.Settings; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; Loading @@ -50,6 +53,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; Loading Loading @@ -702,7 +706,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment entry.setText(mProfile.getName()); entry.setSelectAllOnFocus(true); new AlertDialog.Builder(getActivity()) final AlertDialog alertDialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.rename_dialog_title) .setView(dialogView) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { Loading @@ -715,7 +719,27 @@ public class SetupActionsFragment extends SettingsPreferenceFragment } }) .setNegativeButton(android.R.string.cancel, null) .show(); .create(); entry.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { final boolean empty = TextUtils.isEmpty(s.toString()); alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(!empty); } }); alertDialog.show(); } @Override Loading Loading
res/layout/profile_name_dialog.xml +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/rename_dialog_hint" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceMedium" /> Loading
res/values/cm_strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ <string name="rename_dialog_message">Enter a new name</string> <string name="duplicate_profile_name">Duplicate profile name!</string> <string name="duplicate_appgroup_name">Duplicate app group name!</string> <string name="rename_dialog_hint">Enter profile name</string> <!-- Reset Profiles --> <string name="profile_reset_title">Reset</string> Loading
src/com/android/settings/profiles/SetupActionsFragment.java +26 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ import android.os.Bundle; import android.provider.Settings; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; Loading @@ -50,6 +53,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; Loading Loading @@ -702,7 +706,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment entry.setText(mProfile.getName()); entry.setSelectAllOnFocus(true); new AlertDialog.Builder(getActivity()) final AlertDialog alertDialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.rename_dialog_title) .setView(dialogView) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { Loading @@ -715,7 +719,27 @@ public class SetupActionsFragment extends SettingsPreferenceFragment } }) .setNegativeButton(android.R.string.cancel, null) .show(); .create(); entry.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { final boolean empty = TextUtils.isEmpty(s.toString()); alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(!empty); } }); alertDialog.show(); } @Override Loading