* limitations under the License.
*
*/
+extern alias TizenSystemInformation;
+using TizenSystemInformation.Tizen.System;
using System;
using System.Collections.Generic;
private View bottomView = null;
private bool isTop = false;
private bool isBottom = false;
- uint borderHeight = 0;
+ private uint borderHeight = 0;
+ private int screenWidth = 0;
+ private int screenHeight = 0;
#endregion //Fields
#region Constructors
return false;
}
+ try
+ {
+ Information.TryGetValue<int>("http://tizen.org/feature/screen.width", out screenWidth);
+ Information.TryGetValue<int>("http://tizen.org/feature/screen.height", out screenHeight);
+ }
+ catch (DllNotFoundException e)
+ {
+ Tizen.Log.Fatal("NUI", $"{e}\n");
+ }
+
if (borderInterface == null)
{
borderInterface = new DefaultBorder();
// Increase the window size as much as the border area.
if (isTop) borderHeight += borderInterface.BorderHeight;
if (isBottom) borderHeight += borderInterface.BorderHeight;
- WindowSize += new Size2D((int)borderInterface.BorderLineThickness * 2, (int)(borderHeight + borderInterface.BorderLineThickness * 2));
+
+ // When running the app for the first time, if it runs in full size, do Maximize(true).
+ if (screenWidth != 0 && screenHeight != 0 &&
+ Size.Width >= screenWidth && Size.Height >= screenHeight &&
+ IsMaximized() == false)
+ {
+ Maximize(true);
+ ResizedEventArgs e = new ResizedEventArgs();
+ e.WindowSize = WindowSize;
+ OnBorderWindowResized(this, e);
+ }
+ else
+ {
+ WindowSize += new Size2D((int)borderInterface.BorderLineThickness * 2, (int)(borderHeight + borderInterface.BorderLineThickness * 2));
+ }
if (borderInterface.OverlayMode == true)
{
BackgroundColor = Color.Transparent;
borderInterface.BorderWindow = this;
- EnableFloatingMode(true);
-
borderInterface.OnCreated(borderView);
+ InterceptTouchEvent += (s, e) =>
+ {
+ if (e.Touch.GetState(0) == PointStateType.Down && IsMaximized() == false)
+ {
+ Raise();
+ }
+ return false;
+ };
return true;
}
private bool OverlayInterceptTouch(object sender, View.TouchEventArgs e)
{
- if (isInterceptTouch == true && overlayTimer != null)
+ if (e.Touch.GetState(0) == PointStateType.Down)
{
- overlayTimer.Start();
+ if (isInterceptTouch == true && overlayTimer != null)
+ {
+ overlayTimer.Start();
+ }
}
return false;
}
Tizen.Log.Info("NUI", $"OnBorderWindowResized {e.WindowSize.Width},{e.WindowSize.Height}\n");
int resizeWidth = e.WindowSize.Width;
int resizeHeight = e.WindowSize.Height;
+
if (borderInterface.MinSize != null)
{
resizeWidth = borderInterface.MinSize.Width > resizeWidth ? (int)borderInterface.MinSize.Width : resizeWidth;
{
return false;
}
+ topView.Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ LinearAlignment = LinearLayout.Alignment.CenterVertical,
+ CellPadding = new Size2D(20, 20),
+ };
title = new TextLabel()
{
Text = "CustomBorder",
- Position = new Position(20, 0),
+ };
+
+ var button = new Button()
+ {
+ Text = "AlwaysOnTop",
+ };
+ button.Clicked += (s, e) =>
+ {
+ BorderWindow.EnableFloatingMode(true);
};
topView.Add(title);
+ topView.Add(button);
return true;
}
public override void OnCreated(View borderView)
{
base.OnCreated(borderView);
+ UpdateIcons();
}
public override bool OnCloseIconTouched(object sender, View.TouchEventArgs e)
{
IBorderInterface customBorder = new CustomBorder();
subWindowTwo = new Window("subwin1", customBorder, new Rectangle(60, 20, 800, 800), false);
+ subWindowTwo.EnableFloatingMode(true);
var root = new View(){
Layout = new LinearLayout()