产品优化汇总
This commit is contained in:
@ -140,6 +140,10 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
private int currentTab;
|
||||
|
||||
private boolean isSkipped;
|
||||
|
||||
public final static String EB_MAINACTIVITY_TAG = "MainActivity" ;
|
||||
public final static String EB_SKIP_GAMEFRAGMENT = "GameFragment" ;
|
||||
|
||||
Runnable skipRun = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -524,6 +528,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
|
||||
if (response != null && response.getComment() > 0) {
|
||||
Utils.log("======000");
|
||||
mMessageHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@ -790,6 +795,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
// tvWenDa = (TextView) findViewById(R.id.main_tv_wenda);
|
||||
tvMessage = (TextView) findViewById(R.id.main_tv_message);
|
||||
tvPersonal = (TextView) findViewById(R.id.main_tv_personal);
|
||||
mMessageHint = findViewById(R.id.main_iv_message_hint);
|
||||
}
|
||||
|
||||
private void checkPermission() {
|
||||
@ -1176,10 +1182,10 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
public void onClick(View v) {
|
||||
final int id = v.getId();
|
||||
if (id == R.id.main_ll_game) {
|
||||
EventBus.getDefault().post(new EBUISwitch("MainActivity", 0));
|
||||
EventBus.getDefault().post(new EBUISwitch(EB_MAINACTIVITY_TAG, 0));
|
||||
setTabSelection(0);
|
||||
} else if (id == R.id.main_ll_news) {
|
||||
EventBus.getDefault().post(new EBUISwitch("MainActivity", 1));
|
||||
EventBus.getDefault().post(new EBUISwitch(EB_MAINACTIVITY_TAG, 1));
|
||||
setTabSelection(1);
|
||||
}
|
||||
// else if (id == R.id.main_ll_wenda) {
|
||||
@ -1188,15 +1194,18 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
else if (id == R.id.main_ll_message) {
|
||||
setTabSelection(2);
|
||||
} else if (id == R.id.main_ll_personal) {
|
||||
EventBus.getDefault().post(new EBUISwitch("MainActivity", 2));
|
||||
EventBus.getDefault().post(new EBUISwitch(EB_MAINACTIVITY_TAG, 2));
|
||||
setTabSelection(3);
|
||||
}
|
||||
if (id == R.id.main_ll_personal) {
|
||||
mTintManager.setStatusBarTintResource(R.color.theme);
|
||||
} else if (Build.MANUFACTURER.equals("Meizu") || Build.MANUFACTURER.equals("Xiaomi")) {
|
||||
mTintManager.setStatusBarTintColor(Color.WHITE);
|
||||
} else {
|
||||
mTintManager.setStatusBarTintColor(Color.BLACK);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (id == R.id.main_ll_personal) {
|
||||
mTintManager.setStatusBarTintResource(R.color.theme);
|
||||
} else if (Build.MANUFACTURER.equals("Meizu") || Build.MANUFACTURER.equals("Xiaomi")) {
|
||||
mTintManager.setStatusBarTintColor(Color.WHITE);
|
||||
} else {
|
||||
mTintManager.setStatusBarTintColor(Color.BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1341,11 +1350,11 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
// ivWenDa.setImageResource(R.drawable.ic_wenda_unselect);
|
||||
ivMessage.setImageResource(R.drawable.ic_message_unselect);
|
||||
ivPersonal.setImageResource(R.drawable.ic_user_unselect);
|
||||
tvGame.setTextColor(Color.parseColor("#a7a8b2"));
|
||||
tvNews.setTextColor(Color.parseColor("#a7a8b2"));
|
||||
tvGame.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
tvNews.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
// tvWenDa.setTextColor(Color.parseColor("#a7a8b2"));
|
||||
tvMessage.setTextColor(Color.parseColor("#a7a8b2"));
|
||||
tvPersonal.setTextColor(Color.parseColor("#a7a8b2"));
|
||||
tvMessage.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
tvPersonal.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
}
|
||||
|
||||
// 将所有的Fragment都置为隐藏状态。
|
||||
@ -1375,15 +1384,16 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
|
||||
public void onEventMainThread(EBSkip skip) {
|
||||
if ("GameFragment".equals(skip.getType())) {
|
||||
EventBus.getDefault().post(new EBUISwitch("MainActivity", 0));
|
||||
if (EB_SKIP_GAMEFRAGMENT.equals(skip.getType())) {
|
||||
EventBus.getDefault().post(new EBUISwitch(EB_MAINACTIVITY_TAG, 0));
|
||||
setTabSelection(0);
|
||||
EventBus.getDefault().post(new EBSkip("MainActivity", skip.getCurrentItem()));
|
||||
EventBus.getDefault().post(new EBSkip(EB_MAINACTIVITY_TAG, skip.getCurrentItem()));
|
||||
}
|
||||
}
|
||||
|
||||
public void onEventMainThread(EBReuse reuse) {
|
||||
if (MessageFragment.MESSAGE_READ_OVER.equals(reuse.getType())) {
|
||||
Utils.log("======= over??");
|
||||
mMessageHint.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user