Fixed talkback feedback for wifi menu am: 7c59e7ab53

am: ce18d5ea14

Change-Id: I6f1fc0922cfab21da53219e560a46d94156e3533
This commit is contained in:
Salvador Martinez
2016-09-27 21:59:34 +00:00
committed by android-build-merger
2 changed files with 19 additions and 8 deletions

View File

@@ -287,11 +287,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/wifi_item" style="@style/wifi_item"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:importantForAccessibility="yes"
android:contentDescription="@string/wifi_advanced_toggle_description_collapsed"
android:visibility="gone"> android:visibility="gone">
<CheckBox android:id="@+id/wifi_advanced_togglebox" <CheckBox android:id="@+id/wifi_advanced_togglebox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/wifi_advanced_toggle" style="@style/wifi_advanced_toggle"
android:importantForAccessibility="noHideDescendants"
android:text="@string/wifi_show_advanced" /> android:text="@string/wifi_show_advanced" />
</LinearLayout> </LinearLayout>

View File

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