• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ColorBar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ColorBar类属于com.shizhefei.view.indicator.slidebar包,在下文中一共展示了ColorBar类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateViewLazy

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的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.slidebar.ColorBar; //导入依赖的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.slidebar.ColorBar; //导入依赖的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: setListener

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的package包/类
private void setListener() {
    ibInfo.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(MainActivity.this, AppDeclareActivity.class);
            if (indicator.getCurrentItem() == 0) {
                intent.putExtra("back", tabName[0]);
            } else if (indicator.getCurrentItem() == 1) {
                intent.putExtra("back", tabName[1]);
            }
            startActivity(intent);
        }
    });

    TypedArray ta = obtainStyledAttributes(new int[]{R.attr.main_color, R.attr.sub_color});
    int selectColor = ta.getColor(0, Color.BLACK);
    int unSelectColor = ta.getColor(1, Color.GRAY);
    ta.recycle();

    indicator.setScrollBar(new ColorBar(getApplicationContext(),
            selectColor, DensityUtil.dip2px(this, 2)));
    indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColor, unSelectColor));
    viewPager.setOffscreenPageLimit(2);

    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    inflate = LayoutInflater.from(getApplicationContext());
    indicatorViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
}
 
开发者ID:liying2008,项目名称:neu-ipgw,代码行数:29,代码来源:MainActivity.java


示例5: onCreateViewLazy

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的package包/类
@Override
	protected void onCreateViewLazy(Bundle savedInstanceState) {
		super.onCreateViewLazy(savedInstanceState);
		setContentView(R.layout.fragment_tabmain);
		Resources res = getResources();

		Bundle bundle = getArguments();
//		tabName = bundle.getString(INTENT_STRING_TABNAME);
		index = bundle.getInt(INTENT_INT_INDEX);

		ViewPager viewPager = (ViewPager) findViewById(R.id.fragment_tabmain_viewPager);
		ScrollIndicatorView indicator = (ScrollIndicatorView) findViewById(R.id.fragment_tabmain_indicator);
		ColorBar colorBar = new ColorBar(getApplicationContext(), Color.RED, 5);
		colorBar.setWidth(ScreenUtil.dp2px(getActivity(), barWidth));
		indicator.setScrollBar(colorBar);

		float unSelectSize = 14;
		float selectSize = unSelectSize * 1f;//keep same

		int selectColor = res.getColor(R.color.tab_top_text_2);
		int unSelectColor = res.getColor(R.color.tab_top_text_1);
		indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColor, unSelectColor).setSize(selectSize, unSelectSize));

		viewPager.setOffscreenPageLimit(4);

		indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
		inflate = LayoutInflater.from(getApplicationContext());

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

		Log.d("cccc", "Fragment 将要创建View " + this);
	}
 
开发者ID:freedomofme,项目名称:Netease,代码行数:35,代码来源:FirstLayerFragment.java


示例6: onCreateView

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的package包/类
@Override
protected void onCreateView(Bundle savedInstanceState) {
    super.onCreateView(savedInstanceState);
    setContentView(R.layout.fragment_tab_product);
    Resources res = getResources();


    ViewPager viewPager = (ViewPager) findViewById(R.id.fragment_product_viewPager);
    FixedIndicatorView indicator = (FixedIndicatorView) findViewById(R.id.fragment_product_indicator);
    indicator.setScrollBar(new ColorBar(getApplicationContext(), Color.TRANSPARENT, 5));

    float unSelectSize = 16;
    float selectSize = unSelectSize * 1.0f;//缩放参数

    int selectColor = res.getColor(R.color.tab_top_text_2);
    int unSelectColor = res.getColor(R.color.tab_top_text_1);
    indicator.setOnTransitionListener(new OnTransitionTextListener(selectSize, unSelectSize, selectColor, unSelectColor));

    viewPager.setOffscreenPageLimit(2);

    mIndicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    mInflate = LayoutInflater.from(getApplicationContext());
    mIndicatorViewPager.setAdapter(adapter);

    mSlideShowView = (SlideShowView) mInflate.inflate(R.layout.slide_show_view, null)
            .findViewById(R.id.slideshowView);
    ImageView imageView = new ImageView(getActivity());
    imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    imageView.setBackgroundDrawable(getResources().getDrawable(
            R.mipmap.banner_defalt));
    mBannerViews = new ArrayList<ImageView>();
    mBannerViews.add(imageView);
    AbsListView.LayoutParams lp = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            SystemInfoUtils.dip2px(getApplicationContext(), 100));
    mSlideShowView.setLayoutParams(lp);
    mSlideShowView.setPageOnClickListener(this);
    mSlideShowView.setImageViews(mBannerViews);


}
 
开发者ID:tangqifa,项目名称:Common-App-Architecture,代码行数:41,代码来源:ProductFragment.java


示例7: initIndicator

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的package包/类
private void initIndicator() {
    float unSelectSize = 12;
    float selectSize = unSelectSize * 1.3f;
    moretabIndicator.setOnTransitionListener(new OnTransitionTextListener().setColor(0XFFFFA629, Color.GRAY).setSize(selectSize, unSelectSize));

    moretabIndicator.setScrollBar(new ColorBar(this, 0XFFFFA629, 4));

    moretabViewPager.setOffscreenPageLimit(0);

    indicatorViewPager = new IndicatorViewPager(moretabIndicator, moretabViewPager);

}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:13,代码来源:HomeActivity.java


示例8: onCreateViewLazy

import com.shizhefei.view.indicator.slidebar.ColorBar; //导入依赖的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.slidebar.ColorBar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodeReorderEvent类代码示例发布时间:2022-05-23
下一篇:
Java ShaderProgramException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap