Added new assets for fast-track with arrows.
diff --git a/src/com/android/contacts/FastTrackWindow.java b/src/com/android/contacts/FastTrackWindow.java
index ecff1bd..a97c7f7 100644
--- a/src/com/android/contacts/FastTrackWindow.java
+++ b/src/com/android/contacts/FastTrackWindow.java
@@ -39,8 +39,13 @@
 import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.graphics.Color;
 import android.net.Uri;
 import android.provider.Contacts.Phones;
+import android.text.SpannableStringBuilder;
+import android.text.style.CharacterStyle;
+import android.text.style.ForegroundColorSpan;
+import android.text.style.StyleSpan;
 import android.util.Log;
 import android.view.ContextThemeWrapper;
 import android.view.Gravity;
@@ -110,21 +115,26 @@
     private OnDismissListener mDismissListener;
 
     private long mAggId;
-    private int mRequestedY;
-    private int mSlop;
+    private int mAnchorX;
+    private int mAnchorY;
+    private int mAnchorHeight;
 
     private boolean mHasProfile = false;
     private boolean mHasActions = false;
 
+    private View mArrowUp;
+    private View mArrowDown;
+
     private ImageView mPhoto;
     private ImageView mPresence;
-    private TextView mDisplayName;
-    private TextView mStatus;
+    private TextView mContent;
+    private TextView mPublished;
     private ViewGroup mTrack;
 
     // TODO: read from a resource somewhere
-    private static final int mHeight = 150;
-    private static final int mAnchorHeight = 20;
+    private static final int mHeight = 138;
+    private static final int mArrowHeight = 10;
+    private static final int mArrowWidth = 24;
 
     /**
      * Set of {@link ActionInfo} that are associated with the aggregate
@@ -149,9 +159,6 @@
         Email.CONTENT_ITEM_TYPE,
     };
 
-//    public static final int ICON_SIZE = 42;
-//    public static final int ICON_PADDING = 3;
-
     // TODO: read this status from actual query
     private static final String STUB_STATUS = "has a really long random status message that would be far too long to read on a single device without the need for tiny reading glasses";
 
@@ -172,18 +179,19 @@
         mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
 
-        mSlop = ViewConfiguration.get(mContext).getScaledWindowTouchSlop();
-
         mWindow = PolicyManager.makeNewWindow(mContext);
         mWindow.setCallback(this);
         mWindow.setWindowManager(mWindowManager, null, null);
 
         mWindow.setContentView(R.layout.fasttrack);
 
+        mArrowUp = (View)mWindow.findViewById(R.id.arrow_up);
+        mArrowDown = (View)mWindow.findViewById(R.id.arrow_down);
+        
         mPhoto = (ImageView)mWindow.findViewById(R.id.photo);
         mPresence = (ImageView)mWindow.findViewById(R.id.presence);
-        mDisplayName = (TextView)mWindow.findViewById(R.id.displayname);
-        mStatus = (TextView)mWindow.findViewById(R.id.status);
+        mContent = (TextView)mWindow.findViewById(R.id.content);
+        mPublished = (TextView)mWindow.findViewById(R.id.published);
         mTrack = (ViewGroup)mWindow.findViewById(R.id.fasttrack);
 
         // TODO: move generation of mime-type cache to more-efficient place
@@ -237,14 +245,16 @@
      * Start showing a fast-track window for the given {@link Aggregate#_ID}
      * pointing towards the given location.
      */
-    public void show(Uri aggUri, int y) {
+    public void show(Uri aggUri, int x, int y, int height) {
         if (mShowing || mQuerying) {
             Log.w(TAG, "already in process of showing");
             return;
         }
 
         mAggId = ContentUris.parseId(aggUri);
-        mRequestedY = y;
+        mAnchorX = x;
+        mAnchorY = y;
+        mAnchorHeight = height;
         mQuerying = true;
 
         // Start data query in background
@@ -259,19 +269,44 @@
     }
 
     /**
+     * Show the correct callout arrow based on a {@link R.id} reference.
+     */
+    private void showArrow(int whichArrow, int requestedX) {
+        final View showArrow = (whichArrow == R.id.arrow_up) ? mArrowUp : mArrowDown;
+        final View hideArrow = (whichArrow == R.id.arrow_up) ? mArrowDown : mArrowUp;
+        
+        showArrow.setVisibility(View.VISIBLE);
+        LinearLayout.LayoutParams param = (LinearLayout.LayoutParams)showArrow.getLayoutParams();
+        param.leftMargin = requestedX - mArrowWidth / 2;
+        
+        hideArrow.setVisibility(View.INVISIBLE);
+    }
+
+    /**
      * Actual internal method to show this fast-track window. Called only by
      * {@link #considerShowing()} when all data requirements have been met.
      */
     private void showInternal() {
         mDecor = mWindow.getDecorView();
         WindowManager.LayoutParams l = mWindow.getAttributes();
-
+        
         l.gravity = Gravity.TOP | Gravity.LEFT;
         l.x = 0;
-        l.y = mRequestedY - mHeight;
-
+        
+        if (mAnchorY > mHeight) {
+            // Show downwards callout when enough room
+            showArrow(R.id.arrow_down, mAnchorX);
+            l.y = mAnchorY - (mHeight - (mArrowHeight * 2) - 5);
+            
+        } else {
+            // Otherwise show upwards callout
+            showArrow(R.id.arrow_up, mAnchorX);
+            l.y = mAnchorY + mAnchorHeight - 10;
+            
+        }
+        
         l.width = WindowManager.LayoutParams.FILL_PARENT;
-        l.height = mHeight + mAnchorHeight;
+        l.height = mHeight;
 
         l.dimAmount = 0.6f;
         l.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND
@@ -301,8 +336,8 @@
         // Reset all views to prepare for possible recycling
         mPhoto.setImageResource(R.drawable.ic_contact_list_picture);
         mPresence.setImageDrawable(null);
-        mDisplayName.setText(null);
-        mStatus.setText(null);
+        mContent.setText(null);
+        mPublished.setText(null);
 
         mActions.clear();
         mTrack.removeAllViews();
@@ -353,6 +388,10 @@
             handleData(cursor);
         }
     }
