Adding uninstall feature. 34/284534/2 accepted/tizen/unified/20221121.163718
authortarun.mahay <tarun.mahay@samsung.com>
Fri, 18 Nov 2022 09:10:34 +0000 (14:40 +0530)
committertarun.mahay <tarun.mahay@samsung.com>
Fri, 18 Nov 2022 10:01:16 +0000 (15:31 +0530)
Change-Id: I8aeb6cacd9425810dbdc1a53e1e66fd167edac56
Signed-off-by: tarun.mahay <tarun.mahay@samsung.com>
19 files changed:
Apps/Apps.csproj
Apps/Core/AppLauncher.cs
Apps/Models/AppInfoModel.cs
Apps/ViewManager.cs
Apps/ViewModels/AppViewModel.cs
Apps/Views/AppItemLayout.cs
Apps/Views/AppView.cs
Apps/res/images/dark/cancel_button.png [new file with mode: 0644]
Apps/res/images/dark/cross_button.png [new file with mode: 0644]
Apps/res/images/dark/cross_button_selected.png [new file with mode: 0644]
Apps/res/images/light/cancel_button.png [new file with mode: 0644]
Apps/res/images/light/cross_button.png [new file with mode: 0644]
Apps/res/images/light/cross_button_selected.png [new file with mode: 0644]
Apps/res/themes/dark.xaml
Apps/res/themes/light.xaml
Apps/tizen-manifest.xml
TrayApplication/Views/AppItemView.cs
packaging/org.tizen.Apps-1.0.0.tpk
packaging/org.tizen.TrayApplication-1.0.0.tpk

index 17d407566a3df0708b918068dc3438630768a9bb..2f87b5244f8a8667162dcaaa7582f0b863115da9 100755 (executable)
@@ -28,4 +28,9 @@
     </None>
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="res\images\light\" />
+    <Folder Include="res\images\dark\" />
+  </ItemGroup>
+
 </Project>
index 3c108d512d59e90706dd4c157a3ebeeda5072489..c17abf03b068923c358634f41f6d08f804759aca 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-
+using System;
 using Tizen.Applications;
 using Tizen.Applications.Exceptions;
-using System;
+using Tizen;
 using Apps.Common;
 namespace Apps.Core
 {
@@ -50,5 +50,20 @@ namespace Apps.Core
                 Tizen.Log.Error(Resources.LogTag, "app timeout" + e.Message);
             }
         }
+
+        public static void UninstallApplication(string id)
+        {
+            try
+            {
+                string packageId = PackageManager.GetPackageIdByApplicationId(id);
+                Package package = PackageManager.GetPackage(packageId);
+                Tizen.Log.Info(Resources.LogTag, "packageID: " + packageId);
+                bool ret = PackageManager.Uninstall(packageId);
+            }
+            catch (Exception ex)
+            {
+                Tizen.Log.Error(Resources.LogTag, "Cannot begin uninstallation" + ex.Message);
+            }
+        }
     }
 }
index 6a9ed2572d81cf1200fb37322371189348117675..49e8a4aa2b0ecd6d3ca92920d565ff543c92c6dc 100755 (executable)
 
 using System;
 using System.Collections.Generic;
+using System.Windows.Input;
 using Tizen.NUI;
+using Tizen.NUI.Binding;
 using Apps.Common;
+using Apps.Core;
+
 namespace Apps.Models
 {
     class AppInfoModel : PropertyNotifier
@@ -31,6 +35,7 @@ namespace Apps.Models
             ApplicationId = applicationId;
             IconUrl = url;
             SetExtractedBackground(url);
+            AppSelectCommand = new Command(OnAppSelect);
         }
 
         public string Name { get; internal set; }
@@ -53,6 +58,19 @@ namespace Apps.Models
             set => SetProperty(ref iconBackground, value);
         }
 
