summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Peterson <james.d.peterson@gmail.com>2011-01-19 09:15:55 -0600
committerSteve Kondik <shade@chemlab.org>2011-01-22 16:13:08 -0500
commitc72dd3cf4021e5ff50a7535ebe80ad93a2cb8216 (patch)
tree366286f5b1649e15e4ea941c95006697dc243549
parent7d4b20cdcdb9521466817e0464d78a56cedb22b9 (diff)
downloadandroid_packages_apps_Calendar-c72dd3cf4021e5ff50a7535ebe80ad93a2cb8216.tar.gz
android_packages_apps_Calendar-c72dd3cf4021e5ff50a7535ebe80ad93a2cb8216.tar.bz2
android_packages_apps_Calendar-c72dd3cf4021e5ff50a7535ebe80ad93a2cb8216.zip
Updated Calendar to show colors on the MonthView Display
added back the dna_empty icon and modified it a little bit to show a convex display a more 3D look updated the width of the bits for a little easier viewing Change-Id: Ib932bee555d57135ccfecda7724b570393b45bd6
-rw-r--r--res/drawable-hdpi/app_icon.pngbin5495 -> 5561 bytes
-rw-r--r--res/drawable-hdpi/dna_empty.pngbin0 -> 2223 bytes
-rw-r--r--res/drawable-mdpi/dna_empty.pngbin0 -> 1288 bytes
-rw-r--r--src/com/android/calendar/MonthView.java15
4 files changed, 11 insertions, 4 deletions
diff --git a/res/drawable-hdpi/app_icon.png b/res/drawable-hdpi/app_icon.png
index d4cafaa1..8b6588e8 100644
--- a/res/drawable-hdpi/app_icon.png
+++ b/res/drawable-hdpi/app_icon.png
Binary files differ
diff --git a/res/drawable-hdpi/dna_empty.png b/res/drawable-hdpi/dna_empty.png
new file mode 100644
index 00000000..299980fa
--- /dev/null
+++ b/res/drawable-hdpi/dna_empty.png
Binary files differ
diff --git a/res/drawable-mdpi/dna_empty.png b/res/drawable-mdpi/dna_empty.png
new file mode 100644
index 00000000..4d260509
--- /dev/null
+++ b/res/drawable-mdpi/dna_empty.png
Binary files differ
diff --git a/src/com/android/calendar/MonthView.java b/src/com/android/calendar/MonthView.java
index afee98b1..1f6769a0 100644
--- a/src/com/android/calendar/MonthView.java
+++ b/src/com/android/calendar/MonthView.java
@@ -32,6 +32,7 @@ import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.BitmapDrawable;
import android.os.Handler;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
@@ -71,7 +72,7 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
private static int EVENT_DOT_W_H = 10;
private static int EVENT_NUM_DAYS = 31;
private static int TEXT_TOP_MARGIN = 7;
- private static int BUSY_BITS_WIDTH = 6;
+ private static int BUSY_BITS_WIDTH = 8;
private static int BUSY_BITS_MARGIN = 4;
private static int DAY_NUMBER_OFFSET = 10;
@@ -907,7 +908,7 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
p.setColor(mMonthBgColor);
p.setStyle(Style.FILL);
- canvas.drawRect(rf, p);
+ canvas.drawRoundRect(rf, 6, 6, p);
}
for (int i = 0; i < numEvents; i++) {
@@ -917,13 +918,19 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
}
drawEventRect(rect, event, canvas, p);
}
+ //Draw BusyBits backgrouind for 3D effect
+ Bitmap bmp=((BitmapDrawable) getResources().getDrawable(R.drawable.dna_empty) ).getBitmap();
+ bmp = bmp.createScaledBitmap(bmp,BUSY_BITS_WIDTH,(rect.bottom - BUSY_BITS_MARGIN - top),false);
+ canvas.drawBitmap( bmp, left, top, p);
}
// Draw busybits for a single event
private RectF drawEventRect(Rect rect, Event event, Canvas canvas, Paint p) {
- p.setColor(mBusybitsColor);
+ //p.setColor(mBusybitsColor);
+ //Set Calendar Color
+ p.setColor(event.color);
int left = rect.right - BUSY_BITS_MARGIN - BUSY_BITS_WIDTH;
int bottom = rect.bottom - BUSY_BITS_MARGIN;
@@ -935,7 +942,7 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
rf.left = left;
rf.right = left + BUSY_BITS_WIDTH;
- canvas.drawRect(rf, p);
+ canvas.drawRoundRect(rf, 4, 4, p);
return rf;
}