當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。