public void setJavascriptEnabled(boolean jsEnabled) { Log.d(L.TAG, "Control bar: Javascript " + (jsEnabled ? "enabled" : "disabled")); if (jsToggle.isChecked() != jsEnabled) { jsToggle.setOnCheckedChangeListener(null); jsToggle.setChecked(jsEnabled); jsToggle.setOnCheckedChangeListener(this); } jsToggle.setEnabled(true); }
@Override public void onCheckedChanged(CompoundButton view, boolean isChecked) { if (view == this.jsToggle) { if (this.pageLoadController == null) return; jsToggle.setEnabled(false); pageLoadController.restart(isChecked); } }
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { // TODO Auto-generated method stub int selected = 0; if (isChecked) { buttonView.setEnabled(false); for (int index = 0; index < mSwitches.size(); index++) { if (mSwitches.get(index) != buttonView) { turnOn(mSwitches.get(index)); } else { mSelected = index; } } // TODO listener; if (mListener != null) { mListener.onSegmentChanged(mSelected, mSwitches.get(selected)); } } }
public void disableJavascriptToggle() { jsToggle.setEnabled(false); }