本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}