@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_college);
        res = getResources();
        black = res.getColor(R.color.black);
        colorPrimary = res.getColor(R.color.colorPrimary);

        if (getIntent() != null) {
            int index = getIntent().getIntExtra("index", 0);
            Log.e(TAG, "onCreate: index=" + index);
        }

        StatusBarUtil.setColor(this, black);
        mContext = this;
        Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(mToolbar);
        mToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);
        mAppBarLayout = (AppBarLayout) findViewById(R.id.appbar);
        //


        mViewPager = (ViewPager) findViewById(R.id.container);
        tabLayout = (TabLayout) findViewById(R.id.tabs);
        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
        tabLayout.setupWithViewPager(mViewPager);
        tabLayout.setVisibility(View.GONE);
        tabLayout.setTabIndicatorFullWidth(false);
        mViewPager.setOffscreenPageLimit(3);


        Observable.create((ObservableOnSubscribe<String>) emitter -> {
            String json = Tools.readStrFromAssets("newSchool.json", mContext);
            if (json != null) {
                emitter.onNext(json);
                emitter.onComplete();
            } else {
                emitter.onError(new Throwable());
            }
        }).map(s -> {
            Gson gson = new Gson();
            List<SchoolBeanShell> schoolBeanShells =
                    gson.fromJson(s, new TypeToken<ArrayList<SchoolBeanShell>>() {
                    }.getType());
            for (int i = 0; i < schoolBeanShells.size(); i++) {
                locations.add(schoolBeanShells.get(i).getName());
            }
            return schoolBeanShells;
        }).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Observer<List<SchoolBeanShell>>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(List<SchoolBeanShell> schoolBeanShells) {
                        loadUI(schoolBeanShells);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });


        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (test) {
                    StatusBarUtil.setColor(CollegeActivity.this, colorPrimary, 0);
                } else {
                    StatusBarUtil.setColor(CollegeActivity.this, black);
                }
                test = !test;
            }
        });
        final int[] pics = new int[]{R.drawable.a5, R.drawable.a6, R.drawable.cat};

        headImage = (ImageView) findViewById(R.id.headImg);
        mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
            }

            @Override
            public void onPageSelected(int position) {
                mToolbarLayout.setTitle(String.valueOf(mBeanShells.get(position).getSchool().size()));
                Glide.with(mContext)
                        .load(pics[position % pics.length])
                        .apply(new RequestOptions().placeholder(R.drawable.a6))
                        .into(headImage);
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });
        mViewPager.setCurrentItem(0);
        mAppBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
            Log.e(TAG, "onOffsetChanged: verticalOffset==" + verticalOffset);
            Log.e(TAG, "onOffsetChanged: mAppBarLayout ==" + mAppBarLayout.getMinimumHeightForVisibleOverlappingContent());
            if (Math.abs(verticalOffset) >= mAppBarLayout.getTotalScrollRange()) {
                StatusBarUtil.setColor(CollegeActivity.this, colorPrimary, 0);
            } else {
                StatusBarUtil.setColor(CollegeActivity.this, black);
            }
        });

        bottom = findViewById(R.id.bottom);
    }
The {@link ViewPager} that will host the section contents.
app/src/main/java/home/smart/fly/animations/ui/activity/CollegeActivity.java