@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getActivity() instanceof ColorChange) { this.colorChange = (ColorChange) getActivity(); } cuurentColor = ColorTool.getColor(R.color.default_color, getActivity()); colorChange.onColorChange(cuurentColor, ColorTool.colorBurn(cuurentColor)); EventBus.getDefault().register(this); mFragmentManager = getChildFragmentManager(); }
private void updateData(int parentTypeId) { articleTypes.clear(); articleTypes.addAll(CommonCache.get().getCacheArticleType(parentTypeId)); cuurentColor = getColor(articleTypes.get(0).getColor()); CommonCache.get().cacheColor(articleTypes.get(0).getId(), cuurentColor); // .notifyDataSetChanged(); mainPagerAdapter = new MainPagerAdapter(this, articleTypes); viewPager.setAdapter(mainPagerAdapter); mPagerSlidingTabStrip.setViewPager(viewPager); colorChange.onColorChange(cuurentColor, ColorTool.colorBurn(cuurentColor)); mPagerSlidingTabStrip.setIndicatorColor(cuurentColor); }
public int getColor(String color) { return ColorTool.getColor(color); }