| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | currentIndex = 0; |
| | | showFragment(); |
| | | initView(); |
| | | showFragment(); |
| | | |
| | | } |
| | | }); |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | currentIndex = 1; |
| | | showFragment(); |
| | | initView(); |
| | | showFragment(); |
| | | |
| | | } |
| | | }); |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | currentIndex = 2; |
| | | showFragment(); |
| | | initView(); |
| | | showFragment(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | viewBinding.line1V.setVisibility(View.VISIBLE); |
| | | viewBinding.line2V.setVisibility(View.GONE); |
| | | viewBinding.line3V.setVisibility(View.GONE); |
| | | postEventBus(MessageFunctionTabSwitch.nascent); |
| | | } else if (this.currentIndex == 1) { |
| | | viewBinding.messageTabNascentTitleTv.setTextColor(getResources().getColor(R.color.text80_FFFFFF, null)); |
| | | viewBinding.messageTabRecoverTitleTv.setTextColor(getResources().getColor(R.color.text_FFFFFFFF, null)); |
| | |
| | | viewBinding.line1V.setVisibility(View.GONE); |
| | | viewBinding.line2V.setVisibility(View.VISIBLE); |
| | | viewBinding.line3V.setVisibility(View.GONE); |
| | | postEventBus(MessageFunctionTabSwitch.recover); |
| | | } else if (this.currentIndex == 2) { |
| | | viewBinding.messageTabNascentTitleTv.setTextColor(getResources().getColor(R.color.text80_FFFFFF, null)); |
| | | viewBinding.messageTabRecoverTitleTv.setTextColor(getResources().getColor(R.color.text80_FFFFFF, null)); |
| | |
| | | viewBinding.line1V.setVisibility(View.GONE); |
| | | viewBinding.line2V.setVisibility(View.GONE); |
| | | viewBinding.line3V.setVisibility(View.VISIBLE); |
| | | postEventBus(MessageFunctionTabSwitch.all); |
| | | } |
| | | } |
| | | |
| | |
| | | fragmentList.add(mRecoverMessageFragment); |
| | | fragmentList.add(mAllMessageFragment); |
| | | showFragment(); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | currentFragment = fragmentList.get(currentIndex); |
| | | ft.commit(); |
| | | //把当前显示的fragment记录下来 |
| | | currentFragment = fragmentList.get(currentIndex); |
| | | |
| | | if (this.currentIndex == 0) { |
| | | postEventBus(MessageFunctionTabSwitch.nascent); |
| | | } else if (this.currentIndex == 1) { |
| | | postEventBus(MessageFunctionTabSwitch.recover); |
| | | } else if (this.currentIndex == 2) { |
| | | postEventBus(MessageFunctionTabSwitch.all); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | ft.commit(); |
| | | //把当前显示的fragment记录下来 |
| | | currentFragment = fragmentList.get(currentIndex); |
| | | |
| | | } |
| | | |
| | | |