当前位置: 首页>>代码示例>>Java>>正文


Java Indicator.setScrollBar方法代码示例

本文整理汇总了Java中com.shizhefei.view.indicator.Indicator.setScrollBar方法的典型用法代码示例。如果您正苦于以下问题:Java Indicator.setScrollBar方法的具体用法?Java Indicator.setScrollBar怎么用?Java Indicator.setScrollBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.shizhefei.view.indicator.Indicator的用法示例。


在下文中一共展示了Indicator.setScrollBar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateViewLazy

import com.shizhefei.view.indicator.Indicator; //导入方法依赖的package包/类
@Override
protected void onCreateViewLazy(Bundle savedInstanceState) {
    super.onCreateViewLazy(savedInstanceState);
    setContentView(R.layout.fragment_recyclerview);
    coolRefreshView = (CoolRefreshView) findViewById(R.id.recyclerview_funnyRefreshView);
    recyclerView = (RecyclerView) findViewById(R.id.recyclerview_recyclerView);

    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(adapter = new BooksRecyclerAdapter(BooksLoador.getBooks(0)));
    View headLayout = inflater.inflate(R.layout.main_head, recyclerView, false);
    adapter.addHeader(headLayout);

    ViewPager viewPager = (ViewPager) headLayout.findViewById(R.id.viewPager);
    Indicator indicator = (Indicator) headLayout.findViewById(R.id.indicatorView);
    indicator.setScrollBar(new ColorBar(getContext(), Color.WHITE, DisplayUtil.dipToPix(getContext(), 3)));
    bannerComponent = new BannerComponent(indicator, viewPager, false);
    bannerComponent.setAdapter(new BannerAdapter());
    bannerComponent.startAutoPlay();
}
 
开发者ID:LuckyJayce,项目名称:CoolRefreshView,代码行数:20,代码来源:RecyclerViewFragment.java

示例2: onCreate

import com.shizhefei.view.indicator.Indicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_more_views);
    Indicator indicator = (Indicator) findViewById(R.id.moreviews_indicatorView);
    ViewPager viewPager = (ViewPager) findViewById(R.id.moreviews_viewPager);
    refreshButton = findViewById(R.id.moreviews_refresh_button);
    completeButton = findViewById(R.id.moreviews_complete_button);

    Class[] fragments = {
            RecyclerViewFragment.class,
            ListViewFragment.class,
            WebViewFragment.class,
            TextViewFragment.class,
            ScrollViewFragment.class
    };

    indicator.setScrollBar(new ColorBar(this, ContextCompat.getColor(this, R.color.primary), DisplayUtil.dipToPix(this, 3)));
    indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(Color.BLACK, Color.GRAY));
    viewPager.setOffscreenPageLimit(2);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    indicatorViewPager.setAdapter(pagesAdapter = new PagesAdapter(getSupportFragmentManager(), fragments));

    refreshButton.setOnClickListener(onClickListener);
    completeButton.setOnClickListener(onClickListener);
}
 
开发者ID:LuckyJayce,项目名称:CoolRefreshView,代码行数:27,代码来源:MoreViewsActivity.java

示例3: onCreate

import com.shizhefei.view.indicator.Indicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_more_views);
    Indicator indicator = (Indicator) findViewById(R.id.moreviews_indicatorView);
    ViewPager viewPager = (ViewPager) findViewById(R.id.moreviews_viewPager);
    refreshButton = findViewById(R.id.moreviews_refresh_button);
    completeButton = findViewById(R.id.moreviews_complete_button);
    headTextView = (TextView) findViewById(R.id.moreviews_headtext_textView);

    headTextView.setText("MoreHeaders");

    Class[] fragments = {
            StateHeaderFragment.class,
            JellyHeaderFragment.class,
            MaterialHeaderFragment.class,
            PinContentMaterialHeaderFragment.class,
            TestHeaderFragment.class
    };

    indicator.setScrollBar(new ColorBar(this, ContextCompat.getColor(this, R.color.primary), DisplayUtil.dipToPix(this, 3)));
    indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(Color.BLACK, Color.GRAY));
    viewPager.setOffscreenPageLimit(2);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    indicatorViewPager.setAdapter(pagesAdapter = new PagesAdapter(getSupportFragmentManager(), fragments));

    refreshButton.setOnClickListener(onClickListener);
    completeButton.setOnClickListener(onClickListener);
}
 
开发者ID:LuckyJayce,项目名称:CoolRefreshView,代码行数:30,代码来源:MoreHeadersActivity.java

示例4: onCreateViewLazy

import com.shizhefei.view.indicator.Indicator; //导入方法依赖的package包/类
@Override
    protected void onCreateViewLazy(Bundle savedInstanceState) {
        super.onCreateViewLazy(savedInstanceState);


        setContentView(R.layout.fragment_tab_news);


        ViewPager viewPager = (ViewPager) findViewById(R.id.fragment_tabmain_viewPager);
        viewPager.setOffscreenPageLimit(4);

        Indicator indicator = (Indicator) findViewById(R.id.fragment_tabmain_indicator);

        //设置tab下标
        indicator.setScrollBar(new ColorBar(getApplicationContext(),getResources().getColor(R.color.tab_top_scrollbar),5));

        float unSelectSize = 14;
        float selectSize = unSelectSize * 1.2f;
        int selectColor = getResources().getColor(R.color.tab_top_text_2);
        int unSelectColor = getResources().getColor(R.color.tab_top_text_1);

        indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColor, unSelectColor).setSize(selectSize, unSelectSize));



        indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
        indicatorViewPager.setPageOffscreenLimit(5);
        indicatorViewPager.setAdapter(new NewsFragmentViewPagerAdapter(getChildFragmentManager()));

        inflate = LayoutInflater.from(getActivity());

//         注意这里 的FragmentManager 是 getChildFragmentManager(); 因为是在Fragment里面
//         而在activity里面用FragmentManager 是 getSupportFragmentManager()


        Log.d("cccc", "Fragment 将要创建View " + this);

    }
 
开发者ID:starmelon,项目名称:lovelife,代码行数:39,代码来源:NewsFragment.java


注:本文中的com.shizhefei.view.indicator.Indicator.setScrollBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。