• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SlidingTabLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.example.android.common.view.SlidingTabLayout的典型用法代码示例。如果您正苦于以下问题:Java SlidingTabLayout类的具体用法?Java SlidingTabLayout怎么用?Java SlidingTabLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SlidingTabLayout类属于com.example.android.common.view包,在下文中一共展示了SlidingTabLayout类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState)
{
	View v = inflater.inflate(R.layout.fragment_native_ad, container, false);

	if (getArguments() != null)
	{
		slotId = getArguments().getInt(ARG_SLOT_ID);
		fragmentType = getArguments().getInt(ARG_TYPE);
	}

	tabLayout = (SlidingTabLayout) v.findViewById(R.id.sliding_tabs);
	tabLayout.setDividerColors(Color.TRANSPARENT);
	tabLayout.setSelectedIndicatorColors(Color.WHITE);
	typeList = new ArrayList<>();

	viewPager = (ViewPager) v.findViewById(R.id.pager);

	initAds();

	return v;
}
 
开发者ID:myTargetSDK,项目名称:mytarget-android,代码行数:24,代码来源:NativeAdFragment.java


示例2: onCreate

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_standard);
	Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

	setSupportActionBar(toolbar);
	if (getSupportActionBar() != null)
	{
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
		getSupportActionBar().setDisplayShowHomeEnabled(true);
	}

	tabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
	tabLayout.setDividerColors(Color.TRANSPARENT);
	tabLayout.setSelectedIndicatorColors(Color.WHITE);

	typeList = new ArrayList<>();

	viewPager = (ViewPager) findViewById(R.id.pager);

	initAds();
}
 
开发者ID:myTargetSDK,项目名称:mytarget-android,代码行数:24,代码来源:StandardBannerAdActivity.java


示例3: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_live, container, false);

	ViewPager pager = (ViewPager) view.findViewById(R.id.pager);
	pager.setAdapter(livePagerAdapter);
	SlidingTabLayout slidingTabs = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);
	slidingTabs.setViewPager(pager);

	return view;
}
 
开发者ID:sysdharma,项目名称:py-eventos-android,代码行数:12,代码来源:LiveFragment.java


示例4: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_tracks, container, false);

	holder = new ViewHolder();
	holder.contentView = view.findViewById(R.id.content);
	holder.emptyView = view.findViewById(android.R.id.empty);
	holder.pager = (ViewPager) view.findViewById(R.id.pager);
	holder.slidingTabs = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);

	return view;
}
 
开发者ID:sysdharma,项目名称:py-eventos-android,代码行数:13,代码来源:TracksFragment.java


示例5: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_schedule, container, false);
    DatabaseManager db = DatabaseManager.getInstance();
    ArrayList<Day> days = db.getDates(track);

    String subTitle = "";
    for (Day day : days) {
        if (days.indexOf(day) != 0) {
            subTitle += ", ";
        }
        subTitle += day.getDate();

    }
    ((ActionBarActivity) getActivity()).getSupportActionBar().setSubtitle(subTitle);
    holder = new ViewHolder();
    holder.contentView = view.findViewById(R.id.content);
    holder.emptyView = view.findViewById(android.R.id.empty);
    holder.pager = (ViewPager) view.findViewById(R.id.pager);
    holder.slidingTabs = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);
    holder.contentView.setVisibility(View.VISIBLE);
    holder.emptyView.setVisibility(View.GONE);
    if (holder.pager.getAdapter() == null) {
        holder.pager.setAdapter(daysAdapter);
    }
    holder.slidingTabs.setViewPager(holder.pager);
    if (days.size() > 0) {
        String[] date = days.get(0).getDate().split(" ");
        int position = Integer.parseInt(date[1]) - 13;
        holder.pager.setCurrentItem(position);
    }

    return view;
}
 
开发者ID:OpnTec,项目名称:ots15-companion,代码行数:35,代码来源:ScheduleFragment.java


示例6: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.comments_time_line_fragment_layout, container, false);
	viewPager = (ViewPager) view.findViewById(R.id.commentsViewpager);
	mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.commentsSlingTab);
	return view;
}
 
开发者ID:lookwhatlook,项目名称:WeiboWeiBaTong,代码行数:8,代码来源:CommentsTimeLineFragment.java


示例7: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.search_layout, container, false);
    viewPager = (ViewPager) view.findViewById(R.id.viewpager);
    mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.searchSTL);
    MyLogger("onCreateView");
    return view;
}
 
开发者ID:lookwhatlook,项目名称:WeiboWeiBaTong,代码行数:9,代码来源:SearchMainParentFragment.java