+    
+    private SpannableStringBuilder mBuilder = new SpannableStringBuilder();
+    private CharacterStyle mStyleBold = new StyleSpan(android.graphics.Typeface.BOLD);
+    private CharacterStyle mStyleBlack = new ForegroundColorSpan(Color.BLACK);
 
     /**
      * Handle the result from the {@link TOKEN_DISPLAY_NAME} query.
@@ -362,8 +401,17 @@
 
         if (cursor.moveToNext()) {
             String foundName = cursor.getString(COL_DISPLAY_NAME);
-            mDisplayName.setText(foundName);
-            mStatus.setText(STUB_STATUS);
+            
+            mBuilder.clear();
+            mBuilder.append(foundName);
+            mBuilder.append(" ");
+            mBuilder.append(STUB_STATUS);
+            mBuilder.setSpan(mStyleBold, 0, foundName.length(), 0);
+            mBuilder.setSpan(mStyleBlack, 0, foundName.length(), 0);
+            mContent.setText(mBuilder);
+            
+            mPublished.setText("4 hours ago");
+
         }
 
         mHasProfile = true;
diff --git a/src/com/android/contacts/ShowOrCreateActivity.java b/src/com/android/contacts/ShowOrCreateActivity.java
index 645032b..059a7ee 100755
--- a/src/com/android/contacts/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/ShowOrCreateActivity.java
@@ -83,8 +83,12 @@
     /**
      * Extra used to request a specific {@link FastTrackWindow} position.
      */
+    private static final String EXTRA_X = "pixel_x";
     private static final String EXTRA_Y = "pixel_y";
+    private static final String EXTRA_HEIGHT = "pixel_height";
+    private static final int DEFAULT_X = 0;
     private static final int DEFAULT_Y = 90;
+    private static final int DEFAULT_HEIGHT = 30;
 
     static final int QUERY_TOKEN = 42;
 
@@ -151,8 +155,7 @@
 
         } else {
             // Otherwise assume incoming aggregate Uri
-            final int y = getIntent().getExtras().getInt(EXTRA_Y, DEFAULT_Y);
-            showFastTrack(data, y);
+            showFastTrack(data);
 
         }
     }
@@ -172,10 +175,14 @@
      * Show a {@link FastTrackWindow} for the given aggregate at the requested
      * screen location.
      */
-    private void showFastTrack(Uri aggUri, int y) {
+    private void showFastTrack(Uri aggUri) {
         // Use our local window token for now
+        Bundle extras = getIntent().getExtras();
+        final int x = extras.getInt(EXTRA_X, DEFAULT_X);
+        final int y = extras.getInt(EXTRA_Y, DEFAULT_Y);
+        final int height = extras.getInt(EXTRA_HEIGHT, DEFAULT_HEIGHT);
         mFastTrack = new FastTrackWindow(this, this);
-        mFastTrack.show(aggUri, y);
+        mFastTrack.show(aggUri, x, y, height);
     }
 
     /** {@inheritDoc} */
@@ -205,8 +212,7 @@
         if (count == 1 && aggId != -1) {
             // If we only found one item, jump right to viewing it
             final Uri aggUri = ContentUris.withAppendedId(Aggregates.CONTENT_URI, aggId);
-            final int y = getIntent().getExtras().getInt(EXTRA_Y, DEFAULT_Y);
-            showFastTrack(aggUri, y);
+            showFastTrack(aggUri);
 
 //            Intent viewIntent = new Intent(Intent.ACTION_VIEW,
 //                    ContentUris.withAppendedId(People.CONTENT_URI, personId));
diff --git a/src/com/android/contacts/SocialStreamActivity.java b/src/com/android/contacts/SocialStreamActivity.java
index b429a53..b4ca8bb 100644
--- a/src/com/android/contacts/SocialStreamActivity.java
+++ b/src/com/android/contacts/SocialStreamActivity.java
@@ -166,15 +166,19 @@
     }
 
     private int[] mLocation = new int[2];
+    
+    private static final int PHOTO_WIDTH = 54;
+    private static final int PHOTO_HEIGHT = 54;
 
     private void showFastTrack(View anchor, long aggId) {
         Uri aggUri = ContentUris.withAppendedId(ContactsContract.Aggregates.CONTENT_URI, aggId);
 
         anchor.getLocationInWindow(mLocation);
         final int entryTop = mLocation[1];
+        final int x = (PHOTO_WIDTH / 2) + 3;
 
         mFastTrack.dismiss();
-        mFastTrack.show(aggUri, entryTop);
+        mFastTrack.show(aggUri, x, entryTop, PHOTO_HEIGHT);
     }
 
     /** {@inheritDoc} */