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


Java PagerTabStrip.setTextColor方法代碼示例

本文整理匯總了Java中android.support.v4.view.PagerTabStrip.setTextColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PagerTabStrip.setTextColor方法的具體用法?Java PagerTabStrip.setTextColor怎麽用?Java PagerTabStrip.setTextColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.PagerTabStrip的用法示例。


在下文中一共展示了PagerTabStrip.setTextColor方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例3: 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

示例4: 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

示例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);
	View intro0 = inflater.inflate(R.layout.intro_0, null);
	View intro1 = inflater.inflate(R.layout.intro_1, null);
	View intro2 = inflater.inflate(R.layout.intro_2, null);
	View intro3 = inflater.inflate(R.layout.intro_3, null);
	View intro4 = inflater.inflate(R.layout.intro_4, 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(intro0);
	viewTitle.add("0");
	viewList.add(intro1);
	viewTitle.add("1");
	viewList.add(intro2);
	viewTitle.add("2");
	viewList.add(intro3);
	viewTitle.add("3");
	viewList.add(intro4);
	viewTitle.add("4");
	viewPager.setAdapter(new MyPagerAdapter(viewList, viewTitle));
	viewPager.setOnPageChangeListener(this);
}
 
開發者ID:SumiMakito,項目名稱:HimitsuQR,代碼行數:29,代碼來源:Intro.java

示例6: onCreate

import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_viewpager);
		
		FragmentPagerAdapter adapter = new FragmentPagerAdapter(getFragmentManager()) {
			@Override
			public Fragment getItem(int position) {
				switch (position) {
				case 0:
					return MainFragment.getInstance();
				case 1:
					return MovingFragment.getInstance();
				case 2:
					return BehaviorFragment.getInstance();
				case 3:
					return OverlayFragment.getInstance();
//				case 2:
//					return TestingActivity.getInstance();
				}
				return new Fragment();
			}
			
			@Override
			public String getPageTitle(int pos) {
				switch (pos) {
				case 0:
					return getResources().getString(R.string.pref_main_top_title);
				case 1:
					return getResources().getString(R.string.pref_movable_top_title);
				case 2:
					return getResources().getString(R.string.pref_behavior_title);
				case 3:
					return getResources().getString(R.string.pref_overlay_title);
//				case 2:
//					return getResources().getString(R.string.pref_testing_top_title);
				}
				return "";
			}
			
			@Override
			public int getCount() {
				return 4;
			}
		};
		ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
		viewPager.setAdapter(adapter);
		
		PagerTabStrip pts = (PagerTabStrip) findViewById(R.id.pager_title_strip);
		pts.setTabIndicatorColor(0xFF333333);
		pts.setTextColor(0xFF111111);
		pts.setBackgroundColor(Color.TRANSPARENT);
		
		ActionBar bar = getActionBar();
		bar.setBackgroundDrawable(new ColorDrawable(0xFFAA0000)); 
		
		
		testSettings(true);
		
	}
 
開發者ID:shooash,項目名稱:XHFW3,代碼行數:62,代碼來源:MainPreference.java

示例7: onCreate

import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
	getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

	setContentView(R.layout.list_programmes);

	pagerList = (ViewPager) findViewById(R.id.programm_list_viewpager);

	calendarMorning = Calendar.getInstance();
	calendarEvening = Calendar.getInstance();

	mType = getIntent().getIntExtra(Constantes.TYPE, Constantes.CURSOR_FULL);

	int newPosition = SAVED_NOW;
	if (savedInstanceState != null) {
		newPosition = savedInstanceState.getInt(SAVED_TAB, SAVED_NOW);
	} else {
		if (getIntent().hasExtra(Constantes.DETAIL_DATE_TIME)) {
			isSelected = true;
		} else {
			isNowToUpdate = true;
		}

	}
	initTabs(newPosition);

	if (SdkUtils.isTabletLandscape(getApplicationContext())) {
		pagerDetails = (ViewPager) findViewById(R.id.host_tab_viewpager);
		final PagerTabStrip tabTitle = (PagerTabStrip) findViewById(R.id.host_tab_title);
		if (tabTitle != null) {
			tabTitle.setTabIndicatorColor(getResources().getColor(R.color.androlife_programs_hint_underline));
			tabTitle.setTextColor(getResources().getColor(R.color.androlife_programs_hint_text));
		}

		getSupportLoaderManager().initLoader(mType, null, this);

	}

}
 
開發者ID:rsegismont,項目名稱:Androlife,代碼行數:42,代碼來源:ProgramListActivity.java

示例8: onCreate

import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.Theme_Teal);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Restore preferences
    SharedPreferences preferences = getSharedPreferences(PREFS_FILENAME, MODE_PRIVATE);
    activeRestaurant = preferences.getInt(PREFS_ACTIVE_RESTAURANT, Constants.RESTO_ETTERBEEK);

    // Setup actionbar
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setLogo(R.drawable.ic_vubrestaurant);
    // This deprecated stuff will be removed when using new restaurant selector
    //noinspection deprecation
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    //noinspection deprecation
    actionBar.setListNavigationCallbacks(
            new DropdownNavigationAdapter(this),
            new ActionBar.OnNavigationListener() {
                @Override
                public boolean onNavigationItemSelected(int position, long itemId) {
                    switchActiveRestaurant(position);
                    return true;
                }
            });
    //noinspection deprecation
    actionBar.setSelectedNavigationItem(activeRestaurant);

    // Select the correct language. If its set, take from settings, else derrive from locale
    int language = preferences.getInt(PREFS_LANGUAGE, getLanguageFromLocale());
    restaurantContainer = new RestaurantContainer(this.activeRestaurant, language);
    datesAdapter = new DatesAdapter(getSupportFragmentManager(), restaurantContainer.getDates());

    // Customize pagerTabStrip
    PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.pagerTabStrip);
    pagerTabStrip.setTextColor(getResources().getColor(R.color.l_white));
    pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18.0f);
    pagerTabStrip.setTabIndicatorColor(getResources().getColor(R.color.l_dark_gray));

    // Set up the viewPager for first load (toggle visibility to hide the scroll to Today)
    viewPager = (ViewPager) findViewById(R.id.pager);
    viewPager.setAdapter(datesAdapter);
    viewPager.setVisibility(View.GONE);
    viewPager.setCurrentItem(0); // Today is always the first date (since 1.3.2)
    viewPager.setVisibility(View.VISIBLE);

    // Avoid having the loadContentTask working with an IllegalState
    Object retained = getLastCustomNonConfigurationInstance();
    if (retained instanceof LoadContentTask) {
        loadContentTask = (LoadContentTask) retained;
        loadContentTask.setActivity(this);
    }
}
 
開發者ID:tomjaspers,項目名稱:vubresto-android,代碼行數:57,代碼來源:MainActivity.java


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