本文整理匯總了Java中com.astuetz.PagerSlidingTabStrip.setUnderlineColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PagerSlidingTabStrip.setUnderlineColor方法的具體用法?Java PagerSlidingTabStrip.setUnderlineColor怎麽用?Java PagerSlidingTabStrip.setUnderlineColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.astuetz.PagerSlidingTabStrip
的用法示例。
在下文中一共展示了PagerSlidingTabStrip.setUnderlineColor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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));
}
}
}
示例2: 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();
}
});
}