Removed connect button from Saved Networks dialog.
Bug: 17065357 Change-Id: Idb46ac404b171733ccac271ba74188224ca2611d
This commit is contained in:
@@ -27,10 +27,13 @@ import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.Preference.OnPreferenceClickListener;
|
||||
import android.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
import com.android.settings.search.SearchIndexableRaw;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
@@ -166,7 +169,8 @@ public class SavedAccessPointsWifiSettings extends SettingsPreferenceFragment
|
||||
mAccessPointSavedState = null;
|
||||
}
|
||||
mSelectedAccessPoint = mDlgAccessPoint;
|
||||
mDialog = new WifiDialog(getActivity(), this, mDlgAccessPoint, false);
|
||||
mDialog = new WifiDialog(getActivity(), this, mDlgAccessPoint,
|
||||
false /* not editting */, true /* hide the submit button */);
|
||||
return mDialog;
|
||||
|
||||
}
|
||||
|
@@ -327,6 +327,13 @@ public class WifiConfigController implements TextWatcher,
|
||||
return (level > -1 && level < mLevels.length) ? mLevels[level] : null;
|
||||
}
|
||||
|
||||
void hideSubmitButton() {
|
||||
Button submit = mConfigUi.getSubmitButton();
|
||||
if (submit == null) return;
|
||||
|
||||
submit.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/* show submit button if password, ip and proxy settings are valid */
|
||||
void enableSubmitIfAppropriate() {
|
||||
Button submit = mConfigUi.getSubmitButton();
|
||||
|
@@ -35,6 +35,13 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
|
||||
|
||||
private View mView;
|
||||
private WifiConfigController mController;
|
||||
private boolean mHideSubmitButton;
|
||||
|
||||
public WifiDialog(Context context, DialogInterface.OnClickListener listener,
|
||||
AccessPoint accessPoint, boolean edit, boolean hideSubmitButton) {
|
||||
this(context, listener, accessPoint, edit);
|
||||
mHideSubmitButton = hideSubmitButton;
|
||||
}
|
||||
|
||||
public WifiDialog(Context context, DialogInterface.OnClickListener listener,
|
||||
AccessPoint accessPoint, boolean edit) {
|
||||
@@ -42,6 +49,7 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
|
||||
mEdit = edit;
|
||||
mListener = listener;
|
||||
mAccessPoint = accessPoint;
|
||||
mHideSubmitButton = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,9 +64,14 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
|
||||
setInverseBackgroundForced(true);
|
||||
mController = new WifiConfigController(this, mView, mAccessPoint, mEdit);
|
||||
super.onCreate(savedInstanceState);
|
||||
/* During creation, the submit button can be unavailable to determine
|
||||
* visibility. Right after creation, update button visibility */
|
||||
mController.enableSubmitIfAppropriate();
|
||||
|
||||
if (mHideSubmitButton) {
|
||||
mController.hideSubmitButton();
|
||||
} else {
|
||||
/* During creation, the submit button can be unavailable to determine
|
||||
* visibility. Right after creation, update button visibility */
|
||||
mController.enableSubmitIfAppropriate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user