public class DropDownListView
extends ListView
setDropDownStyle(boolean)
to enable drop down style
beforesetOnDropDownListener(OnDropDownListener)
set listener which will be excuted when drop down, but you
should call onDropDownComplete()
manual at the end of listener to reinstate status.setHeaderDefaultText(String)
, setHeaderLoadingText(String)
, setHeaderPullText(String)
,
setHeaderReleaseText(String)
, setHeaderSecondText(CharSequence)
to set textsetOnBottomStyle(boolean)
to enable on bottom style
beforesetOnBottomListener(OnClickListener)
set listener which will be excuted when scroll to bottom, but you
should call onBottomComplete()
manual at the end of listener to reinstate status.setAutoLoadOnBottom(boolean)
to enable
auto call OnBottomListener when scroll to bottomsetFooterDefaultText(String)
, setFooterLoadingText(String)
,
setFooterNoMoreText(String)
to set textModifier and Type | Class and Description |
---|---|
static interface |
DropDownListView.OnDropDownListener
OnDropDownListener, called when header released
|
Modifier and Type | Field and Description |
---|---|
static int |
HEADER_STATUS_CLICK_TO_LOAD
status which you can click to load, init satus
|
static int |
HEADER_STATUS_DROP_DOWN_TO_LOAD
status which you can drop down and then release to excute onDropDownListener, when height of header layout lower
than a value
|
static int |
HEADER_STATUS_LOADING
status which is loading
|
static int |
HEADER_STATUS_RELEASE_TO_LOAD
status which you can release to excute onDropDownListener, when height of header layout higher than a value
|
Constructor and Description |
---|
DropDownListView(Context context) |
DropDownListView(Context context,
AttributeSet attrs) |
DropDownListView(Context context,
AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
Button |
getFooterButton()
get footer button
|
java.lang.String |
getFooterDefaultText()
get footer default text, default is R.string.drop_down_list_footer_default_text
|
RelativeLayout |
getFooterLayout()
get footer layout view
|
java.lang.String |
getFooterLoadingText()
get footer loading text, default is R.string.drop_down_list_footer_loading_text
|
java.lang.String |
getFooterNoMoreText()
get footer no more text, default is R.string.drop_down_list_footer_no_more_text
|
java.lang.String |
getHeaderDefaultText()
get header default text, default is R.string.drop_down_list_header_default_text
|
RelativeLayout |
getHeaderLayout()
get header layout view
|
java.lang.String |
getHeaderLoadingText()
get header loading text, default is R.string.drop_down_list_header_loading_text
|
float |
getHeaderPaddingTopRate()
get rate about drop down distance and header padding top when drop down
|
java.lang.String |
getHeaderPullText()
get header pull text, default is R.string.drop_down_list_header_pull_text
|
int |
getHeaderReleaseMinDistance()
get min distance which header can release to loading
|
java.lang.String |
getHeaderReleaseText()
get header release text, default is R.string.drop_down_list_header_release_text
|
boolean |
isAutoLoadOnBottom() |
boolean |
isDropDownStyle() |
boolean |
isHasMore()
get whether has more
|
boolean |
isOnBottomStyle() |
boolean |
isShowFooterProgressBar()
get whether show footer loading progress bar when loading
|
boolean |
isShowFooterWhenNoMore()
get isShowFooterWhenNoMore
|
void |
onBottom()
on bottom loading, you can call it by manual, but you should manual call onBottomComplete at the same time.
|
void |
onBottomComplete()
on bottom load complete, restore view status
|
void |
onDropDown()
on drop down loading, you can call it by manual, but you should manual call onBottomComplete at the same time.
|
void |
onDropDownComplete()
drop down complete, restore view status
|
void |
onDropDownComplete(java.lang.CharSequence secondText)
drop down complete, restore view status
|
void |
onScroll(AbsListView view,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount) |
void |
onScrollStateChanged(AbsListView view,
int scrollState) |
boolean |
onTouchEvent(MotionEvent event) |
void |
setAdapter(ListAdapter adapter) |
void |
setAutoLoadOnBottom(boolean isAutoLoadOnBottom)
set whether auto load when on bottom
|
void |
setDropDownStyle(boolean isDropDownStyle) |
void |
setFooterDefaultText(java.lang.String footerDefaultText)
set footer default text, default is R.string.drop_down_list_footer_default_text
|
void |
setFooterLoadingText(java.lang.String footerLoadingText)
set footer loading text, default is R.string.drop_down_list_footer_loading_text
|
void |
setFooterNoMoreText(java.lang.String footerNoMoreText)
set footer no more text, default is R.string.drop_down_list_footer_no_more_text
|
void |
setHasMore(boolean hasMore)
set whether has more. if hasMore is false, onBottm will not be called when listView scroll to bottom
|
void |
setHeaderDefaultText(java.lang.String headerDefaultText)
set header default text, default is R.string.drop_down_list_header_default_text
|
void |
setHeaderLoadingText(java.lang.String headerLoadingText)
set header loading text, default is R.string.drop_down_list_header_loading_text
|
void |
setHeaderPaddingTopRate(float headerPaddingTopRate)
set rate about drop down distance and header padding top when drop down
|
void |
setHeaderPullText(java.lang.String headerPullText)
set header pull text, default is R.string.drop_down_list_header_pull_text
|
void |
setHeaderReleaseMinDistance(int headerReleaseMinDistance)
set min distance which header can release to loading
|
void |
setHeaderReleaseText(java.lang.String headerReleaseText)
set header release text, default is R.string.drop_down_list_header_release_text
|
void |
setHeaderSecondText(java.lang.CharSequence secondText)
set header second text
|
void |
setOnBottomListener(OnClickListener onBottomListener) |
void |
setOnBottomStyle(boolean isOnBottomStyle) |
void |
setOnDropDownListener(DropDownListView.OnDropDownListener onDropDownListener) |
void |
setOnScrollListener(AbsListView.OnScrollListener listener) |
void |
setSecondPositionVisible()
set second position visible(index is 1), because first position is header layout
|
void |
setShowFooterProgressBar(boolean isShowFooterProgressBar)
set whether show footer loading progress bar when loading
|
void |
setShowFooterWhenNoMore(boolean isShowFooterWhenNoMore)
set isShowFooterWhenNoMore
|
public static final int HEADER_STATUS_CLICK_TO_LOAD
public static final int HEADER_STATUS_DROP_DOWN_TO_LOAD
public static final int HEADER_STATUS_RELEASE_TO_LOAD
public static final int HEADER_STATUS_LOADING
public DropDownListView(Context context)
public DropDownListView(Context context, AttributeSet attrs)
public DropDownListView(Context context, AttributeSet attrs, int defStyle)
public boolean isDropDownStyle()
public void setDropDownStyle(boolean isDropDownStyle)
isDropDownStyle
- public boolean isOnBottomStyle()
public void setOnBottomStyle(boolean isOnBottomStyle)
isOnBottomStyle
- public boolean isAutoLoadOnBottom()
public void setAutoLoadOnBottom(boolean isAutoLoadOnBottom)
isAutoLoadOnBottom
- public boolean isShowFooterProgressBar()
public void setShowFooterProgressBar(boolean isShowFooterProgressBar)
isShowFooterProgressBar
- public boolean isShowFooterWhenNoMore()
public void setShowFooterWhenNoMore(boolean isShowFooterWhenNoMore)
isShowFooterWhenNoMore
- the isShowFooterWhenNoMore to setpublic Button getFooterButton()
public void setAdapter(ListAdapter adapter)
public void setOnScrollListener(AbsListView.OnScrollListener listener)
public void setOnDropDownListener(DropDownListView.OnDropDownListener onDropDownListener)
onDropDownListener
- public void setOnBottomListener(OnClickListener onBottomListener)
onBottomListener
- public boolean onTouchEvent(MotionEvent event)
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
public void onScrollStateChanged(AbsListView view, int scrollState)
public void onDropDown()
public void onDropDownComplete(java.lang.CharSequence secondText)
secondText
- display below header text, if null, not displaypublic void setHeaderSecondText(java.lang.CharSequence secondText)
secondText
- secondText display below header text, if null, not displaypublic void onDropDownComplete()
public void onBottom()
public void onBottomComplete()
public void setSecondPositionVisible()
public void setHasMore(boolean hasMore)
hasMore
- public boolean isHasMore()
public RelativeLayout getHeaderLayout()
public RelativeLayout getFooterLayout()
public float getHeaderPaddingTopRate()
public void setHeaderPaddingTopRate(float headerPaddingTopRate)
headerPaddingTopRate
- public int getHeaderReleaseMinDistance()
public void setHeaderReleaseMinDistance(int headerReleaseMinDistance)
headerReleaseMinDistance
- public java.lang.String getHeaderDefaultText()
public void setHeaderDefaultText(java.lang.String headerDefaultText)
headerDefaultText
- public java.lang.String getHeaderPullText()
public void setHeaderPullText(java.lang.String headerPullText)
headerPullText
- public java.lang.String getHeaderReleaseText()
public void setHeaderReleaseText(java.lang.String headerReleaseText)
headerReleaseText
- public java.lang.String getHeaderLoadingText()
public void setHeaderLoadingText(java.lang.String headerLoadingText)
headerLoadingText
- public java.lang.String getFooterDefaultText()
public void setFooterDefaultText(java.lang.String footerDefaultText)
footerDefaultText
- public java.lang.String getFooterLoadingText()
public void setFooterLoadingText(java.lang.String footerLoadingText)
footerLoadingText
- public java.lang.String getFooterNoMoreText()
public void setFooterNoMoreText(java.lang.String footerNoMoreText)
footerNoMoreText
-