uifw/AvKon/src/aknlongtapanimation.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
--- a/uifw/AvKon/src/aknlongtapanimation.cpp	Tue Aug 31 15:28:30 2010 +0300
+++ b/uifw/AvKon/src/aknlongtapanimation.cpp	Wed Sep 01 12:16:19 2010 +0100
@@ -24,8 +24,6 @@
 
 #include <AknTasHook.h> // for testability hooks
 #include <touchfeedback.h>
-const TInt KStartIntensity = 1;
-const TInt KEndIntensity = 100;
 #include "aknlongtapanimation.h"
 
 enum TInternalFlags
@@ -42,6 +40,9 @@
 /** Window`s Position when hiding the animation which  does not own Window Group */
 const TInt KAknAnimationNotOwnWindowGroupWindowPosition = -10; // never at front  
 
+/** animation's position offset */
+const TInt KVerticalOffset = -75;
+
 /**  window group's name */
 _LIT( KAknLongTapWgName, "LongTapAnim" ); // window groups name
 
@@ -165,9 +166,11 @@
     
     SetRect( TRect( TPoint(aX, aY), layoutRect.Rect().Size() ));
     
-    // Position window so that it will be directly on top of
-    // the location that was clicked.
+    // position window
     TPoint point( aX - Rect().Width() / 2, aY - Rect().Height() / 2 );
+    point.iY += KVerticalOffset;
+    point.iY = Max( 0, point.iY );
+    
     Window().SetPosition( point );
 
     iAnim->SetSize( layoutRect.Rect().Size() );
@@ -190,15 +193,9 @@
     MTouchFeedback* feedback = MTouchFeedback::Instance();
     if ( feedback )
         {
-        CBitmapAnimClientData* animData = iAnim->BitmapAnimData();	
-		TInt interval = animData->FrameIntervalInMilliSeconds()
-		             * KConversionFromMillisecondsToMicroseconds;
-        TInt frameCount = animData->FrameArray().Count();
-
-        // timeout should be greater than normal animation time 
-        // so that timeout does not interfere into normal operation
-        TInt timeout = interval * (frameCount+1); 
-        feedback->StartFeedback( this, ETouchContinuousSmooth, NULL, KStartIntensity, timeout );
+        feedback->InstantFeedback( 
+                this, ETouchFeedbackLongTap,
+                ETouchFeedbackVibra, TPointerEvent() );
         }
 	StartAnimation();
     }
@@ -393,14 +390,6 @@
 	{
 		iExtension->iIndex = frameCount - 1;
 	}
-    MTouchFeedback* feedback = MTouchFeedback::Instance();
-    if ( feedback )
-        {
-        // intensity should go from 0 to 100
-        TInt intensity = KEndIntensity
-                       * (iExtension->iIndex+1) / frameCount;
-        feedback->ModifyFeedback( this, intensity );
-        }
 	DrawNow();
 	}