Skip to content

Commit

Permalink
update sample and enhance comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eschao committed Sep 11, 2016
1 parent 4080d39 commit e3673bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import android.widget.TextView;

import com.eschao.android.widget.elasticlistview.LoadFooter.*;
import com.eschao.android.widget.elasticlistview.UpdateHeader.*;

/**
* <p>ElasticListView, like iOS feature, allows you pull down from the top of
Expand Down Expand Up @@ -251,8 +250,8 @@ public ElasticListView setFont(Typeface tf) {
* shown, The operation will be preserved if the ListView is not ready and
* be executing later. You can call it in some startup points to achieve an
* automatic updating once the ListView is displayed</p>
* <p>Use {@link enableUpdater(bool)} to make sure update header is enabled
* first</p>
* <p>Use {@link #enableUpdateHeader(boolean)} to make sure update header is
* enabled first</p>
*
*/
public ElasticListView requestUpdate() {
Expand Down Expand Up @@ -594,7 +593,6 @@ private void init() {
mLoadFooter = new LoadFooter(getContext());
view = LayoutInflater.from(context).inflate(R.layout.load_footer, null);
mLoadFooter.addView(view);
//addFooterView(mLoadFooter);
mLoadFooter.setOnClickListener(mLoadClickListener);

// others
Expand Down Expand Up @@ -670,10 +668,20 @@ protected final boolean isLoadFooterVisible() {
return mLoadFooter == getChildAt(getChildCount()-1);
}

/**
* Is updating?
*
* @return true if updating
*/
public final boolean isUpdating() {
return (mUpdateHeader == getChildAt(0) && mUpdateHeader.getHeight() > 0);
}

/**
* Is loading?
*
* @return true if loading
*/
public final boolean isLoading() {
return (mLoadFooter == getChildAt(getChildCount()-1)
&& mLoadFooter.getHeight() > 0);
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/menu/action_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
android:checkableBehavior="single">
<item
android:id="@+id/auto_load"
android:checked="true"
android:title="@string/menu_auto_load"/>
<item
android:id="@+id/click_to_load"
android:title="@string/menu_click_to_load"/>
<item
android:id="@+id/release_to_load"
android:checked="true"
android:title="@string/menu_release_to_load"/>
</group>
<item
Expand Down

0 comments on commit e3673bc

Please sign in to comment.