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