项目修改与整理
This commit is contained in:
@ -351,8 +351,6 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
if (savedInstanceState != null) {
|
||||
currentTab = savedInstanceState.getInt("currentTab");
|
||||
isSkipped = savedInstanceState.getBoolean("isSkipped");
|
||||
} else if (isNewFirstLaunch) {
|
||||
currentTab = 1;
|
||||
} else {
|
||||
currentTab = 0;
|
||||
}
|
||||
@ -368,7 +366,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
if (isNewFirstLaunch) {
|
||||
getPluginUpdate();
|
||||
// sp.edit().putBoolean("isNewFirstLaunchV" + PackageUtils.getVersionName(getApplicationContext()), false).apply();
|
||||
sp.edit().putBoolean("isNewFirstLaunchV" + PackageUtils.getVersionName(getApplicationContext()), false).apply();
|
||||
}
|
||||
|
||||
// 获取免责声明
|
||||
@ -404,7 +402,6 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
handler.postDelayed(skipRun, 500);
|
||||
|
||||
Log.e("TD_CHANNEL_ID", (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID"));
|
||||
Log.e("device", TokenUtils.getDeviceId(this));
|
||||
}
|
||||
|
||||
private void updateUserGhzs() {
|
||||
@ -880,14 +877,14 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
public void run() {
|
||||
if (getIntent() != null && getIntent().getExtras() != null && !isSkipped) {
|
||||
isSkipped = true;
|
||||
String to = getIntent().getStringExtra("to");
|
||||
if(!TextUtils.isEmpty(to)){
|
||||
Class<?> clazz = ClassUtils.forName(to);
|
||||
if (clazz != null) {
|
||||
Intent skipIntent = new Intent(MainActivity.this, clazz);
|
||||
Bundle bundle = getIntent().getBundleExtra("data");
|
||||
if (bundle != null) {
|
||||
String to = bundle.getString("to");
|
||||
if(!TextUtils.isEmpty(to)){
|
||||
Class<?> clazz = ClassUtils.forName(to);
|
||||
if (clazz != null) {
|
||||
Intent skipIntent = new Intent(MainActivity.this, clazz);
|
||||
|
||||
Bundle bundle = getIntent().getBundleExtra("data");
|
||||
if (bundle != null) {
|
||||
String entrance = bundle.getString("entrance");
|
||||
if (TextUtils.isEmpty(entrance) || !entrance.startsWith("(") || !entrance.endsWith(")")) {
|
||||
bundle.putString("entrance", "(插件跳转)");
|
||||
@ -896,10 +893,10 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
if (packageName != null) {
|
||||
bundle.putInt("currentItem", 1);
|
||||
}
|
||||
}
|
||||
|
||||
skipIntent.putExtra("data", bundle);
|
||||
startActivity(skipIntent);
|
||||
skipIntent.putExtra("data", bundle);
|
||||
startActivity(skipIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -984,7 +981,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
hideFragments(transaction);
|
||||
switch (index) {
|
||||
case 0:
|
||||
ivGame.setImageResource(R.drawable.home1_selected);
|
||||
ivGame.setImageResource(R.drawable.ic_game_select);
|
||||
tvGame.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (gameFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
@ -1010,7 +1007,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
currentTab = 0;
|
||||
break;
|
||||
case 1:
|
||||
ivNews.setImageResource(R.drawable.home2_selected);
|
||||
ivNews.setImageResource(R.drawable.ic_news_select);
|
||||
tvNews.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (newsFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
@ -1036,7 +1033,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
currentTab = 1;
|
||||
break;
|
||||
case 2:
|
||||
ivPersonal.setImageResource(R.drawable.home3_selected);
|
||||
ivPersonal.setImageResource(R.drawable.ic_user_select);
|
||||
tvPersonal.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (personalFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
@ -1066,9 +1063,9 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
|
||||
// 清除掉所有的选中状态。
|
||||
private void clearSelection() {
|
||||
ivGame.setImageResource(R.drawable.home1_unselected);
|
||||
ivNews.setImageResource(R.drawable.home2_unselected);
|
||||
ivPersonal.setImageResource(R.drawable.home3_unselected);
|
||||
ivGame.setImageResource(R.drawable.ic_game_unselect);
|
||||
ivNews.setImageResource(R.drawable.ic_news_unselect);
|
||||
ivPersonal.setImageResource(R.drawable.ic_user_unselect);
|
||||
tvGame.setTextColor(getResources().getColor(R.color.title));
|
||||
tvNews.setTextColor(getResources().getColor(R.color.title));
|
||||
tvPersonal.setTextColor(getResources().getColor(R.color.title));
|
||||
|
||||
Reference in New Issue
Block a user