+        private ICommand appSelectCommand;
+        public ICommand AppSelectCommand
+        {
+            get => appSelectCommand;
+            set => SetProperty(ref appSelectCommand, value);
+        }
+
+        private void OnAppSelect(object selectedItem)
+        {
+            AppLauncher.LaunchApplication(ApplicationId);
+            NUIApplication.Current.Exit();
+        }
+
         private void SetDefaultImageVisual()
         {
             defaultVisual = new ImageVisual()
index 3b3db88d6d01167a915325c6be46b6474d920df5..0f60d8b15926ca41fda85484ac87a066cc4a4393 100755 (executable)
@@ -21,6 +21,7 @@ using System.Collections.Generic;
 using System.IO;
 using Tizen.NUI;
 using Tizen.NUI.Xaml;
+using Tizen.NUI.Components;
 using Tizen.Applications;
 using Apps.Common;
 using Apps.ViewModels;
@@ -95,13 +96,20 @@ namespace Apps
                 UpdateViewModel(appListTask);
             }
         }
-
         private void OnUninstallProgressChanged(object sender, PackageManagerEventArgs e)
         {
-            if (e.Progress == 0)
+            if (e.State == PackageEventState.Completed)
             {
+                Tizen.Log.Info(Resources.LogTag, "Package id is : " + e.PackageId);
                 appList = appList.Where(c => c.PackageId != e.PackageId);
                 appViewModel.CreateData(appList);
+                string uninstallSuccessMessage = "App has been uninstalled successfully";
+                Notification.MakeToast(uninstallSuccessMessage, Notification.ToastBottom).Post(Notification.ToastShort);
+            }
+            else if (e.State == PackageEventState.Failed)
+            {
+                string uninstallFailedMessage = "This app can't be uninstalled";
+                Notification.MakeToast(uninstallFailedMessage, Notification.ToastBottom).Post(Notification.ToastShort);
             }
         }
 
index f0d77d8e3e8eade9cd7508fa1a56b82105252bff..c643b2e13be15e30800f623d0f9644d38853e39e 100755 (executable)
@@ -13,7 +13,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-
 using System.Collections;
 using System.Collections.Generic;
 using System.Windows.Input;
@@ -28,7 +27,7 @@ namespace Apps.ViewModels
         public AppViewModel()
         {
             AppListSource = new AppInfoViewModel();
-            AppSelectCommand = new Command(OnAppSelect);
+            AppRemoveCommand = new Command(OnAppRemove);
         }
 
         private IEnumerable appListSource;
@@ -39,12 +38,12 @@ namespace Apps.ViewModels
             set => SetProperty(ref appListSource, value);
         }
 
-        private ICommand appSelectCommand;
+        private ICommand appRemoveCommand;
 
-        public ICommand AppSelectCommand
+        public ICommand AppRemoveCommand
         {
-            get => appSelectCommand;
-            set => SetProperty(ref appSelectCommand, value);
+            get => appRemoveCommand;
+            set => SetProperty(ref appRemoveCommand, value);
         }
 
         public void CreateData(IEnumerable<ApplicationInfo> list)
@@ -52,10 +51,10 @@ namespace Apps.ViewModels
             ((AppInfoViewModel)AppListSource).CreateData(list);
         }
 
-        private void OnAppSelect(object selectedItem)
+        private void OnAppRemove(object selectedItem)
         {
             Models.AppInfoModel appInfo = (Models.AppInfoModel)selectedItem;
-            Core.AppLauncher.LaunchApplication(appInfo.ApplicationId);
+            Core.AppLauncher.UninstallApplication(appInfo.ApplicationId);
         }
     }
 }
index 8e2c0ce4cef35995dfe8b736f85b8fc5b8de0c56..06946e9c655b0b83cace5692116aabd55c23f5d1 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-
+using System;
+using System.Windows.Input;
 using Tizen.NUI;
+using Tizen.NUI.Binding;
 using Tizen.NUI.Components;
 using Tizen.NUI.BaseComponents;
 using Apps.Common;
@@ -27,9 +29,27 @@ namespace Apps.Views
         private View iconBackgroundView;
         private TextLabel appLabel;
         private ImageView appIcon;
