Merge branch 'devel/master' into tizen accepted/tizen/unified/20191004.003538 submit/tizen/20191001.081227 submit/tizen/20191001.095942
authorSunghyun kim <scholb.kim@samsung.com>
Tue, 1 Oct 2019 06:38:41 +0000 (15:38 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Tue, 1 Oct 2019 06:38:41 +0000 (15:38 +0900)
packaging/com.samsung.dali-demo.spec
resources/style/demo-theme.json.in
resources/style/examples-theme.json.in
resources/style/mobile/demo-theme.json.in
resources/style/mobile/examples-theme.json.in
resources/style/mobile/tests-theme.json.in
resources/style/tests-theme.json.in
shared/dali-table-view.cpp
shared/dali-table-view.h

index 4e51b4e..4b6cc1e 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    1.4.38
+Version:    1.4.39
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 1c2dc27..1203c52 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.3255, 0.3412, 0.6353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.3647, 0.7569, 0.8157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.3804, 0.7412, 0.6510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 1, 1, 0.13 ]
     }
+
   }
 }
index 054a3a9..4dd7a86 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.8255, 0.2412, 0.1353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.8647, 0.4569, 0.3157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.9804, 0.5412, 0.5510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 0, 0, 0.13 ]
     }
+
   }
 }
index acf3c91..05578b7 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.3255, 0.3412, 0.6353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.3647, 0.7569, 0.8157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.3804, 0.7412, 0.6510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 1, 1, 0.13 ]
     }
+
   }
 }
index 591b5b2..f6e1c6b 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.8255, 0.2412, 0.1353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.8647, 0.4569, 0.3157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.9804, 0.5412, 0.5510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 0, 0, 0.13 ]
     }
+
   }
 }
index 078a049..90d8049 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.8255, 0.2412, 0.9353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.8647, 0.4569, 0.8157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.9804, 0.5412, 0.9510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 1, 1, 0.13 ]
     }
+
   }
 }
index c8111c8..c25d961 100644 (file)
         "units": "USER_SPACE",
         "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
       }
+    },
+
+    "BubbleColor1":
+    {
+      "color": [ 0.8255, 0.2412, 0.9353, 0.32 ]
+    },
+
+    "BubbleColor2":
+    {
+      "color": [ 0.8647, 0.4569, 0.8157, 0.32 ]
+    },
+
+    "BubbleColor3":
+    {
+      "color": [ 0.9804, 0.5412, 0.9510, 0.32 ]
+    },
+
+    "BubbleColor4":
+    {
+      "color": [ 1, 1, 1, 0.13 ]
     }
+
   }
 }
index de20ab1..5b65822 100644 (file)
@@ -44,13 +44,15 @@ const std::string LOGO_PATH( DEMO_IMAGE_DIR "Logo-for-demo.png" );
 
 // Keyboard focus effect constants.
 const float KEYBOARD_FOCUS_ANIMATION_DURATION = 1.0f;           ///< The total duration of the keyboard focus animation
