本文整理汇总了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;
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}