+        private bool isRemoveMode = false;
+        private Timer timer;
+        private bool isMoved;
+        private bool isLongPressed;
+
+        public event EventHandler<EventArgs> LongPressed;
+        public event EventHandler<EventArgs> RemoveClicked;
+
+        public static readonly BindableProperty AppSelectCommandProperty = BindableProperty.Create(nameof(AppSelectCommand), typeof(ICommand), typeof(AppView), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var instance = (AppItemLayout)bindable;
+            if (oldValue != newValue)
+            {
+                instance.appSelectCommand = (ICommand)newValue;
+            }
+        },
+        defaultValueCreator: (bindable) => ((AppItemLayout)bindable).appSelectCommand);
 
-        public AppItemLayout() : base()
+        public AppItemLayout(bool removeMode) : base()
         {
+            isRemoveMode = removeMode;
             BackgroundColor = Color.Transparent;
             WidthSpecification = 154.SpToPx();
             HeightSpecification = 162.SpToPx();
@@ -48,12 +68,9 @@ namespace Apps.Views
                 HeightSpecification = 138.SpToPx(),
                 CornerRadius = new Vector4(12, 12, 12, 12),
                 BoxShadow = new Shadow(4.0f, new Color(0, 0, 0, 0.10f), new Vector2(2, 2)),
-                Layout = new LinearLayout()
+                Layout = new RelativeLayout()
                 {
                     Padding = new Extents(0, 0, 8, 0).SpToPx(),
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Top,
-                    LinearOrientation = LinearLayout.Orientation.Vertical,
                 }
             };
             base.Add(baseView);
@@ -70,6 +87,8 @@ namespace Apps.Views
                 },
             };
             baseView.Add(iconBackgroundView);
+            RelativeLayout.SetHorizontalAlignment(IconBackground, RelativeLayout.Alignment.Center);
+            RelativeLayout.SetVerticalAlignment(IconBackground, RelativeLayout.Alignment.Start);
 
             appIcon = new ImageView()
             {
@@ -80,6 +99,7 @@ namespace Apps.Views
             appLabel = new TextLabel()
             {
                 StyleName = "ItemTitle",
+                FontFamily = "BreezeSans",
                 ThemeChangeSensitive = true,
                 HeightSpecification = 24.SpToPx(),
                 WidthSpecification = LayoutParamPolicies.MatchParent,
@@ -88,9 +108,25 @@ namespace Apps.Views
             };
 
             baseView.Add(appLabel);
+            RelativeLayout.SetHorizontalAlignment(Label, RelativeLayout.Alignment.Center);
+            RelativeLayout.SetVerticalAlignment(Label, RelativeLayout.Alignment.End);
 
             UpdateTheme(ThemeManager.PlatformThemeId);
             ThemeManager.ThemeChanged += OnThemeUpdated;
+            TouchEvent += OnTouched;
+            AllowOnlyOwnTouch = true;
+            if (removeMode)
+            {
+                AddCrossButton();
+            }
+        }
+
+        private ICommand appSelectCommand;
+
+        public ICommand AppSelectCommand
+        {
+            get => (ICommand)GetValue(AppSelectCommandProperty);
+            set => SetValue(AppSelectCommandProperty, value);
         }
 
         public TextLabel Label => appLabel;
@@ -99,6 +135,104 @@ namespace Apps.Views
 
         public View IconBackground => iconBackgroundView;
 