示例8: onCreateView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.mention_timeline_fragment_layout, container, false);
	viewPager = (ViewPager) view.findViewById(R.id.mentionViewpager);
	mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.mentionSlidingTab);
	return view;
}
 
开发者ID:lookwhatlook,项目名称:WeiboWeiBaTong,代码行数:8,代码来源:MentionsTimeLineFragment.java


示例9: setupView

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
private void setupView(View view) {
    final ViewPager pager = (ViewPager) view.findViewById(R.id.main_pager);
    pager.setAdapter(createPagerAdapter());

    final SlidingTabLayout tab = (SlidingTabLayout) view.findViewById(R.id.main_tab);
    tab.setCustomTabView(R.layout.layout_main_tab, R.id.main_tab_text);
    tab.setViewPager(pager);
}
 
开发者ID:t28hub,项目名称:section-adapter,代码行数:9,代码来源:MainFragment.java


示例10: onCreate

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);

	// Drawer
	mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
	mDrawer = (LinearLayout)findViewById(R.id.drawer);
	mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

	getSupportActionBar().setHomeButtonEnabled(true);
	getSupportActionBar().setDisplayHomeAsUpEnabled(true);

	mDrawerToggle = new ActionBarDrawerToggle(
			this,
			mDrawerLayout,
			R.drawable.ic_drawer,
			R.string.drawer_open,
			R.string.drawer_close) {
		
		public void onDrawerClosed(View view) {
               super.onDrawerClosed(view);
		}

		public void onDrawerOpened(View drawerView) {
			super.onDrawerOpened(drawerView);
		}
	};
	
	mDrawerLayout.setDrawerListener(mDrawerToggle);
	actionBar = getSupportActionBar();

       // ViewPager
       mViewPager = (ViewPager) findViewById(R.id.viewpager);
       mViewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), tabsTitles));

       mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
       mSlidingTabLayout.setViewPager(mViewPager);
   }
 
开发者ID:jiahaoliuliu,项目名称:DrawerWithTabsAndViewPagerGradle,代码行数:40,代码来源:MainActivity.java


示例11: initLayout

import com.example.android.common.view.SlidingTabLayout; //导入依赖的package包/类
private void initLayout() {

//		getActionBar().setDisplayHomeAsUpEnabled(true);
//		getActionBar().setDisplayShowHomeEnabled(true);
//		getActionBar().setTitle(getString(R.string.filter));


//		ActionBar actionBar = getActionBar();
//
//		actionBar.setDisplayHomeAsUpEnabled(true);
//		actionBar.setDisplayShowHomeEnabled(true);
//		actionBar.setTitle(getString(R.string.filter));
//		actionBar.setIcon(R.drawable.ic_filter);

		View title = getLayoutInflater().inflate(R.layout.filteractivity_title_layout, null);
		Switch switchBtn = (Switch) title.findViewById(R.id.switchBtn);
//		actionBar.setCustomView(title, new ActionBar.LayoutParams(Gravity.RIGHT));
//		actionBar.setDisplayShowCustomEnabled(true);

		switchBtn.setChecked(SettingUtils.isEnableFilter());
		switchBtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
			@Override
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				SettingUtils.setEnableFilter(isChecked);
			}
		});

//		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
//		actionBar.addTab(actionBar.newTab().setText(getString(R.string.filter_keyword)).setTabListener(tabListener));
//
//		actionBar.addTab(actionBar.newTab().setText(getString(R.string.filter_user)).setTabListener(tabListener));
//		actionBar.addTab(actionBar.newTab().setText(getString(R.string.filter_topic)).setTabListener(tabListener));
//
//		actionBar.addTab(actionBar.newTab().setText(getString(R.string.filter_source)).setTabListener(tabListener));

		mSlidingTab = (SlidingTabLayout) findViewById(R.id.filterSTL);
		viewPager = (ViewPager) findViewById(R.id.filterViewpager);
		TimeLinePagerAdapter adapter = new TimeLinePagerAdapter(getSupportFragmentManager());
		viewPager.setOffscreenPageLimit(4);
		viewPager.setAdapter(adapter);
		viewPager.setOnPageChangeListener(onPageChangeListener);
		mSlidingTab.setViewPager(viewPager);

	}
 
开发者ID:lookwhatlook,项目名称:WeiboWeiBaTong,代码行数:45,代码来源:FilterActivity.java



注:本文中的com.example.android.common.view.SlidingTabLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResourceResolver类代码示例发布时间:2022-05-23
下一篇:
Java PacketRejectedException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap