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


Java CirclePageIndicator.setVisibility方法代码示例

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


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

示例1: onCreateView

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    Toast.makeText(getActivity(), "onCreateView ViewPagerFragment", Toast.LENGTH_SHORT).show();
    View view = inflater.inflate(R.layout.fragment_view_pager, container, false);

    if (viewPagerItems != null && viewPagerItems.size() > 0) {
        ViewPager pager = (ViewPager) view.findViewById(R.id.viewpager);
        pager.setAdapter(new ViewPagerWithTabsAdapter(getActivity(), getActivity().getSupportFragmentManager(), viewPagerItems));
        int defaultViewPagerItemSelectedPosition = defaultViewPagerItemSelectedPosition();
        if (defaultViewPagerItemSelectedPosition >= 0 && defaultViewPagerItemSelectedPosition < viewPagerItems.size())
            pager.setCurrentItem(defaultViewPagerItemSelectedPosition);

        if (!showViewPagerIndicator()) {
            pager.setOnPageChangeListener(mOnPageChangeListener);
        } else {
            CirclePageIndicator viewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
            viewPagerIndicator.setViewPager(pager);
            viewPagerIndicator.setVisibility(View.VISIBLE);
            viewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
        }

        replaceTitle(viewPagerItems.get(0).getTitleResource());
    }
    return view;
}
 
开发者ID:lengpiseth,项目名称:material-design-library,代码行数:27,代码来源:ViewPagerFragment.java

示例2: onResume

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
@Override
public void onResume() {
	InfoFragmentPagerAdapter adapter = new InfoFragmentPagerAdapter(getChildFragmentManager());
	ArrayList<Integer> lineas = new ArrayList<Integer>();
	for(Integer l : DataStorage.paradas.get(numParada).getLineas()) {
		lineas.add(l);
	}
	adapter.addItem(InfoParadaFragment.newInstance(numParada, lineas));
	Parada paradaActual = DataStorage.paradas.get(numParada);
	if(paradaActual.getRepetida() != null){
		
		int otraParada = paradaActual.getRepetida().getId();
		adapter.addItem(InfoParadaFragment.newInstance(otraParada, lineas));
	}
	vPager.setAdapter(adapter);
	CirclePageIndicator indicator = (CirclePageIndicator) content.findViewById(R.id.indicator);
	if(vPager.getAdapter().getCount() > 1) {
		indicator.setViewPager(vPager);
	} else {
		indicator.setVisibility(View.GONE);
	}
	super.onStart();
}
 
开发者ID:Arasthel,项目名称:AlmeriBus,代码行数:24,代码来源:MostrarInfoParada.java

示例3: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
private void showIndicator(View view, ViewPager pager) {
    if (!showViewPagerIndicator()) pager.setOnPageChangeListener(mOnPageChangeListener);
    else {
        mViewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:10,代码来源:ViewPagerFragment.java

示例4: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
private void showIndicator(ViewPager pager) {
    if (!showViewPagerIndicator()) {
        pager.setOnPageChangeListener(mOnPageChangeListener);
    } else {
        mViewPagerIndicator = (CirclePageIndicator)
                findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:12,代码来源:ViewPagerActivity.java

示例5: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
private void showIndicator(View view, ViewPager pager) {
    if (!showViewPagerIndicator()) pager.addOnPageChangeListener(mOnPageChangeListener);
    else {
        mViewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
开发者ID:andreister,项目名称:hasty,代码行数:10,代码来源:ViewPagerFragment.java

示例6: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
private void showIndicator(ViewPager pager) {
    if (!showViewPagerIndicator()) {
        pager.addOnPageChangeListener(mOnPageChangeListener);
    } else {
        mViewPagerIndicator = (CirclePageIndicator)
                findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
开发者ID:andreister,项目名称:hasty,代码行数:12,代码来源:ViewPagerActivity.java

示例7: onCreate

import com.viewpagerindicator.CirclePageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_pager);

    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);

    ViewPagerHandler handler = getViewPagerHandler();
    if (handler != null && handler.getViewPagerItems() != null)
        viewPagerItems = handler.getViewPagerItems();

    if (viewPagerItems != null && viewPagerItems.size() > 0) {
        ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
        pager.setAdapter(new ViewPagerWithTabsAdapter(this, getSupportFragmentManager(), viewPagerItems));
        int defaultViewPagerItemSelectedPosition = defaultViewPagerItemSelectedPosition();
        if (defaultViewPagerItemSelectedPosition >= 0 && defaultViewPagerItemSelectedPosition < viewPagerItems.size())
            pager.setCurrentItem(defaultViewPagerItemSelectedPosition);

        if (!showViewPagerIndicator()) {
            pager.setOnPageChangeListener(mOnPageChangeListener);
        } else {
            CirclePageIndicator viewPagerIndicator = (CirclePageIndicator) findViewById(R.id.viewpagerindicator);
            viewPagerIndicator.setViewPager(pager);
            viewPagerIndicator.setVisibility(View.VISIBLE);
            viewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
        }

        replaceTitle(viewPagerItems.get(0).getTitleResource());
    }
}
 
开发者ID:lengpiseth,项目名称:material-design-library,代码行数:34,代码来源:ViewPagerActivity.java


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