+        public Button CrossButton { get; internal set; }
+
+        private void OnThemeUpdated(object sender, ThemeChangedEventArgs e)
+        {
+            if (e.IsPlatformThemeChanged)
+            {
+                UpdateTheme(e.PlatformThemeId);
+            }
+        }
+
+        private void UpdateTheme(string currentPlatformThemeId)
+        {
+            if (currentPlatformThemeId.Equals(Resources.LightPlatformThemeId))
+            {
+                baseView.BoxShadow = new Shadow(4.0f, new Color(0, 0, 0, 0.20f), new Vector2(2, 2));
+            }
+            else if (currentPlatformThemeId.Equals(Resources.DarkPlatformThemeId))
+            {
+                baseView.BoxShadow = new Shadow(4.0f, new Color(1.0f, 1.0f, 1.0f, 0.20f), new Vector2(2, 2));
+            }
+        }
+
+        private bool OnTouched(object source, TouchEventArgs e)
+        {
+            if (e.Touch.GetState(0) == PointStateType.Down)
+            {
+                timer = new Timer(500);
+                timer.Start();
+                isMoved = false;
+                isLongPressed = false;
+                timer.Tick += (object source1, Timer.TickEventArgs ev) =>
+                {
+                    if (isMoved == false)
+                    {
+                        isLongPressed = true;
+                        LongPressed.Invoke(this, new EventArgs());
+                        Tizen.Log.Debug(Resources.LogTag, "Long Pressed");
+                    }
+                    return false;
+                };
+            }
+            else
+            {
+                DisposeTimer();
+                if (e.Touch.GetState(0) == PointStateType.Up)
+                {
+                    if (isLongPressed == false && isMoved == false)
+                    {
+                        if (isRemoveMode == false)
+                        {
+                            AppSelectCommand.Execute(BindingContext);
+                        }
+                        else
+                        {
+                            RemoveClicked.Invoke(this, new EventArgs());
+                        }
+                        Tizen.Log.Debug(Resources.LogTag, "Clicked");
+                    }
+                    isLongPressed = false;
+                }
+                else
+                {
+                    isMoved = true;
+                }
+            }
+            return true;
+        }
+
+        public void AddCrossButton()
+        {
+            if (CrossButton == null)
+            {
+                CrossButton = new Button("CrossButton")
+                {
+                    Size2D = new Size2D(48, 48).SpToPx(),
+                };
+                baseView.Add(CrossButton);
+                RelativeLayout.SetHorizontalAlignment(CrossButton, RelativeLayout.Alignment.End);
+                RelativeLayout.SetVerticalAlignment(CrossButton, RelativeLayout.Alignment.Start);
+                CrossButton.Clicked += (object sender, ClickedEventArgs e) =>{
+                    if (isRemoveMode)
+                    {
+                        RemoveClicked.Invoke(this, new EventArgs());
+                    }
+                };
+            }
+        }
+
+        private void DisposeTimer()
+        {
+            if (timer != null)
+            {
+                timer.Stop();
+                timer.Dispose();
+                timer = null;
+            }
+        }
+
         protected override void Dispose(DisposeTypes type)
         {
             if (Disposed)
@@ -107,10 +241,12 @@ namespace Apps.Views
             }
             if (type == DisposeTypes.Explicit)
             {
+                DisposeTimer();
+
                 baseView.Remove(appLabel);
                 appLabel?.Dispose();
                 appLabel = null;
-                
+
                 iconBackgroundView.Remove(appIcon);
                 appIcon?.Dispose();
                 appIcon = null;
@@ -119,32 +255,17 @@ namespace Apps.Views
                 iconBackgroundView?.Dispose();
                 iconBackgroundView = null;
 
+                baseView.Remove(CrossButton);
+                CrossButton?.Dispose();
+                CrossButton = null;
+
                 Remove(baseView);
                 baseView?.Dispose();
                 baseView = null;
+
             }
             Tizen.Log.Info(Resources.LogTag, "Dispose appItemLayout");
             base.Dispose(type);
         }
-
-        private void OnThemeUpdated(object sender, ThemeChangedEventArgs e)
-        {
-            if (e.IsPlatformThemeChanged)
-            {
-                UpdateTheme(e.PlatformThemeId);
-            }
-        }
-
-        private void UpdateTheme(string currentPlatformThemeId)
-        {
-            if (currentPlatformThemeId.Equals(Resources.LightPlatformThemeId))
-            {
-                baseView.BoxShadow = new Shadow(4.0f, new Color(0, 0, 0, 0.20f), new Vector2(2, 2));
-            }
-            else if (currentPlatformThemeId.Equals(Resources.DarkPlatformThemeId))
-            {
-                baseView.BoxShadow = new Shadow(4.0f, new Color(1.0f, 1.0f, 1.0f, 0.20f), new Vector2(2, 2));
-            }
-        }
     }
 }
