private void syncRadioButton(RadioGroup group, int checkedId) { int index = group.indexOfChild(group.findViewById(checkedId)); if (shadow_user_info_tab.getVisibility() == View.VISIBLE) { shadow_uliv_user_info.setCurrentItem(index); ((RadioButton) rg_user_info.findViewById(checkedId)).setChecked(true); uliv_user_info.setCurrentItemWithoutAnim(index); } else { uliv_user_info.setCurrentItem(index); ((RadioButton) shadow_rg_user_info.findViewById(checkedId)).setChecked(true); shadow_uliv_user_info.setCurrentItemWithoutAnim(index); } }
private void initTab() { shadow_user_info_tab = findViewById(R.id.user_info_tab); shadow_rg_user_info = (RadioGroup) findViewById(R.id.rg_user_info); shadow_uliv_user_info = (UnderlineIndicatorView) findViewById(R.id.uliv_user_info); shadow_rg_user_info.setOnCheckedChangeListener(this); shadow_uliv_user_info.setCurrentItemWithoutAnim(1); user_info_tab = View.inflate(this, R.layout.user_info_tab, null); rg_user_info = (RadioGroup) user_info_tab.findViewById(R.id.rg_user_info); uliv_user_info = (UnderlineIndicatorView) user_info_tab.findViewById(R.id.uliv_user_info); rg_user_info.setOnCheckedChangeListener(this); uliv_user_info.setCurrentItemWithoutAnim(1); }