本文整理匯總了Java中com.viewpagerindicator.CirclePageIndicator.setSnap方法的典型用法代碼示例。如果您正苦於以下問題:Java CirclePageIndicator.setSnap方法的具體用法?Java CirclePageIndicator.setSnap怎麽用?Java CirclePageIndicator.setSnap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.viewpagerindicator.CirclePageIndicator
的用法示例。
在下文中一共展示了CirclePageIndicator.setSnap方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
if(getActionBar()!=null)
getActionBar().hide();
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
mIndicator.setSnap(true);
mIndicator.setViewPager(mViewPager);
}
示例2: onCreate
import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.instructions);
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mViewPager);
final float density = getResources().getDisplayMetrics().density;
mIndicator.setRadius(7 * density);
mIndicator.setFillColor(0xFFFFFFFF);
mIndicator.setPageColor(0xFF466066);
mIndicator.setStrokeColor(0xFFFFFFFF);
mIndicator.setStrokeWidth(2 * density);
mIndicator.setSnap(false);
}
示例3: onCreate
import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles);
CircleAdapter mAdapter = new CircleAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
indicator.setSnap(true);
}
示例4: onCreate
import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
indicator.setSnap(true);
}