index e7bce79ac272ba1711d1d7fe16a11d7150464a67..8b482ade8b64d0f5d7594d2872e4dc38182023f3 100755 (executable)
@@ -13,7 +13,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-
+using System;
+using System.Collections.Generic;
 using System.Windows.Input;
 using Tizen.NUI;
 using Tizen.NUI.Components;
@@ -25,15 +26,21 @@ namespace Apps.Views
 {
     class AppView : CollectionView
     {
-        public static readonly BindableProperty AppSelectCommandProperty = BindableProperty.Create(nameof(AppSelectCommand), typeof(ICommand), typeof(AppView), null, propertyChanged: (bindable, oldValue, newValue) =>
+        private bool removeMode;
+        private Window removePopupWindow;
+        private AlertDialog removePopup;
+        private View popupBaseView;
+        private Window.WindowOrientation popupOrientation;
+
+        public static readonly BindableProperty AppRemoveCommandProperty = BindableProperty.Create(nameof(AppRemoveCommand), typeof(ICommand), typeof(AppView), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (AppView)bindable;
             if (oldValue != newValue)
             {
-                instance.appSelectCommand = (ICommand)newValue;
+                instance.appRemoveCommand = (ICommand)newValue;
             }
         },
-        defaultValueCreator: (bindable) => ((AppView)bindable).appSelectCommand);
+        defaultValueCreator: (bindable) => ((AppView)bindable).appRemoveCommand);
 
         public AppView(object viewModel) : base()
         {
@@ -46,39 +53,130 @@ namespace Apps.Views
             ScrollingDirection = Direction.Vertical;
             SelectionMode = ItemSelectionMode.Single;
             BindingContext = viewModel;
+            removeMode = false;
+            UpdateItemTemplate(removeMode);
+            Header = GetHeader();
+            this.SetBinding(AppRemoveCommandProperty, "AppRemoveCommand");
+            this.SetBinding(ItemsSourceProperty, "AppListSource");
+            Tizen.Log.Info(Resources.LogTag, "AppView");
+        }
+
+        private void OnLongPressed(object sender, EventArgs e)
+        {
+            removeMode = !removeMode;
+            UpdateItemTemplate(removeMode);
+        }
+
+        private void UpdateItemTemplate(bool removeMode)
+        {
             ItemTemplate = new DataTemplate(() =>
             {
-                AppItemLayout item = new AppItemLayout();
+                AppItemLayout item = new AppItemLayout(removeMode);
                 item.Label.SetBinding(TextLabel.TextProperty, "Name");
                 item.Icon.SetBinding(ImageView.ResourceUrlProperty, "IconUrl");
                 item.IconBackground.SetBinding(BackgroundProperty, "IconBackground");
+                item.SetBinding(AppItemLayout.AppSelectCommandProperty, "AppSelectCommand");
+                item.LongPressed += OnLongPressed;
+                if (removeMode && item.CrossButton != null)
+                {
+                    item.RemoveClicked += OnRemoveClicked;
+                }
                 return item;
             });
-            Header = GetHeader();
-            this.SetBinding(ItemsSourceProperty, "AppListSource");
-            this.SetBinding(AppSelectCommandProperty, "AppSelectCommand");
+        }
 
-            SelectionChanged += OnAppSelection;
-            Tizen.Log.Info(Resources.LogTag, "AppView");
+        private void OnRemoveClicked(object sender, EventArgs e)
+        {
+            AddConfirmationPopup(((AppItemLayout)sender).BindingContext);
         }
 
-        private ICommand appSelectCommand;
+        private void UpdateRemovePopupWindowDimensions()
+        {
+            popupBaseView.WidthSpecification = removePopupWindow.Size.Width;
+            popupBaseView.HeightSpecification = removePopupWindow.Size.Height - 361.SpToPx();
+            popupBaseView.Remove(removePopup);
+            popupBaseView.Add(removePopup);
+        }
 
-        public ICommand AppSelectCommand
+        private void OnRemovePopupWindowResized(object sender, Window.ResizedEventArgs e)
         {
-            get => (ICommand)GetValue(AppSelectCommandProperty);
-            set => SetValue(AppSelectCommandProperty, value);
+            UpdateRemovePopupWindowDimensions();
+            popupOrientation = removePopupWindow.GetCurrentOrientation();
+            Tizen.Log.Info(Resources.LogTag, "Orientation: " + popupOrientation);
         }
 
-        private void OnAppSelection(object sender, SelectionChangedEventArgs e)
+        public void AddConfirmationPopup(object selectedItem)
         {
-            if(SelectedItem == null)
+            Tizen.Log.Info(Resources.LogTag, "Popup Added");
+            if (removePopupWindow == null)
             {
-                return;
+                removePopupWindow = new Window();
+                List<Window.WindowOrientation> list = new List<Window.WindowOrientation>
+                {
+                    Window.WindowOrientation.Landscape,
+                    Window.WindowOrientation.LandscapeInverse,
+                    Window.WindowOrientation.NoOrientationPreference,
+                    Window.WindowOrientation.Portrait,
+                    Window.WindowOrientation.PortraitInverse
+                };
+                removePopupWindow.SetAvailableOrientations(list);
+                popupOrientation = removePopupWindow.GetCurrentOrientation();
+
+                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",
+                        Title = "Delete App from the Device",
+                        Message = "Do you want to delete this app from the device?",
+                        Actions = new List<Button>() { cancelButton, deleteButton },
+                    };
+                }
+                popupBaseView.Add(removePopup);
+                UpdateRemovePopupWindowDimensions();
+                removePopupWindow.Resized += OnRemovePopupWindowResized;
+
+                cancelButton.Clicked += (object sender, ClickedEventArgs e) =>
+                {
+                    removeMode = false;
+                    UpdateItemTemplate(removeMode);
+                    RemoveConfirmationPopup();
+                };
+                deleteButton.Clicked += (object sender, ClickedEventArgs e) =>
+                {
+                    removeMode = false;
+                    UpdateItemTemplate(removeMode);
+                    AppRemoveCommand.Execute(selectedItem);
+                    RemoveConfirmationPopup();
+                };
+            }
+        }
+
+        private void RemoveConfirmationPopup()
+        {
+            if (removePopup != null)
+            {
+                removePopupWindow?.Remove(popupBaseView);
+                popupBaseView?.Remove(removePopup);
+                removePopup.Dispose();
+                removePopup = null;
+                popupBaseView?.Dispose();
+                popupBaseView = null;
+                removePopupWindow?.Dispose();
+                removePopupWindow = null;
             }
-            AppSelectCommand.Execute(SelectedItem);
-            SelectedItem = null;
-            NUIApplication.Current.Exit();
         }
 
         private RecyclerViewItem GetHeader()
