Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Draw a generic "Actions" title at the root list.
Browse files Browse the repository at this point in the history
This leaves room for app toggle icons, which can be possible if/when we add a button that goes straight to the Actions app (at least on digital watches), regardless if Actions is run as a page or stand-alone.
  • Loading branch information
firetech committed Jun 1, 2012
1 parent b151d59 commit 88c32a9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/org/metawatch/manager/apps/ActionsApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,7 @@ private Bitmap drawDigital(final Context context, boolean preview) {
canvas.drawColor(Color.WHITE);

final int maxY = 96 - textHeight;
int y = 1;
if (!containerStack.isEmpty()) {
y += textHeight + 4; //Make room for a title.
}
int y = textHeight + 5; //Make room for a title.

boolean scrolled = false;
for (int i = Math.max(0, currentSelection - 96/textHeight + (containerStack.isEmpty() ? 3 : 4));
Expand Down Expand Up @@ -396,15 +393,14 @@ private Bitmap drawDigital(final Context context, boolean preview) {
}
}

if (!containerStack.isEmpty()) {
// Draw title.
if (scrolled) {
// Paint white over any scrolled items.
canvas.drawRect(0, 0, 95, textHeight+4, paintWhite);
}
canvas.drawText((String) TextUtils.ellipsize(containerStack.peek().getTitle(), paint, 84, TruncateAt.END), 2, textHeight+1, paint);
canvas.drawLine(1, textHeight+2, 86, textHeight+2, paint);
// Draw title.
if (scrolled) {
// Paint white over any scrolled items.
canvas.drawRect(0, 0, 95, textHeight+4, paintWhite);
}
String title = (containerStack.isEmpty() ? "Actions" : containerStack.peek().getTitle());
canvas.drawText((String) TextUtils.ellipsize(title, paint, 84, TruncateAt.END), 2, textHeight+1, paint);
canvas.drawLine(1, textHeight+2, 86, textHeight+2, paint);

// Draw icons.
drawDigitalAppSwitchIcon(context, canvas, preview);
Expand Down

0 comments on commit 88c32a9

Please sign in to comment.