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


Java Indicator类代码示例

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


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

import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
private void initView() {
    viewPager = (ViewPager) findViewById(R.id.fragment_tabmain_viewPager);
    indicator = (Indicator) findViewById(R.id.fragment_tabmain_indicator);
    ibInfo = (ImageButton) findViewById(R.id.ibInfo);
    if (!AccountApp.isWifiChecked) {
        // 检查设备是否连接到WiFi
        try {
            if (!NetWorkUtils.isWifiByType(this)) {
                AppToast.showToast("设备未接入WiFi。");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        AccountApp.isWifiChecked = true;
    }
    // 检查推送
    checkPush();
}
 
开发者ID:liying2008,项目名称:neu-ipgw,代码行数:19,代码来源:MainActivity.java

示例4: onCreate

import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initWindow();
    setContentView(R.layout.activity_main);

    SViewPager viewPager = (SViewPager) findViewById(R.id.tabmain_viewPager);
    Indicator indicator = (Indicator) findViewById(R.id.tabmain_indicator);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    indicatorViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
    // 禁止viewpager的滑动事件
    viewPager.setCanScroll(false);
    // 设置viewpager保留界面不重新加载的页面数量
    viewPager.setOffscreenPageLimit(4);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbar.setTitle(R.string.index_name);
    setSupportActionBar(toolbar);
    invalidateOptionsMenu();


}
 
开发者ID:freedomofme,项目名称:Netease,代码行数:24,代码来源:MainActivity.java

示例5: 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

示例6: onCreate

import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle arg0) {
    setContentView(R.layout.activity_tabmain);
    super.onCreate(arg0);
    mTitleBar.setTitle(TAB_NAMES[0]);

    ViewPager viewPager = (ViewPager) findViewById(R.id.tabmain_viewPager);
    Indicator indicator = (Indicator) findViewById(R.id.tabmain_indicator);
    mIndicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    mIndicatorViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
    // 禁止viewpager的滑动事件
    viewPager.setCanScroll(false);
    // 设置viewpager保留界面不重新加载的页面数量
    viewPager.setOffscreenPageLimit(4);
    // 默认是1,,自动预加载左右两边的界面。设置viewpager预加载数为0。只加载加载当前界面。
    viewPager.setPrepareNumber(0);

    mIndicatorViewPager.setOnIndicatorPageChangeListener(new IndicatorViewPager.OnIndicatorPageChangeListener() {
        @Override
        public void onIndicatorPageChange(int preItem, int currentItem) {
            if (currentItem == 1) {
                mTitleBar.setTitleVisibility(false);
            } else {
                mTitleBar.setTitleVisibility(true);
                mTitleBar.setTitle(TAB_NAMES[currentItem]);
            }

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

示例7: TextWidthColorBar

import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
public TextWidthColorBar(Context context, Indicator indicator, int color, int height) {
	super(context, color, height);
	this.indicator = indicator;
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:5,代码来源:TextWidthColorBar.java

示例8: 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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。