Fixed talkback feedback for wifi menu

When you go to add a existing or new access
point for wifi talkback would say the
incorrect thing when you tapped on the
advanced options dropdown menu toggle.
This fixes what talkback says to more
accurately reflect what the widget does.

Test: Accessibility Scanner
Bug: 31623421
Change-Id: I9a00c4e8723014b0b3097f046dbcd1de01636e76
This commit is contained in:
Salvador Martinez
2016-09-26 15:43:00 -07:00
parent 727186bd33
commit 7c59e7ab53
2 changed files with 19 additions and 8 deletions

View File

@@ -54,6 +54,7 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
@@ -262,13 +263,13 @@ public class WifiConfigController implements TextWatcher,
showSecurityFields();
showIpConfigFields();
showProxyFields();
final CheckBox advancedTogglebox =
(CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox);
mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox))
.setOnCheckedChangeListener(this);
if (showAdvancedFields) {
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox)).setChecked(true);
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.VISIBLE);
}
advancedTogglebox.setOnCheckedChangeListener(this);
advancedTogglebox.setChecked(showAdvancedFields);
mView.findViewById(R.id.wifi_advanced_fields)
.setVisibility(showAdvancedFields ? View.VISIBLE : View.GONE);
}
if (mMode == WifiConfigUiBase.MODE_MODIFY) {
@@ -1210,11 +1211,18 @@ public class WifiConfigController implements TextWatcher,
((EditText) mPasswordView).setSelection(pos);
}
} else if (view.getId() == R.id.wifi_advanced_togglebox) {
final View advancedToggle = mView.findViewById(R.id.wifi_advanced_toggle);
final int toggleVisibility;
final int stringID;
if (isChecked) {
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.VISIBLE);
toggleVisibility = View.VISIBLE;
stringID = R.string.wifi_advanced_toggle_description_expanded;
} else {
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.GONE);
toggleVisibility = View.GONE;
stringID = R.string.wifi_advanced_toggle_description_collapsed;
}
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(toggleVisibility);
advancedToggle.setContentDescription(mContext.getString(stringID));
}
}