當前位置: 首頁>>代碼示例>>Java>>正文


Java PagerTabStrip類代碼示例

本文整理匯總了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));
}
 
開發者ID:4pp,項目名稱:downloader,代碼行數:19,代碼來源:DownloadActivity.java

示例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);
    }
}
 
開發者ID:DestinyVaultHelper,項目名稱:dvh,代碼行數:21,代碼來源:MainActivity.java

示例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;
}
 
開發者ID:SpiritCroc,項目名稱:Modular-Remote,代碼行數:24,代碼來源:Util.java

示例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;
}
 
開發者ID:bduncavage,項目名稱:recyclerViewToTheRescue,代碼行數:17,代碼來源:ListPagerFragment.java

示例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));
}
 
開發者ID:SumiMakito,項目名稱:HimitsuQR,代碼行數:17,代碼來源:About.java

示例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();
        }
    }
}
 
開發者ID:securityfirst,項目名稱:Umbrella_android,代碼行數:26,代碼來源:TabbedChecklistFragment.java

示例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);
        }
    }
}
 
開發者ID:dan-zx,項目名稱:tedroid,代碼行數:20,代碼來源:ClassicGameActivity.java

示例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;
}
 
開發者ID:swiftype,項目名稱:SwiftypeAndroid,代碼行數:20,代碼來源:ResultListsPagerFragment.java

示例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();

}
 
開發者ID:aldialimucaj,項目名稱:TopeApp,代碼行數:27,代碼來源:Tope.java

示例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));
    }
 
開發者ID:NasaGeek,項目名稱:utexas-utilities,代碼行數:18,代碼來源:ScheduleActivity.java

示例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();
   }
 
開發者ID:BoogieMAN2K,項目名稱:Beem,代碼行數:19,代碼來源:ContactList.java

示例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();

        }
    });

}
 
開發者ID:yueare,項目名稱:wether,代碼行數:34,代碼來源:UIupdater.java

示例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);
}
 
開發者ID:ksvc,項目名稱:ksyhttpcache_android,代碼行數:34,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:krshandro,項目名稱:todamo-android,代碼行數:10,代碼來源:MainActivity.java

示例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;
}
 
開發者ID:EspressifApp,項目名稱:IOT-Espressif-Android,代碼行數:30,代碼來源:PlatformXimaFragment.java


注:本文中的android.support.v4.view.PagerTabStrip類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。