本文整理匯總了Java中android.support.v4.view.PagerTabStrip.setTabIndicatorColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PagerTabStrip.setTabIndicatorColor方法的具體用法?Java PagerTabStrip.setTabIndicatorColor怎麽用?Java PagerTabStrip.setTabIndicatorColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.PagerTabStrip
的用法示例。
在下文中一共展示了PagerTabStrip.setTabIndicatorColor方法的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: 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;
}
示例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));
}
示例4: 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();
}
示例5: 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();
}
});
}
示例6: 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);
}
示例7: 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;
}
示例8: configPagerTabStrip
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
private void configPagerTabStrip() {
PagerTabStrip pagerTabStrip = (PagerTabStrip) mPager.findViewById(R.id.pager_title_strip);
// show one title
pagerTabStrip.setNonPrimaryAlpha(0);
// set the black underlining
pagerTabStrip.setTabIndicatorColor(0x000000);
}
示例9: 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);
}
示例10: onActivityCreated
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
//Initialize
HomePagerAdapter pagerAdapter = new HomePagerAdapter(getChildFragmentManager());
ViewPager viewPager = (ViewPager) getView().findViewById(R.id.pager);
//Set the view pager's adapter
viewPager.setAdapter(pagerAdapter);
//Set the tab indicator color on the PagerTabStrip
PagerTabStrip pagerTabStrip = (PagerTabStrip) getView().findViewById(R.id.pager_tab_strip);
pagerTabStrip.setTabIndicatorColor(Color.parseColor(getString(R.string.tab_indicator_color)));
}
示例11: onActivityCreated
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
//Initialize
ToDoPagerAdapter pagerAdapter = new ToDoPagerAdapter(getChildFragmentManager());
ViewPager viewPager = (ViewPager) getView().findViewById(R.id.pager);
//Set the view pager's adapter
viewPager.setAdapter(pagerAdapter);
//Set the tab indicator color on the PagerTabStrip
PagerTabStrip pagerTabStrip = (PagerTabStrip) getView().findViewById(R.id.pager_tab_strip);
pagerTabStrip.setTabIndicatorColor(Color.parseColor(getString(R.string.tab_indicator_color)));
}
示例12: onActivityCreated
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
public void onActivityCreated(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
//Initialize
FinancesPagerAdapter pagerAdapter = new FinancesPagerAdapter(getChildFragmentManager());
ViewPager viewPager = (ViewPager) getView().findViewById(R.id.pager);
//Set the view pager's adapter
viewPager.setAdapter(pagerAdapter);
//Set the tab indicator color on the PagerTabStrip
PagerTabStrip pagerTabStrip = (PagerTabStrip) getView().findViewById(R.id.pager_tab_strip);
pagerTabStrip.setTabIndicatorColor(Color.parseColor(getString(R.string.tab_indicator_color)));
}
示例13: setUpLayout
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
private void setUpLayout(View layout) {
viewPager = (ViewPager) layout.findViewById(R.id.view_pager);
pagerStrip = (PagerTabStrip) layout.findViewById(R.id.pager_strip);
adapter = new SwipeTimelineFragmentPagerAdapter();
viewPager.setAdapter(adapter);
pagerStrip.setDrawFullUnderline(false);
pagerStrip.setTabIndicatorColor(getResources().getColor(R.color.twitt4droid_primary_color));
}
示例14: onCreateView
import android.support.v4.view.PagerTabStrip; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// initialize the inflater
mInflater = inflater;
View rootView = mInflater.inflate(R.layout.app_ops_summary,
container, false);
mContentContainer = container;
mRootView = rootView;
mPageNames = getResources().getTextArray(R.array.app_ops_categories);
mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
MyPagerAdapter adapter = new MyPagerAdapter(getChildFragmentManager());
mViewPager.setAdapter(adapter);
mViewPager.setOnPageChangeListener(adapter);
PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
tabs.setTabIndicatorColorResource(android.R.color.holo_blue_light);
} else {
final TypedValue val = new TypedValue();
getActivity().getTheme().resolveAttribute(android.R.attr.colorAccent, val, true);
tabs.setTabIndicatorColor(val.data);
}
// We have to do this now because PreferenceFrameLayout looks at it
// only when the view is added.
if (container != null && "android.preference.PreferenceFrameLayout".equals(container.getClass().getName())) {
new ObjectWrapper(rootView.getLayoutParams()).set("removeBorders", true);
}
return rootView;
}
示例15: 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);
}