本文整理汇总了Java中com.astuetz.PagerSlidingTabStrip.setShouldExpand方法的典型用法代码示例。如果您正苦于以下问题:Java PagerSlidingTabStrip.setShouldExpand方法的具体用法?Java PagerSlidingTabStrip.setShouldExpand怎么用?Java PagerSlidingTabStrip.setShouldExpand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.astuetz.PagerSlidingTabStrip
的用法示例。
在下文中一共展示了PagerSlidingTabStrip.setShouldExpand方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFinishInflate
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
super.onFinishInflate();
pager = ((ViewPager) findViewById(R.id.pager));
strip = (PagerSlidingTabStrip) findViewById(R.id.tabs_strip);
strip.setShouldExpand(true);
Adapter adapter = new Adapter(getContext());
pager.setAdapter(adapter);
strip.setViewPager(pager);
backspace = findViewById(R.id.backspace);
backspace.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
callback.backspaceClicked();
}
});
if (adapter.recentIds.length == 0) {
pager.setCurrentItem(1);
}
}
示例2: onCreate
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mBeyondApplication = (BeyondApplication) getApplication();
mTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
mTabs.setShouldExpand(true);
mPager = (ViewPager) findViewById(R.id.pager);
mPagerAdapter = new PagerAdapter(getFragmentManager());
mPager.setAdapter(mPagerAdapter);
mPager.setOffscreenPageLimit(2);
mTabs.setViewPager(mPager);
mTabs.setOnPageChangeListener(this);
// Bind UPnP service
Intent upnpServiceIntent = new Intent(MainActivity.this, BeyondUpnpService.class);
bindService(upnpServiceIntent, mUpnpServiceConnection, Context.BIND_AUTO_CREATE);
// Bind System service
Intent systemServiceIntent = new Intent(MainActivity.this, SystemService.class);
bindService(systemServiceIntent, mSystemServiceConnection, Context.BIND_AUTO_CREATE);
}
示例3: onCreateView
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.pager_fragment, container, false);
ViewPager pager = (ViewPager) view.findViewById(R.id.pagerForList);
PagerAdapter pagerAdapter = new PagerAdapter(getChildFragmentManager());
pager.setAdapter(pagerAdapter);
pager.setOffscreenPageLimit(2);
tabs = (PagerSlidingTabStrip) view.findViewById(R.id.tabs_main);
tabs.setShouldExpand(true);
tabs.setBackgroundColor(getResources().getColor(R.color.brown));
tabs.setIndicatorColor(getResources().getColor(R.color.white));
tabs.setTextColor(getResources().getColor(R.color.black));
tabs.setIndicatorHeight(height);
tabs.setDividerColor(getResources().getColor(R.color.black));
tabs.setViewPager(pager);
// tabs.setTextSize(45);
return view;
}
示例4: initViewPager
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
private void initViewPager() {
List<Fragment> fragments = getFragments();
showPage = 0;
vp_apps = (ViewPager) findViewById(R.id.vp_apps);
vp_apps.setAdapter(new PagerAdapter(getSupportFragmentManager(), fragments));
psts_apps_tabs = (PagerSlidingTabStrip) findViewById(R.id.psts_apps_tabs);
psts_apps_tabs.setShouldExpand(true);
psts_apps_tabs.setViewPager(vp_apps);
vp_apps.setCurrentItem(showPage);
psts_apps_tabs.setBackgroundColor(getResources().getColor(R.color.main500));
psts_apps_tabs.setUnderlineColor(getResources().getColor(R.color.transparent));
psts_apps_tabs.setIndicatorColor(getResources().getColor(R.color.titlewhite));
psts_apps_tabs.setDividerColor(getResources().getColor(R.color.main500));
ViewPager.OnPageChangeListener pageListener = new PageListener();
psts_apps_tabs.setOnPageChangeListener(pageListener);
float dp = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
psts_apps_tabs.setIndicatorHeight((int) dp);
LinearLayout ll = (LinearLayout) psts_apps_tabs.getChildAt(0);
for(int p=0; p < ll.getChildCount(); p++) {
TextView tv = (TextView) ll.getChildAt(p);
if (p == showPage) {
tv.setTextColor(getResources().getColor(R.color.titlewhite));
} else {
tv.setTextColor(getResources().getColor(R.color.titlewhite_alpha));
}
}
}
示例5: showTabs
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
private void showTabs(ViewPager pager, View view) {
mViewPagerTabs = (PagerSlidingTabStrip) view.findViewById(R.id.tabs);
mViewPagerTabs.setTextColor(getResources().getColor(android.R.color.white));
mViewPagerTabs.setShouldExpand(expandTabs());
mViewPagerTabs.setViewPager(pager);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mViewPagerTabs.setTabBackground(android.R.attr.selectableItemBackground);
}
}
示例6: showTabs
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
private void showTabs(ViewPager pager) {
mViewPagerTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
mViewPagerTabs.setTextColor(getResources().getColor(android.R.color.white));
mViewPagerTabs.setShouldExpand(expandTabs());
mViewPagerTabs.setViewPager(pager);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mViewPagerTabs.setTabBackground(android.R.attr.selectableItemBackground);
}
}
示例7: onCreate
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
this.getSupportActionBar().setElevation(0);
getWindow().setSharedElementExitTransition(new Slide());
getWindow().setSharedElementEnterTransition(new Slide());
tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
viewPager = (ViewPager) findViewById(R.id.pager);
viewPagerAdapter = new ContactsAdapter(this.getSupportFragmentManager(), this);
viewPager.setAdapter(viewPagerAdapter);
tabs.setShouldExpand(true);
tabs.setTextColor(getResources().getColor(R.color.text_primary));
tabs.setDividerColor(getResources().getColor(R.color.primary));
tabs.setIndicatorColorResource(R.color.text_primary);
tabs.setIndicatorHeight(7);
// Bind the tabs to the ViewPager
tabs.setViewPager(viewPager);
//Start in Contacts Fragment
viewPager.setCurrentItem(1);
// Listener for slide animation on searchable selected
setOnSearchableListener();
// Configure custom-searchable UI
// CustomSearchableInfo.setTransparencyColor(Color.parseColor("#0288D1"));
}
示例8: onCreate
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mMinHeaderHeight = getResources().getDimensionPixelSize(R.dimen.min_header_height);
mHeaderHeight = getResources().getDimensionPixelSize(R.dimen.header_height);
mMinHeaderTranslation = -mMinHeaderHeight + Utils.getActionBarHeight(this);
setContentView(R.layout.activity_main);
mHeaderPicture = (ImageView) findViewById(R.id.header_picture);
mHeaderPicture.setImageResource(R.drawable.pic3);
mHeader = findViewById(R.id.header);
mPagerSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setOffscreenPageLimit(2);
mViewPager.requestDisallowInterceptTouchEvent(true);
mPagerAdapter = new PagerAdapter(getSupportFragmentManager());
mPagerAdapter.setTabHolderScrollingContent(this);
mViewPager.setAdapter(mPagerAdapter);
mPagerSlidingTabStrip.setShouldExpand(true);
mPagerSlidingTabStrip.setTextColorResource(android.R.color.white);
mPagerSlidingTabStrip.setDividerColorResource(android.R.color.white);
mPagerSlidingTabStrip.setViewPager(mViewPager);
mPagerSlidingTabStrip.setOnPageChangeListener(new ActivityOnPageChangeListener());
mPagerSlidingTabStrip.setTabPaddingLeftRight(getResources().getDimensionPixelOffset(R.dimen.tab_padding));
}
示例9: setupSlidingTabs
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
private void setupSlidingTabs(ViewPager vpPager2) {
tabs = (PagerSlidingTabStrip) findViewById(R.id.slidingTabStrip);
tabs.setShouldExpand(true);
tabs.setAllCaps(false);
float dimension = getResources().getDimensionPixelSize(
R.dimen.fontsize_small);
tabs.setTextSize((int) dimension);
Util.applyPrimaryFont(getApplicationContext(), tabs);
tabs.setViewPager(vpPager);
tabs.setIndicatorColor(getResources().getColor(R.color.watsi_blue));
}
示例10: onCreateView
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.pager, container, false);
pager = (ViewPager) view.findViewById(R.id.pager);
if (adapter == null) {
adapter = new XRPagerAdapter(getChildFragmentManager());
ArrayList<AbstractXRFragment> fl = new ArrayList<AbstractXRFragment>();
AlbumListFragment albumListFragment = new AlbumListFragment();
fl.add(albumListFragment);
ArtistListFragment artistListFragment = new ArtistListFragment();
fl.add(artistListFragment);
SongListFragment songListFragment = new SongListFragment();
fl.add(songListFragment);
adapter.setFragmentList(fl);
}
pager.setAdapter(adapter);
// Bind the tabs to the ViewPager
PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) view.findViewById(R.id.tabs);
tabs.setShouldExpand(true);
tabs.setViewPager(pager);
return view;
}
示例11: onCreate
import com.astuetz.PagerSlidingTabStrip; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_schedules);
pColor = DB.patients().getActive(this).getColor();
setupToolbar(null, pColor);
setupStatusBar(pColor);
subscribeToEvents();
processIntent();
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
TextView title = ((TextView) findViewById(R.id.textView2));
title.setBackgroundColor(pColor);
title.setText(getString(mScheduleId != -1 ? R.string.title_edit_schedule_activity : R.string.title_create_schedule_activity));
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
mViewPager.setOnPageChangeListener(this);
mViewPager.setOffscreenPageLimit(3);
tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
tabs.setOnPageChangeListener(this);
tabs.setAllCaps(true);
tabs.setShouldExpand(true);
tabs.setDividerPadding(3);
tabs.setDividerColor(getResources().getColor(R.color.white_50));
tabs.setDividerColor(getResources().getColor(R.color.transparent));
tabs.setIndicatorHeight(ScreenUtils.dpToPx(getResources(), 4));
tabs.setIndicatorColor(ScreenUtils.equivalentNoAlpha(pColor, 0.8f));
tabs.setTextColor(Color.parseColor("#222222"));
tabs.setUnderlineColor(ScreenUtils.equivalentNoAlpha(pColor, 0.5f));
tabs.setViewPager(mViewPager);
if (mSchedule != null) {
mViewPager.setCurrentItem(1);
}
findViewById(R.id.add_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveSchedule();
}
});
}