From c567acb6c32cdc3a9cf40b30c6716ab8bc5dd614 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 31 Aug 2009 14:34:43 -0700 Subject: Add the all apps button. --- res/drawable-hdpi/all_apps_button.png | Bin 0 -> 8371 bytes res/drawable-hdpi/all_apps_button_pow2.png | Bin 0 -> 8709 bytes res/layout-port/launcher.xml | 23 +++++++++++------- res/raw/rollo.c | 37 ++++++++++++++++++++++------- res/values/dimens.xml | 1 + 5 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 res/drawable-hdpi/all_apps_button.png create mode 100644 res/drawable-hdpi/all_apps_button_pow2.png (limited to 'res') diff --git a/res/drawable-hdpi/all_apps_button.png b/res/drawable-hdpi/all_apps_button.png new file mode 100644 index 0000000..945bf93 Binary files /dev/null and b/res/drawable-hdpi/all_apps_button.png differ diff --git a/res/drawable-hdpi/all_apps_button_pow2.png b/res/drawable-hdpi/all_apps_button_pow2.png new file mode 100644 index 0000000..ab93e94 Binary files /dev/null and b/res/drawable-hdpi/all_apps_button_pow2.png differ 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 @@ - - android:focusable="true" - android:clickable="true" + + android:scaleType="center" + android:src="@drawable/all_apps_button" + + launcher:direction="horizontal" /> + 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 @@ 19dip 8dip 64dip + 56dip -- cgit v1.1