public abstract class BaseSliderView extends Object
DefaultSliderView and
TextSliderView
if you want to show progressbar, you just need to set a progressbar id as @+id/loading_bar.| 限定符和类型 | 类和说明 |
|---|---|
static interface |
BaseSliderView.ImageLoadListener |
static interface |
BaseSliderView.OnSliderClickListener |
static class |
BaseSliderView.ScaleType |
| 限定符和类型 | 字段和说明 |
|---|---|
protected Context |
mContext |
protected BaseSliderView.OnSliderClickListener |
mOnSliderClickListener |
| 限定符 | 构造器和说明 |
|---|---|
protected |
BaseSliderView(Context context) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
bindEventAndShow(View v,
ImageView targetImageView)
When you want to implement your own slider view, please call this method in the end in `getView()` method
|
BaseSliderView |
bundle(Bundle bundle)
lets users add a bundle of additional information
|
BaseSliderView |
description(String description)
the description of a slider image.
|
BaseSliderView |
empty(int resId)
the placeholder image when loading image from url or file.
|
BaseSliderView |
error(int resId)
if you set errorDisappear false, this will set a error placeholder image.
|
BaseSliderView |
errorDisappear(boolean disappear)
determine whether remove the image which failed to download or load from file
|
Bundle |
getBundle()
when you have some extra information, please put it in this bundle.
|
Context |
getContext() |
String |
getDescription() |
int |
getEmpty() |
int |
getError() |
Picasso |
getPicasso()
Get the last instance set via setPicasso(), or null if no user provided instance was set
|
BaseSliderView.ScaleType |
getScaleType() |
String |
getUrl() |
abstract View |
getView()
the extended class have to implement getView(), which is called by the adapter,
every extended class response to render their own view.
|
BaseSliderView |
image(File file)
set a file as a image that will to load
|
BaseSliderView |
image(int res) |
BaseSliderView |
image(String url)
set a url as a image that preparing to load
|
boolean |
isErrorDisappear() |
void |
setOnImageLoadListener(BaseSliderView.ImageLoadListener l)
set a listener to get a message , if load error.
|
BaseSliderView |
setOnSliderClickListener(BaseSliderView.OnSliderClickListener l)
set a slider image click listener
|
void |
setPicasso(Picasso picasso)
Provide a Picasso instance to use when loading pictures, this is useful if you have a
particular HTTP cache you would like to share.
|
BaseSliderView |
setScaleType(BaseSliderView.ScaleType type) |
protected Context mContext
protected BaseSliderView.OnSliderClickListener mOnSliderClickListener
protected BaseSliderView(Context context)
public BaseSliderView empty(int resId)
resId - Image resource idpublic BaseSliderView errorDisappear(boolean disappear)
disappear - public BaseSliderView error(int resId)
resId - image resource idpublic BaseSliderView description(String description)
description - public BaseSliderView image(String url)
url - public BaseSliderView image(File file)
file - public BaseSliderView image(int res)
public BaseSliderView bundle(Bundle bundle)
bundle - public String getUrl()
public boolean isErrorDisappear()
public int getEmpty()
public int getError()
public String getDescription()
public Context getContext()
public BaseSliderView setOnSliderClickListener(BaseSliderView.OnSliderClickListener l)
l - protected void bindEventAndShow(View v, ImageView targetImageView)
v - the whole viewtargetImageView - where to place imagepublic BaseSliderView setScaleType(BaseSliderView.ScaleType type)
public BaseSliderView.ScaleType getScaleType()
public abstract View getView()
public void setOnImageLoadListener(BaseSliderView.ImageLoadListener l)
l - public Bundle getBundle()
public Picasso getPicasso()
public void setPicasso(Picasso picasso)
picasso - The Picasso instance to use, may be null to let the system use the default
instance