+++ /dev/null
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
- </startup>
-</configuration>
\ No newline at end of file
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
public class Application
{
- /* public delegate string SWIGStringDelegate(string message);
-
- [global::System.Runtime.InteropServices.DllImport("libcapi-appfw-app-common.so.0", EntryPoint = "RegisterCreateStringCallback")]
- public static extern void RegisterCreateStringCallback(SWIGStringDelegate stringDelegate);*/
-
[STAThread]
static void Main(string[] args)
{
- /*RegisterCreateStringCallback(new SWIGStringDelegate((string message) =>
- {
- return message;
- }));*/
-
new DaliDemo(CommonResource.GetDaliResourcePath() + @"../../style/demo-theme.json").Run(args);
}
}
{
public static string GetDaliResourcePath()
{
- return @"/opt/usr/globalapps/Tizen.NUI.Samples/res/images/Dali/";
+ return @"/opt/usr/globalapps/org.tizen.example.Tizen.NUI.Samples/res/images/Dali/";
}
public static string GetFHResourcePath()
{
- return @"/opt/usr/globalapps/Tizen.NUI.Samples/res/images/FH3/";
+ return @"/opt/usr/globalapps/org.tizen.example.Tizen.NUI.Samples/res/images/FH3/";
}
public static string GetTVResourcePath()
{
- return @"/opt/usr/globalapps/Tizen.NUI.Samples/res/images/VD/";
+ return @"/opt/usr/globalapps/org.tizen.example.Tizen.NUI.Samples/res/images/VD/";
}
}
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.UIComponents;
{
public class Example
{
- // Constructors
-
- /**
- * @param[in] name unique name of example
- * @param[in] title The caption for the example to appear on a tile button.
- */
public Example(string name, string title)
{
this.name = name;
{
static private uint mCurPage = 0;
- static public string DEMO_IMAGE_DIR = @"../../../demo/csharp-demo/res/images/FH3/DaliDemo/";
+ static public string DEMO_IMAGE_DIR = CommonResource.GetDaliResourcePath() + "DaliDemo/";
static public string LOGO_PATH = DEMO_IMAGE_DIR + "Logo-for-demo.png";
- 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.
- Vector3 startScale = new Vector3(KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE); ///< @see KEYBOARD_FOCUS_START_SCALE
- Vector3 endScale = new Vector3(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 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.
- const float ROTATE_ANIMATION_TIME = 0.5f; ///< Time to perform rotate effect.
- const int MAX_PAGES = 256; ///< Maximum pages (arbitrary safety limit)
+ 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.
+ const float ROTATE_ANIMATION_TIME = 0.5f; // Time to perform rotate effect.
+
const int EXAMPLES_PER_ROW = 3;
const int ROWS_PER_PAGE = 3;
const int EXAMPLES_PER_PAGE = EXAMPLES_PER_ROW * ROWS_PER_PAGE;
- const float LOGO_MARGIN_RATIO = 0.1f / 0.3f;
- const float BOTTOM_PADDING_RATIO = 0.4f / 0.9f;
- Vector3 SCROLLVIEW_RELATIVE_SIZE = new Vector3(0.9f, 1.0f, 0.8f); ///< ScrollView's relative size to its parent
- Vector3 TABLE_RELATIVE_SIZE = new Vector3(0.95f, 0.9f, 0.8f); ///< TableView's relative size to the entire stage. The Y value means sum of the logo and table relative heights.
- const float STENCIL_RELATIVE_SIZE = 1.0f;
- const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap Duration for Effects
- const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects
- Vector3 ANGLE_CUBE_PAGE_ROTATE = new Vector3((float)Math.PI * 0.5f, (float)Math.PI * 0.5f, 0.0f);
+ Vector3 TABLE_RELATIVE_SIZE = new Vector3(0.95f, 0.9f, 0.8f); // TableView's relative size to the entire stage. The Y value means sum of the logo and table relative heights.
Vector4[] BUBBLE_COLOR =
{
};
const int NUMBER_OF_SHAPE_IMAGES = 2;
-
const int NUM_BACKGROUND_IMAGES = 18;
- const float BACKGROUND_SWIPE_SCALE = 0.025f;
const float BACKGROUND_SPREAD_SCALE = 1.5f;
- const float SCALE_MOD = 1000.0f * (float)Math.PI * 2.0f;
- const float SCALE_SPEED = 10.0f;
- const float SCALE_SPEED_SIN = 0.1f;
-
const uint BACKGROUND_ANIMATION_DURATION = 15000; // 15 secs
- Vector4 BACKGROUND_COLOR = new Vector4(0.3569f, 0.5451f, 0.7294f, 1.0f);
-
const float BUBBLE_MIN_Z = -1.0f;
const float BUBBLE_MAX_Z = 0.0f;
const uint CORE_MAJOR_VERSION = 1;
const uint CORE_MINOR_VERSION = 4;
- const uint CORE_MICRO_VERSION = 25;
+ const uint CORE_MICRO_VERSION = 50;
const uint ADAPTOR_MAJOR_VERSION = 1;
const uint ADAPTOR_MINOR_VERSION = 4;
- const uint ADAPTOR_MICRO_VERSION = 25;
+ const uint ADAPTOR_MICRO_VERSION = 50;
const uint TOOLKIT_MAJOR_VERSION = 1;
const uint TOOLKIT_MINOR_VERSION = 4;
- const uint TOOLKIT_MICRO_VERSION = 25;
+ const uint TOOLKIT_MICRO_VERSION = 50;
public void AddExample(Example example)
{
// Add logo
ImageView logo = new ImageView(LOGO_PATH);
logo.Name = "LOGO_IMAGE";
- //logo.SetAnchorPoint(AnchorPoint::TOP_CENTER);
logo.PositionUsesPivotPoint = true;
logo.PivotPoint = PivotPoint.TopCenter;
logo.ParentOrigin = new Position(0.5f, 0.1f, 0.5f);
logo.HeightResizePolicy = ResizePolicyType.UseNaturalSize;
//// The logo should appear on top of everything.
- //logo.DrawMode = DrawModeType.Overlay2D;
mRootActor.Add(logo);
// Show version in a popup when log is tapped
ushort buttonsPageMargin = (ushort)((1.0f - TABLE_RELATIVE_SIZE.X) * 0.5f * stageSize.Width);
mScrollView.SetPadding(new PaddingType(buttonsPageMargin, buttonsPageMargin, 0, 0));
- //mScrollView.SetAxisAutoLock(true);
mScrollView.ScrollCompleted += OnScrollComplete;
mScrollView.ScrollStarted += OnScrollStart;
private void OnScrollStart(object source, Scrollable.StartedEventArgs e)
{
mScrolling = true;
- //PlayAnimation();
}
private void OnScrollComplete(object source, Scrollable.CompletedEventArgs e)
// move focus to 1st item of new page
mScrolling = false;
mCurPage = mScrollView.GetCurrentPage();
- //FocusManager.Instance.SetCurrentFocusView(mPages[mScrollView.GetCurrentPage()].GetChildAt(0));
}
private void OnLogoTapped(object source, TapGestureDetector.DetectedEventArgs e)
mVersionPopup.HeightResizePolicy = ResizePolicyType.FitToChildren;
mVersionPopup.TouchedOutside += HideVersionPopup;
+ mVersionPopup.PositionUsesPivotPoint = true;
+ mVersionPopup.PivotPoint = PivotPoint.Center;
+ mVersionPopup.ParentOrigin = ParentOrigin.Center;
+
Window.Instance.Add(mVersionPopup);
}
}
}
- /**
- * Creates the background image
- */
+ // Creates the background image
private View CreateBackground(string stylename)
{
View background = new View();
ImageView focusableTile = new ImageView();
focusableTile.SetStyleName("DemoTile");
- focusableTile.ResourceUrl = CommonResource.GetFHResourcePath() + "DaliDemo/demo-tile-texture.9.png";
+ focusableTile.ResourceUrl = CommonResource.GetDaliResourcePath() + "DaliDemo/demo-tile-texture.9.png";
focusableTile.PositionUsesPivotPoint = true;
focusableTile.ParentOrigin = ParentOrigin.Center;
focusableTile.WidthResizePolicy = focusableTile.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
PropertyValue value = new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f));
int propertyIndex = focusableTile.RegisterProperty("uCustomPosition", value);
- // We create a constraint to perform a precalculation on the scroll-view X offset
- // and pass it to the shader uniform, along with the tile's position.
- //Constraint shaderPosition = Constraint::New<Vector3>(focusableTile, propertyIndex, TileShaderPositionConstraint(mPageWidth, position.x));
- //shaderPosition.AddSource(Source(mScrollView, ScrollView::Property::SCROLL_POSITION) );
- //shaderPosition.SetRemoveAction(Constraint::Discard );
- //shaderPosition.Apply();
- //focusableTile.Add( tileContent );
-
// Create an ImageView for the 9-patch border around the tile.
ImageView borderImage = new ImageView();
borderImage.SetStyleName("DemoTileBorder");
- borderImage.ResourceUrl = CommonResource.GetFHResourcePath() + "DaliDemo/item-background.9.png";
+ borderImage.ResourceUrl = CommonResource.GetDaliResourcePath() + "DaliDemo/item-background.9.png";
borderImage.PositionUsesPivotPoint = true;
borderImage.PivotPoint = PivotPoint.Center;
borderImage.ParentOrigin = ParentOrigin.Center;
// Connect to the touch events
focusableTile.TouchEvent += OnTilePressed;
- //focusableTile.HoverEvent += OnTileHovered;
return focusableTile;
}
tile.SetPadding(new PaddingType((int)margin, (int)margin, (int)margin, (int)margin));
page.AddChild(tile, new TableView.CellPosition(row, column));
- //page.Add(tile);
tiles.Add(tile);
{
int randSize = sizeRandom.Next(10, 400);
shapeType = shapeRandom.Next(0, NUMBER_OF_SHAPE_IMAGES);
- //shapeType = (shapeType + 1) % 2;
Console.WriteLine("randSize is {0}, shapeType is {1}", randSize, shapeType);
child.Position = childPos;
- // Define bubble horizontal parallax and vertical wrapping
- //Constraint animConstraint = Constraint::New<Vector3>(child, Actor::Property::POSITION, AnimateBubbleConstraint(childPos, Random::Range(-0.85f, 0.25f)));
- //animConstraint.AddSource(Source(mScrollView, ScrollView::Property::SCROLL_POSITION));
- //animConstraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
- //animConstraint.AddSource(Dali::LocalSource(Dali::Actor::Property::SIZE));
- //animConstraint.SetRemoveAction(Constraint::Discard);
- //animConstraint.Apply();
-
// Kickoff animation
Animation animation = new Animation(animationDurationRandom.Next(30, 160) * 1000);
animation.AnimateBy(child, "Position", new Vector3(0.0f, -2000.0f, 0.0f), new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
string fragmentShaderPrefix = "#extension GL_OES_standard_derivatives : enable\n";
string fragmentShader = "varying mediump vec2 vTexCoord;\n" +
- "\n" +
- "uniform mediump float uGlowBoundary;\n" +
- "uniform mediump vec2 uOutlineParams;\n" +
- "uniform lowp vec4 uOutlineColor;\n" +
- "uniform lowp vec4 uShadowColor;\n" +
-"uniform mediump vec2 uShadowOffset;\n" +
-"uniform lowp vec4 uGlowColor;\n" +
-"uniform lowp float uDoOutline;\n" +
-"uniform lowp float uDoShadow;\n" +
-"uniform lowp float uDoGlow;\n" +
- "\n" +
- "uniform sampler2D sTexture;\n" +
- "uniform lowp vec4 uColor;\n" +
- "\n" +
- "void main()\n" +
- "{\n" +
+ "\n" +
+ "uniform mediump float uGlowBoundary;\n" +
+ "uniform mediump vec2 uOutlineParams;\n" +
+ "uniform lowp vec4 uOutlineColor;\n" +
+ "uniform lowp vec4 uShadowColor;\n" +
+ "uniform mediump vec2 uShadowOffset;\n" +
+ "uniform lowp vec4 uGlowColor;\n" +
+ "uniform lowp float uDoOutline;\n" +
+ "uniform lowp float uDoShadow;\n" +
+ "uniform lowp float uDoGlow;\n" +
+ "\n" +
+ "uniform sampler2D sTexture;\n" +
+ "uniform lowp vec4 uColor;\n" +
+ "\n" +
+ "void main()\n" +
+ "{\n" +
"// sample distance field\n" +
"mediump float smoothing = 0.5;\n" +
"mediump float smoothWidth = fwidth(distance);\n" +
"mediump float alphaFactor = smoothstep(smoothing - smoothWidth, smoothing + smoothWidth, distance);\n" +
"lowp vec4 color;\n" +
- "if (uDoShadow == 0.0)\n" +
- "{\n" +
- "mediump float alpha = uColor.a * alphaFactor;\n" +
- "lowp vec4 rgb = uColor;\n" +
- "\n" +
- "if (uDoOutline > 0.0)\n" +
- "{\n" +
- "mediump float outlineWidth = uOutlineParams[1] + smoothWidth;\n" +
- "mediump float outlineBlend = smoothstep(uOutlineParams[0] - outlineWidth, uOutlineParams[0] + outlineWidth, distance);\n" +
- "alpha = smoothstep(smoothing - smoothWidth, smoothing + smoothWidth, distance);\n" +
- "rgb = mix(uOutlineColor, uColor, outlineBlend);\n" +
- "}\n" +
- "\n" +
- "if (uDoGlow > 0.0)\n" +
- "{\n" +
- "rgb = mix(uGlowColor, rgb, alphaFactor);\n" +
- "alpha = smoothstep(uGlowBoundary, smoothing, distance);\n" +
- "}\n" +
- "\n" +
- "// set fragment color\n" +
- "color = vec4(rgb.rgb, alpha);\n" +
- "}\n" +
- "\n" +
- "else // (uDoShadow > 0.0)\n" +
- "{\n" +
- "mediump float shadowDistance = texture2D(sTexture, vTexCoord - uShadowOffset).a;\n" +
- "mediump float inText = alphaFactor;\n" +
- "mediump float inShadow = smoothstep(smoothing - smoothWidth, smoothing + smoothWidth, shadowDistance);\n" +
- "\n" +
- "// inside object, outside shadow\n" +
- "if (inText == 1.0)\n" +
- "{\n" +
- "color = uColor;\n" +
- "}\n" +
- "// inside object, outside shadow\n" +
- "else if ((inText != 0.0) && (inShadow == 0.0))\n" +
- "{\n" +
- "color = uColor;\n" +
- "color.a *= inText;\n" +
- "}\n" +
- "// outside object, completely inside shadow\n" +
- "else if ((inText == 0.0) && (inShadow == 1.0))\n" +
- "{\n" +
- "color = uShadowColor;\n" +
- "}\n" +
- "// inside object, completely inside shadow\n" +
- "else if ((inText != 0.0) && (inShadow == 1.0))\n" +
- "{\n" +
- "color = mix(uShadowColor, uColor, inText);\n" +
- "color.a = uShadowColor.a;\n" +
- "}\n" +
- "// inside object, inside shadow's border\n" +
- "else if ((inText != 0.0) && (inShadow != 0.0))\n" +
- "{\n" +
- "color = mix(uShadowColor, uColor, inText);\n" +
- "color.a *= max(inText, inShadow);\n" +
- "}\n" +
- "// inside shadow's border\n" +
- "else if (inShadow != 0.0)\n" +
- "{\n" +
- "color = uShadowColor;\n" +
- "color.a *= inShadow;\n" +
- "}\n" +
- "// outside shadow and object\n" +
- "else \n" +
- "{\n" +
- "color.a = 0.0;\n" +
- "}\n" +
- "\n" +
- "}\n" +
- "\n" +
- "gl_FragColor = color;\n" +
- "\n" +
- "}";
+ "if (uDoShadow == 0.0)\n" +
+ "{\n" +
+ "mediump float alpha = uColor.a * alphaFactor;\n" +
+ "lowp vec4 rgb = uColor;\n" +
+ "\n" +
+ "if (uDoOutline > 0.0)\n" +
+ "{\n" +
+ "mediump float outlineWidth = uOutlineParams[1] + smoothWidth;\n" +
+ "mediump float outlineBlend = smoothstep(uOutlineParams[0] - outlineWidth, uOutlineParams[0] + outlineWidth, distance);\n" +
+ "alpha = smoothstep(smoothing - smoothWidth, smoothing + smoothWidth, distance);\n" +
+ "rgb = mix(uOutlineColor, uColor, outlineBlend);\n" +
+ "}\n" +
+ "\n" +
+ "if (uDoGlow > 0.0)\n" +
+ "{\n" +
+ "rgb = mix(uGlowColor, rgb, alphaFactor);\n" +
+ "alpha = smoothstep(uGlowBoundary, smoothing, distance);\n" +
+ "}\n" +
+ "\n" +
+ "// set fragment color\n" +
+ "color = vec4(rgb.rgb, alpha);\n" +
+ "}\n" +
+ "\n" +
+ "else // (uDoShadow > 0.0)\n" +
+ "{\n" +
+ "mediump float shadowDistance = texture2D(sTexture, vTexCoord - uShadowOffset).a;\n" +
+ "mediump float inText = alphaFactor;\n" +
+ "mediump float inShadow = smoothstep(smoothing - smoothWidth, smoothing + smoothWidth, shadowDistance);\n" +
+ "\n" +
+ "// inside object, outside shadow\n" +
+ "if (inText == 1.0)\n" +
+ "{\n" +
+ "color = uColor;\n" +
+ "}\n" +
+ "// inside object, outside shadow\n" +
+ "else if ((inText != 0.0) && (inShadow == 0.0))\n" +
+ "{\n" +
+ "color = uColor;\n" +
+ "color.a *= inText;\n" +
+ "}\n" +
+ "// outside object, completely inside shadow\n" +
+ "else if ((inText == 0.0) && (inShadow == 1.0))\n" +
+ "{\n" +
+ "color = uShadowColor;\n" +
+ "}\n" +
+ "// inside object, completely inside shadow\n" +
+ "else if ((inText != 0.0) && (inShadow == 1.0))\n" +
+ "{\n" +
+ "color = mix(uShadowColor, uColor, inText);\n" +
+ "color.a = uShadowColor.a;\n" +
+ "}\n" +
+ "// inside object, inside shadow's border\n" +
+ "else if ((inText != 0.0) && (inShadow != 0.0))\n" +
+ "{\n" +
+ "color = mix(uShadowColor, uColor, inText);\n" +
+ "color.a *= max(inText, inShadow);\n" +
+ "}\n" +
+ "// inside shadow's border\n" +
+ "else if (inShadow != 0.0)\n" +
+ "{\n" +
+ "color = uShadowColor;\n" +
+ "color.a *= inShadow;\n" +
+ "}\n" +
+ "// outside shadow and object\n" +
+ "else \n" +
+ "{\n" +
+ "color.a = 0.0;\n" +
+ "}\n" +
+ "\n" +
+ "}\n" +
+ "\n" +
+ "gl_FragColor = color;\n" +
+ "\n" +
+ "}";
PropertyMap map = new PropertyMap();
private void ApplyScrollViewEffect()
{
// Remove old effect if exists.
-
if (mScrollViewEffect)
{
mScrollView.RemoveEffect(mScrollViewEffect);
mRotateAnimation.Play();
}
- internal View mRootActor; ///< All content (excluding background is anchored to this Actor)
- private Animation mRotateAnimation; ///< Animation to rotate and resize mRootActor.
- private Animation mPressedAnimation; ///< Button press scaling animation.
- private ScrollView mScrollView; ///< ScrollView container (for all Examples)
- private ScrollViewPagePathEffect mScrollViewEffect; ///< Effect to be applied to the scroll view
- private RulerPtr mScrollRulerX; ///< ScrollView X (horizontal) ruler
- private RulerPtr mScrollRulerY; ///< ScrollView Y (vertical) ruler
- private View mPressedActor; ///< The currently pressed actor.
- private Timer mAnimationTimer; ///< Timer used to turn off animation after a specific time period
- private TapGestureDetector mLogoTapDetector; ///< To detect taps on the logo
- private Popup mVersionPopup; ///< Displays DALi library version information
-
- /**
- * This struct encapsulates all data relevant to each of the elements used within the custom keyboard focus effect.
- */
+ internal View mRootActor; // All content (excluding background is anchored to this Actor)
+ private Animation mRotateAnimation; // Animation to rotate and resize mRootActor.
+ private Animation mPressedAnimation; // Button press scaling animation.
+ private ScrollView mScrollView; // ScrollView container (for all Examples)
+ private ScrollViewPagePathEffect mScrollViewEffect; // Effect to be applied to the scroll view
+ private RulerPtr mScrollRulerX; // ScrollView X (horizontal) ruler
+ private RulerPtr mScrollRulerY; // ScrollView Y (vertical) ruler
+ private View mPressedActor; // The currently pressed actor.
+ private Timer mAnimationTimer; // Timer used to turn off animation after a specific time period
+ private TapGestureDetector mLogoTapDetector; // To detect taps on the logo
+ private Popup mVersionPopup; // Displays DALi library version information
+
+ // This struct encapsulates all data relevant to each of the elements used within the custom keyboard focus effect.
private struct FocusEffect
{
- public ImageView actor; ///< The parent keyboard focus highlight actor
- public Animation animation; ///< The animation for the parent keyboard focus highlight actor
+ public ImageView actor; // The parent keyboard focus highlight actor
+ public Animation animation; // The animation for the parent keyboard focus highlight actor
};
- FocusEffect[] mFocusEffect = new FocusEffect[FOCUS_ANIMATION_ACTOR_NUMBER]; ///< The elements used to create the custom focus effect
+ FocusEffect[] mFocusEffect = new FocusEffect[FOCUS_ANIMATION_ACTOR_NUMBER]; // The elements used to create the custom focus effect
- private View[] mPages; ///< List of pages.
- private List<Animation> mBackgroundAnimations = new List<Animation>(); ///< List of background bubble animations
- private List<Example> mExampleList = new List<Example>(); ///< List of examples.
+ private View[] mPages; // List of pages.
+ private List<Animation> mBackgroundAnimations = new List<Animation>(); // List of background bubble animations
+ private List<Example> mExampleList = new List<Example>(); // List of examples.
- private float mPageWidth; ///< The width of a page within the scroll-view, used to calculate the domain
- private uint mTotalPages; ///< Total pages within scrollview.
+ private float mPageWidth; // The width of a page within the scroll-view, used to calculate the domain
+ private uint mTotalPages; // Total pages within scrollview.
- private bool mScrolling; ///< Flag indicating whether view is currently being scrolled
- private bool mSortAlphabetically; ///< Sort examples alphabetically.
- private bool mBackgroundAnimsPlaying; ///< Are background animations playing
+ private bool mScrolling; // Flag indicating whether view is currently being scrolled
+ private bool mSortAlphabetically; // Sort examples alphabetically.
+ private bool mBackgroundAnimsPlaying; // Are background animations playing
}
}
using System;
-using System.Collections.Generic;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
using Tizen.NUI.UIComponents;
namespace Tizen.NUI.Samples
private string GRID_LABEL = "Grid";
private string DEPTH_LABEL = "Depth";
- private string TOOLBAR_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/top-bar.png";
- private string EDIT_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-edit.png";
- private string EDIT_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-edit-selected.png";
- private string DELETE_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-delete.png";
- private string DELETE_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-delete-selected.png";
- private string REPLACE_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-replace.png";
- private string REPLACE_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-replace-selected.png";
- private string INSERT_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-insert.png";
- private string INSERT_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-insert-selected.png.png";
- private string SELECTED_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/item-select-check.png";
-
- private string SPIRAL_LAYOUT_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-spiral.png";
- private string SPIRAL_LAYOUT_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-spiral-selected.png";
- private string GRID_LAYOUT_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-grid.png";
- private string GRID_LAYOUT_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-grid-selected.png";
- private string DEPTH_LAYOUT_IMAGE = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-depth.png";
- private string DEPTH_LAYOUT_IMAGE_SELECTED = CommonResource.GetFHResourcePath() + "ItemViewDemo/icon-item-view-layout-depth-selected.png";
-
-
+ private string TOOLBAR_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/top-bar.png";
+ private string EDIT_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-edit.png";
+ private string EDIT_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-edit-selected.png";
+ private string DELETE_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-delete.png";
+ private string DELETE_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-delete-selected.png";
+ private string REPLACE_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-replace.png";
+ private string REPLACE_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-replace-selected.png";
+ private string INSERT_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-insert.png";
+ private string INSERT_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-insert-selected.png.png";
+ private string SELECTED_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/item-select-check.png";
+
+ private string SPIRAL_LAYOUT_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-spiral.png";
+ private string SPIRAL_LAYOUT_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-spiral-selected.png";
+ private string GRID_LAYOUT_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-grid.png";
+ private string GRID_LAYOUT_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-grid-selected.png";
+ private string DEPTH_LAYOUT_IMAGE = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-depth.png";
+ private string DEPTH_LAYOUT_IMAGE_SELECTED = CommonResource.GetDaliResourcePath() + "ItemViewDemo/icon-item-view-layout-depth-selected.png";
+
+
private ItemView mItemView;
private ItemFactoryWrapper mItemFactoryWrapper;
private PropertyMap mGridLayout;
private ImageView mToolBarBackground;
private Layer mToolBarLayer;
- //private Layer mContentLayer;
private View mContentView;
- //private View mToolBarView;
private int mDurationSeconds = 250;
private void SetTitle(string title)
{
- if(mTitle != null)
+ if (mTitle != null)
{
mTitle.Text = title;
}
{
mGridLayout = new PropertyMap();
mGridLayout.Insert((int)DefaultItemLayoutProperty.TYPE, new PropertyValue((int)DefaultItemLayoutType.GRID));
- //mGridLayout.Add((int)DefaultItemLayoutProperty.GRID_COLUMN_NUMBER, new Dali.Property.Value(_columnNumber))
- // .Add((int)DefaultItemLayoutProperty.GRID_ROW_SPACING, new Dali.Property.Value(_rowSpacing))
- // .Add((int)DefaultItemLayoutProperty.GRID_COLUMN_SPACING, new Dali.Property.Value(_columnSpacing))
- // .Add((int)DefaultItemLayoutProperty.GRID_TOP_MARGIN, new Dali.Property.Value(TopMargin))
- // .Add((int)DefaultItemLayoutProperty.GRID_BOTTOM_MARGIN, new Dali.Property.Value(BottomMargin))
- // .Add((int)DefaultItemLayoutProperty.GRID_BOTTOM_MARGIN, new Dali.Property.Value(SideMargin));
}
public void CreateDepthLayout()
mItemFactoryWrapper.NewItemDelegate = NewItemView;
mItemView = new ItemView(mItemFactoryWrapper);
- //mItemView.BackgroundColor = Color.Blue;
+ mItemView.PositionUsesPivotPoint = true;
mItemView.ParentOrigin = Position.ParentOriginCenter;
mItemView.PivotPoint = Position.PivotPointCenter;
- mItemView.PositionUsesPivotPoint = true;
window.Add(mItemView);
window.GetDefaultLayer().Behavior = Layer.LayerBehavior.Layer3D;
mItemView.GetItemsRange(range);
uint item = (e.LongPressGesture.ScreenPoint.Y < 0.5f * (float)windowSize.Height) ? range.begin : range.end;
-
+
mItemView.ScrollToItem(item, SCROLL_TO_ITEM_ANIMATION_TIME);
break;
}
}
- // Set the new orientation to the layout
- //Issue
- //mItemView.GetLayout(layoutId)->SetOrientation(static_cast<ControlOrientation::Type>(mOrientation / 90));
-
Size2D windowSize = Window.Instance.Size;
if (layoutId == (int)AllImagesLayouts.DEPTH_LAYOUT)
mLayout.PushBack(new PropertyValue(mDepthLayout));
mLayout.PushBack(new PropertyValue(mGridLayout));
mItemView.Layout = mLayout;
-
- // Set up the depth layout according to the new orientation
- // issue
- //if (Toolkit::IsVertical(mDepthLayout->GetOrientation()))
- //{
- // mDepthLayout->SetItemSize(DepthLayoutItemSizeFunctionPortrait(stageSize.width));
- //}
- //else
- //{
- // mDepthLayout->SetItemSize(DepthLayoutItemSizeFunctionLandscape(stageSize.height));
- //}
}
// Enable anchoring for depth layout only
// Activate the layout
mItemView.ActivateLayout((uint)layoutId, new Vector3(800, 800, 800), 0.0f);
- //mItemView.ActivateLayout((uint)layoutId, new Vector3(windowSize.Width, windowSize.Height, windowSize.Width), 0.0f);
}
public View NewItemView(uint itemId)
{
// Create an image view for this item
- string imagePath = CommonResource.GetFHResourcePath() + "ItemViewDemo/gallery/gallery-medium-";
+ string imagePath = CommonResource.GetDaliResourcePath() + "ItemViewDemo/gallery/gallery-medium-";
uint id = itemId % 53;
imagePath += id.ToString();
imagePath += ".jpg";
borderActor.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
borderActor.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
borderActor.SetSizeModeFactor(new Vector3(2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f));
- //borderActor.SetColorMode(ColorMode.UseParentColor);
+ borderActor.SetColorMode(ColorMode.UseParentColor);
PropertyMap borderProperty = new PropertyMap();
borderProperty.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
actor.Add(borderActor);
Size spiralItemSize = new Size(30, 30, 0);
- //static_cast < ItemLayout &> (*mSpiralLayout).GetItemSize(0u, Vector3(Stage::GetCurrent().GetSize()), spiralItemSize);
// Add a checkbox child actor; invisible until edit-mode is enabled
ImageView checkBox = new ImageView();
checkBox.Name = "CheckBox";
- //checkBox.SetColorMode(ColorMode.UseParentColor);
+ checkBox.SetColorMode(ColorMode.UseParentColor);
checkBox.ParentOrigin = ParentOrigin.TopRight;
checkBox.PivotPoint = PivotPoint.TopRight;
checkBox.Size = spiralItemSize;
ImageView tick = new ImageView(SELECTED_IMAGE);
tick.Name = "Tick";
- //tick.SetColorMode(ColorMode.UseParentColor);
tick.ParentOrigin = ParentOrigin.TopRight;
tick.PivotPoint = PivotPoint.TopRight;
tick.Size = spiralItemSize;
tick.Hide();
checkBox.Add(tick);
- if(mTapDetector)
+ if (mTapDetector)
{
mTapDetector.Attach(actor);
}
public void Deactivate()
{
- if(mLayoutButton != null)
+ if (mLayoutButton != null)
{
mLayoutButton.GetParent().Remove(mLayoutButton);
mLayoutButton.Dispose();
mToolBarBackground.Dispose();
}
- if(mItemView != null)
+ if (mItemView != null)
{
mItemView.GetParent().Remove(mItemView);
mItemView.Dispose();
mContentView.Dispose();
}
- if(mToolBarLayer != null)
+ if (mToolBarLayer != null)
{
Window.Instance.RemoveLayer(mToolBarLayer);
mToolBarLayer.Dispose();
}
- //public void CreateToolBarView()
- //{
- // mToolBarView = new View();
- // mToolBarView.Name = "TOOLBAR";
- // mToolBarView.BackgroundImage = TOOLBAR_IMAGE;
- // mToolBarView.ParentOrigin = ParentOrigin.TopCenter;
- // mToolBarView.PivotPoint = PivotPoint.TopCenter;
- // mToolBarView.PositionUsesPivotPoint = true;
- // mToolBarView.WidthResizePolicy = ResizePolicyType.FillToParent;
- // mToolBarView.Size2D = new Size2D(0, 80);
- // Window.Instance.Add(mToolBarView);
-
- // mToolBarView.RaiseToTop();
-
- // mTitle = new TextLabel();
- // mTitle.ParentOrigin = ParentOrigin.TopLeft;
- // mTitle.PivotPoint = PivotPoint.TopLeft;
- // mTitle.PositionUsesPivotPoint = true;
- // mTitle.PointSize = 10.0f;
- // mTitle.WidthResizePolicy = ResizePolicyType.FillToParent;
- // mTitle.HeightResizePolicy = ResizePolicyType.FillToParent;
- // mTitle.Text = APPLICATION_TITLE;
- // mTitle.VerticalAlignment = VerticalAlignment.Center;
- // mTitle.HorizontalAlignment = HorizontalAlignment.Center;
- // mToolBarView.Add(mTitle);
- //}
-
private void CreateToolBarLayer()
{
mToolBarLayer = new Layer();
mToolBarLayer.Name = "TOOLBAR";
- //mToolBarLayer.BackgroundImage = TOOLBAR_IMAGE;
- //mToolBarLayer.PositionUsesPivotPoint = true;
mToolBarLayer.SetAnchorPoint(PivotPoint.TopCenter);
mToolBarLayer.SetParentOrigin(ParentOrigin.TopCenter);
mToolBarLayer.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.Width);
SetLayoutImage();
return true;
};
- //mToolBarView.Add(mLayoutButton);
mToolBarLayer.Add(mLayoutButton);
}
SwitchToNextMode();
return true;
};
- //mToolBarView.Add(mEditButton);
mToolBarLayer.Add(mEditButton);
}
private void CreateDeleteButton()
{
mDeleteButton = new PushButton();
- //mDeleteButton.BackgroundColor = Color.Red;
mDeleteButton.ParentOrigin = ParentOrigin.BottomRight;
mDeleteButton.PivotPoint = PivotPoint.BottomRight;
mDeleteButton.PositionUsesPivotPoint = true;
{
ItemIdContainer removeList = new ItemIdContainer();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View tick = child.FindChildByName("Tick");
private void CreateInsertButton()
{
mInsertButton = new PushButton();
- //mInsertButton.BackgroundColor = Color.Red;
mInsertButton.ParentOrigin = ParentOrigin.BottomRight;
mInsertButton.PivotPoint = PivotPoint.BottomRight;
mInsertButton.PositionUsesPivotPoint = true;
ItemContainer insertList = new ItemContainer();
Random random = new Random();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View tick = child.FindChildByName("Tick");
private void CreateReplaceButton()
{
mReplaceButton = new PushButton();
- //mReplaceButton.BackgroundColor = Color.Red;
mReplaceButton.ParentOrigin = ParentOrigin.BottomRight;
mReplaceButton.PivotPoint = PivotPoint.BottomRight;
mReplaceButton.PositionUsesPivotPoint = true;
ItemContainer replaceList = new ItemContainer();
Random random = new Random();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View tick = child.FindChildByName("Tick");
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
- if(mItemView.GetChildAt(i) != null)
+ if (mItemView.GetChildAt(i) != null)
{
mTapDetector.Attach(mItemView.GetChildAt(i));
}
mTapDetector.Detected += (obj, e) =>
{
View item = e.View;
- if(item != null)
+ if (item != null)
{
mItemView.RemoveItem(mItemView.GetItemId(item), 0.5f);
}
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View box = child.FindChildByName("CheckBox");
if (box)
mTapDetector.Detected += (obj, e) =>
{
View view = e.View;
- if(view != null)
+ if (view != null)
{
Console.WriteLine("haha");
}
View tick = view.FindChildByName("Tick");
if (tick)
{
- if(tick.Visibility)
+ if (tick.Visibility)
{
tick.Hide();
}
void ExitRemoveManyMode()
{
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View box = child.FindChildByName("CheckBox");
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
- if(mItemView.GetChildAt(i) != null)
+ if (mItemView.GetChildAt(i) != null)
{
mTapDetector.Attach(mItemView.GetChildAt(i));
}
-
+
}
mTapDetector.Detected += (obj, e) =>
{
- if(e.View != null)
+ if (e.View != null)
{
uint id = mItemView.GetItemId(e.View);
Random random = new Random();
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View box = child.FindChildByName("CheckBox");
void ExitInsertManyMode()
{
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
- if(child != null)
+ if (child != null)
{
View box = child.FindChildByName("CheckBox");
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
- if(mItemView.GetChildAt(i) != null)
+ if (mItemView.GetChildAt(i) != null)
{
mTapDetector.Attach(mItemView.GetChildAt(i));
- }
+ }
}
mTapDetector.Detected += (obj, e) =>
mTapDetector = new TapGestureDetector();
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
View box = child.FindChildByName("CheckBox");
void ExitReplaceManyMode()
{
for (uint i = 0; i < mItemView.GetChildCount(); ++i)
- //for (uint i = 0; i < ITEM_COUNT; ++i)
{
View child = mItemView.GetChildAt(i);
View box = child.FindChildByName("CheckBox");
mTapDetector.Reset();
mReplaceButton.Hide();
}
-
+
}
}
--- /dev/null
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Samples
+{
+ public class LottieAnimationTest : IExample
+ {
+ LottieAnimationView lav;
+ public void Activate()
+ {
+ lav = new LottieAnimationView();
+ lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "a.json";
+ lav.LoopCount = -1;
+ lav.BackgroundColor = Color.White;
+ Window.Instance.GetDefaultLayer().Add(lav);
+ lav.Play();
+ }
+ public void Deactivate()
+ {
+ Window.Instance.GetDefaultLayer().Remove(lav);
+ }
+ }
+}
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>None</DebugType>
</PropertyGroup>
- <ItemGroup>
- <None Remove="App.config" />
- <None Remove="packages.config" />
- </ItemGroup>
<ItemGroup>
- <PackageReference Include="Tizen.NET.API8" Version="8.0.0.99999" />
- <PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" />
+ <PackageReference Include="Tizen.NET" Version="8.0.0.15045" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.9" />
</ItemGroup>
</Project>