private ImageView providerImage;
private bool isAnimating;
- public delegate void AnimationEventHandler();
+ public delegate void AnimationEventHandler(bool direction);
internal event AnimationEventHandler AnimationInitialized;
internal event AnimationEventHandler AnimationFinished;
+ internal View mainView;
+ private bool direction;
+
+ internal Animation animation;
+
internal DefaultFrameBroker(Window window) : base(window)
{
this.window = window;
protected override void OnFrameResumed(FrameData frame)
{
+ base.OnFrameResumed(frame);
+
+ direction = frame.DirectionForward;
+
if (isAnimating)
{
return;
}
isAnimating = true;
- base.OnFrameResumed(frame);
- if (AnimationInitialized != null)
- {
- AnimationInitialized();
- }
+
+ AnimationInitialized?.Invoke(frame.DirectionForward);
if (frame.DirectionForward)
{
StartAnimation();
}
- private void PlayAnimateTo(FrameData frame, TransitionAnimation animation)
+ protected override void OnFramePaused()
{
- if (animation)
+ base.OnFramePaused();
+ animation?.Stop();
+
+ ResetImage();
+
+ isAnimating = false;
+ }
+
+ private void PlayAnimateTo(FrameData frame, TransitionAnimation transition)
+ {
+ if (transition != null)
{
- providerImage = frame.Image;
- providerImage.PositionUsesPivotPoint = true;
- providerImage.PivotPoint = animation.GetDefaultPivotPoint();
- providerImage.ParentOrigin = animation.GetDefaultParentOrigin();
- providerImage.Position = animation.GetDefaultPosition();
- providerImage.Size = animation.GetDefaultSize();
+ //ResetImage();
+ if (!providerImage)
+ {
+ providerImage = new ImageView(transition.DefaultImageStyle);
+ providerImage.ParentOrigin = transition.DefaultImageStyle.ParentOrigin;
+ providerImage.PivotPoint = transition.DefaultImageStyle.PivotPoint;
+ providerImage.PositionUsesPivotPoint = true;
+ providerImage.AddRenderer(GetRenderer(frame));
+ if (mainView)
+ {
+ mainView.Add(providerImage);
+ providerImage.LowerToBottom();
+ }
+ else
+ {
+ window.Add(providerImage);
+ }
+ }
+ else
+ {
+ providerImage.ApplyStyle(transition.DefaultImageStyle.Clone());
+ }
- window.Add(providerImage);
+ providerImage.Show();
+ int propertyCount = transition.AnimationDataList.Count;
+ animation = new Animation(transition.DurationMilliSeconds+80);
+ animation.Properties = new string[propertyCount];
+ animation.DestValue = new string[propertyCount];
+ animation.StartTime = new int[propertyCount];
+ animation.EndTime = new int[propertyCount];
+ for (int i = 0; i < propertyCount; i++)
+ {
+ animation.Properties[i] = transition.AnimationDataList[i].Property;
+ animation.DestValue[i] = transition.AnimationDataList[i].DestinationValue;
+ animation.StartTime[i] = 80+transition.AnimationDataList[i].StartTime;
+ animation.EndTime[i] = 80+transition.AnimationDataList[i].EndTime;
+ }
animation.PlayAnimateTo(providerImage);
+ animation.Finished += Ani_Finished;
}
else
{
set
{
forwardAnimation = value;
- forwardAnimation.Finished += Ani_Finished;
}
}
set
{
backwardAnimation = value;
- backwardAnimation.Finished += Ani_Finished;
}
}
private void Ani_Finished(object sender, EventArgs e)
{
- if (AnimationFinished != null)
- {
- AnimationFinished();
- }
+ FinishAnimation();
+ AnimationFinished?.Invoke(direction);
+ }
+
+ private void ResetImage()
+ {
if (providerImage != null)
{
- providerImage.Unparent();
- providerImage.Dispose();
- providerImage = null;
+ providerImage.Hide();
+ //providerImage.Unparent();
+ //providerImage.Dispose();
+ //providerImage = null;
}
- FinishAnimation();
- isAnimating = false;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Tizen.Applications;
using Tizen.Applications.Exceptions;
/// </summary>
internal abstract class FrameBrokerBase : IDisposable
{
- private string LogTag = "NUI";
- private readonly SafeFrameBrokerHandle _handle;
- private Dictionary<int, Interop.FrameBroker.AppControlResultCallback> _resultCallbackMaps = new Dictionary<int, Interop.FrameBroker.AppControlResultCallback>();
- private int _resultId = 0;
- private Interop.FrameBroker.FrameContextLifecycleCallbacks _callbacks;
- private IntPtr _context = IntPtr.Zero;
- private bool _disposed = false;
+ private string logTag = "NUI";
+ private readonly SafeFrameBrokerHandle handle;
+ private Dictionary<int, Interop.FrameBroker.AppControlResultCallback> resultCallbackMaps = new Dictionary<int, Interop.FrameBroker.AppControlResultCallback>();
+ private int resultId = 0;
+ private Interop.FrameBroker.FrameContextLifecycleCallbacks callbacks;
+ private IntPtr context = IntPtr.Zero;
+ private bool disposed = false;
+
+ private Renderer renderer;
+ private TextureSet textureSet;
/// <summary>
/// Initializes the FrameBroker class.
throw FrameBrokerBaseErrorFactory.GetException(Interop.FrameBroker.ErrorCode.InvalidParameter, "Invalid parameter");
}
- _callbacks.OnCreate = new Interop.FrameBroker.FrameContextCreateCallback(OnCreateNative);
- _callbacks.OnResume = new Interop.FrameBroker.FrameContextResumeCallback(OnResumeNavie);
- _callbacks.OnPause = new Interop.FrameBroker.FrameContextPauseCallback(OnPauseNative);
- _callbacks.OnDestroy = new Interop.FrameBroker.FrameContextDestroyCallback(OnDestroyNative);
- _callbacks.OnError = new Interop.FrameBroker.FrameContextErrorCallback(OnErrorNative);
- _callbacks.OnUpdate = new Interop.FrameBroker.FrameContextUpdateCallback(OnUpdateNative);
+ callbacks.OnCreate = new Interop.FrameBroker.FrameContextCreateCallback(OnCreateNative);
+ callbacks.OnResume = new Interop.FrameBroker.FrameContextResumeCallback(OnResumeNavie);
+ callbacks.OnPause = new Interop.FrameBroker.FrameContextPauseCallback(OnPauseNative);
+ callbacks.OnDestroy = new Interop.FrameBroker.FrameContextDestroyCallback(OnDestroyNative);
+ callbacks.OnError = new Interop.FrameBroker.FrameContextErrorCallback(OnErrorNative);
+ callbacks.OnUpdate = new Interop.FrameBroker.FrameContextUpdateCallback(OnUpdateNative);
- err = Interop.FrameBroker.Create(window.GetNativeWindowHandler(), ref _callbacks, IntPtr.Zero, out _handle);
+ err = Interop.FrameBroker.Create(window.GetNativeWindowHandler(), ref callbacks, IntPtr.Zero, out handle);
if (err != Interop.FrameBroker.ErrorCode.None)
{
throw FrameBrokerBaseErrorFactory.GetException(err, "Failed to create frame broker handle");
var task = new TaskCompletionSource<FrameBrokerBaseResult>();
int requestId = 0;
- lock (_resultCallbackMaps)
+ lock (resultCallbackMaps)
{
- requestId = _resultId++;
- _resultCallbackMaps[requestId] = (handle, result, userData) =>
+ requestId = resultId++;
+ resultCallbackMaps[requestId] = (handle, result, userData) =>
{
task.SetResult((FrameBrokerBaseResult)result);
- lock (_resultCallbackMaps)
+ lock (resultCallbackMaps)
{
- _resultCallbackMaps.Remove((int)userData);
+ resultCallbackMaps.Remove((int)userData);
}
};
}
Interop.FrameBroker.ErrorCode err;
if (toProvider)
- err = Interop.FrameBroker.SendLaunchRequestToProvider(_handle, appControl.SafeAppControlHandle, _resultCallbackMaps[requestId], null, (IntPtr)requestId);
+ err = Interop.FrameBroker.SendLaunchRequestToProvider(handle, appControl.SafeAppControlHandle, resultCallbackMaps[requestId], null, (IntPtr)requestId);
else
- err = Interop.FrameBroker.SendLaunchRequest(_handle, appControl.SafeAppControlHandle, _resultCallbackMaps[requestId], null, (IntPtr)requestId);
+ err = Interop.FrameBroker.SendLaunchRequest(handle, appControl.SafeAppControlHandle, resultCallbackMaps[requestId], null, (IntPtr)requestId);
if (err != Interop.FrameBroker.ErrorCode.None)
{
/// <exception cref="InvalidOperationException">Thrown when failed because of system error.</exception>
internal void StartAnimation()
{
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.StartAnimation(_context);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.StartAnimation(context);
if (err != Interop.FrameBroker.ErrorCode.None)
{
throw FrameBrokerBaseErrorFactory.GetException(err, "Failed to notify that the animation is started");
/// <exception cref="InvalidOperationException">Thrown when failed because of system error.</exception>
internal void FinishAnimation()
{
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.FinishAnimation(_context);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.FinishAnimation(context);
if (err != Interop.FrameBroker.ErrorCode.None)
{
throw FrameBrokerBaseErrorFactory.GetException(err, "Failed to notify that the animation is finished");
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFrameCreated()
{
- Log.Warn(LogTag, "The OnFrameCreated() is not implemented");
+ Log.Warn(logTag, "The OnFrameCreated() is not implemented");
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFrameResumed(FrameData frame)
{
- Log.Warn(LogTag, "The OnFrameResumed() is not implemented");
+ Log.Warn(logTag, "The OnFrameResumed() is not implemented");
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFrameUpdated(FrameData frame)
{
- Log.Warn(LogTag, "The OnFrameUpdated() is not implemented");
+ Log.Warn(logTag, "The OnFrameUpdated() is not implemented");
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFramePaused()
{
- Log.Warn(LogTag, "The OnFramePaused() is not implemented");
+ Log.Warn(logTag, "The OnFramePaused() is not implemented");
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFrameDestroyed()
{
- Log.Warn(LogTag, "The OnFrameDestroyed() is not implemented");
+ Log.Warn(logTag, "The OnFrameDestroyed() is not implemented");
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnFrameErred(FrameError error)
{
- Log.Warn(LogTag, "The OnFrameErred() is not implemented");
+ Log.Warn(logTag, "The OnFrameErred() is not implemented");
}
private void OnCreateNative(IntPtr context, IntPtr userData)
{
- _context = context;
+ this.context = context;
OnFrameCreated();
}
private void OnDestroyNative(IntPtr context, IntPtr userData)
{
- _context = IntPtr.Zero;
+ context = IntPtr.Zero;
OnFrameDestroyed();
}
private void OnErrorNative(IntPtr context, int error, IntPtr userData)
{
- _context = IntPtr.Zero;
+ context = IntPtr.Zero;
OnFrameErred((FrameError)error);
}
OnFrameUpdated(new FrameData(frame));
}
+
+ private Shader CreateShader()
+ {
+ string vertex_shader =
+ "attribute mediump vec2 aPosition;\n" +
+ "varying mediump vec2 vTexCoord;\n" +
+ "uniform highp mat4 uMvpMatrix;\n" +
+ "uniform mediump vec3 uSize;\n" +
+ "varying mediump vec2 sTexCoordRect;\n" +
+ "void main()\n" +
+ "{\n" +
+ "gl_Position = uMvpMatrix * vec4(aPosition * uSize.xy, 0.0, 1.0);\n" +
+ "vTexCoord = aPosition + vec2(0.5);\n" +
+ "}\n";
+
+ string fragment_shader =
+ "#extension GL_OES_EGL_image_external:require\n" +
+ "uniform lowp vec4 uColor;\n" +
+ "varying mediump vec2 vTexCoord;\n" +
+ "uniform samplerExternalOES sTexture;\n" +
+ "void main()\n" +
+ "{\n" +
+ "gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;\n" +
+ "}\n";
+
+ return new Shader(vertex_shader, fragment_shader);
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private struct Vec2
+ {
+ float x;
+ float y;
+ public Vec2(float xIn, float yIn)
+ {
+ x = xIn;
+ y = yIn;
+ }
+ }
+
+ private struct TexturedQuadVertex
+ {
+ public Vec2 position;
+ };
+
+ private IntPtr RectangleDataPtr()
+ {
+ TexturedQuadVertex vertex1 = new TexturedQuadVertex();
+ TexturedQuadVertex vertex2 = new TexturedQuadVertex();
+ TexturedQuadVertex vertex3 = new TexturedQuadVertex();
+ TexturedQuadVertex vertex4 = new TexturedQuadVertex();
+ vertex1.position = new Vec2(-0.5f, -0.5f);
+ vertex2.position = new Vec2(-0.5f, 0.5f);
+ vertex3.position = new Vec2(0.5f, -0.5f);
+ vertex4.position = new Vec2(0.5f, 0.5f);
+
+ TexturedQuadVertex[] texturedQuadVertexData = new TexturedQuadVertex[4] { vertex1, vertex2, vertex3, vertex4 };
+
+ int lenght = Marshal.SizeOf(vertex1);
+ IntPtr pA = Marshal.AllocHGlobal(lenght * 4);
+
+ for (int i = 0; i < 4; i++)
+ {
+ Marshal.StructureToPtr(texturedQuadVertexData[i], pA + i * lenght, true);
+ }
+
+ return pA;
+ }
+
+ private Geometry CreateQuadGeometry()
+ {
+ /* Create Property buffer */
+ PropertyValue value = new PropertyValue((int)PropertyType.Vector2);
+ PropertyMap vertexFormat = new PropertyMap();
+ PropertyBuffer vertexBuffer = new PropertyBuffer(vertexFormat);
+
+ vertexFormat.Add("aPosition", value);
+ vertexBuffer.SetData(RectangleDataPtr(), 4);
+
+ Geometry geometry = new Geometry();
+ geometry.AddVertexBuffer(vertexBuffer);
+ geometry.SetType(Geometry.Type.TRIANGLE_STRIP);
+
+ value.Dispose();
+ vertexFormat.Dispose();
+ vertexBuffer.Dispose();
+
+ return geometry;
+ }
+
+ internal Renderer GetRenderer(FrameData data)
+ {
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Texture texture = null;
+ renderer = new Renderer(geometry, shader);
+ textureSet = new TextureSet();
+
+ switch (data.Type)
+ {
+ case FrameData.FrameType.RemoteSurfaceTbmSurface:
+ if (data.TbmSurface == null)
+ {
+ geometry.Dispose();
+ shader.Dispose();
+ return null;
+ }
+ texture = new Texture(data.TbmSurface);
+ textureSet.SetTexture(0, texture);
+ renderer.SetTextures(textureSet);
+ break;
+ default:
+ break;
+ }
+
+ texture.Dispose();
+ geometry.Dispose();
+ shader.Dispose();
+ return renderer;
+ }
+
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
- if (!_disposed)
+ if (!disposed)
{
- _handle.Dispose();
- _disposed = true;
+ handle.Dispose();
+ renderer?.Dispose();
+ textureSet?.Dispose();
+ disposed = true;
}
}
{
internal static class FrameBrokerBaseErrorFactory
{
- private static string LogTag = "Tizen.NUI";
+ private static string logTag = "NUI";
internal static Exception GetException(Interop.FrameBroker.ErrorCode err, string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
{
- Log.Error(LogTag, memberName + "@" + filePath + "(" + lineNumber + ") " + message);
+ Log.Error(logTag, memberName + "(" + lineNumber + ") " + message);
switch (err)
{
case Interop.FrameBroker.ErrorCode.InvalidParameter:
/// </summary>
internal class FrameData
{
- private const string LogTag = "NUI";
- private readonly IntPtr _frame;
- private int _fd = -1;
- private uint _size = 0;
- private ImageView _image = null;
-
- private Renderer renderer;
- private TextureSet textureSet;
+ private const string logTag = "NUI";
+ private readonly IntPtr frame;
+ private int fd = -1;
+ private uint size = 0;
internal FrameData(IntPtr frame)
{
- _frame = frame;
- }
-
- private Shader CreateShader()
- {
- string vertex_shader =
- "attribute mediump vec2 aPosition;\n" +
- "varying mediump vec2 vTexCoord;\n" +
- "uniform highp mat4 uMvpMatrix;\n" +
- "uniform mediump vec3 uSize;\n" +
- "varying mediump vec2 sTexCoordRect;\n" +
- "void main()\n" +
- "{\n" +
- "gl_Position = uMvpMatrix * vec4(aPosition * uSize.xy, 0.0, 1.0);\n" +
- "vTexCoord = aPosition + vec2(0.5);\n" +
- "}\n";
-
- string fragment_shader =
- "#extension GL_OES_EGL_image_external:require\n" +
- "uniform lowp vec4 uColor;\n" +
- "varying mediump vec2 vTexCoord;\n" +
- "uniform samplerExternalOES sTexture;\n" +
- "void main()\n" +
- "{\n" +
- "gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;\n" +
- "}\n";
-
- return new Shader(vertex_shader, fragment_shader);
- }
-
- [StructLayout(LayoutKind.Sequential)]
- private struct Vec2
- {
- float x;
- float y;
- public Vec2(float xIn, float yIn)
- {
- x = xIn;
- y = yIn;
- }
- }
-
- private struct TexturedQuadVertex
- {
- public Vec2 position;
- };
-
- private IntPtr RectangleDataPtr()
- {
- TexturedQuadVertex vertex1 = new TexturedQuadVertex();
- TexturedQuadVertex vertex2 = new TexturedQuadVertex();
- TexturedQuadVertex vertex3 = new TexturedQuadVertex();
- TexturedQuadVertex vertex4 = new TexturedQuadVertex();
- vertex1.position = new Vec2(-0.5f, -0.5f);
- vertex2.position = new Vec2(-0.5f, 0.5f);
- vertex3.position = new Vec2(0.5f, -0.5f);
- vertex4.position = new Vec2(0.5f, 0.5f);
-
- TexturedQuadVertex[] texturedQuadVertexData = new TexturedQuadVertex[4] { vertex1, vertex2, vertex3, vertex4 };
-
- int lenght = Marshal.SizeOf(vertex1);
- IntPtr pA = Marshal.AllocHGlobal(lenght * 4);
-
- for (int i = 0; i < 4; i++)
- {
- Marshal.StructureToPtr(texturedQuadVertexData[i], pA + i * lenght, true);
- }
-
- return pA;
- }
-
- private Geometry CreateQuadGeometry()
- {
- /* Create Property buffer */
- PropertyMap vertexFormat = new PropertyMap();
- vertexFormat.Add("aPosition", new PropertyValue((int)PropertyType.Vector2));
-
- PropertyBuffer vertexBuffer = new PropertyBuffer(vertexFormat);
- vertexBuffer.SetData(RectangleDataPtr(), 4);
-
-
- Geometry geometry = new Geometry();
- geometry.AddVertexBuffer(vertexBuffer);
- geometry.SetType(Geometry.Type.TRIANGLE_STRIP);
-
- return geometry;
- }
-
- /// <summary>
- /// Gets the image view.
- /// </summary>
- internal ImageView Image
- {
- get
- {
- if (_image == null)
- {
- _image = new ImageView();
- renderer = new Renderer(CreateQuadGeometry(), CreateShader());
- textureSet = new TextureSet();
- }
- switch (Type)
- {
- case FrameType.RemoteSurfaceTbmSurface:
- if (TbmSurface == null)
- {
- return null;
- }
- textureSet.SetTexture(0, new Texture(TbmSurface));
- renderer.SetTextures(textureSet);
- _image.AddRenderer(renderer);
- break;
- default:
- break;
- }
-
- return _image;
- }
+ this.frame = frame;
}
/// <summary>
get
{
Interop.FrameBroker.FrameDirection direction = Interop.FrameBroker.FrameDirection.Backward + 1;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetDirection(_frame, out direction);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetDirection(frame, out direction);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get direction");
+ Log.Error(logTag, "Failed to get direction");
}
return (direction == Interop.FrameBroker.FrameDirection.Forward);
}
get
{
SafeBundleHandle safeBundle;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetExtraData(_frame, out safeBundle);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetExtraData(frame, out safeBundle);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get extra data");
+ Log.Error(logTag, "Failed to get extra data");
return null;
}
return new Bundle(safeBundle);
get
{
IntPtr tbmSurface = IntPtr.Zero;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetTbmSurface(_frame, out tbmSurface);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetTbmSurface(frame, out tbmSurface);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get tbm surface");
+ Log.Error(logTag, "Failed to get tbm surface");
}
return tbmSurface;
}
{
get
{
- if (_fd != -1)
- return _fd;
+ if (fd != -1)
+ return fd;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetImageFile(_frame, out _fd, out _size);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetImageFile(frame, out fd, out size);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get fd of image file");
+ Log.Error(logTag, "Failed to get fd of image file");
}
- return _fd;
+ return fd;
}
}
{
get
{
- if (_size != 0)
- return _size;
+ if (size != 0)
+ return size;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetImageFile(_frame, out _fd, out _size);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetImageFile(frame, out fd, out size);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get size of image file");
+ Log.Error(logTag, "Failed to get size of image file");
}
- return _size;
+ return size;
}
}
get
{
string filePath = string.Empty;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetFilePath(_frame, out filePath);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetFilePath(frame, out filePath);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get file path");
+ Log.Error(logTag, "Failed to get file path");
}
return filePath;
}
get
{
string fileGroup = string.Empty;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetFileGroup(_frame, out fileGroup);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetFileGroup(frame, out fileGroup);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get file group");
+ Log.Error(logTag, "Failed to get file group");
}
return fileGroup;
}
get
{
Interop.FrameBroker.FrameType type = Interop.FrameBroker.FrameType.SplashScreenImage + 1;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetType(_frame, out type);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetType(frame, out type);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get frame type");
+ Log.Error(logTag, "Failed to get frame type");
}
return (FrameType)type;
}
get
{
int x = -1;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetPositionX(_frame, out x);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetPositionX(frame, out x);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get position X");
+ Log.Error(logTag, "Failed to get position X");
}
return x;
}
get
{
int y = -1;
- Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetPositionY(_frame, out y);
+ Interop.FrameBroker.ErrorCode err = Interop.FrameBroker.GetPositionY(frame, out y);
if (err != Interop.FrameBroker.ErrorCode.None)
{
- Log.Error(LogTag, "Failed to get position Y");
+ Log.Error(logTag, "Failed to get position Y");
}
return y;
}
[EditorBrowsable(EditorBrowsableState.Never)]
internal class FrameProvider : IDisposable
{
- private string LogTag = "NUI";
- private readonly SafeFrameProviderHandle _handle;
- private Interop.FrameProvider.FrameProviderEventCallbacks _callbacks;
- private bool _disposed = false;
+ private string logTag = "NUI";
+ private readonly SafeFrameProviderHandle handle;
+ private Interop.FrameProvider.FrameProviderEventCallbacks callbacks;
+ private bool disposed = false;
/// <summary>
throw FrameProviderErrorFactory.GetException(Interop.FrameProvider.ErrorCode.InvalidParameter, "Invalid parameter");
}
- _callbacks.OnShow = new Interop.FrameProvider.ShowCallback(OnShowNative);
- _callbacks.OnHide = new Interop.FrameProvider.HideCallback(OnHideNative);
+ callbacks.OnShow = new Interop.FrameProvider.ShowCallback(OnShowNative);
+ callbacks.OnHide = new Interop.FrameProvider.HideCallback(OnHideNative);
- err = Interop.FrameProvider.Create(window.GetNativeWindowHandler(), ref _callbacks, IntPtr.Zero, out _handle);
+ err = Interop.FrameProvider.Create(window.GetNativeWindowHandler(), ref callbacks, IntPtr.Zero, out handle);
if (err != Interop.FrameProvider.ErrorCode.None)
{
throw FrameProviderErrorFactory.GetException(err, "Failed to create frame provider handle");
private void OnShowNative(IntPtr handle, IntPtr userData)
{
- Log.Debug(LogTag, "OnShowNative()");
+ Log.Debug(logTag, "OnShowNative()");
Shown?.Invoke(this, EventArgs.Empty);
}
private void OnHideNative(IntPtr handle, IntPtr userdata)
{
- Log.Debug(LogTag, "OnHideNative()");
+ Log.Debug(logTag, "OnHideNative()");
Hidden?.Invoke(this, EventArgs.Empty);
}
[EditorBrowsable(EditorBrowsableState.Never)]
internal void NotifyShowStatus(Bundle extraData)
{
- Interop.FrameProvider.ErrorCode err = Interop.FrameProvider.NotifyShowStatus(_handle, extraData.SafeBundleHandle);
+ Interop.FrameProvider.ErrorCode err = Interop.FrameProvider.NotifyShowStatus(handle, extraData.SafeBundleHandle);
if (err != Interop.FrameProvider.ErrorCode.None)
{
throw FrameProviderErrorFactory.GetException(err, "Failed to notify show status");
[EditorBrowsable(EditorBrowsableState.Never)]
internal void NotifyHideStatus(Bundle extraData)
{
- Interop.FrameProvider.ErrorCode err = Interop.FrameProvider.NotifyHideStatus(_handle, extraData.SafeBundleHandle);
+ Interop.FrameProvider.ErrorCode err = Interop.FrameProvider.NotifyHideStatus(handle, extraData.SafeBundleHandle);
if (err != Interop.FrameProvider.ErrorCode.None)
{
throw FrameProviderErrorFactory.GetException(err, "Failed to notify hide status");
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
- if (!_disposed)
+ if (!disposed)
{
- _handle.Dispose();
- _disposed = true;
+ handle.Dispose();
+ disposed = true;
}
}
public void Dispose()
{
Dispose(true);
-
}
}
}
{
internal static class FrameProviderErrorFactory
{
- private static string LogTag = "Tizen.NUI";
+ private static string logTag = "NUI";
internal static Exception GetException(Interop.FrameProvider.ErrorCode err, string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
{
- Log.Error(LogTag, memberName + "@" + filePath + "(" + lineNumber + ") " + message);
+ Log.Error(logTag, memberName + "(" + lineNumber + ") " + message);
switch (err)
{
case Interop.FrameProvider.ErrorCode.InvalidParameter:
using System.ComponentModel;
using System.Text;
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
+ /// <summary>
+ /// Data of animation data for transition
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class TransitionAnimationData
+ {
+ /// <summary>
+ /// start time of animation
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int StartTime { get; set; }
+
+ /// <summary>
+ /// end time of animation
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int EndTime { get; set; }
+
+ /// <summary>
+ /// property of animation
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Property { get; set; }
+
+ /// <summary>
+ /// destination value of animation
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string DestinationValue { get; set; }
+ }
+
/// <summary>
/// Transition animation effect
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public class TransitionAnimation : Animation
+ public class TransitionAnimation
{
+ private ImageViewStyle defaultImageStyle;
+ private List<TransitionAnimationData> animationDataList;
+
+
/// <summary>
/// Create an instance of Transition.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public TransitionAnimation(int durationMilliSeconds) : base(durationMilliSeconds)
+ public TransitionAnimation(int durationMilliSeconds)
{
-
+ DurationMilliSeconds = durationMilliSeconds;
+ if (animationDataList == null)
+ {
+ animationDataList = new List<TransitionAnimationData>();
+ }
}
/// <summary>
- /// Return default size of main view.
+ /// total time of animation.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Size GetDefaultSize()
+ public int DurationMilliSeconds { get; set; }
+
+ /// <summary>
+ /// Default style of animate image view.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public List<TransitionAnimationData> AnimationDataList
{
- return new Size(0, 0);
+ get
+ {
+ return animationDataList;
+ }
}
+
/// <summary>
- /// Return default position of main view.
+ /// Add data of transition animation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Position GetDefaultPosition()
+ public void AddAnimationData(TransitionAnimationData data)
{
- return new Position(0, 0);
+ if (data == null)
+ {
+ throw new ArgumentNullException(nameof(data));
+ }
+
+ animationDataList?.Add(data);
}
/// <summary>
- /// Return default position of main view.
+ /// Remove data of transition animation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Position GetDefaultParentOrigin()
+ public void RemoveAnimationData(TransitionAnimationData data)
{
- return ParentOrigin.Center;
+ animationDataList?.Remove(data);
}
/// <summary>
- /// Return default position of main view.
+ /// Clear data list of transition animation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public virtual Position GetDefaultPivotPoint()
+ public void ClearAnimationData()
{
- return PivotPoint.Center;
+ animationDataList?.Clear();
}
+ /// <summary>
+ /// Setting default style of ImageView
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle DefaultImageStyle
+ {
+ get
+ {
+ if (defaultImageStyle == null)
+ {
+ defaultImageStyle = new ImageViewStyle();
+ defaultImageStyle.Size = new Size(0, 0);
+ defaultImageStyle.Position = new Position(0, 0);
+ defaultImageStyle.ParentOrigin = ParentOrigin.Center;
+ defaultImageStyle.PivotPoint = PivotPoint.Center;
+ defaultImageStyle.PositionUsesPivotPoint = true;
+ }
+ return defaultImageStyle;
+ }
+ set
+ {
+ defaultImageStyle = value;
+ }
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public SlideIn(int durationMilliSeconds) : base(durationMilliSeconds)
{
- Properties = new string[1];
- DestValue = new string[1];
- StartTime = new int[1];
- EndTime = new int[1];
-
- StartTime[0] = 0;
- EndTime[0] = durationMilliSeconds;
-
- Properties[0] = "PositionX";
- DestValue[0] = "0";
-
defaultInitValue = -Window.Instance.GetWindowSize().Width;
- }
- /// <summary>
- /// Return default position of main view.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Position GetDefaultPosition()
- {
- return new Position(defaultInitValue, 0);
- }
+ DefaultImageStyle.Position = new Position(defaultInitValue, 0);
+ DefaultImageStyle.Size = Window.Instance.GetWindowSize();
- /// <summary>
- /// Return default size of main view.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Size GetDefaultSize()
- {
- return Window.Instance.GetWindowSize();
+ TransitionAnimationData data = new TransitionAnimationData();
+ data.StartTime = 0;
+ data.EndTime = durationMilliSeconds;
+ data.Property = "PositionX";
+ data.DestinationValue = "0";
+ AddAnimationData(data);
}
-
}
[EditorBrowsable(EditorBrowsableState.Never)]
public SlideOut(int durationMilliSeconds) : base(durationMilliSeconds)
{
- Properties = new string[1];
- DestValue = new string[1];
- StartTime = new int[1];
- EndTime = new int[1];
-
- StartTime[0] = 0;
- EndTime[0] = durationMilliSeconds;
-
- Properties[0] = "PositionX";
-
- DestValue[0] = Window.Instance.GetWindowSize().Width.ToString();
-
defaultInitValue = 0;
- }
- /// <summary>
- /// Return default position of main view.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Position GetDefaultPosition()
- {
- return new Position(defaultInitValue, 0);
- }
+ DefaultImageStyle.Position = new Position(defaultInitValue, 0);
+ DefaultImageStyle.Size = Window.Instance.GetWindowSize();
- /// <summary>
- /// Return default size of main view.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Size GetDefaultSize()
- {
- return Window.Instance.GetWindowSize();
+ TransitionAnimationData data = new TransitionAnimationData();
+ data.StartTime = 0;
+ data.EndTime = durationMilliSeconds;
+ data.Property = "PositionX";
+ data.DestinationValue = Window.Instance.GetWindowSize().Width.ToString();
+ AddAnimationData(data);
}
}
}
using System.ComponentModel;
using System.Text;
using Tizen.Applications;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class TransitionOptions : IDisposable
{
+ private bool disposed = false;
private FrameProvider frameProvider;
private DefaultFrameBroker frameBroker;
private bool enableTransition = false;
private Window mainWindow;
+ private View animatedTarget;
private string sharedId;
/// <summary>
mainWindow = window;
}
+
+ /// <summary>
+ /// Set animated view of seamless animation.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View AnimatedTarget
+ {
+ get
+ {
+ return animatedTarget;
+ }
+ set
+ {
+ animatedTarget = value;
+ }
+ }
+
/// <summary>
/// Gets or sets transition enable
/// </summary>
if (value)
{
frameBroker = new DefaultFrameBroker(mainWindow);
+ frameBroker.mainView = animatedTarget;
frameBroker.AnimationInitialized += FrameBroker_TransitionAnimationInitialized;
frameBroker.AnimationFinished += FrameBroker_TransitionAnimationFinished;
EnableProvider();
/// Emits the event when the animation is started.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler AnimationInitialized;
+ public delegate void AnimationEventHandler(bool direction);
/// <summary>
- /// Emits the event when the animation is finished.
+ /// Emits the event when the animation is started.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler AnimationFinished;
-
+ public event AnimationEventHandler AnimationInitialized;
/// <summary>
- /// Dispose for IDisposable pattern
+ /// Emits the event when the animation is finished.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void Dispose()
- {
- if (frameBroker != null)
- {
- frameBroker.Dispose();
- }
-
- if (frameProvider != null)
- {
- frameProvider.Dispose();
- }
- }
+ public event AnimationEventHandler AnimationFinished;
- private void FrameBroker_TransitionAnimationFinished()
+ private void FrameBroker_TransitionAnimationFinished(bool direction)
{
- AnimationFinished?.Invoke(this, EventArgs.Empty);
+ AnimationFinished?.Invoke(direction);
}
- private void FrameBroker_TransitionAnimationInitialized()
+ private void FrameBroker_TransitionAnimationInitialized(bool direction)
{
- AnimationInitialized?.Invoke(this, EventArgs.Empty);
+ AnimationInitialized?.Invoke(direction);
}
/// <summary>
frameProvider?.NotifyShowStatus(bundle);
CallerScreenShown?.Invoke(this, e);
+ bundle.Dispose();
+ bundle = null;
}
private void FrameProvider_Hidden(object sender, EventArgs e)
frameProvider?.NotifyHideStatus(bundle);
CallerScreenHidden?.Invoke(this, e);
+ bundle.Dispose();
+ bundle = null;
}
internal void SendLaunchRequest(AppControl appControl)
{
this.frameBroker.SendLaunchRequest(appControl, true);
}
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ if (frameBroker != null)
+ {
+ frameBroker.Dispose();
+ }
+
+ if (frameProvider != null)
+ {
+ frameProvider.Dispose();
+ }
+ disposed = true;
+ }
+ }
+
+ /// <summary>
+ /// Dispose for IDisposable pattern
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Dispose()
+ {
+ Dispose(true);
+ }
}
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace NUIBrokerSample
+{
+ public class DefaultView : View
+ {
+ public DefaultView()
+ {
+ PositionUsesPivotPoint = true;
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter;
+ PivotPoint = Tizen.NUI.PivotPoint.Center;
+ }
+ }
+}
--- /dev/null
+using System;
+using Tizen.Applications;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace NUIBrokerSample
+{
+ public class Program : NUIApplication
+ {
+ private Window window;
+ private View animationView;
+ private ObjectAnimationManager objectAnimationManager;
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ window = GetDefaultWindow();
+ window.KeyEvent += OnKeyEvent;
+
+ var xamlPage = CreateXamlPage();
+ animationView = xamlPage.AnimationView;
+ window.Add(xamlPage);
+
+ EnableAppTransition(true);
+
+ //Animating by default transition
+ //EnableAppTransition(false);
+
+ objectAnimationManager = new ObjectAnimationManager(xamlPage);
+ }
+
+ private XamlPage CreateXamlPage()
+ {
+ var page = new XamlPage(this);
+ page.PositionUsesPivotPoint = true;
+ page.ParentOrigin = ParentOrigin.TopLeft;
+ page.PivotPoint = PivotPoint.TopLeft;
+ page.BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1.0f);
+ page.Size = new Size(window.WindowSize.Width, window.WindowSize.Height, 0);
+
+ return page;
+ }
+
+ private void EnableAppTransition(bool isCustomAnimation = true)
+ {
+ TransitionOptions = new TransitionOptions(window);
+ TransitionOptions.AnimatedTarget = animationView;
+ TransitionOptions.EnableTransition = true;
+
+ if (isCustomAnimation)
+ {
+ //Set Custom Animation
+ TransitionOptions.ForwardAnimation = new SeamlessForward(400);
+ TransitionOptions.BackwardAnimation = new SeamlessBackward(400);
+ TransitionOptions.AnimationInitialized += TransitionOptions_AnimationInitialized;
+ }
+ else
+ {
+ //Set Default Animation
+ TransitionOptions.ForwardAnimation = new SlideIn(600);
+ TransitionOptions.BackwardAnimation = new SlideOut(600);
+ }
+
+ }
+
+ private void TransitionOptions_AnimationInitialized(bool direction)
+ {
+ objectAnimationManager.StartIconAnimationByDirection(direction);
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ {
+ Exit();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <AssemblyName>NUIBrokerSample</AssemblyName>
+ <DebugType>embedded</DebugType>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Folder Include="lib\" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="res\layout\XamlPage.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NUI.XamlBuild" Version="1.0.10" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\src\Tizen.NUI\Tizen.NUI.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <NeedInjection>True</NeedInjection>
+ </PropertyGroup>
+
+</Project>
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI;
+
+namespace NUIBrokerSample
+{
+ class ObjectAnimationManager
+ {
+ private XamlPage xamlPage;
+ private Position defaultPosition = new Position(0, 0);
+
+ public ObjectAnimationManager(XamlPage xamlPage)
+ {
+ this.xamlPage = xamlPage;
+ }
+
+ public void StartIconAnimationByDirection(bool direction)
+ {
+ if(direction)
+ {
+ xamlPage.mainView.Hide();
+ xamlPage.picture.Hide();
+ defaultPosition = xamlPage.mainViewModel.MainPosition;
+
+ Animation ani = new Animation(500);
+ ani.DefaultAlphaFunction = GetSineInOut80();
+ ani.AnimateTo(xamlPage.IconView, "Position", new Position(0, 150));
+ ani.AnimateTo(xamlPage.AddView, "Position", new Position(30, 180));
+
+ ani.AnimateTo(xamlPage.IconView, "Scale", new Vector3(1.3f, 1.3f, 1.3f));
+ ani.AnimateTo(xamlPage.AddView, "Scale", new Vector3(0.5f, 0.5f, 0.5f));
+
+ ani.AnimateTo(xamlPage.MainProfileText, "Position", new Position(0, 220));
+
+ ani.AnimateTo(xamlPage.AnimationView, "Size", new Size(Window.Instance.WindowSize));
+ ani.AnimateTo(xamlPage.AnimationView, "Position", new Position(0, 0));
+
+ ani.AnimateTo(xamlPage.cinematicText, "Position", new Position(0, 320));
+
+ ani.Play();
+
+ }
+ else
+ {
+ int startTime = 200;
+ int endTime = 400;
+ xamlPage.mainView.Show();
+ xamlPage.picture.Show();
+
+ Animation ani = new Animation(endTime);
+ ani.DefaultAlphaFunction = GetSineInOut80();
+ ani.AnimateTo(xamlPage.IconView, "Position", new Position(-160, 80), startTime, endTime);
+ ani.AnimateTo(xamlPage.AddView, "Position", new Position(160, 80), startTime, endTime);
+
+ ani.AnimateTo(xamlPage.IconView, "Scale", new Vector3(1.0f, 1.0f, 1.0f), startTime, endTime);
+ ani.AnimateTo(xamlPage.AddView, "Scale", new Vector3(1.0f, 1.0f, 1.0f), startTime, endTime);
+
+ ani.AnimateTo(xamlPage.MainProfileText, "Position", new Position(0, 60), startTime, endTime);
+
+ ani.AnimateTo(xamlPage.AnimationView, "Size", new Size(470, 600), startTime, endTime);
+ ani.AnimateTo(xamlPage.AnimationView, "Position", defaultPosition);
+
+ ani.AnimateTo(xamlPage.cinematicText, "Position", new Position(0, 150));
+
+ ani.Play();
+
+ }
+ }
+
+
+ private AlphaFunction GetSineInOut80()
+ {
+ return new AlphaFunction(new Vector2(0.45f, 0.43f), new Vector2(0.41f, 1.0f));
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI;
+
+namespace NUIBrokerSample
+{
+ class SeamlessBackward : TransitionAnimation
+ {
+ string[] properties = { "SizeWidth", "SizeHeight" };
+ string[] destinationValue = { "470", "600" };
+
+ public SeamlessBackward(int durationMilliSeconds) : base(durationMilliSeconds)
+ {
+ DefaultImageStyle.Size = new Size(Window.Instance.WindowSize);
+ DefaultImageStyle.Position = new Position(0, 0);
+ DefaultImageStyle.ParentOrigin = ParentOrigin.TopCenter;
+ DefaultImageStyle.PivotPoint = PivotPoint.TopCenter;
+
+ int idx = 0;
+ foreach (string property in properties)
+ {
+ TransitionAnimationData data = new TransitionAnimationData();
+ data.StartTime = 0;
+ data.EndTime = durationMilliSeconds;
+ data.Property = property;
+ data.DestinationValue = destinationValue[idx++];
+ AddAnimationData(data);
+ }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace NUIBrokerSample
+{
+ class SeamlessForward : TransitionAnimation
+ {
+ private string[] properties = { "SizeWidth", "SizeHeight", "PositionX", "PositionY", "Opacity" };
+ private string[] destinationValue = { "1080", "1920", "0", "0", "1" };
+
+ public SeamlessForward(int durationMilliSeconds) : base(durationMilliSeconds)
+ {
+ DefaultImageStyle.Size = new Size(470, 600);
+ DefaultImageStyle.Position = new Position(0, 0);
+ DefaultImageStyle.ParentOrigin = ParentOrigin.TopCenter;
+ DefaultImageStyle.PivotPoint = PivotPoint.TopCenter;
+
+ int idx = 0;
+ foreach (string property in properties)
+ {
+ TransitionAnimationData data = new TransitionAnimationData();
+ data.StartTime = 0;
+ data.EndTime = durationMilliSeconds;
+ data.Property = property;
+ data.DestinationValue = destinationValue[idx++];
+ AddAnimationData(data);
+ }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace NUIBrokerSample
+{
+ class DelegateCommand : ICommand
+ {
+ private readonly Func<bool> canExecute;
+ private readonly Action execute;
+
+ /// <summary>
+ /// Initializes a new instance of the DelegateCommand class.
+ /// </summary>
+ /// <param name="execute">indicate an execute function</param>
+ public DelegateCommand(Action execute) : this(execute, null)
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the DelegateCommand class.
+ /// </summary>
+ /// <param name="execute">execute function </param>
+ /// <param name="canExecute">can execute function</param>
+ public DelegateCommand(Action execute, Func<bool> canExecute)
+ {
+ this.execute = execute;
+ this.canExecute = canExecute;
+ }
+ /// <summary>
+ /// can executes event handler
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+
+ /// <summary>
+ /// implement of icommand can execute method
+ /// </summary>
+ /// <param name="o">parameter by default of icomand interface</param>
+ /// <returns>can execute or not</returns>
+ public bool CanExecute(object o)
+ {
+ if (this.canExecute == null)
+ {
+ return true;
+ }
+ return this.canExecute();
+ }
+
+ /// <summary>
+ /// implement of icommand interface execute method
+ /// </summary>
+ /// <param name="o">parameter by default of icomand interface</param>
+ public void Execute(object o)
+ {
+ this.execute();
+ }
+
+ /// <summary>
+ /// raise ca excute changed when property changed
+ /// </summary>
+ public void RaiseCanExecuteChanged()
+ {
+ if (this.CanExecuteChanged != null)
+ {
+ this.CanExecuteChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using Tizen.NUI;
+
+namespace NUIBrokerSample
+{
+ public class MainViewModel : INotifyPropertyChanged
+ {
+ private Position2D mainPosition;
+
+ public MainViewModel()
+ {
+ mainPosition = new Position2D(-50, 500);
+ }
+
+ public Position2D MainPosition
+ {
+ get
+ {
+ return mainPosition;
+ }
+ set
+ {
+ mainPosition = value;
+ PageContents = string.Format($"Move {mainPosition.X}, {mainPosition.Y}");
+ OnPropertyChanged("MainPosition");
+ }
+ }
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected void OnPropertyChanged(string propertyName)
+ {
+ if(PropertyChanged != null)
+ {
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ private ICommand minusCommand;
+ public ICommand MinusCommand
+ {
+ get { return (this.minusCommand) ?? (this.minusCommand = new DelegateCommand(Minus)); }
+ }
+
+ private void Minus()
+ {
+ }
+
+
+ private ICommand plusCommand;
+ public ICommand PlusCommand
+ {
+ get { return (this.plusCommand) ?? (this.plusCommand = new DelegateCommand(Plus)); }
+ }
+
+ private void Plus()
+ {
+ }
+
+ private string pageContent;
+ public string PageContents
+ {
+ get
+ {
+ return pageContent;
+ }
+ set
+ {
+ pageContent = value;
+ OnPropertyChanged("PageContents");
+ }
+ }
+
+ }
+}
--- /dev/null
+using System;
+using Tizen.Applications;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace NUIBrokerSample
+{
+ public partial class XamlPage : View
+ {
+ private const int TOUCH_AREA = 5;
+ private const string TARGET_APPLICATION = "org.tizen.example.NUIMusicPlayer";
+ private const string EMART_APPLICATION = "org.tizen.example.ScrollingTransition";
+
+ private NUIApplication application;
+ private Animation startAni;
+
+ private Position downPosition = new Position(0, 0);
+ private Position movePosition = new Position(0, 0);
+ public XamlPage(NUIApplication application)
+ {
+ this.application = application;
+ InitializeComponent();
+ }
+
+ private bool OnViewTouchEvent2(object source, TouchEventArgs e)
+ {
+ PointStateType type = e.Touch.GetState(0);
+ Vector2 vector = e.Touch.GetScreenPosition(0);
+ switch (type)
+ {
+ case PointStateType.Down:
+ downPosition = movePosition = new Position(vector);
+ PlayScaleDownAnimation(mainView);
+ PlayScaleDownAnimation(source as View);
+ break;
+ case PointStateType.Motion:
+ var currentPosition = new Position(vector);
+ MoveMainScreen(new Position(mainViewModel.MainPosition) + (currentPosition - movePosition));
+ movePosition = currentPosition;
+ break;
+ case PointStateType.Up:
+ if (isTouchArea(AbsPosition(new Position(vector) - downPosition)))
+ {
+ LaunchApplication(TARGET_APPLICATION);
+ }
+
+ PlayScaleUpAnimation(mainView);
+ PlayScaleUpAnimation(source as View);
+ break;
+ }
+ return false;
+ }
+
+ private void LaunchApplication(string opr)
+ {
+ AppControl appControl = new AppControl();
+ appControl.ApplicationId = opr;
+ application.SendLaunchRequest(appControl);
+ }
+
+ private Position AbsPosition(Position2D position)
+ {
+ return new Position(Math.Abs(position.X), Math.Abs(position.Y));
+ }
+
+ private bool isTouchArea(Position2D position)
+ {
+ return (position.X < TOUCH_AREA && position.Y < TOUCH_AREA);
+ }
+
+ private void MoveMainScreen(Position position)
+ {
+ mainViewModel.MainPosition = position;
+ }
+
+ private void PlayScaleDownAnimation(View view)
+ {
+ //ClearAnimation();
+ Animation startAni = new Animation(150);
+ startAni.AnimateTo(view, "Scale", new Vector3(0.9f, 0.9f, 1.0f));
+ startAni.Play();
+ }
+
+ private void PlayScaleUpAnimation(View view)
+ {
+ //ClearAnimation();
+ Animation startAni = new Animation(150);
+ startAni.AnimateTo(view, "Scale", new Vector3(1.0f, 1.0f, 1.0f));
+ startAni.Play();
+ }
+
+ private void ClearAnimation()
+ {
+ if (startAni != null)
+ {
+ startAni.Stop();
+ startAni.Clear();
+ startAni.Dispose();
+ startAni = null;
+ }
+ }
+
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<View x:Class="NUIBrokerSample.XamlPage"
+ xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:b="clr-namespace:Tizen.NUI;assembly=Tizen.NUI"
+ xmlns:local="clr-namespace:NUIBrokerSample">
+ <View.XamlResources>
+ <ResourceDictionary>
+ <x:String x:Key="bgPath">
+ "*Resource*/familyboard_setting_bg1.png"
+ </x:String>
+ <x:String x:Key="mainImage">
+ "*Resource*/pic_1.jpg"
+ </x:String>
+ <x:String x:Key="chartIcon">
+ "*Resource*/bar-chart-5-128.png"
+ </x:String>
+ <x:String x:Key="clockIcon">
+ "*Resource*/clock-128.png"
+ </x:String>
+ <x:String x:Key="playIcon">
+ "*Resource*/play-128.png"
+ </x:String>
+ <x:String x:Key="profileIcon">
+ "*Resource*/profile.jpg"
+ </x:String>
+ <x:String x:Key="addIcon">
+ "*Resource*/add.png"
+ </x:String>
+ <x:String x:Key="mainText">
+ "Beautiful, dreamy and dramtic
 instrumental neo classical piano scores
 from movies and tv series.
"
+ </x:String>
+ <b:Color x:Key="grayColor" R="0.3" G="0.3" B="0.3" A="1.0"></b:Color>
+ <x:String x:Key="whiteMainTextColor">
+ "0.95, 0.95, 0.95, 1.0"
+ </x:String>
+ <x:String x:Key="whiteSubTextColor">
+ "0.7, 0.7, 0.7, 1.0"
+ </x:String>
+ <Size2D x:Key="popupSize" Width="470" Height="600">
+ </Size2D>
+ <x:Single x:Key="point1">12.0</x:Single>
+ <x:Single x:Key="point2">24.0</x:Single>
+ </ResourceDictionary>
+ </View.XamlResources>
+
+ <View.BindingContext>
+ <local:MainViewModel x:Name="mainViewModel"/>
+ </View.BindingContext>
+
+ <ImageView ResourceUrl="*Resource*/familyboard_setting_bg6.png"
+ WidthResizePolicy="FillToParent"
+ HeightResizePolicy="FillToParent"/>
+
+ <View x:Name="mainView"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="TopCenter"
+ BackgroundColor="Black"
+ Position2D="{Binding MainPosition}"
+ Size2D="{StaticResource popupSize}"
+ CornerRadius="10" >
+
+ <ImageView x:Name="picture"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="BottomCenter"
+ PivotPoint="BottomCenter"
+ ResourceUrl="*Resource*/pic_1.jpg"
+ Size2D="360,360"/>
+ <TextLabel PositionUsesPivotPoint="True"
+ ParentOrigin="Center"
+ PivotPoint="Center"
+ MultiLine="True"
+ HorizontalAlignment="Center"
+ TextColor="0.6, 0.6, 0.6, 1.0"
+ PointSize="14"
+ Position2D="0,-30"
+ WidthResizePolicy="FillToParent"
+ Text="{StaticResource mainText}" />
+
+ <TextLabel x:Name="cinematicText"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ Text="Cinematic Piano"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Top"
+ TextColor="0.95, 0.95, 0.95, 1.0"
+ PointSize="20"
+ Position2D="0,150"
+ WidthResizePolicy="FillToParent">
+ <TextLabel.FontStyle>
+ <PropertyMap>
+ <KeyValue Key="weight" Value="bold" />
+ </PropertyMap>
+ </TextLabel.FontStyle>
+ </TextLabel>
+
+ <TextLabel PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ Text="9,465
"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Top"
+ TextColor="0.3, 0.3, 0.3, 1.0"
+ PointSize="{StaticResource point1}"
+ Position2D="-35,198"
+ WidthResizePolicy="FillToParent"/>
+ <ImageView ParentOrigin="TopCenter"
+ ResourceUrl="*Resource*/bar-chart-5-128.png"
+ Color="0.3, 0.3, 0.3, 1.0"
+ Position2D="-85,190"
+ Size2D="15,15"/>
+
+ <TextLabel PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ Text="5h 35m
"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Top"
+ TextColor="0.3, 0.3, 0.3, 1.0"
+ PointSize="{StaticResource point1}"
+ Position2D="65,198"
+ WidthResizePolicy="FillToParent"/>
+ <ImageView ParentOrigin="TopCenter"
+ ResourceUrl="*Resource*/clock-128.png"
+ Color="0.3, 0.3, 0.3, 1.0"
+ Position2D="10,190"
+ Size2D="15,15"/>
+
+ <View PositionUsesPivotPoint="True"
+ ParentOrigin="BottomCenter"
+ PivotPoint="Center"
+ BackgroundColor="White"
+ Position2D="0,-40"
+ Size2D="52,52"
+ CornerRadius="26">
+ <ImageView PositionUsesPivotPoint="True"
+ ParentOrigin="Center"
+ PivotPoint="Center"
+ ResourceUrl="*Resource*/play-128.png"
+ Color="Black"
+ Size2D="20,20"/>
+ </View>
+ </View>
+
+ <View x:Name="AnimationView"
+ Position2D="{Binding MainPosition}"
+ Size2D="{StaticResource popupSize}"
+ TouchEvent="OnViewTouchEvent2"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="TopCenter" >
+ <View x:Name="IconView"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ BackgroundColor="White"
+ Position2D="-160,80"
+ Size2D="76,76"
+ CornerRadius="38">
+ <View PositionUsesPivotPoint="True"
+ ParentOrigin="Center"
+ PivotPoint="Center"
+ BackgroundColor="Black"
+ Size2D="76,76"
+ CornerRadius="37">
+ <ImageView PositionUsesPivotPoint="True"
+ ParentOrigin="Center"
+ PivotPoint="Center"
+ ResourceUrl="*Resource*/profile.jpg"
+ Size2D="62,62"
+ CornerRadius="31"/>
+ </View>
+ </View>
+
+ <TextLabel x:Name="MainProfileText"
+ Text="PIANO DAILY"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Top"
+ TextColor="0.95,0.95,0.95,1.0"
+ PointSize="{StaticResource point1}"
+ Position2D="0,60"
+ WidthResizePolicy="FillToParent">
+ <TextLabel.FontStyle>
+ <PropertyMap>
+ <KeyValue Key="weight" Value="bold" />
+ </PropertyMap>
+ </TextLabel.FontStyle>
+ </TextLabel>
+ <TextLabel Text="July 2020"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Top"
+ TextColor="0.70,0.70,0.70,1.0"
+ PointSize="{StaticResource point1}"
+ Position2D="0,90"
+ WidthResizePolicy="FillToParent"/>
+ <View x:Name="AddView"
+ PositionUsesPivotPoint="True"
+ ParentOrigin="TopCenter"
+ PivotPoint="Center"
+ BackgroundColor="White"
+ Position2D="160, 80"
+ Size2D="60, 60"
+ CornerRadius="30">
+ <ImageView PositionUsesPivotPoint="True"
+ ParentOrigin="Center"
+ PivotPoint="Center"
+ ResourceUrl="*Resource*/add.png"
+ Size2D="15, 15"/>
+ </View>
+ </View>
+
+</View>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.NUIBrokerSample" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.NUIBrokerSample" exec="NUIBrokerSample.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet-nui" launch_mode="single">
+ <label>NUIBrokerSample</label>
+ <icon>NUIBrokerSample.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ <splash-screens />
+ </ui-application>
+ <shortcut-list />
+ <privileges>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ </privileges>
+ <dependencies />
+ <provides-appdefined-privileges />
+</manifest>
--- /dev/null
+using System;
+using Tizen.Applications;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace NUIMusicPlayer
+{
+ public class Program : NUIApplication
+ {
+ private Window window;
+ private XamlPage page;
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ window = GetDefaultWindow();
+ window.KeyEvent += OnKeyEvent;
+
+ page = new XamlPage();
+ page.PositionUsesPivotPoint = true;
+ page.ParentOrigin = ParentOrigin.TopLeft;
+ page.PivotPoint = PivotPoint.TopLeft;
+ page.BackgroundColor = Color.Black;
+ page.Size = window.WindowSize;
+ window.Add(page);
+
+ TransitionOptions = new TransitionOptions(window);
+ TransitionOptions.EnableTransition = true;
+ TransitionOptions.CallerScreenHidden += TransitionOptions_CallerScreenHidden;
+ TransitionOptions.CallerScreenShown += TransitionOptions_CallerScreenShown;
+ }
+
+ private void TransitionOptions_CallerScreenShown(object sender, EventArgs e)
+ {
+ page.ShowInitObject();
+ }
+
+ private void TransitionOptions_CallerScreenHidden(object sender, EventArgs e)
+ {
+ page.HideInitObject();
+ }
+
+ protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+ {
+ base.OnAppControlReceived(e);
+ window.Activate();
+ }
+
+ protected override void OnResume()
+ {
+ base.OnResume();
+ }
+
+ protected override void OnPause()
+ {
+ base.OnPause();
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ {
+ window.Lower();
+ //window.Hide();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <AssemblyName>NUIMusicPlayer</AssemblyName>
+ <DebugType>embedded</DebugType>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Folder Include="lib\" />
+ <Folder Include="res\" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="res\layout\XamlPage.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NUI.XamlBuild" Version="1.0.10" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\src\Tizen.NUI\Tizen.NUI.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <NeedInjection>True</NeedInjection>
+ </PropertyGroup>
+
+</Project>
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace NUIMusicPlayer
+{
+ public partial class XamlPage : View
+ {
+ public XamlPage()
+ {
+ InitializeComponent();
+
+ HideInitObject();
+ }
+
+ private bool OnBackTouchEvent(object source, View.TouchEventArgs e)
+ {
+ if (e.Touch.GetState(0) == PointStateType.Up)
+ {
+ Window.Instance.Hide();
+ }
+ return false;
+ }
+
+ public void ShowInitObject()
+ {
+ profileContainer.Opacity = 1.0f;
+ addContainer.Opacity = 1.0f;
+ profileText1.Opacity = 1.0f;
+ profileText2.Opacity = 1.0f;
+ cinematicText.Show();
+ }
+
+ public void HideInitObject()
+ {
+ profileContainer.Opacity = 0.0f;
+ addContainer.Opacity = 0.0f;
+ profileText1.Opacity = 0.0f;
+ profileText2.Opacity = 0.0f;
+ cinematicText.Hide();
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<View x:Class="NUIMusicPlayer.XamlPage"
+ xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
+
+ <View x:Name="profileContainer" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" BackgroundColor="White" Position2D="0,150" Size2D="96,96" CornerRadius="48" Opacity="0">
+ <View x:Name="profileContainer_inner" PositionUsesPivotPoint="True" ParentOrigin="Center" PivotPoint="Center" BackgroundColor="Black" Size2D="94,94" CornerRadius="47">
+ <ImageView x:Name="profileImage" PositionUsesPivotPoint="True" ParentOrigin="Center" PivotPoint="Center" ResourceUrl="*Resource*/profile.jpg" Size2D="80,80" CornerRadius="40"/>
+ </View>
+ </View>
+
+ <View x:Name="addContainer" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" BackgroundColor="White" Position2D="33,183" Size2D="40,40" CornerRadius="20" Opacity="0">
+ <ImageView x:Name="addIcon" PositionUsesPivotPoint="True" ParentOrigin="Center" PivotPoint="Center" ResourceUrl="*Resource*/add.png" Size2D="16,16"/>
+ </View>
+ <ImageView x:Name="backBtn" PositionUsesPivotPoint="True" ParentOrigin="BottomLeft" PivotPoint="Center" ResourceUrl="*Resource*/arrow-89-128.png" Position2D="50,-60" Size2D="40,40" TouchEvent="OnBackTouchEvent"/>
+
+ <TextLabel x:Name="profileText1" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="PIANO DAILY" HorizontalAlignment="Center" VerticalAlignment="Top" TextColor="0.95,0.95,0.95,1.0" PointSize="20" Position2D="0,220" WidthResizePolicy="FillToParent" Opacity="0"/>
+ <TextLabel x:Name="profileText2" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="July 2020" HorizontalAlignment="Center" VerticalAlignment="Top" TextColor="0.70,0.70,0.70,1.0" PointSize="13" Position2D="0,243" WidthResizePolicy="FillToParent" Opacity="0"/>
+
+ <TextLabel x:Name="info1" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="9,465
" HorizontalAlignment="Center" VerticalAlignment="Top" TextColor="0.3, 0.3, 0.3, 1.0" PointSize="20" Position2D="-65,400" WidthResizePolicy="FillToParent"/>
+ <ImageView x:Name="info1Icon" ParentOrigin="TopCenter" ResourceUrl="*Resource*/bar-chart-5-128.png" Color="0.3, 0.3, 0.3, 1.0" Position2D="-125,392" Size2D="18,18"/>
+
+ <TextLabel x:Name="info2" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="5h 35m
" HorizontalAlignment="Center" VerticalAlignment="Top" TextColor="0.3, 0.3, 0.3, 1.0" PointSize="20" Position2D="65,400" WidthResizePolicy="FillToParent"/>
+ <ImageView x:Name="info2Icon" ParentOrigin="TopCenter" ResourceUrl="*Resource*/clock-128.png" Color="0.3, 0.3, 0.3, 1.0" Position2D="-2,392" Size2D="18,18"/>
+
+ <TextLabel x:Name="cinematicText" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="Cinematic Piano" HorizontalAlignment="Center" VerticalAlignment="Top" TextColor="0.95, 0.95, 0.95, 1.0" PointSize="70" Position2D="0,320" WidthResizePolicy="FillToParent">
+ <TextLabel.FontStyle>
+ <PropertyMap>
+ <KeyValue Key="weight" Value="bold" />
+ </PropertyMap>
+ </TextLabel.FontStyle>
+ </TextLabel>
+
+ <ImageView x:Name="imgView" PositionUsesPivotPoint="True" ParentOrigin="BottomCenter" PivotPoint="BottomCenter" ResourceUrl="*Resource*/pic_1.jpg" Size2D="850,850"/>
+
+ <TextLabel x:Name="contents" PositionUsesPivotPoint="True" ParentOrigin="TopCenter" PivotPoint="Center" Text="Beautiful, dreamy and dramtic
 instrumental neo classical piano scores
 from movies and tv series.
" MultiLine="True" HorizontalAlignment="Center"
+ VerticalAlignment="Top" TextColor="0.4, 0.4, 0.4, 1.0" PointSize="30" Position2D="0,500" WidthResizePolicy="FillToParent"/>
+
+ <View x:Name="playBtn" PositionUsesPivotPoint="True" ParentOrigin="BottomCenter" PivotPoint="Center" BackgroundColor="White" Position2D="0,-70" Size2D="88,88" CornerRadius="44">
+ <ImageView x:Name="playIcon" PositionUsesPivotPoint="True" ParentOrigin="Center" PivotPoint="Center" ResourceUrl="*Resource*/play-128.png" Color="Black" Size2D="26,26"/>
+ </View>
+
+</View>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.NUIMusicPlayer" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.NUIMusicPlayer"
+ exec="NUIMusicPlayer.dll"
+ type="dotnet-nui"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single"
+ >
+ <label>NUIMusicPlayer</label>
+ <icon>NUIMusicPlayer.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+</manifest>