summaryrefslogtreecommitdiffstats
path: root/docs/html/training/swipe/index.jd
blob: 17b4cf73b03693bc5bfeab251dc38aa3f990269b (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
page.title=Supporting Swipe-to-Refresh
trainingnavtop=true
startpage=true


@jd:body

<div id="tb-wrapper">
<div id="tb">

<h2>Dependencies and prerequisites</h2>
<ul>
  <li>Android 1.6 (API level 4) or later
  </li>

  <li>Latest version of the Android v4 <a href=
  "{@docRoot}tools/support-library/index.html">Support Library</a>
  </li>
</ul>

<h2>Sample Apps</h2>

<ul>
    <li><a href="{@docRoot}samples/SwipeRefreshLayoutBasic/index.html">
            SwipeRefreshLayoutBasic</a></li>
    <li><a href="{@docRoot}samples/SwipeRefreshListFragment/index.html">
            SwipeRefreshListFragment</a></li>
    <li><a href="{@docRoot}samples/SwipeRefreshMultipleViews/index.html">
            SwipeRefreshMultipleViews</a></li>
</ul>

</div>
</div>

<p>
  Even if your app automatically updates its content on a regular basis, you
  can allow users to request manual updates as well. For example, a weather
  forecasting app can allow users get the latest forecasts on demand. To
  provide a standard user experience for requesting updates, the Android
  platform includes the swipe-to-refresh design pattern, which allows users
  to trigger an update with a vertical swipe.
</p>

<p class="note">
  <strong>Note:</strong> This class requires the latest version of the Android
  v4 Support Library APIs. If you have not used the Support Library before,
  follow the instructions in the <a href=
  "{@docRoot}tools/support-library/setup.html">Support Library Setup</a>
  document.
</p>

<h2>Lessons</h2>

<dl>
  <dt>
    <b><a href="add-swipe-interface.html">Adding Swipe-to-Refresh To Your
    App</a></b>
  </dt>

  <dd>
    <div style="width:290px;margin-right:35px;float:right">
      <div class="framed-nexus5-port-span-5">
        <video class="play-on-hover" autoplay alt=
        "When the user performs a swipe gesture, the SwipeRefreshLayout widget displays a progress indicator until your app finishes updating its data.">
        <!-- Preferred video size 216x384 (portrait) -->
          <source src="images/swipe.mp4">
        </video>
      </div>

      <div style="font-size:10pt;margin-left:20px;margin-bottom:30px">
        <em>To replay the movie, click on the device screen</em>
      </div>
    </div>
  </dd>

  <dd>
    Learn how to provide swipe-to-refresh support in a {@link
    android.widget.ListView} or {@link android.widget.GridView}, and how to
    provide an accessible refresh option using the action bar.
  </dd>

  <dt>
    <b><a href="respond-refresh-request.html">Responding to a Refresh
    Request</a></b>
  </dt>

  <dd>
    Learn how to respond to the swipe-to-refresh gesture, and how to perform the
    same update from an action bar action.
  </dd>
</dl>