本文整理匯總了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());
}
}