[NUI] Fix Picker value changed not invoked when align animation ended
authorWoochanlee <wc0917.lee@samsung.com>
Wed, 2 Jun 2021 11:16:52 +0000 (20:16 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Jun 2021 05:35:32 +0000 (14:35 +0900)
src/Tizen.NUI.Components/Controls/Picker.cs

index d4d549f..97a4ff7 100755 (executable)
@@ -373,6 +373,11 @@ namespace Tizen.NUI.Components
             if (onAlignAnimation) {
                 onAlignAnimation = false;
                 PageAdjust(e.Position.Y);
+                if (currentValue != ((int)(-e.Position.Y / itemHeight) + 2))
+                {
+                    currentValue = ((int)(-e.Position.Y / itemHeight) + 2);
+                    OnValueChanged();
+                }
 
                 return;
             }
@@ -383,8 +388,11 @@ namespace Tizen.NUI.Components
                 pickerScroller.ScrollTo(-e.Position.Y + offset, true);
             }
             else {
-                currentValue = ((int)(-e.Position.Y / itemHeight) + 2);
-                OnValueChanged();
+                if (currentValue != ((int)(-e.Position.Y / itemHeight) + 2))
+                {
+                    currentValue = ((int)(-e.Position.Y / itemHeight) + 2);
+                    OnValueChanged();
+                }
             }
         }