本文整理汇总了Java中com.shizhefei.view.indicator.Indicator类的典型用法代码示例。如果您正苦于以下问题:Java Indicator类的具体用法?Java Indicator怎么用?Java Indicator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Indicator类属于com.shizhefei.view.indicator包,在下文中一共展示了Indicator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateViewLazy
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreateViewLazy(Bundle savedInstanceState) {
super.onCreateViewLazy(savedInstanceState);
setContentView(R.layout.fragment_recyclerview);
coolRefreshView = (CoolRefreshView) findViewById(R.id.recyclerview_funnyRefreshView);
recyclerView = (RecyclerView) findViewById(R.id.recyclerview_recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter = new BooksRecyclerAdapter(BooksLoador.getBooks(0)));
View headLayout = inflater.inflate(R.layout.main_head, recyclerView, false);
adapter.addHeader(headLayout);
ViewPager viewPager = (ViewPager) headLayout.findViewById(R.id.viewPager);
Indicator indicator = (Indicator) headLayout.findViewById(R.id.indicatorView);
indicator.setScrollBar(new ColorBar(getContext(), Color.WHITE, DisplayUtil.dipToPix(getContext(), 3)));
bannerComponent = new BannerComponent(indicator, viewPager, false);
bannerComponent.setAdapter(new BannerAdapter());
bannerComponent.startAutoPlay();
}
示例2: onCreate
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_more_views);
Indicator indicator = (Indicator) findViewById(R.id.moreviews_indicatorView);
ViewPager viewPager = (ViewPager) findViewById(R.id.moreviews_viewPager);
refreshButton = findViewById(R.id.moreviews_refresh_button);
completeButton = findViewById(R.id.moreviews_complete_button);
Class[] fragments = {
RecyclerViewFragment.class,
ListViewFragment.class,
WebViewFragment.class,
TextViewFragment.class,
ScrollViewFragment.class
};
indicator.setScrollBar(new ColorBar(this, ContextCompat.getColor(this, R.color.primary), DisplayUtil.dipToPix(this, 3)));
indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(Color.BLACK, Color.GRAY));
viewPager.setOffscreenPageLimit(2);
indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
indicatorViewPager.setAdapter(pagesAdapter = new PagesAdapter(getSupportFragmentManager(), fragments));
refreshButton.setOnClickListener(onClickListener);
completeButton.setOnClickListener(onClickListener);
}
示例3: initView
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
private void initView() {
viewPager = (ViewPager) findViewById(R.id.fragment_tabmain_viewPager);
indicator = (Indicator) findViewById(R.id.fragment_tabmain_indicator);
ibInfo = (ImageButton) findViewById(R.id.ibInfo);
if (!AccountApp.isWifiChecked) {
// 检查设备是否连接到WiFi
try {
if (!NetWorkUtils.isWifiByType(this)) {
AppToast.showToast("设备未接入WiFi。");
}
} catch (Exception e) {
e.printStackTrace();
}
AccountApp.isWifiChecked = true;
}
// 检查推送
checkPush();
}
示例4: onCreate
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initWindow();
setContentView(R.layout.activity_main);
SViewPager viewPager = (SViewPager) findViewById(R.id.tabmain_viewPager);
Indicator indicator = (Indicator) findViewById(R.id.tabmain_indicator);
indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
indicatorViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
// 禁止viewpager的滑动事件
viewPager.setCanScroll(false);
// 设置viewpager保留界面不重新加载的页面数量
viewPager.setOffscreenPageLimit(4);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle(R.string.index_name);
setSupportActionBar(toolbar);
invalidateOptionsMenu();
}
示例5: onCreate
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_more_views);
Indicator indicator = (Indicator) findViewById(R.id.moreviews_indicatorView);
ViewPager viewPager = (ViewPager) findViewById(R.id.moreviews_viewPager);
refreshButton = findViewById(R.id.moreviews_refresh_button);
completeButton = findViewById(R.id.moreviews_complete_button);
headTextView = (TextView) findViewById(R.id.moreviews_headtext_textView);
headTextView.setText("MoreHeaders");
Class[] fragments = {
StateHeaderFragment.class,
JellyHeaderFragment.class,
MaterialHeaderFragment.class,
PinContentMaterialHeaderFragment.class,
TestHeaderFragment.class
};
indicator.setScrollBar(new ColorBar(this, ContextCompat.getColor(this, R.color.primary), DisplayUtil.dipToPix(this, 3)));
indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(Color.BLACK, Color.GRAY));
viewPager.setOffscreenPageLimit(2);
indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
indicatorViewPager.setAdapter(pagesAdapter = new PagesAdapter(getSupportFragmentManager(), fragments));
refreshButton.setOnClickListener(onClickListener);
completeButton.setOnClickListener(onClickListener);
}
示例6: onCreate
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle arg0) {
setContentView(R.layout.activity_tabmain);
super.onCreate(arg0);
mTitleBar.setTitle(TAB_NAMES[0]);
ViewPager viewPager = (ViewPager) findViewById(R.id.tabmain_viewPager);
Indicator indicator = (Indicator) findViewById(R.id.tabmain_indicator);
mIndicatorViewPager = new IndicatorViewPager(indicator, viewPager);
mIndicatorViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
// 禁止viewpager的滑动事件
viewPager.setCanScroll(false);
// 设置viewpager保留界面不重新加载的页面数量
viewPager.setOffscreenPageLimit(4);
// 默认是1,,自动预加载左右两边的界面。设置viewpager预加载数为0。只加载加载当前界面。
viewPager.setPrepareNumber(0);
mIndicatorViewPager.setOnIndicatorPageChangeListener(new IndicatorViewPager.OnIndicatorPageChangeListener() {
@Override
public void onIndicatorPageChange(int preItem, int currentItem) {
if (currentItem == 1) {
mTitleBar.setTitleVisibility(false);
} else {
mTitleBar.setTitleVisibility(true);
mTitleBar.setTitle(TAB_NAMES[currentItem]);
}
}
});
}
示例7: TextWidthColorBar
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
public TextWidthColorBar(Context context, Indicator indicator, int color, int height) {
super(context, color, height);
this.indicator = indicator;
}
示例8: onCreateViewLazy
import com.shizhefei.view.indicator.Indicator; //导入依赖的package包/类
@Override
protected void onCreateViewLazy(Bundle savedInstanceState) {
super.onCreateViewLazy(savedInstanceState);
setContentView(R.layout.fragment_tab_news);
ViewPager viewPager = (ViewPager) findViewById(R.id.fragment_tabmain_viewPager);
viewPager.setOffscreenPageLimit(4);
Indicator indicator = (Indicator) findViewById(R.id.fragment_tabmain_indicator);
//设置tab下标
indicator.setScrollBar(new ColorBar(getApplicationContext(),getResources().getColor(R.color.tab_top_scrollbar),5));
float unSelectSize = 14;
float selectSize = unSelectSize * 1.2f;
int selectColor = getResources().getColor(R.color.tab_top_text_2);
int unSelectColor = getResources().getColor(R.color.tab_top_text_1);
indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColor, unSelectColor).setSize(selectSize, unSelectSize));
indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
indicatorViewPager.setPageOffscreenLimit(5);
indicatorViewPager.setAdapter(new NewsFragmentViewPagerAdapter(getChildFragmentManager()));
inflate = LayoutInflater.from(getActivity());
// 注意这里 的FragmentManager 是 getChildFragmentManager(); 因为是在Fragment里面
// 而在activity里面用FragmentManager 是 getSupportFragmentManager()
Log.d("cccc", "Fragment 将要创建View " + this);
}