-const float KEYBOARD_FOCUS_START_SCALE = 1.05f;                 ///< The starting scale of the focus highlight
-const float KEYBOARD_FOCUS_END_SCALE = 1.18f;                   ///< The end scale of the focus highlight
-const float KEYBOARD_FOCUS_END_ALPHA = 0.7f;                    ///< The end alpha of the focus highlight
-const float KEYBOARD_FOCUS_INITIAL_FADE_PERCENTAGE = 0.16f;     ///< The duration of the initial fade (from translucent to the end-alpha) as a percentage of the overal animation duration.
-const Vector3 startScale( KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE ); ///< @see KEYBOARD_FOCUS_START_SCALE
-const Vector3 endScale( KEYBOARD_FOCUS_END_SCALE, KEYBOARD_FOCUS_END_SCALE, KEYBOARD_FOCUS_END_SCALE );         ///< @see KEYBOARD_FOCUS_END_SCALE
-const float initialFadeDuration = KEYBOARD_FOCUS_ANIMATION_DURATION * KEYBOARD_FOCUS_INITIAL_FADE_PERCENTAGE;   ///< @see KEYBOARD_FOCUS_INITIAL_FADE_PERCENTAGE
+const int32_t KEYBOARD_FOCUS_ANIMATION_LOOP_COUNT = 5;          ///< The number of loops for the keyboard focus animation
+const float KEYBOARD_FOCUS_FINAL_SCALE_FLOAT = 1.05f;           ///< The final scale of the focus highlight
+const float KEYBOARD_FOCUS_ANIMATED_SCALE_FLOAT = 1.18f;        ///< The scale of the focus highlight during the animation
+const float KEYBOARD_FOCUS_FINAL_ALPHA = 0.7f;                  ///< The final alpha of the focus highlight
+const float KEYBOARD_FOCUS_ANIMATING_ALPHA = 0.0f;              ///< The alpha of the focus highlight during the animation
+const float KEYBOARD_FOCUS_FADE_PERCENTAGE = 0.16f;             ///< The duration of the fade (from translucent to the final-alpha) as a percentage of the overall animation duration
+const Vector3 KEYBOARD_FOCUS_FINAL_SCALE( KEYBOARD_FOCUS_FINAL_SCALE_FLOAT, KEYBOARD_FOCUS_FINAL_SCALE_FLOAT, KEYBOARD_FOCUS_FINAL_SCALE_FLOAT );  ///< @see KEYBOARD_FOCUS_START_SCALE_FLOAT
+const Vector3 FOCUS_INDICATOR_ANIMATING_SCALE( KEYBOARD_FOCUS_ANIMATED_SCALE_FLOAT, KEYBOARD_FOCUS_ANIMATED_SCALE_FLOAT, KEYBOARD_FOCUS_ANIMATED_SCALE_FLOAT );   ///< @see KEYBOARD_FOCUS_END_SCALE_FLOAT
+const float KEYBOARD_FOCUS_MID_KEY_FRAME_TIME = KEYBOARD_FOCUS_ANIMATION_DURATION - ( KEYBOARD_FOCUS_ANIMATION_DURATION * KEYBOARD_FOCUS_FADE_PERCENTAGE ); ///< Time of the mid key-frame
 
 const float TILE_LABEL_PADDING = 8.0f;                          ///< Border between edge of tile and the example text
 const float BUTTON_PRESS_ANIMATION_TIME = 0.35f;                ///< Time to perform button scale effect.
@@ -69,15 +71,14 @@ const float EFFECT_SNAP_DURATION = 0.66f;                       ///< Scroll Snap
 const float EFFECT_FLICK_DURATION = 0.5f;                       ///< Scroll Flick Duration for Effects
 const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f);
 
-
-const Vector4 BUBBLE_COLOR[] =
+const char * const BUBBLE_COLOR_STYLE_NAME[] =
 {
-  Vector4( 0.3255f, 0.3412f, 0.6353f, 0.32f ),
-  Vector4( 0.3647f, 0.7569f, 0.8157f, 0.32f ),
-  Vector4( 0.3804f, 0.7412f, 0.6510f, 0.32f ),
-  Vector4( 1.f, 1.f, 1.f, 0.13f )
+  "BubbleColor1",
+  "BubbleColor2",
+  "BubbleColor3",
+  "BubbleColor4"
 };
