blob: 392f56521ac9643d5afab157412ac33f598f2bdd [file] [log] [blame]
Alexander Lucas9f935c72011-01-11 17:24:40 -08001<p>This is a demo application highlighting how to use some of the new APIs in
Roman Nurikf4f345d2011-02-04 15:27:25 -08002Honeycomb, including:</p>
Alexander Lucas9f935c72011-01-11 17:24:40 -08003
Roman Nurikf4f345d2011-02-04 15:27:25 -08004<ul>
5 <li><a href="../../../guide/topics/fundamentals/fragments.html">Fragments</a></li>
6 <li>The <a href="../../../guide/topics/ui/actionbar.html">action bar</a>
7 and contextual action bar</li>
8 <li>Drag and drop</li>
9 <li>The new <a href="../../../reference/android/animation/package-summary.html"><code>android.animation</code></a>
10 framework</li>
11 <li>Custom notifications</li>
Adam Cohen1ff28c72011-02-10 18:19:50 -080012 <li>For information on how to implement <a href="../../../reference/android/widget/StackView.html"><code>StackView</code></a>
13 and other adapter-based app widgets, see <a href="../StackWidget/index.html">StackView App Widget</a></li>
Roman Nurikf4f345d2011-02-04 15:27:25 -080014</ul>
15
16<p>The image gallery shows how all these pieces can work together in one application.</p>
17
Scott Main34ff3e72011-10-14 04:20:16 -070018<p class="note"><strong>Update:</strong> This app has been updated for Android 4.0 to support
19handsets by reusing fragments in separate activities when on smaller screens.</p>
20
Roman Nurikf4f345d2011-02-04 15:27:25 -080021<p>The application includes the following key classes:<p>
Alexander Lucas9f935c72011-01-11 17:24:40 -080022<ul>
23 <li><a href="src/com/example/android/hcgallery/ContentFragment.html">ContentFragment</a>
Roman Nurikf4f345d2011-02-04 15:27:25 -080024 A fragment responsible for containing the "content" of the application.
25 Displays images, receives drag/drop events from other fragments, and can
26 invoke the contextual action bar using
27 <a href="../../../reference/android/view/ActionMode.html">action modes</a>.</li>
Alexander Lucas9f935c72011-01-11 17:24:40 -080028 <li><a href="src/com/example/android/hcgallery/TitlesFragment.html">TitlesFragment</a>
29 Shows a ListView of photos to display in the ContentFragment. Photos can
30 be chosen either by tapping on the listview, or dragging them from the
31 list to the content area. The list of photos displayed depends on the
32 category selected in the ActionBar.</li>
33 <li><a href="src/com/example/android/hcgallery/MainActivity.html">MainActivity</a>
34 This is the main entry point of the application. MainActivity is
35 responsible for initialization of the ActionBar, TitlesFragment, and
36 ContentFragment. MainActivity is also responsible for keeping track of
37 the currently selected theme and currently selected photo when the
38 activity is recreated, such as when the screen is rotated or an intent to
Roman Nurikf4f345d2011-02-04 15:27:25 -080039 a separate activity is fired (such as the included Camera sample).
Alexander Lucas9f935c72011-01-11 17:24:40 -080040 MainActivity also contains code demonstrating how to animate
41 showing/hiding fragments (in this case, the TitlesFragment) and the
42 ActionBar, demonstrating how to smoothly transition between states
Scott Main40b35dc2011-02-22 16:40:19 -080043 in your application.</li></ul>
Alexander Lucas9f935c72011-01-11 17:24:40 -080044
Scott Main8e567702011-10-14 11:05:08 -070045<img alt="Screenshot" src="../images/hcgallery.png" />
46<img alt="Screenshot" src="../images/hcgallery-phone1.png" />
47<img alt="Screenshot" src="../images/hcgallery-phone2.png" />