diff options
author | Joe Onorato <joeo@android.com> | 2009-08-31 14:34:43 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-08-31 14:34:43 -0700 |
commit | c567acb6c32cdc3a9cf40b30c6716ab8bc5dd614 (patch) | |
tree | bbda44727cc0e0304573dd0f5af441434692874f /res | |
parent | 0d1c563125290a58a75f6476887942a62a79d136 (diff) | |
download | packages_apps_trebuchet-c567acb6c32cdc3a9cf40b30c6716ab8bc5dd614.zip packages_apps_trebuchet-c567acb6c32cdc3a9cf40b30c6716ab8bc5dd614.tar.gz packages_apps_trebuchet-c567acb6c32cdc3a9cf40b30c6716ab8bc5dd614.tar.bz2 |
Add the all apps button.
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable-hdpi/all_apps_button.png | bin | 0 -> 8371 bytes | |||
-rw-r--r-- | res/drawable-hdpi/all_apps_button_pow2.png | bin | 0 -> 8709 bytes | |||
-rw-r--r-- | res/layout-port/launcher.xml | 23 | ||||
-rw-r--r-- | res/raw/rollo.c | 37 | ||||
-rw-r--r-- | res/values/dimens.xml | 1 |
5 files changed, 44 insertions, 17 deletions
diff --git a/res/drawable-hdpi/all_apps_button.png b/res/drawable-hdpi/all_apps_button.png Binary files differnew file mode 100644 index 0000000..945bf93 --- /dev/null +++ b/res/drawable-hdpi/all_apps_button.png diff --git a/res/drawable-hdpi/all_apps_button_pow2.png b/res/drawable-hdpi/all_apps_button_pow2.png Binary files differnew file mode 100644 index 0000000..ab93e94 --- /dev/null +++ b/res/drawable-hdpi/all_apps_button_pow2.png diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index d57d3a4..5b5c37c 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -49,21 +49,28 @@ </com.android.launcher2.Workspace> - <com.android.launcher2.HandleView - android:id="@+id/all_apps_button" + <LinearLayout + android:id="@+id/buttons" android:layout_width="fill_parent" android:layout_height="56dip" android:layout_gravity="bottom" - android:background="@drawable/handle" + android:gravity="right" + > - android:focusable="true" - android:clickable="true" + <com.android.launcher2.HandleView + android:id="@+id/all_apps_button" + android:layout_width="@dimen/button_bar_height" + android:layout_height="@dimen/button_bar_height" - android:scaleType="center" - android:src="@drawable/handle_icon" + android:focusable="true" + android:clickable="true" - launcher:direction="horizontal" /> + android:scaleType="center" + android:src="@drawable/all_apps_button" + + launcher:direction="horizontal" /> + </LinearLayout> <com.android.launcher2.DeleteZone android:id="@+id/delete_zone" diff --git a/res/raw/rollo.c b/res/raw/rollo.c index 216d761..f6097cf 100644 --- a/res/raw/rollo.c +++ b/res/raw/rollo.c @@ -12,6 +12,9 @@ #define PARAM_BUBBLE_HEIGHT 1 #define PARAM_BUBBLE_BITMAP_WIDTH 2 #define PARAM_BUBBLE_BITMAP_HEIGHT 3 +#define PARAM_SCROLL_HANDLE_ID 4 +#define PARAM_SCROLL_HANDLE_TEX_WIDTH 5 +#define PARAM_SCROLL_HANDLE_TEX_HEIGHT 6 // State ====== #define STATE_ICON_COUNT 0 @@ -26,14 +29,14 @@ #define STATE_FLING_DURATION 6 #define STATE_FLING_END_POS 7 +#define SCROLL_HANDLE_POS 8 + // Scratch variables ====== #define SCRATCH_ADJUSTED_DECELERATION 0 // Drawing constants, should be parameters ====== #define SCREEN_WIDTH_PX 480 #define SCREEN_HEIGHT 854 -#define COLUMNS_PER_PAGE 4 -#define ROWS_PER_PAGE 4 #define PAGE_PADDING_TOP_PX 80 #define CELL_PADDING_TOP_PX 5 @@ -169,15 +172,15 @@ main(int launchID) float iconLabelGutter = ICON_LABEL_GUTTER_PX * densityScale; float scrollXPx = loadI32(ALLOC_STATE, STATE_SCROLL_X); - float maxScrollX = -(pageCount-1) * SCREEN_WIDTH_PX; + float maxScrollXPx = -(pageCount-1) * SCREEN_WIDTH_PX; int done = 0; // Clamp -- because java doesn't know how big the icons are if (scrollXPx > 0) { scrollXPx = 0; } - if (scrollXPx < maxScrollX) { - scrollXPx = maxScrollX; + if (scrollXPx < maxScrollXPx) { + scrollXPx = maxScrollXPx; } // If we've been given a velocity, start a fling @@ -217,8 +220,8 @@ main(int launchID) if (endPos > 0) { endPos = 0; } - if (endPos < maxScrollX) { - endPos = maxScrollX; + if (endPos < maxScrollXPx) { + endPos = maxScrollXPx; } float scrollOnPage = modf(endPos, SCREEN_WIDTH_PX); int endPage = -endPos/SCREEN_WIDTH_PX; @@ -279,8 +282,8 @@ main(int launchID) if (scrollXPx > 0) { scrollXPx = 0; } - if (scrollXPx < maxScrollX) { - scrollXPx = maxScrollX; + if (scrollXPx < maxScrollXPx) { + scrollXPx = maxScrollXPx; } storeI32(ALLOC_STATE, STATE_CURRENT_SCROLL_X, scrollXPx); @@ -290,6 +293,8 @@ main(int launchID) storeF(ALLOC_STATE, STATE_ADJUSTED_DECELERATION, 0); } + // Draw the icons ======================================== + bindProgramVertex(NAMED_PV); bindProgramFragment(NAMED_PF); bindProgramFragmentStore(NAMED_PFS); @@ -307,6 +312,20 @@ main(int launchID) draw_page(icon, lastIcon, -VIEW_ANGLE*currentPagePosition); draw_page(icon+iconsPerPage, lastIcon, (-VIEW_ANGLE*currentPagePosition)+VIEW_ANGLE); + + // Draw the scroll handle ======================================== + /* + bindProgramVertex(NAMED_PVOrtho); + bindProgramFragment(NAMED_PFText); + bindProgramFragmentStore(NAMED_PFSText); + + bindTexture(NAMED_PFText, 0, loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_ID)); + float handleLeft = 40 + (320 * (scrollXPx/(float)(maxScrollXPx))); + float handleTop = 680; + float handleWidth = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_WIDTH); + float handleHeight = loadI32(ALLOC_PARAMS, PARAM_SCROLL_HANDLE_TEX_HEIGHT); + drawRect(handleLeft, handleTop, handleLeft+handleWidth, handleTop+handleHeight, 0.0f); + */ return !done; } diff --git a/res/values/dimens.xml b/res/values/dimens.xml index b802353..e0ca384 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -18,4 +18,5 @@ <dimen name="search_widget_inset">19dip</dimen> <dimen name="gesture_thumbnail_inset">8dip</dimen> <dimen name="gesture_thumbnail_size">64dip</dimen> + <dimen name="button_bar_height">56dip</dimen> </resources> |