Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package nextrek.widgets.rubberlist;

import android.view.View.OnTouchListener;
import android.widget.AbsListView.OnScrollListener;

public interface IRubberWidgetController extends OnScrollListener, OnTouchListener {
    /**
     * Physical resistance to user drag.
     */
    public static final float DRAG_RESISTANCE = 0.60f;
    
    /**
     * How many pixels user have to drag to switch between PULL_TO_REFRESH and RELEASE_TO_REFRESH.
     */
    public static final int DRAG_TOLERANCE_BEFORE_STATE_SWITCH = 50;

    public enum WidgetState {
        TAP_TO_REFRESH, PULL_TO_REFRESH, RELEASE_TO_REFRESH, REFRESHING, NEW_DATA_AVAILABLE
    }
    
    /**
     * Set a resource image to show in case of NEW_DATA_AVAILABLE
     */
    public void setNewDataAvailableImageResource(int resId);
    
    /**
     * Set a new widget state. Nothing happens if widget is already in the request state.
     * @param newState
     */
    public void setWidgetState(WidgetState newState);
    
    /**
     * Returns current widget state.
     * @return WidgetState
     */
    public WidgetState getWidgetState();
    
    /**
     * Set onRefreshListner to update parent ListView adapter.
     * @param listener
     */
    public void setOnRefreshListener(OnRubberListRefreshListener listener);
    
    /**
     * Perform a refresh action using OnRefreshListener.
     */
    public void triggerRefresh();

    /**
     * 
     */
    public void onRefreshComplete();
    
    /**
     * Interface definition for a callback to be invoked when list should be
     * refreshed.
     */
    public interface OnRubberListRefreshListener {
        /**
         * Called when the list should be refreshed.
         * <p>
         * A call to {@link RubberListView #onRefreshComplete()} is
         * expected to indicate that the refresh has completed.
         */
        public void onRefresh();
    }
}

Commits for Nextrek/Android/LibrerieNextrek/src/nextrek/widgets/rubberlist/IRubberWidgetController.java

Diff revisions: vs.
Revision Author Commited Message
4 FMMortaroli picture FMMortaroli Fri 19 Apr, 2013 16:54:38 +0000