summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshivamv <shivam.v2@samsung.com>2022-10-05 16:11:49 +0530
committershivamv <shivam.v2@samsung.com>2022-10-05 16:11:49 +0530
commite4d651eaa25c2ffbda23169f94d79141c0df0684 (patch)
tree748fbbfbee7450638bc454fc4e0d033050350b8b
parent59bf32cbc4989f83cd13abcda5b6edb41ef4c184 (diff)
downloadtray-e4d651eaa25c2ffbda23169f94d79141c0df0684.tar.gz
tray-e4d651eaa25c2ffbda23169f94d79141c0df0684.tar.bz2
tray-e4d651eaa25c2ffbda23169f94d79141c0df0684.zip
Fixing Broken Popup. Reducing LongPress duration.
Change-Id: I9437616c0b3cba32fec635af0324cfbd145c2c27 Signed-off-by: shivamv <shivam.v2@samsung.com>
-rwxr-xr-xTrayApplication/Views/AppItemView.cs2
-rwxr-xr-xTrayApplication/Views/ApplicationsView.cs52
-rwxr-xr-x[-rw-r--r--]packaging/org.tizen.TrayApplication-1.0.0.tpkbin5488337 -> 5488429 bytes
3 files changed, 29 insertions, 25 deletions
diff --git a/TrayApplication/Views/AppItemView.cs b/TrayApplication/Views/AppItemView.cs
index a880720..0ef3fbd 100755
--- a/TrayApplication/Views/AppItemView.cs
+++ b/TrayApplication/Views/AppItemView.cs
@@ -101,7 +101,7 @@ namespace TrayApplication.Views
if (e.Touch.GetState(0) == PointStateType.Down)
{
Overlay.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.3f);
- timer = new Timer(1000);
+ timer = new Timer(500);
timer.Start();
isMoved = false;
isLongPressed = false;
diff --git a/TrayApplication/Views/ApplicationsView.cs b/TrayApplication/Views/ApplicationsView.cs
index fed2fb9..4ddcc9c 100755
--- a/TrayApplication/Views/ApplicationsView.cs
+++ b/TrayApplication/Views/ApplicationsView.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections;
-using System.Threading;
using System.Windows.Input;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
@@ -21,10 +20,9 @@ namespace TrayApplication.Views
private int currentAppsCount;
private AlertDialog removePopup;
private Window removePopupWindow;
+ private View popupBaseView;
private Window.WindowOrientation popupOrientation;
private bool removeMode;
- private int removePopupWidth;
- private int removePopupHeight;
public static readonly BindableProperty AppListProperty = BindableProperty.Create(nameof(AppList), typeof(IEnumerable), typeof(ApplicationsView), null, propertyChanged: (bindable, oldValue, newValue) =>
{
@@ -85,6 +83,7 @@ namespace TrayApplication.Views
else
{
RemoveDeleteOption();
+ RemoveConfirmationPopup();
appIcons[^1].AddTouchEvent();
appIcons[^1].Opacity = 1.0f;
}
@@ -174,14 +173,11 @@ namespace TrayApplication.Views
}
private void UpdateRemovePopupWindowDimensions()
- {
- Thread.Sleep(100);
- removePopupWidth = (int)((DeviceInfo.IsPortrait ? DeviceInfo.DisplayHeight : DeviceInfo.DisplayWidth) * 0.36f);
- removePopupHeight = 256.SpToPx();
- int windowPositionX = ((DeviceInfo.DisplayWidth - removePopupWidth) / 2) - 144.SpToPx();
- int windowPositionY = ((DeviceInfo.DisplayHeight - removePopupHeight) / 2) - 32.SpToPx();
- removePopupWindow.WindowPosition = new Position2D(windowPositionX, windowPositionY);
- removePopupWindow.WindowSize = new Size2D(removePopupWidth + 144.SpToPx(), removePopupHeight + 32.SpToPx());
+ {
+ popupBaseView.WidthSpecification = removePopupWindow.Size.Width;
+ popupBaseView.HeightSpecification = (int)(0.70f * removePopupWindow.Size.Height);
+ popupBaseView.Remove(removePopup);
+ popupBaseView.Add(removePopup);
}
private void AddConfirmationPopup(object appIcon)
@@ -200,39 +196,41 @@ namespace TrayApplication.Views
};
removePopupWindow.SetAvailableOrientations(list);
popupOrientation = removePopupWindow.GetCurrentOrientation();
- UpdateRemovePopupWindowDimensions();
removePopupWindow.SetTransparency(true);
removePopupWindow.BackgroundColor = Color.Transparent;
+ popupBaseView = new View();
+ removePopupWindow.Add(popupBaseView);
Button cancelButton = new Button("CancelButton");
Button deleteButton = new Button()
{
Size2D = new Size2D(252, 48).SpToPx(),
Text = "Delete",
- };
+ };
+ deleteButton.PointSize = 16.SpToPx();
if (removePopup == null)
{
removePopup = new AlertDialog()
{
StyleName = "AlertDialogBackground",
- Size2D = new Size2D(removePopupWidth, removePopupHeight),
Title = "Delete App from the Tray",
Message = "Do you want to delete this app from the Tray? App won't be uninstalled from your device",
Actions = new List<Button>() { cancelButton, deleteButton },
};
- }
- removePopupWindow.Add(removePopup);
+ }
+ popupBaseView.Add(removePopup);
+ UpdateRemovePopupWindowDimensions();
removePopupWindow.Resized += OnRemovePopupWindowResized;
cancelButton.Clicked += (object sender, ClickedEventArgs e) =>
{
- RemoveConfirmationPopup();
+ RemoveModeToggled.Invoke(this, new EventArgs());
};
deleteButton.Clicked += (object sender, ClickedEventArgs e) =>
{
AppRemoveCommand.Execute(((AppItemView)appIcon).BindingContext);
- RemoveConfirmationPopup();
+ RemoveModeToggled.Invoke(this, new EventArgs());
};
}
}
@@ -246,12 +244,17 @@ namespace TrayApplication.Views
private void RemoveConfirmationPopup()
{
- removePopupWindow.Remove(removePopup);
- removePopup.Dispose();
- removePopup = null;
- removePopupWindow.Dispose();
- removePopupWindow = null;
- RemoveModeToggled.Invoke(this, new EventArgs());
+ if (removePopup != null)
+ {
+ removePopupWindow?.Remove(popupBaseView);
+ popupBaseView?.Remove(removePopup);
+ removePopup.Dispose();
+ removePopup = null;
+ popupBaseView?.Dispose();
+ popupBaseView = null;
+ removePopupWindow?.Dispose();
+ removePopupWindow = null;
+ }
}
protected override void Dispose(DisposeTypes type)
@@ -271,6 +274,7 @@ namespace TrayApplication.Views
}
appIcons.Clear();
appIcons = null;
+ RemoveConfirmationPopup();
}
Tizen.Log.Info(Resources.LogTag, "ApplicationsView Dispose");
base.Dispose(type);
diff --git a/packaging/org.tizen.TrayApplication-1.0.0.tpk b/packaging/org.tizen.TrayApplication-1.0.0.tpk
index 05716b6..58a440b 100644..100755
--- a/packaging/org.tizen.TrayApplication-1.0.0.tpk
+++ b/packaging/org.tizen.TrayApplication-1.0.0.tpk
Binary files differ