public void onEventMainThread(SubscriptionAddActivity.FollowFlagEvent event) { if (event.flag && index == 2) { mTitleView.setLeftButton(getString(R.string.feed_edit)); } else mTitleView.setLeftButton(0); }
private void initBottomButton() { newsButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab1_normal, 0, 0); newsButton.setTextColor(getResources().getColor(R.color.calendar_header)); gameButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab2_normal, 0, 0); gameButton.setTextColor(getResources().getColor(R.color.calendar_header)); threadButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab3_normal, 0, 0); threadButton.setTextColor(getResources().getColor(R.color.calendar_header)); dataButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab4_normal, 0, 0); dataButton.setTextColor(getResources().getColor(R.color.calendar_header)); if (majorTeamGsonModel == null || TextUtils.isEmpty(majorTeamGsonModel.avatar)) { if (AppSharePreferences.getFollowFlag(getApplicationContext())) { majorImageView.setImageResource(R.drawable.tab_center_notset_normal); } else { majorImageView.setImageResource(R.drawable.tab_center_normal); } } else { File file = DiskCacheUtils.findInCache(majorTeamGsonModel.avatar, imageLoader.getDiskCache()); if (file == null || !file.exists()) { imageLoader.displayImage(majorTeamGsonModel.avatar, majorImageView, options); } else { majorImageView.setImageBitmap(BitmapFactory.decodeFile(file.getAbsolutePath())); } } mTitleView.setLeftButton(0); majorImageView.setBackgroundResource(R.drawable.main_tab_center); switch (index) { case 0: { mTitleView.setTitle(null); newsButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab1_selected, 0, 0); newsButton.setTextColor(getResources().getColor(R.color.title)); break; } case 1: { mTitleView.setTitle(getString(R.string.top_toolbar_small_online)); gameButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab2_selected, 0, 0); gameButton.setTextColor(getResources().getColor(R.color.title)); break; } case 2: { mTitleView.setTitle(null); // ((Button)v).setCompoundDrawablesWithIntrinsicBounds(0, // R.drawable.tab2_selected, 0, 0); if (majorTeamGsonModel == null || TextUtils.isEmpty(majorTeamGsonModel.avatar)) { if (AppSharePreferences.getFollowFlag(getApplicationContext())) { majorImageView.setImageResource(R.drawable.tab_center_notset_pressed); } else { majorImageView.setImageResource(R.drawable.tab_center_selected); } majorImageView.setBackgroundColor(getResources().getColor(R.color.title)); } else { if (!TextUtils.isEmpty(majorTeamGsonModel.color)) majorImageView.setBackgroundColor(Color.parseColor(majorTeamGsonModel.color)); else majorImageView.setBackgroundColor(getResources().getColor(R.color.title)); } if (AppSharePreferences.getFollowFlag(getApplicationContext())) mTitleView.setLeftButton(getString(R.string.feed_edit)); break; } case 3: { mTitleView.setTitle(getString(R.string.title_football_group)); threadButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab3_selected, 0, 0); threadButton.setTextColor(getResources().getColor(R.color.title)); break; } case 4: { mTitleView.setTitle(getString(R.string.title_football_top)); dataButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tab4_selected, 0, 0); dataButton.setTextColor(getResources().getColor(R.color.title)); break; } } }