+ /// update state of password switch and message depending on password protection
+ Switch passwordSwitch = getPasswordSwitch();
+ // set null listener before setChecked() to prevent infinite loop of calls
+ passwordSwitch.setOnCheckedChangeListener(null);
+ if (mPublicShare.isPasswordProtected()) {
+ if (!passwordSwitch.isChecked()) {
+ passwordSwitch.toggle();
+ }
+ getPasswordValue().setVisibility(View.VISIBLE);
+ } else {
+ if (passwordSwitch.isChecked()) {
+ passwordSwitch.toggle();
+ }
+ getPasswordValue().setVisibility(View.INVISIBLE);
+ }
+ // recover listener
+ passwordSwitch.setOnCheckedChangeListener(
+ mOnPasswordSwitchCheckedChangeListener
+ );
+
+