@@ -96,9 +194,15 @@ namespace Apps.Views
                                                            Add("width", new PropertyValue("normal")).
                                                            Add("weight", new PropertyValue("normal")).
                                                            Add("slant", new PropertyValue("normal"));
-
             return allAppTitle;
         }
+
+        private ICommand appRemoveCommand;
+        public ICommand AppRemoveCommand
+        {
+            get => (ICommand)GetValue(AppRemoveCommandProperty);
+            set => SetValue(AppRemoveCommandProperty, value);
+        }
     }
 }
 
diff --git a/Apps/res/images/dark/cancel_button.png b/Apps/res/images/dark/cancel_button.png
new file mode 100644 (file)
index 0000000..f5818fb
Binary files /dev/null and b/Apps/res/images/dark/cancel_button.png differ
diff --git a/Apps/res/images/dark/cross_button.png b/Apps/res/images/dark/cross_button.png
new file mode 100644 (file)
index 0000000..3a984e7
Binary files /dev/null and b/Apps/res/images/dark/cross_button.png differ
diff --git a/Apps/res/images/dark/cross_button_selected.png b/Apps/res/images/dark/cross_button_selected.png
new file mode 100644 (file)
index 0000000..42a99c0
Binary files /dev/null and b/Apps/res/images/dark/cross_button_selected.png differ
diff --git a/Apps/res/images/light/cancel_button.png b/Apps/res/images/light/cancel_button.png
new file mode 100644 (file)
index 0000000..a575b04
Binary files /dev/null and b/Apps/res/images/light/cancel_button.png differ
diff --git a/Apps/res/images/light/cross_button.png b/Apps/res/images/light/cross_button.png
new file mode 100644 (file)
index 0000000..215a099
Binary files /dev/null and b/Apps/res/images/light/cross_button.png differ
diff --git a/Apps/res/images/light/cross_button_selected.png b/Apps/res/images/light/cross_button_selected.png
new file mode 100644 (file)
index 0000000..b5afd49
Binary files /dev/null and b/Apps/res/images/light/cross_button_selected.png differ
index 90d1f92e7d02b2c75e95bdf160787b3d144c2685..8ffff0b2d2d9cdc4c9be70888fceb4cfb53754ca 100644 (file)
@@ -11,6 +11,31 @@ Id="DarkTheme">
             <TextLabelStyle PixelSize ="24sp" TextColor ="#FDFDFD" />
         </c:DefaultTitleItemStyle.Label>
     </c:DefaultTitleItemStyle>
