本文整理匯總了Java中android.support.v4.view.PagerTabStrip類的典型用法代碼示例。如果您正苦於以下問題:Java PagerTabStrip類的具體用法?Java PagerTabStrip怎麽用?Java PagerTabStrip使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PagerTabStrip類屬於android.support.v4.view包,在下文中一共展示了PagerTabStrip類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initView
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
protected void initView(Bundle savedInstanceState) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("下載管理");
toolbar.setTitleTextColor(Color.WHITE);
setSupportActionBar(toolbar);
toolbar.setOnMenuItemClickListener(this);
tabbar = (PagerTabStrip)findViewById(R.id.tabbar);
mViewPager = (ViewPager)findViewById(R.id.viewpager);
FragmentManager fm = getSupportFragmentManager();
fragmentAdapter = new FragmentAdapter(fm);
mViewPager.setOffscreenPageLimit(2);
mViewPager.setAdapter(fragmentAdapter);
tabbar.setTextColor(ContextCompat.getColor(this,R.color.write));
tabbar.setBackgroundColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
tabbar.setTabIndicatorColor(ContextCompat.getColor(this,R.color.colorAccent));
}
示例2: initUIInner
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
void initUIInner() {
setFiltersVisible(filtersVisible);
if (!Data.getInstance().getIsLoading()) {
findViewById(R.id.waiting_screen).setVisibility(View.GONE);
mViewPager = (DisableableViewPager) findViewById(R.id.pager);
mPagerAdapter = new ItemsFragmentPagerAdapter(getSupportFragmentManager(), this, isPremium());
mPageTabs = (PagerTabStrip) findViewById(R.id.pager_title_strip);
mViewPager.setOnPageChangeListener(this);
mViewPager.setAdapter(mPagerAdapter);
onPageSelected(0);
} else {
findViewById(R.id.waiting_screen).setVisibility(View.VISIBLE);
}
}
示例3: getY
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
public static int getY(View view, boolean force) {
if (!force && bufferedY != -1) {
return bufferedY;
}
int newY = view.getMeasuredHeight();
if (view instanceof ViewPager) {
ViewPager viewPager = (ViewPager) view;
for (int i = 0; i < viewPager.getChildCount(); i++) {
View child = viewPager.getChildAt(i);
if (child.getVisibility() != View.GONE &&
(child instanceof PagerTabStrip ||
child instanceof PagerTitleStrip)) {
// Some views use space within the viewPager, but are not part of the page
newY -= child.getMeasuredHeight();
}
}
}
if (newY > 0) {
bufferedY = newY;
}
if (DEBUG) Log.v(LOG_TAG, "getY " + bufferedY);
return bufferedY;
}
示例4: onCreateView
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_viewpager, container, false);
viewPager = (ViewPager)rootView.findViewById(R.id.view_pager);
viewPager.setAdapter(new ListPagerAdapter(getChildFragmentManager()));
tabStrip = (PagerTabStrip)rootView.findViewById(R.id.tab_strip);
tabStrip.setBackgroundColor(getResources().getColor(R.color.toolbar_background));
tabStrip.setTextColor(getResources().getColor(R.color.dark_text));
tabStrip.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.textSizeTC3));
tabStrip.setTabIndicatorColor(getResources().getColor(R.color.rdio_blue));
return rootView;
}
示例5: init
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
public void init(){
viewPager =(ViewPager) findViewById(R.id.viewpager);
tabStrip =(PagerTabStrip) findViewById(R.id.pagertab);
inflater =this.getLayoutInflater().from(this);
staff =inflater.inflate(R.layout.about_staff, null);
update =inflater.inflate(R.layout.about_update,null);
tabStrip.setTabIndicatorColor(Color.rgb(255, 255, 255)); //FF9C95 RGB 255, 156, 149
tabStrip.setDrawFullUnderline(true);
tabStrip.setTextColor(Color.WHITE);
tabStrip.setBackgroundColor(Color.rgb(154, 205, 50));
viewList .add(staff);
viewTitle .add("STAFF");
viewList .add(update);
viewTitle .add("檢查更新");
viewPager .setAdapter(new MyPagerAdapter(viewList, viewTitle));
}
示例6: setUserVisibleHint
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isAdded() && isVisibleToUser && Global.INSTANCE.hasShownCoachMark("swipe_side") && !Global.INSTANCE.hasShownCoachMark("check_lists")) {
PagerTabStrip pagerTabStrip = (PagerTabStrip) getActivity().findViewById(R.id.pager_title_strip);
if (pagerTabStrip != null && pagerTabStrip.getChildCount() > 1 ) {
new MaterialTapTargetPrompt.Builder(getActivity())
.setTarget(pagerTabStrip.getChildAt(1))
.setSecondaryText(getString(R.string.view_all_checlists))
.setBackgroundColour(getResources().getColor(R.color.coachmark_background_dark))
.setFocalColour(getResources().getColor(R.color.coachmark_focal_background))
.setSecondaryTextColour(getResources().getColor(R.color.umbrella_green))
.setPromptFocal(new RectanglePromptFocal())
.setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
if (state == MaterialTapTargetPrompt.STATE_REVEALED) {
Global.INSTANCE.setCoachMarkShown("check_lists", true);
}
}
})
.show();
}
}
}
示例7: setUpFont
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
/** Inicializa la fuente y la coloca en cada textview */
private void setUpFont() {
Typeface typeface = Typefaces.get(this, Typefaces.Font.TWOBIT);
scoreTextTextView.setTypeface(typeface);
linesTextTextView.setTypeface(typeface);
nextTetrominoTextTextView.setTypeface(typeface);
gameOverTextView.setTypeface(typeface);
scoreTextView.setTypeface(typeface);
levelTextView.setTypeface(typeface);
linesTextView.setTypeface(typeface);
PagerTabStrip strip = (PagerTabStrip) viewPager.findViewById(R.id.pager_tab_strip);
for (int i = 0; i < strip.getChildCount(); i++) {
View nextChild = strip.getChildAt(i);
if (nextChild instanceof TextView) {
TextView textViewToConvert = (TextView) nextChild;
textViewToConvert.setTypeface(typeface);
}
}
}
示例8: onCreateView
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.result_lists_pager, null);
final SwiftypeConfig config = new SwiftypeConfig(getResources());
final String[] documentTypeNames = config.getDocumentTypeNames();
adapter = new ResultListsAdapter(getFragmentManager(), R.id.results_pager, documentTypeNames, config.getMaxResultFieldLength());
pager = (ViewPager) rootView.findViewById(R.id.results_pager);
pager.setAdapter(adapter);
tabs = (PagerTabStrip) rootView.findViewById(R.id.pager_title_strip);
visibility = (documentTypeNames.length < 2) ? View.GONE : View.VISIBLE;
if (query != null) {
newSearchRequest(query);
}
return rootView;
}
示例9: onCreate
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tope);
// adding preference layout to settings menu
PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
cleanUp();
// Create the adapter that will return a fragment for each of the three
// primary sections of the app.
mSectionsPagerAdapter = new TopeSectionsPagerAdapter(this, getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
pagerTabStrip = (PagerTabStrip) findViewById(R.id.pager_title_strip);
pagerTabStrip.setDrawFullUnderline(true);
pagerTabStrip.setTabIndicatorColor(0x030303);
clientDataSource = TopeUtils.getClientDataSource(getApplicationContext());
actionDataSource = TopeUtils.getActionDataSource(getApplicationContext());
startStatusChecking();
}
示例10: initialisePaging
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
private void initialisePaging() {
List<PageDescriptor> pages = new ArrayList<>();
pages.add(new SimplePageDescriptor("Exam Schedule", "Exam Schedule"));
pages.add(new CourseSchedulePageDescriptor(true, "Current Schedule",
DEFAULT_COURSE_SCHEDULE_URL));
mPagerAdapter = new SchedulePagerAdapter(getSupportFragmentManager(), pages, this);
pager.setPageMargin(2);
pager.setOffscreenPageLimit(2);
pager.setAdapter(mPagerAdapter);
pager.addOnPageChangeListener(this);
pager.setCurrentItem(1, false);
// titleIndicator.setOnPageChangeListener(this);
// ((PagerTabStrip) findViewById(R.id.titles)).no
PagerTabStrip titleIndicator = (PagerTabStrip) findViewById(R.id.tabs);
ViewCompat.setElevation(titleIndicator, getResources().getDimensionPixelSize(R.dimen.actionbar_elevation));
}
示例11: onCreate
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
protected void onCreate(Bundle saveBundle) {
super.onCreate(saveBundle);
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
setContentView(R.layout.contactlist);
this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
viewPager = (ViewPager) findViewById(R.id.pager);
groupsPagesAdapter = new ListPagerAdapter(getSupportFragmentManager(), viewPager);
pagerTabs = (PagerTabStrip) findViewById(R.id.tabstrip);
pagerTabs.setTabIndicatorColorResource(R.color.vert_manu);
pagerTabs.setNonPrimaryAlpha(PAGER_TAB_SECONDARY_ALPHA);
mListGroup.add(getString(R.string.contact_list_all_contact));
mListGroup.add(getString(R.string.contact_list_no_group));
groupsPagesAdapter.notifyDataSetChanged();
}
示例12: UIupdater
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
UIupdater(Context context)
{
this.context=context;
//獲取布局
LayoutInflater flater = LayoutInflater.from(context);
mview = flater.inflate(R.layout.mview, null);
pager = (ViewPager) mview.findViewById(R.id.viewpager);
tabStrip = (PagerTabStrip) mview.findViewById(R.id.tabstrip);
button=(Button)mview.findViewById(R.id.buttonSet);
//取消tab下麵的長橫線
tabStrip.setDrawFullUnderline(false);
//設置tab的背景色
//tabStrip.setBackgroundColor(Color.argb(255, 111, 40, 98));
tabStrip.setBackgroundColor(Color.argb(255, 26, 209, 255));
//設置當前tab頁簽的下劃線顏色
tabStrip.setTabIndicatorColor(Color.argb(255, 26, 209, 255));
tabStrip.setTextSpacing(80);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, addcity.class);
context.startActivity(intent);
((MyActivity)context).finish();
}
});
}
示例13: onCreate
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
titlelist = new ArrayList<String>();
fraglist = new ArrayList<Fragment>();
urlFragment = new URLFragment();
cacheFragment = new CacheFragment();
settingFragment = new SettingFragment();
cachingFragment = new CachingFragment();
fraglist.add(cacheFragment);
fraglist.add(cachingFragment);
fraglist.add(urlFragment);
fraglist.add(settingFragment);
pager_tab = (PagerTabStrip)findViewById(R.id.pager_tab);
pager_tab.setTabIndicatorColor(getResources().getColor(R.color.colorAccent));
pager_tab.setDrawFullUnderline(false);
pager_tab.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
pager_tab.setTextSpacing(50);
titlelist.add("已完成");
titlelist.add("未完成");
titlelist.add("播放");
titlelist.add("設置");
viewPager = (ViewPager)findViewById(R.id.my_viewpager);
verifyStoragePermissions(this);
}
示例14: initContentView
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
private void initContentView() {
setContentView(R.layout.activity_main);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mNavigationView = (NavigationView) findViewById(R.id.nav_view);
mBottomSheetView = findViewById(R.id.design_bottom_sheet);
mBaseDaysViewPager = (ViewPager) findViewById(R.id.viewPager_days);
mDaySectionPagerTabStrip = (PagerTabStrip) findViewById(R.id.pagerTabStrip_daySection);
}
示例15: onCreateView
import android.support.v4.view.PagerTabStrip; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.soundbox_fragment_xima, container, false);
mFragments = new ArrayList<TrackBaseFragment>();
// Live radio
XimaLiveFragment liveFg = new XimaLiveFragment();
liveFg.setTitle(getString(R.string.esp_soundbox_xima_live_title));
mFragments.add(liveFg);
// Hot tracks
XimaHotFragment hotFg = new XimaHotFragment();
hotFg.setTitle(getString(R.string.esp_soundbox_xima_hot_title));
mFragments.add(hotFg);
// Search tracks
XimaSearchFragment searchFg = new XimaSearchFragment();
searchFg.setTitle(getString(R.string.esp_soundbox_xima_search_title));
mFragments.add(searchFg);
mPager = (ViewPager)view.findViewById(R.id.pager);
PagerTabStrip pagerTab = (PagerTabStrip)view.findViewById(R.id.indicator);
int tabColor = getResources().getColor(R.color.esp_actionbar_color);
pagerTab.setTextColor(tabColor);
pagerTab.setTabIndicatorColor(tabColor);
mPagerAdapter = new PagerAdapter(getFragmentManager(), mFragments);
mPager.setAdapter(mPagerAdapter);
mPager.setOffscreenPageLimit(5);
return view;
}