const int mContents = mRow * mColumn;
Size2D windowSize;
+ TableView table;
public void Activate()
{
windowSize = window.Size;
// Create Table
- TableView table = new TableView(mRow, mColumn)
+ table = new TableView(mRow, mColumn)
{
PositionUsesPivotPoint = true,
PivotPoint = PivotPoint.Center,
public void Deactivate()
{
+ AccessibilityManager.Instance.FocusedViewActivated -= OnFocusedView;
+ if(table) { table.Unparent(); }
}
}
-}
\ No newline at end of file
+}
if (null != example)
{
DeleteDaliDemo();
-
- example.Activate();
+ int exceptNum = 0;
+ string exceptionMessage = "Unknown!";
+ try
+ {
+ example.Activate();
+ }
+ catch (Exception e)
+ {
+ if (e is global::System.EntryPointNotFoundException)
+ {
+ Tizen.Log.Fatal("NUI", $"@@ ERROR! No dali-csharp-binding! Exception={e.Message} \n");
+ exceptNum = 1;
+ exceptionMessage = e.Message;
+ }
+ else if (e is global::System.ArgumentException)
+ {
+ Tizen.Log.Fatal("NUI", $"@@ ERROR! this comes when VideoView test on Ubuntu! Exception={e.Message} \n");
+ exceptNum = 2;
+ exceptionMessage = e.Message;
+ }
+ }
+ switch (exceptNum)
+ {
+ case 0:
+ default:
+ break;
+ case 1:
+ case 2:
+ example.Deactivate();
+ var errorPage = assembly?.CreateInstance("Tizen.NUI.Samples.ShowErrorPage") as ShowErrorPage;
+ errorPage.Activate();
+ errorPage.ShowExcpetionText(exceptionMessage);
+ example = errorPage;
+ break;
+ }
+ curExample = example;
}
-
- curExample = example;
}
private void ExitSample()
public void Activate()
{
- Assert.IsFalse(true, "TDD test, Exception throw");
+ //Assert.IsFalse(true, "TDD test, Exception throw");
win = Window.Instance;
win.BackgroundColor = Color.Green;
dimView.Unparent();
}
}
-}
\ No newline at end of file
+}
}
public void Deactivate()
{
+ window.KeyEvent -= OnKeyEvent;
+ if (t1)
+ {
+ t1.Unparent();
+ t1.Dispose();
+ }
+ if (t2)
+ {
+ t2.Unparent();
+ t2.Dispose();
+ }
+ if (t3)
+ {
+ t3.Unparent();
+ t3.Dispose();
+ }
+ if (t4)
+ {
+ t4.Unparent();
+ t4.Dispose();
+ }
+ if (scroll)
+ {
+ scroll.RemoveAllChildren(true);
+ scroll.Unparent();
+ scroll.Dispose();
+ }
}
private TextLabel t1, t2, t3, t4;
defaultLayer.Add(playButton);
}
- private void OnRiveWindowTouchEvent(object source, Window.TouchEventArgs e)
+ private void OnRiveWindowTouchEvent(object source, Window.TouchEventArgs e)
{
Vector2 lp = e.Touch.GetLocalPosition(0);
Vector2 sp = e.Touch.GetScreenPosition(0);
- float scale = (1000.0f /720.0f);
+ float scale = (1000.0f / 720.0f);
// Set root and spark node position
rav.SetNodePosition("root", new Position(lp.X * scale, lp.Y * scale));
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(playButton);
+ window.TouchEvent -= OnRiveWindowTouchEvent;
+ if (rav) { defaultLayer.Remove(rav); }
+ if (playButton) { defaultLayer.Remove(playButton); }
}
}
}
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(playButton);
+ window.TouchEvent -= OnRiveWindowTouchEvent;
+ if (rav) { defaultLayer.Remove(rav); }
+ if (playButton) { defaultLayer.Remove(playButton); }
}
}
}
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(playButton);
- defaultLayer.Remove(stopButton);
- defaultLayer.Remove(bounceButton);
- defaultLayer.Remove(brokeButton);
- defaultLayer.Remove(fillButton);
- defaultLayer.Remove(strokeButton);
- defaultLayer.Remove(opacityButton);
- defaultLayer.Remove(scaleButton);
- defaultLayer.Remove(rotationButton);
- defaultLayer.Remove(positionButton);
+ if (rav) { defaultLayer.Remove(rav); }
+ if (playButton) { defaultLayer.Remove(playButton); }
+ if (stopButton) { defaultLayer.Remove(stopButton); }
+ if (bounceButton) { defaultLayer.Remove(bounceButton); }
+ if (brokeButton) { defaultLayer.Remove(brokeButton); }
+ if (fillButton) { defaultLayer.Remove(fillButton); }
+ if (strokeButton) { defaultLayer.Remove(strokeButton); }
+ if (opacityButton) { defaultLayer.Remove(opacityButton); }
+ if (scaleButton) { defaultLayer.Remove(scaleButton); }
+ if (rotationButton) { defaultLayer.Remove(rotationButton); }
+ if (positionButton) { defaultLayer.Remove(positionButton); }
}
}
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(scroll);
- defaultLayer.Remove(header);
+ window.TouchEvent -= OnRiveWindowTouchEvent;
+ if (rav) { defaultLayer.Remove(rav); }
+ if (scroll) { defaultLayer.Remove(scroll); }
+ if (header) { defaultLayer.Remove(header); }
}
}
}
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(playButton);
- defaultLayer.Remove(stopButton);
+ if (rav) { defaultLayer.Remove(rav); }
+ if (playButton) { defaultLayer.Remove(playButton); }
+ if (stopButton) { defaultLayer.Remove(stopButton); }
}
}
}
}
public void Deactivate()
{
- defaultLayer.Remove(rav);
- defaultLayer.Remove(playButton);
- defaultLayer.Remove(stopButton);
+ if (rav) { defaultLayer.Remove(rav); }
+ if (playButton) { defaultLayer.Remove(playButton); }
+ if (stopButton) { defaultLayer.Remove(stopButton); }
}
}
}
int num = 4;
for (int i = 0; i < num; i++)
{
- utilitySwitch[i].Dispose();
+ utilitySwitch[i]?.Dispose();
utilitySwitch[i] = null;
- familySwitch[i].Dispose();
+ familySwitch[i]?.Dispose();
familySwitch[i] = null;
- foodSwitch[i].Dispose();
+ foodSwitch[i]?.Dispose();
foodSwitch[i] = null;
- kitchenSwitch[i].Dispose();
+ kitchenSwitch[i]?.Dispose();
kitchenSwitch[i] = null;
- modeText[i].Dispose();
+ modeText[i]?.Dispose();
modeText[i] = null;
- utilitySwitch2[i].Dispose();
+ utilitySwitch2[i]?.Dispose();
utilitySwitch2[i] = null;
- familySwitch2[i].Dispose();
+ familySwitch2[i]?.Dispose();
familySwitch2[i] = null;
- foodSwitch2[i].Dispose();
+ foodSwitch2[i]?.Dispose();
foodSwitch2[i] = null;
- kitchenSwitch2[i].Dispose();
+ kitchenSwitch2[i]?.Dispose();
kitchenSwitch2[i] = null;
- modeText2[i].Dispose();
+ modeText2[i]?.Dispose();
modeText2[i] = null;
}
- createText[0].Dispose();
+ createText[0]?.Dispose();
createText[0] = null;
- createText[1].Dispose();
+ createText[1]?.Dispose();
createText[1] = null;
for (int j = 0; j < 3; j++)
{
if (parentView[j] != null)
{
- parentView[j].Dispose();
+ parentView[j]?.Dispose();
parentView[j] = null;
}
}
NUIApplication.GetDefaultWindow().Remove(root);
- root.Dispose();
+ root?.Dispose();
root = null;
}
}
using global::System;
using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
namespace Tizen.NUI.Samples
{
}
}
- Window win;
- myPlayer player;
+ Window win = null;
+ myPlayer player = null;
string resourcePath;
const string tag = "NUITEST";
- View dummy;
+ View dummy = null;
public void Activate()
{
win = NUIApplication.GetDefaultWindow();
tlog.Fatal(tag, $"Deactivate()!");
- dummy.Unparent();
-
- videoView.Unparent();
+ if (dummy) { dummy.Unparent(); }
+ if (videoView) { videoView.Unparent(); }
// currently it is crashed when Dispose() is called. need to check.
//videoView.Dispose();
videoView.PivotPoint = PivotPoint.Center;
win.Add(videoView);
- var playerHandle = new SafeNativePlayerHandle(videoView);
- player = new myPlayer(playerHandle.DangerousGetHandle());
+ try
+ {
+ var playerHandle = videoView.NativeHandle;
+ player = new myPlayer(playerHandle.DangerousGetHandle());
+ }
+ catch( Exception e)
+ {
+ if (e is global::System.ArgumentException)
+ {
+ Tizen.Log.Fatal("NUI", $"[ERROR] could not get NativePlayerHandle!");
+ }
+ }
if (player != null)
{
player.Start();
--- /dev/null
+
+using global::System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.Samples
+{
+ public class ShowErrorPage : IExample
+ {
+ View root;
+ TextLabel title, msg;
+ Button goback;
+ public void Activate()
+ {
+ var win = NUIApplication.GetDefaultWindow();
+ var winSize = win.Size;
+ root = new View()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = NUI.ParentOrigin.Center,
+ PivotPoint = NUI.PivotPoint.Center,
+ Size = winSize,
+ BackgroundColor = Color.BlueViolet,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ Padding = new Extents(30, 30, 30, 30),
+ },
+ };
+ win.Add(root);
+ title = new TextLabel()
+ {
+ BackgroundColor = Color.Beige,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ PointSize = 15,
+ MultiLine = true,
+ Text = "Error, please check the exception below!",
+ Padding = new Extents(10, 10, 10, 10),
+ };
+ root.Add(title);
+
+ msg = new TextLabel()
+ {
+ BackgroundColor = Color.LightCoral,
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = winSize.Height / 2,
+ PointSize = 19,
+ MultiLine = true,
+ };
+ root.Add(msg);
+
+ goback = new Button()
+ {
+ BackgroundColor = Color.HotPink,
+ Text = "Please go back by keyboard \"back\" button",
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ };
+ root.Add(goback);
+ }
+
+ public void Deactivate()
+ {
+ root?.Unparent();
+
+ goback?.Unparent();
+ goback?.Dispose();
+
+ msg?.Unparent();
+ msg?.Dispose();
+
+ title?.Unparent();
+ title?.Dispose();
+
+ root?.Dispose();
+ }
+
+ public void ShowExcpetionText(string message)
+ {
+ if (msg)
+ {
+ msg.Text = message;
+ }
+ }
+ }
+}