本文整理汇总了Java中com.github.florent37.materialviewpager.header.HeaderDesign类的典型用法代码示例。如果您正苦于以下问题:Java HeaderDesign类的具体用法?Java HeaderDesign怎么用?Java HeaderDesign使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HeaderDesign类属于com.github.florent37.materialviewpager.header包,在下文中一共展示了HeaderDesign类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPageSelected
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
@Override
public void onPageSelected(int position) {
if (position == lastPosition || listener == null) {
return;
}
HeaderDesign headerDesign = listener.getHeaderDesign(position);
if (headerDesign == null) {
return;
}
int fadeDuration = 400;
int color = headerDesign.getColor();
if (headerDesign.getColorRes() != 0) {
color = getContext().getResources().getColor(headerDesign.getColorRes());
}
if (headerDesign.getDrawable() != null) {
setImageDrawable(headerDesign.getDrawable(), fadeDuration);
} else {
setImageUrl(headerDesign.getImageUrl(), fadeDuration);
}
setColor(color, fadeDuration);
lastPosition = position;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:MaterialViewPager.java
示例2: NotePagerListener
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
private NotePagerListener() {
headers = new ArrayList<>();
headers.add(HeaderDesign.fromColorResAndUrl(R.color.black_semi_transparent, "http://wallpapercave.com/wp/aZlqiAT.png"));
// headers.add(HeaderDesign.fromColorResAndUrl(R.color.blue, "http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2014/06/wallpaper_51.jpg"));
headers.add(HeaderDesign.fromColorResAndUrl(R.color.black_semi_transparent, "http://www.droid-life.com/wp-content/uploads/2014/10/lollipop-wallpapers10.jpg"));
headers.add(HeaderDesign.fromColorResAndUrl(R.color.black_semi_transparent, "http://www.tothemobile.com/wp-content/uploads/2014/07/original.jpg"));
}
开发者ID:JeanBarriere,项目名称:Note,代码行数:8,代码来源:NotePagerListener.java
示例3: getHeaderDesign
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
@Override
public HeaderDesign getHeaderDesign(int page) {
// if (headers != null && headers.size() > 0)
// return headers.get(page % headers.size());
return HeaderDesign.fromColorResAndUrl(R.color.black_semi_transparent, "http://wallpapercave.com/wp/aZlqiAT.png");
// return HeaderDesign.fromColorResAndUrl(R.color.half_black, "");
}
开发者ID:JeanBarriere,项目名称:Note,代码行数:8,代码来源:NotePagerListener.java
示例4: initViews
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
private void initViews() {
MaterialViewPager materialViewPager = (MaterialViewPager) findViewById(R.id.main_material_pager);
Toolbar toolbar = materialViewPager.getToolbar();
if (toolbar != null) {
toolbar.setTitle("");
toolbar.setPopupTheme(R.style.AppBaseTheme_PopupOverlay);
toolbar.setNavigationIcon(R.drawable.ic_nav);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager(), TITLE_LIST);
materialViewPager.getViewPager().setAdapter(viewPagerAdapter);
mMaterialPagerListener = new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
mTargetUrl = beauty[page];
return HeaderDesign.fromColorAndUrl(getResources().getColor(R.color.colorPrimary), mTargetUrl);
}
};
materialViewPager.setMaterialViewPagerListener(mMaterialPagerListener);
ViewPager pager = materialViewPager.getViewPager();
materialViewPager.getViewPager().setOffscreenPageLimit(pager.getAdapter().getCount());
materialViewPager.getPagerTitleStrip().setViewPager(pager);
TextView headerText = (TextView) findViewById(R.id.main_logo);
headerText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
PhotoActivity.launch(MainActivity.this, mTargetUrl);
}
});
}
开发者ID:Temoa,项目名称:GankIO,代码行数:37,代码来源:MainActivity.java
示例5: addHeader
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
public void addHeader(int color, String ImageURL) {
headers.add(HeaderDesign.fromColorResAndUrl(color, ImageURL));
}
开发者ID:JeanBarriere,项目名称:Note,代码行数:4,代码来源:NotePagerListener.java
示例6: getHeaderDesign
import com.github.florent37.materialviewpager.header.HeaderDesign; //导入依赖的package包/类
HeaderDesign getHeaderDesign(int page);
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:2,代码来源:MaterialViewPager.java
注:本文中的com.github.florent37.materialviewpager.header.HeaderDesign类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论