-
+    <c:ButtonStyle x:Key="CrossButton" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+        <c:ButtonStyle.Icon>
+            <ImageViewStyle Size="48sp, 48sp">
+                <ImageViewStyle.ResourceUrl>
+                    <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/cross_button.png" Pressed="*Resource*/images/light/cross_button_selected.png" />
+                </ImageViewStyle.ResourceUrl>
+            </ImageViewStyle>
+        </c:ButtonStyle.Icon>
+    </c:ButtonStyle>
+    <c:AlertDialogStyle x:Key="AlertDialogBackground" ThemeChangeSensitive="true" BackgroundColor="#16131A">
+        <c:AlertDialogStyle.TitleTextLabel>
+            <TextLabelStyle TextColor="#FDFDFD" FontFamily="BreezeSans" PixelSize="24sp" />
+        </c:AlertDialogStyle.TitleTextLabel>
+        <c:AlertDialogStyle.MessageTextLabel>
+            <TextLabelStyle TextColor="#FDFDFD" FontFamily="BreezeSans" PixelSize="24sp" />
+        </c:AlertDialogStyle.MessageTextLabel>
+    </c:AlertDialogStyle>
+    <c:ButtonStyle x:Key="CancelButton" ThemeChangeSensitive="true" Size="252sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent" >
+        <c:ButtonStyle.Icon>
+            <ImageViewStyle Size="252sp, 48sp">
+                <ImageViewStyle.ResourceUrl>
+                    <Selector x:TypeArguments="x:String" Normal="*Resource*/images/dark/cancel_button.png" />
+                </ImageViewStyle.ResourceUrl>
+            </ImageViewStyle>
+        </c:ButtonStyle.Icon>
+    </c:ButtonStyle>
     <TextLabelStyle x:Key="ItemTitle" TextColor="#FDFDFD" FontFamily="BreezeSans" PixelSize="16sp"/>
 </Theme>
\ No newline at end of file
index e3f046b619cccdc6b43291c8fedb830bd705d4cd..cbd7a3906589c2760da864baf16d229cdb6e265c 100644 (file)
@@ -11,6 +11,31 @@ Id="LightTheme">
             <TextLabelStyle PixelSize ="24sp" TextColor ="#090E21" />
         </c:DefaultTitleItemStyle.Label>
     </c:DefaultTitleItemStyle>
