@CheckedChange({R.id.leftCheck, R.id.rightCheck, R.id.bottomCheck, R.id.scaleCheck, R.id.alphaCheck}) protected void checkedChanged(CompoundButton compoundButton, boolean isChecked) { if (!isChecked) { return; } BaseAnimation baseAnimation; switch (compoundButton.getId()) { case R.id.leftCheck: baseAnimation = new SlideInLeftAnimation(); break; case R.id.rightCheck: baseAnimation = new SlideInRightAnimation(); break; case R.id.bottomCheck: baseAnimation = new SlideInBottomAnimation(); break; case R.id.alphaCheck: baseAnimation = new AlphaInAnimation(); break; default: baseAnimation = new ScaleInAnimation(); break; } //开启动画,并取消动画只在第一次加载时展示 adapter.enableAnimation(baseAnimation, false); }
@CheckedChange void popVoice(boolean checked) { if (disableCheckedChange) { return; } if (checked) { slowlyPop(false); } else { if (popEmoji.isChecked()) { keyboardControl.showEmojiInput(); } else { keyboardControl.showSystemInput(true); } } }
@CheckedChange(R.id.enable_switch) void serviceEnabled(CompoundButton button) { if (button.isChecked()) { if (!isServiceRunning()) { AmplifierService_.intent(this).start(); } if(!preferenceProvider.isSavingEnabled()){ reset(); } currentMicGroup.setVisibility(View.VISIBLE); } else { AmplifierService_.intent(this).stop(); currentMicGroup.setVisibility(View.INVISIBLE); } }
@CheckedChange(R.id.sw_accessibility_service) void setAutoOperateServiceEnable(CompoundButton button, boolean enable) { boolean isAccessibilityServiceEnabled = AccessibilityServiceTool.isAccessibilityServiceEnabled(App.getApp()); if (enable && !isAccessibilityServiceEnabled) { enableAccessibilityService(); } else if (!enable && isAccessibilityServiceEnabled) { if (!AccessibilityService.disable()) { AccessibilityServiceTool.goToAccessibilitySetting(); } } }
@CheckedChange(R.id.sw_floating_window) void setFloatingWindowEnable(CompoundButton button, boolean enable) { if (enable && !HoverMenuManger.isHoverMenuShowing()) { HoverMenuManger.showHoverMenu(); if (Pref.enableAccessibilityServiceByRoot()) { enableAccessibilityServiceByRoot(); } } else if (!enable && HoverMenuManger.isHoverMenuShowing()) { HoverMenuManger.hideHoverMenu(); } }
@CheckedChange({R.id.daily_task_radio, R.id.weekly_task_radio, R.id.disposable_task_radio}) void onCheckedChanged(CompoundButton button) { ExpandableRelativeLayout relativeLayout = findExpandableLayoutOf(button); if (button.isChecked()) { relativeLayout.post(relativeLayout::expand); } else { relativeLayout.collapse(); } }
@CheckedChange void popEmoji(boolean checked) { if (disableCheckedChange) { return; } if (checked) { // 需要弹出 emoji 键盘 slowlyPop(true); } else { keyboardControl.showSystemInput(true); } }
@CheckedChange({R.id.autoGetPasswordCheckBox, R.id.sendHeartCheckBox}) public void onChecked(CompoundButton view, boolean isChecked) { switch (view.getId()) { case R.id.autoGetPasswordCheckBox: if (isChecked) { String c = "该功能会自动发送短信获取密码,请慎重使用!非闪讯电话卡或双卡手机请关闭此功能,否则无法正常使用软件"; new NoticeDialog(context, "注意", c).show(); } preference.putBoolean(Preference.AUTO_GET_PASSWORD, isChecked); break; case R.id.sendHeartCheckBox: preference.putBoolean(Preference.SEND_HEART, isChecked); break; } }
@CheckedChange(R.id.switch_view) protected void checkedChangeOnSwitch(boolean isChecked) { // called whenever the switch is touched if (isChecked) { ViewService_.intent(getApplication()).showMask().start(); } else { ViewService_.intent(getApplication()).hideMask().start(); } }
@CheckedChange(R.id.rent_single_building) public void buildingCheckChange(CompoundButton buttonView, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "SingleHoseOnRentPublishClick"); if (isChecked) { mRentBuilding = "0"; mRentSeatNumber.setVisibility(View.GONE); } else { mRentBuilding = mRentSeatNumber.getText().toString(); mRentSeatNumber.setVisibility(View.VISIBLE); } }
@CheckedChange(R.id.rent_not_unit) public void unitCheckChange(CompoundButton buttonViews, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "SingleHoseOnRentPublishClick"); if (isChecked) { mRentUnitNumber = "0"; mRentUnitNo.setVisibility(View.GONE); } else { mRentUnitNumber = mRentUnitNo.getText().toString(); mRentUnitNo.setVisibility(View.VISIBLE); } }
@CheckedChange(R.id.rent_villa) public void villaCheckChange(CompoundButton buttonViews, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "VillaOnRentPublishClick"); if (isChecked) { mRentRoomNumber = "0000"; mRentRoomNO.setVisibility(View.GONE); } else { mRentRoomNumber = mRentRoomNO.getText().toString(); mRentRoomNO.setVisibility(View.VISIBLE); } }
@CheckedChange(R.id.sell_single_building) public void buildingCheckChange(CompoundButton buttonView, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "SingleHoseOnSellPublishClick"); if (isChecked) { mSellBuilding = "0"; mSellSeatNumber.setVisibility(View.GONE); } else { mSellBuilding = mSellSeatNumber.getText().toString(); mSellSeatNumber.setVisibility(View.VISIBLE); } }
@CheckedChange(R.id.sell_not_unit) public void sellNotUnit(CompoundButton buttonView, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "SingleHoseOnSellPublishClick"); if (isChecked) { mSellUnitNumber = "0"; mUtilNot.setVisibility(View.GONE); } else { mSellUnitNumber = mUtilNot.getText().toString(); mUtilNot.setVisibility(View.VISIBLE); } }
@CheckedChange(R.id.sell_villa) public void sellVilla(CompoundButton buttonView, boolean isChecked) { ManyiAnalysis.onEvent(getActivity(), "VillaOnSellPublishClick"); if (isChecked) { mSellRoomNumber = "0000"; mSellRoomNO.setVisibility(View.GONE); } else { mSellRoomNumber = mSellRoomNO.getText().toString(); mSellRoomNO.setVisibility(View.VISIBLE); } }
@CheckedChange protected void openCellId(boolean checked) { if (checked && TextUtils.isEmpty(Settings.with(this).openCellIdApiKey())) { openCellId.setChecked(false); obtainOpenCellIdApiKey(); } else { Settings.with(this).useOpenCellId(checked); } }
@CheckedChange void generateReadme(boolean checked) { projectInfo.gitReadmeEnabled = checked; }
@CheckedChange(R.id.danmaku_switch) void onDanmakuSwitch(CompoundButton switchBtn, boolean isChecked){ mDanmakuView.setVisibility(isChecked ? VISIBLE : GONE); }
@CheckedChange protected void mozillaLocationServices(boolean checked) { Settings.with(this).useMozillaLocationService(checked); }
@CheckedChange protected void filterRemote(boolean enabled) { Settings.with(this).useLacells(enabled); updateSourcesVisibility(); }
@CheckedChange protected void filterOnPhone(boolean enabled) { filterRemote(!enabled); }
@CheckedChange(R.id.enable_check_box) void onCheckedChangeEnableCheckBox(boolean isChecked) { Dictionary dictionary = getDictionary(); dictionary.setEnabled(isChecked); dictionaries.updateDictionary(dictionary); }
@CheckedChange(R.id.radio_button_default_url) void defaultUrlChecked(CompoundButton button, boolean isChecked) { if (isChecked) { presenter.onCertificateLocationChangeAttempt(CertLocation.DEFAULT_URL); } }
@CheckedChange(R.id.radio_button_custom_url) void customUrlChecked(CompoundButton button, boolean isChecked) { if (isChecked) { presenter.onCertificateLocationChangeAttempt(CertLocation.CUSTOM_URL); } }
@CheckedChange(R.id.radio_button_import_from_file) void importFromFileChecked(CompoundButton button, boolean isChecked) { if (isChecked) { presenter.onCertificateLocationChangeAttempt(CertLocation.FILE); } }
@CheckedChange(R.id.autoSync) protected void setSyncEnabled(boolean enabled) { syncPeriodText.setTextColor(getResources().getColor(enabled ? R.color.main_color : R.color.main_color_disabled)); syncPeriodText.setEnabled(enabled); syncOverWifiCheckBox.setEnabled(enabled); }