-const int NUMBER_OF_BUBBLE_COLOR( sizeof(BUBBLE_COLOR) / sizeof(BUBBLE_COLOR[0]) );
+const int NUMBER_OF_BUBBLE_COLORS( sizeof( BUBBLE_COLOR_STYLE_NAME ) / sizeof( BUBBLE_COLOR_STYLE_NAME[ 0 ] ) );
 
 const char * const SHAPE_IMAGE_TABLE[] =
 {
@@ -308,8 +309,9 @@ void DaliTableView::Initialize( Application& application )
 void DaliTableView::CreateFocusEffect()
 {
   // Hook the required signals to manage the focus.
-  KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &DaliTableView::OnKeyboardPreFocusChange );
-  KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
+  auto keyboardFocusManager = KeyboardFocusManager::Get();
+  keyboardFocusManager.PreFocusChangeSignal().Connect( this, &DaliTableView::OnKeyboardPreFocusChange );
+  keyboardFocusManager.FocusedActorEnterKeySignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
   AccessibilityManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
 
   // Loop to create both actors for the focus highlight effect.
@@ -322,31 +324,49 @@ void DaliTableView::CreateFocusEffect()
     mFocusEffect[i].actor.SetInheritScale( false );
     mFocusEffect[i].actor.SetColorMode( USE_OWN_COLOR );
 
-    // Setup initial values pre-animation.
-    mFocusEffect[i].actor.SetScale( startScale );
-    mFocusEffect[i].actor.SetOpacity( 0.0f );
+    KeyFrames alphaKeyFrames = KeyFrames::New();
+    alphaKeyFrames.Add( 0.0f, KEYBOARD_FOCUS_FINAL_ALPHA );
+    alphaKeyFrames.Add( KEYBOARD_FOCUS_MID_KEY_FRAME_TIME, KEYBOARD_FOCUS_ANIMATING_ALPHA );
+    alphaKeyFrames.Add( KEYBOARD_FOCUS_ANIMATION_DURATION, KEYBOARD_FOCUS_FINAL_ALPHA );
 
-    // Create and setup the animation to do the following:
-    //   1) Initial fade in over short period of time
-    //   2) Zoom in (larger) and fade out simultaneously over longer period of time.
-    mFocusEffect[i].animation = Animation::New( KEYBOARD_FOCUS_ANIMATION_DURATION );
+    KeyFrames scaleKeyFrames = KeyFrames::New();
+    scaleKeyFrames.Add( 0.0f, KEYBOARD_FOCUS_FINAL_SCALE );
+    scaleKeyFrames.Add( KEYBOARD_FOCUS_MID_KEY_FRAME_TIME, FOCUS_INDICATOR_ANIMATING_SCALE );
+    scaleKeyFrames.Add( KEYBOARD_FOCUS_ANIMATION_DURATION, KEYBOARD_FOCUS_FINAL_SCALE );
 
-    mFocusEffect[i].animation.AnimateTo( Property( mFocusEffect[i].actor, Actor::Property::COLOR_ALPHA ), KEYBOARD_FOCUS_END_ALPHA, AlphaFunction::LINEAR, TimePeriod( 0.0f, initialFadeDuration ) );
-    mFocusEffect[i].animation.AnimateTo( Property( mFocusEffect[i].actor, Actor::Property::SCALE ), endScale, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
-    mFocusEffect[i].animation.AnimateTo( Property( mFocusEffect[i].actor, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
+    mFocusEffect[i].animation = Animation::New( KEYBOARD_FOCUS_ANIMATION_DURATION );
+    mFocusEffect[i].animation.AnimateBetween( Property( mFocusEffect[i].actor, Actor::Property::COLOR_ALPHA ), alphaKeyFrames );
+    mFocusEffect[i].animation.AnimateBetween( Property( mFocusEffect[i].actor, Actor::Property::SCALE ), scaleKeyFrames );
 
-    mFocusEffect[i].animation.SetLooping( true );
+    mFocusEffect[i].animation.SetLoopCount( KEYBOARD_FOCUS_ANIMATION_LOOP_COUNT );
   }
 
   // Parent the secondary effect from the primary.
   mFocusEffect[0].actor.Add( mFocusEffect[1].actor );
 
+  keyboardFocusManager.SetFocusIndicatorActor( mFocusEffect[0].actor );
+
+  // Connect to the on & off stage signals of the indicator which represents when it is enabled & disabled respectively
+  mFocusEffect[0].actor.OnStageSignal().Connect( this, &DaliTableView::OnFocusIndicatorEnabled );
+  mFocusEffect[0].actor.OffStageSignal().Connect( this, &DaliTableView::OnFocusIndicatorDisabled );
+}
+
+void DaliTableView::OnFocusIndicatorEnabled( Actor /* actor */ )
+{
   // Play the animation on the 1st glow object.
   mFocusEffect[0].animation.Play();
-  // Stagger the animation on the 2st glow object half way through.
+
+  // Stagger the animation on the 2nd glow object half way through.
   mFocusEffect[1].animation.PlayFrom( KEYBOARD_FOCUS_ANIMATION_DURATION / 2.0f );
+}
 
-  KeyboardFocusManager::Get().SetFocusIndicatorActor( mFocusEffect[0].actor );
+void DaliTableView::OnFocusIndicatorDisabled( Dali::Actor /* actor */ )
+{
+  // Stop the focus effect animations
+  for( auto i = 0u; i < FOCUS_ANIMATION_ACTOR_NUMBER; ++i )
+  {
+    mFocusEffect[ i ].animation.Stop();
+  }
 }
 
 void DaliTableView::ApplyCubeEffectToPages()
@@ -750,7 +770,7 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count )
     imageMap.Add( Toolkit::Visual::Property::SHADER, effect );
     dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
 
-    dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] );
+    dfActor.SetStyleName( BUBBLE_COLOR_STYLE_NAME[ i%NUMBER_OF_BUBBLE_COLORS ] );
 
     layer.Add( dfActor );
   }
index e52afee..03b22eb 100644 (file)
@@ -298,6 +298,20 @@ private: // Application callbacks & implementation
   void OnFocusedActorActivated( Dali::Actor activatedActor );
 
   /**
+   * Callback when the keyboard focus indicator is enabled.
+   *
+   * @param[in] actor The keyboard focus indicator.
+   */
+  void OnFocusIndicatorEnabled( Dali::Actor actor );
+
+  /**
+   * Callback when the keyboard focus indicator is disabled.
+   *
+   * @param[in] actor The keyboard focus indicator.
+   */
+  void OnFocusIndicatorDisabled( Dali::Actor actor );
+
+  /**
    * Called when the logo is tapped
    *
    * @param[in]  actor  The tapped actor