diff options
author | Michael Kolb <kolby@google.com> | 2012-05-23 10:26:53 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2012-05-23 11:19:47 -0700 |
commit | 9d5a6eb4d7ec662e666dc5dfe1506616d5b59341 (patch) | |
tree | e7d12d521c13b8aa2c48af637ff808602d9a61b8 /src | |
parent | 3a821e86f5851cbce1185a481acb88a0f33c98ae (diff) | |
download | packages_apps_settings-9d5a6eb4d7ec662e666dc5dfe1506616d5b59341.zip packages_apps_settings-9d5a6eb4d7ec662e666dc5dfe1506616d5b59341.tar.gz packages_apps_settings-9d5a6eb4d7ec662e666dc5dfe1506616d5b59341.tar.bz2 |
Match setup wizard wifi settings with new wireframes
Bug: 6521472
Change-Id: I159d8a98327ad775b2c5ccfc7380d60d62b54dad
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/WifiSettings.java | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index ac7f321..28b0f36 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -59,6 +59,8 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.ImageButton; +import android.widget.PopupMenu; +import android.widget.PopupMenu.OnMenuItemClickListener; import android.widget.RelativeLayout; import android.widget.Switch; import android.widget.TextView; @@ -193,26 +195,38 @@ public class WifiSettings extends SettingsPreferenceFragment } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, + public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mSetupWizardMode) { View view = inflater.inflate(R.layout.setup_preference, container, false); - ImageButton b1 = (ImageButton) view.findViewById(R.id.wps_push); - if (b1 != null) { - b1.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - showDialog(WPS_PBC_DIALOG_ID); + View other = view.findViewById(R.id.other_network); + other.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + if (mWifiManager.isWifiEnabled()) { + onAddNetworkPressed(); } - }); - } - ImageButton b2 = (ImageButton) view.findViewById(R.id.add_network); - if (b2 != null) { - b2.setOnClickListener(new OnClickListener() { + } + }); + final ImageButton b = (ImageButton) view.findViewById(R.id.more); + if (b != null) { + b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (mWifiManager.isWifiEnabled()) { - onAddNetworkPressed(); + PopupMenu pm = new PopupMenu(inflater.getContext(), b); + pm.inflate(R.menu.wifi_setup); + pm.setOnMenuItemClickListener(new OnMenuItemClickListener() { + @Override + public boolean onMenuItemClick(MenuItem item) { + if (R.id.wifi_wps == item.getItemId()) { + showDialog(WPS_PBC_DIALOG_ID); + return true; + } + return false; + } + }); + pm.show(); } } }); |