View unanswered posts | View active topics It is currently Sun May 28, 2017 9:24 pm

This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
 Activity Modification Recommendation 
Author Message

Joined: Tue Oct 20, 2009 3:23 pm
Posts: 1
Post Activity Modification Recommendation
This is hopefully a simple question. I have studied the API "a bit", but I'd like a second opinion before I start hacking up what I'd like to do.

Basically, I'd like to change the color of an Activity based on whether is has changed. Currently I have a hook for "activityMoved" where I'd like to do something (change color) to the visual so that the user knows it has changed.

What is the simpliest way to do this?


Tue Oct 20, 2009 3:40 pm
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Activity Modification Recommendation

Yes, it's quite simple. When you detect a change, or in some way want to mark something on a specific activity, you set a property on it. Then, in the paint process you install an activity override, which on an activity by activity basis asks you if you have any changes to the specific instance. If the activity is changed, you do. There's a few examples of this is the iCal demo source code.

Here's an example:

ActivityInteractor.setStaticOverride(AShapeUtil.DEFAULT_BACKGROUND_SHAPE_NAME, AShape.A_PAINT, new OverrideFilter() {
public Object getOverride(Object subject, Object defaultObject)
if (isSelected(subject))
defaultObject = GfxUtil.alphaColor((Color) defaultObject, 235);

return isWholeDay(subject) || isInteracting(subject) || isSelected(subject) ? defaultObject : null;


Wed Oct 21, 2009 5:19 pm
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 2 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.