-
+    <c:ButtonStyle x:Key="CrossButton" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+        <c:ButtonStyle.Icon>
+            <ImageViewStyle Size="48sp, 48sp">
+                <ImageViewStyle.ResourceUrl>
+                    <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/cross_button.png" Pressed="*Resource*/images/light/cross_button_selected.png" />
+                </ImageViewStyle.ResourceUrl>
+            </ImageViewStyle>
+        </c:ButtonStyle.Icon>
+    </c:ButtonStyle>
+    <c:AlertDialogStyle x:Key="AlertDialogBackground" ThemeChangeSensitive="true" BackgroundColor="#FAFAFA">
+        <c:AlertDialogStyle.TitleTextLabel>
+            <TextLabelStyle TextColor="#090E21" FontFamily="BreezeSans" PixelSize="24sp" />
+        </c:AlertDialogStyle.TitleTextLabel>
+        <c:AlertDialogStyle.MessageTextLabel>
+            <TextLabelStyle TextColor="#090E21" FontFamily="BreezeSans" PixelSize="24sp" />
+        </c:AlertDialogStyle.MessageTextLabel>
+    </c:AlertDialogStyle>
+    <c:ButtonStyle x:Key="CancelButton" ThemeChangeSensitive="true" Size="252sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent" >
+        <c:ButtonStyle.Icon>
+            <ImageViewStyle Size="252sp, 48sp">
+                <ImageViewStyle.ResourceUrl>
+                    <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/cancel_button.png" />
+                </ImageViewStyle.ResourceUrl>
+            </ImageViewStyle>
+        </c:ButtonStyle.Icon>
+    </c:ButtonStyle>
     <TextLabelStyle x:Key="ItemTitle" TextColor="#090E21" FontFamily="BreezeSans" PixelSize="16sp"/>
 </Theme>
\ No newline at end of file
index 39ec8ef9acc03df41e3c60a51946046f5445760a..5022efd25655b9bfb2285795e988cf2d6003cf56 100755 (executable)
@@ -11,6 +11,8 @@
     <privileges>
         <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
         <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+        <privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
+        <privilege>http://tizen.org/privilege/window.priority.set</privilege>
     </privileges>
     <dependencies />
     <provides-appdefined-privileges />
index 7a7956e7aec796e8cd1cde890223dba118beb7a3..cb005533dd2a847d1cc7d00722068094ea53cb3f 100755 (executable)
@@ -125,6 +125,7 @@ namespace TrayApplication.Views
                 {
                     if (isMoved == false)
                     {
+                        Overlay.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
                         isLongPressed = true;
                         LongPressed.Invoke(this, new EventArgs());
                         Tizen.Log.Debug(Resources.LogTag, "Long Pressed");
@@ -135,12 +136,7 @@ namespace TrayApplication.Views
             else
             {
                 Overlay.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
-                if (timer != null)
-                {
-                    timer.Stop();
-                    timer.Dispose();
-                    timer = null;
-                }
+                DisposeTimer();
                 if (e.Touch.GetState(0) == PointStateType.Up)
                 {
                     if (isLongPressed == false && isMoved == false)
@@ -165,6 +161,16 @@ namespace TrayApplication.Views
             return true;
         }
 
+        private void DisposeTimer()
+        {
+            if (timer != null)
+            {
+                timer.Stop();
+                timer.Dispose();
+                timer = null;
+            }
+        }
+
         public View BaseView { get; }
 
         public TextLabel Label { get; }
@@ -237,6 +243,8 @@ namespace TrayApplication.Views
             }
             if (type == DisposeTypes.Explicit)
             {
+                DisposeTimer();
+
                 BaseView.Remove(Label);
                 Label?.Dispose();
 
@@ -246,7 +254,7 @@ namespace TrayApplication.Views
                 BaseView.Remove(IconBackground);
                 IconBackground?.Dispose();
 
-                BaseView.Remove(CrossButton);
+                Remove(CrossButton);
                 CrossButton?.Dispose();
 
                 Remove(BaseView);
index 0cf6160efff2546eb258a92cec904a63836f7a40..11f9a1a4a1119ee7e43ae31dd350c56c9c3e4ed3 100755 (executable)
Binary files a/packaging/org.tizen.Apps-1.0.0.tpk and b/packaging/org.tizen.Apps-1.0.0.tpk differ
index 15e813a5172feefda00545059eeaf9c1490d69ac..b3b68c97d9b40155335b8c4535f6f909d1fff8b4 100755 (executable)
Binary files a/packaging/org.tizen.TrayApplication-1.0.0.tpk and b/packaging/org.tizen.TrayApplication-1.0.0.tpk differ