Search in sources :

Example 1 with ViewPagerObserver

use of com.moshx.indicators.observer.ViewPagerObserver in project AndroidIndicators by MoshDev.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    setTitle(null);
    ViewPager mViewPager = (ViewPager) findViewById(R.id.viewPager);
    mViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
    final ViewPagerObserver observer = new ViewPagerObserver(mViewPager);
    titleIndicator = (TitleIndicator) findViewById(R.id.titleIndicator);
    observer.addObservableView(titleIndicator);
    titleIndicator.setToolBar(toolbar);
    IconicTabsView iconicTabsView = (IconicTabsView) findViewById(R.id.iconicTabsView);
    // iconicTabsView.setIconicTabsEffect(new FadeIconicTabsEffect());
    iconicTabsView.setIconicTabsEffect(new GreyscaleIconicTabsEffect());
    // iconicTabsView.setIconicTabsEffect(new ArgbIconicTabsEffect(0xFF010101, Color.RED));
    observer.addObservableView(iconicTabsView);
    ArgbEvaluator argbEvaluator;
}
Also used : IconicTabsView(com.moshx.indicators.tab.IconicTabsView) ArgbEvaluator(android.animation.ArgbEvaluator) ViewPagerObserver(com.moshx.indicators.observer.ViewPagerObserver) ViewPager(android.support.v4.view.ViewPager) GreyscaleIconicTabsEffect(com.moshx.indicators.tab.effect.GreyscaleIconicTabsEffect) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

ArgbEvaluator (android.animation.ArgbEvaluator)1 ViewPager (android.support.v4.view.ViewPager)1 Toolbar (android.support.v7.widget.Toolbar)1 ViewPagerObserver (com.moshx.indicators.observer.ViewPagerObserver)1 IconicTabsView (com.moshx.indicators.tab.IconicTabsView)1 GreyscaleIconicTabsEffect (com.moshx.indicators.tab.effect.GreyscaleIconicTabsEffect)1