Ejemplo n.º 1
0
        /// <summary>
        /// Get the list of layers' information such as the start frame and the end frame in the Lottie file.
        /// </summary>
        /// <returns>List of Tuple (string of layer name, integer of start frame, integer of end frame)</returns>
        /// <since_tizen> 7 </since_tizen>
        public List <Tuple <string, int, int> > GetContentInfo()
        {
            NUILog.Debug($"<");
            if (currentStates.contentInfo != null)
            {
                return(currentStates.contentInfo);
            }

            PropertyMap imageMap   = base.Image;
            PropertyMap contentMap = new PropertyMap();

            if (imageMap != null)
            {
                PropertyValue val = imageMap.Find(ImageVisualProperty.ContentInfo);
                if (val != null)
                {
                    if (val.Get(contentMap))
                    {
                        currentStates.contentInfo = new List <Tuple <string, int, int> >();
                        for (uint i = 0; i < contentMap.Count(); i++)
                        {
                            string        key = contentMap.GetKeyAt(i).StringKey;
                            PropertyArray arr = new PropertyArray();
                            contentMap.GetValue(i).Get(arr);
                            if (arr != null)
                            {
                                int startFrame, endFrame;
                                arr.GetElementAt(0).Get(out startFrame);
                                arr.GetElementAt(1).Get(out endFrame);

                                NUILog.Debug($"[{i}] layer name={key}, startFrame={startFrame}, endFrame={endFrame}");

                                Tuple <string, int, int> item = new Tuple <string, int, int>(key, startFrame, endFrame);

                                currentStates.contentInfo?.Add(item);
                            }
                        }
                    }
                }
            }
            NUILog.Debug($">");
            return(currentStates.contentInfo);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Set the minimum and the maximum frame.
        /// </summary>
        /// <param name="minFrame">minimum frame</param>
        /// <param name="maxFrame">maximum frame</param>
        /// <since_tizen> 7 </since_tizen>
        public void SetMinMaxFrame(int minFrame, int maxFrame)
        {
            NUILog.Debug($"< [{GetId()}] SetPlayRange({minFrame}, {maxFrame})");

            currentStates.changed           = true;
            currentStates.framePlayRangeMin = minFrame;
            currentStates.framePlayRangeMax = maxFrame;

            PropertyArray array = new PropertyArray();

            array.PushBack(new PropertyValue(currentStates.framePlayRangeMin));
            array.PushBack(new PropertyValue(currentStates.framePlayRangeMax));

            PropertyMap map = new PropertyMap();

            map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
            DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
            NUILog.Debug($"  [{GetId()}] currentStates.min:({currentStates.framePlayRangeMin}, max:{currentStates.framePlayRangeMax})>");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// LottieAnimationView constructor
        /// </summary>
        /// <param name="scale">The factor of scaling image, default : 1.0f</param>
        /// <param name="shown">false : not displayed (hidden), true : displayed (shown), default : true</param>
        /// <remarks>
        /// If the shown parameter is false, the animation is not visible even if the LottieAnimationView instance is created.
        /// </remarks>
        /// <example>
        /// <code>
        /// LottieAnimationView myLottie = new LottieAnimationView();
        /// LottieAnimationView myLottie2 = new LottieAnimationView(2.0f);
        /// LottieAnimationView myLottie3 = new LottieAnimationView(1.0f, false);
        /// </code>
        /// </example>
        /// <since_tizen> 7 </since_tizen>
        public LottieAnimationView(float scale = 1.0f, bool shown = true) : base()
        {
            ActionPlay  = Interop.LottieAnimationView.AnimatedVectorImageVisualActionPlayGet();
            ActionPause = Interop.LottieAnimationView.AnimatedVectorImageVisualActionPauseGet();
            ActionStop  = Interop.LottieAnimationView.AnimatedVectorImageVisualActionStopGet();

            NUILog.Debug($"< constructor GetId={GetId()} >");
            currentStates.url                 = "";
            currentStates.frame               = -1;
            currentStates.loopCount           = 1;
            currentStates.loopMode            = LoopingModeType.Restart;
            currentStates.stopEndAction       = StopBehaviorType.CurrentFrame;
            currentStates.framePlayRangeMin   = -1;
            currentStates.framePlayRangeMax   = -1;
            currentStates.changed             = false;
            currentStates.totalFrame          = -1;
            currentStates.scale               = scale;
            currentStates.redrawInScalingDown = true;
            SetVisible(shown);
        }
Ejemplo n.º 4
0
        protected override void Dispose(DisposeTypes type)
        {
            if (disposed)
            {
                return;
            }

            //Release your own unmanaged resources here.
            //You should not access any managed member here except static instance.
            //because the execution order of Finalizes is non-deterministic.

            //disconnect event signal
            if (finishedEventHandler != null && visualEventSignalCallback != null)
            {
                VisualEventSignal().Disconnect(visualEventSignalCallback);
                finishedEventHandler = null;
                NUILog.Debug($"disconnect event signal");
            }

            base.Dispose(type);
        }
Ejemplo n.º 5
0
        public void SetMinMaxFrameByMarker(string marker1, string marker2 = null)
        {
            NUILog.Debug($"< [{GetId()}] SetMinMaxFrameByMarker({marker1}, {marker2})");

            currentStates.changed = true;
            currentStates.mark1   = marker1;
            currentStates.mark2   = marker2;

            PropertyArray array = new PropertyArray();

            array.PushBack(new PropertyValue(currentStates.mark1));
            if (marker2 != null)
            {
                array.PushBack(new PropertyValue(currentStates.mark2));
            }

            PropertyMap map = new PropertyMap();

            map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
            DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
            NUILog.Debug($"  [{GetId()}] currentStates.mark1:{currentStates.mark1}, mark2:{currentStates.mark2} >");
        }
Ejemplo n.º 6
0
        //temporary fix to pass TCT

        internal void UpdateVisual(int visualIndex, string visualName, VisualMap visualMap)
        {
            VisualBase visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap);

            visualNameDictionary[visualIndex] = visualName;
            visualDictionary[visualIndex]     = visual;
            tranformDictionary[visualIndex]   = visualMap.OutputTransformMap;

            if (visual != null)
            {
                visual.Name       = visualName;
                visual.DepthIndex = visualMap.DepthIndex;

                RegisterVisual(visualIndex, visual);

                RelayoutRequest();
                NUILog.Debug("UpdateVisual() name=" + visualName);
            }
            else
            {
                NUILog.Debug("UpdateVisual() FAIL! visual create failed name=" + visualName);
            }
        }
Ejemplo n.º 7
0
        private void onVisualEventSignal(IntPtr targetView, int visualIndex, int signalId)
        {
            OnFinished();

            if (targetView != IntPtr.Zero)
            {
                View v = Registry.GetManagedBaseHandleFromNativePtr(targetView) as View;
                if (v != null)
                {
                    NUILog.Debug($"targetView is not null! name={v.Name}");
                }
                else
                {
                    NUILog.Debug($"target is something created from dali");
                }
            }
            VisualEventSignalArgs e = new VisualEventSignalArgs();

            e.VisualIndex = visualIndex;
            e.SignalId    = signalId;
            visualEventSignalHandler?.Invoke(this, e);

            NUILog.Debug($"<[{GetId()}] onVisualEventSignal()! visualIndex={visualIndex}, signalId={signalId}>");
        }
Ejemplo n.º 8
0
 private void OnFinished()
 {
     NUILog.Debug($"<[{GetId()}] OnFinished()>");
     finishedEventHandler?.Invoke(this, null);
 }
Ejemplo n.º 9
0
 public AnimatedVectorImageView(float scale) : base(scale)
 {
     NUILog.Debug($"[AnimatedVectorImageView START[ constructor scale={scale}) objId={GetId()} ] END]");
 }
Ejemplo n.º 10
0
 public AnimatedVectorImageView() : base()
 {
     NUILog.Debug($"[AnimatedVectorImageView START[ constructor objId={GetId()} ] END]");
 }
Ejemplo n.º 11
0
 internal SayFinishedEventArgs(int result)
 {
     State = (Accessibility.SayFinishedState)(result);
     NUILog.Debug($"SayFinishedEventArgs Constructor! State={State}");
 }
Ejemplo n.º 12
0
 private static void SayFinishedEventCallback(int result)
 {
     NUILog.Debug($"sayFinishedEventCallback(res={result}) called!");
     SayFinished?.Invoke(typeof(Accessibility), new SayFinishedEventArgs(result));
 }
Ejemplo n.º 13
0
        public void Initialize()
        {
            Window window = Window.Instance;

            window.BackgroundColor = Color.White;

            TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f");

            pixelLabel.Position2D      = new Position2D(10, 10);
            pixelLabel.PixelSize       = 32.0f;
            pixelLabel.BackgroundColor = Color.Magenta;
            window.Add(pixelLabel);

            _pointLabel                 = new TextLabel("Test Point Size 32.0f");
            _pointLabel.Position2D      = new Position2D(10, 100);
            _pointLabel.PointSize       = 32.0f;
            _pointLabel.BackgroundColor = Color.Red;
            //_pointLabel.TextColorAnimatable = Color.Green; // Set initial text color using animatable property
            _pointLabel.TouchEvent += LabelTouched;
            _colorToggle            = true;

            window.Add(_pointLabel);


            TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled.");

            ellipsis.Size2D          = new Size2D(100, 80);
            ellipsis.Position2D      = new Position2D(10, 200);
            ellipsis.PointSize       = 20.0f;
            ellipsis.Ellipsis        = true;
            ellipsis.BackgroundColor = Color.Cyan;
            window.Add(ellipsis);

            TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop.");

            autoScrollStopMode.Size2D             = new Size2D(400, 50);
            autoScrollStopMode.Position2D         = new Position2D(10, 300);
            autoScrollStopMode.PointSize          = 15.0f;
            autoScrollStopMode.BackgroundColor    = Color.Green;
            autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop;
            autoScrollStopMode.EnableAutoScroll   = true;
            window.Add(autoScrollStopMode);

            TextField field = new TextField();

            field.Size2D                 = new Size2D(400, 100);
            field.Position2D             = new Position2D(10, 400);
            field.BackgroundColor        = Color.Cyan;
            field.PlaceholderText        = "input someth...";
            field.PlaceholderTextFocused = "input someth... focused";
            field.Focusable              = true;
            PropertyMap hiddenMap = new PropertyMap();

            hiddenMap.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
            hiddenMap.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(2));
            hiddenMap.Add(HiddenInputProperty.SubstituteCount, new PropertyValue(4));
            hiddenMap.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x23));
            field.HiddenInputSettings  = hiddenMap;
            field.EnableSelection      = true;
            field.EnableShiftSelection = false;
            window.Add(field);

            InputMethod inputMethod = new InputMethod();

            inputMethod.PanelLayout  = InputMethod.PanelLayoutType.Number;
            inputMethod.ActionButton = InputMethod.ActionButtonTitleType.Go;
            inputMethod.AutoCapital  = InputMethod.AutoCapitalType.Word;
            inputMethod.Variation    = 1;

            field.InputMethodSettings = inputMethod.OutputMap;

            PropertyMap propertyMap = new PropertyMap();

            propertyMap.Add("placeholderText", new PropertyValue("Placeholder Text"));
            propertyMap.Add("placeholderTextFocused", new PropertyValue("Placeholder Text Focused"));
            propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
            propertyMap.Add("placeholderPointSize", new PropertyValue(15.0f));

            PropertyMap fontStyleMap = new PropertyMap();

            fontStyleMap.Add("weight", new PropertyValue("bold"));
            fontStyleMap.Add("width", new PropertyValue("condensed"));
            fontStyleMap.Add("slant", new PropertyValue("italic"));
            propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));

            TextEditor editor = new TextEditor();

            editor.Size2D          = new Size2D(400, 100);
            editor.Position2D      = new Position2D(10, 550);
            editor.BackgroundColor = Color.Magenta;
            editor.EnableScrollBar = true;
            editor.EnableSelection = true;
            editor.Focusable       = true;
            editor.Placeholder     = propertyMap;
            window.Add(editor);
            editor.TextChanged += (obj, e) => {
                Tizen.Log.Debug("NUI", "editor line count: " + e.TextEditor.LineCount);
            };

            editor.ScrollStateChanged += (obj, e) => {
                Tizen.Log.Debug("NUI", "editor scroll state:" + e.ScrollState);
            };

            Tizen.Log.Debug("NUI", "editor id: " + editor.ID);

            FocusManager.Instance.SetCurrentFocusView(editor);
            editor.UpFocusableView  = field;
            field.DownFocusableView = editor;

            NUILog.Debug($"### field.EnableShiftSelection={field.EnableShiftSelection}, editor.EnableShiftSelection={editor.EnableShiftSelection}");
        }
Ejemplo n.º 14
0
 private void debugPrint()
 {
     NUILog.Debug($"======= currentStates");
     NUILog.Debug($"url={currentStates.url}, loopCount={currentStates.loopCount}, framePlayRangeMin={currentStates.framePlayRangeMin}, framePlayRangeMax={currentStates.framePlayRangeMax} \n");
 }