private void setCoordsModificationVisibility(final IConnector con, final Geocache cache) { if (cache != null && (cache.getType() == CacheType.MYSTERY || cache.getType() == CacheType.MULTI)) { coordinatesGroup.setVisibility(View.VISIBLE); modifyBoth.setVisibility(con.supportsOwnCoordinates() ? View.VISIBLE : View.GONE); } else { coordinatesGroup.setVisibility(View.GONE); modifyBoth.setVisibility(View.GONE); } }
private void showPlatforms() { TransitionSet transitionSet = new TransitionSet(); transitionSet .addTransition(new Fade(Fade.OUT).addTarget(mSelectedPlatform).setDuration(150)) .addTransition(new Slide(Gravity.LEFT).addTarget(mPlatforms).setDuration(400)) .addTransition(new Rotate().addTarget(mIndicator).setDuration(500)); TransitionManager.beginDelayedTransition(this, transitionSet); mIndicator.setRotation(180); mPlatforms.setVisibility(VISIBLE); mSelectedPlatform.setVisibility(GONE); }
private void refreshSelectedPlatform() { if (mSelectedPlatformId == R.id.mPlatformWeChat) { showSelectedPlatform(R.drawable.bg_yl_share_live_view_platform_we_chat_checked); } else if (mSelectedPlatformId == R.id.mPlatformWeChatMoments) { showSelectedPlatform(R.drawable.bg_yl_share_live_view_platform_we_chat_moments_checked); } else if (mSelectedPlatformId == R.id.mPlatformWeibo) { showSelectedPlatform(R.drawable.bg_yl_share_live_view_platform_weibo_checked); } else if (mSelectedPlatformId == R.id.mPlatformQQ) { showSelectedPlatform(R.drawable.bg_yl_share_live_view_platform_qq_checked); } else if (mSelectedPlatformId == R.id.mPlatformQzone) { showSelectedPlatform(R.drawable.bg_yl_share_live_view_platform_qzone_checked); } else { mSelectedPlatform.setVisibility(GONE); } }
@Override public void setCheckable(boolean checkable) { if (!checkable && mRadioButton == null && mCheckBox == null) { return; } // Depending on whether its exclusive check or not, the checkbox or // radio button will be the one in use (and the other will be // otherCompoundButton) final CompoundButton compoundButton; final CompoundButton otherCompoundButton; if (mItemData.isExclusiveCheckable()) { if (mRadioButton == null) { insertRadioButton(); } compoundButton = mRadioButton; otherCompoundButton = mCheckBox; } else { if (mCheckBox == null) { insertCheckBox(); } compoundButton = mCheckBox; otherCompoundButton = mRadioButton; } if (checkable) { compoundButton.setChecked(mItemData.isChecked()); final int newVisibility = checkable ? View.VISIBLE : View.GONE; if (compoundButton.getVisibility() != newVisibility) { compoundButton.setVisibility(newVisibility); } // Make sure the other compound button isn't visible if (otherCompoundButton != null && otherCompoundButton.getVisibility() != View.GONE) { otherCompoundButton.setVisibility(View.GONE); } } else { if (mCheckBox != null) { mCheckBox.setVisibility(View.GONE); } if (mRadioButton != null) { mRadioButton.setVisibility(View.GONE); } } }
/** 判断期数是否大于1 */ public void stateCheck() { if (iProgressQishu > 1) { isGift = false; isJoin = false; isTouzhu = true; check.setVisibility(CheckBox.GONE); joinCheck.setVisibility(CheckBox.GONE); touzhuCheck.setVisibility(CheckBox.GONE); textAlert.setVisibility(TextView.VISIBLE); } else { check.setVisibility(CheckBox.VISIBLE); joinCheck.setVisibility(CheckBox.VISIBLE); touzhuCheck.setVisibility(CheckBox.VISIBLE); textAlert.setVisibility(TextView.GONE); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.wfd_power_saving); mRgPower = (RadioGroup) findViewById(R.id.Wfd_Power_Saving_Style); mEtDisplayTime = (EditText) findViewById(R.id.Wfd_Power_Delay_Time_Edit); /* remove dim and show image , rollback in future*/ RadioButton tempButton = (RadioButton) findViewById(R.id.Wfd_Power_Style_2); tempButton.setVisibility(View.GONE); mBtDone = (Button) findViewById(R.id.Wfd_Done); mBtDone.setOnClickListener(this); mState = Settings.Global.getInt( getContentResolver(), Settings.Global.WIFI_DISPLAY_POWER_SAVING_OPTION, 0); setInitState(mState); mDisplayTime = Settings.Global.getInt( getContentResolver(), Settings.Global.WIFI_DISPLAY_POWER_SAVING_DELAY, 0); mEtDisplayTime.setText(String.valueOf(mDisplayTime)); }
private void showSelectedPlatform(@DrawableRes int platform) { mSelectedPlatform.setBackgroundResource(platform); mSelectedPlatform.setVisibility(VISIBLE); }