From: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics Date: Mon, 21 Aug 2023 11:09:08 +0000 (+0530) Subject: The patch contains following changes: X-Git-Tag: accepted/tizen/unified/20230823.173931~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca8493a5764e7ab794b5a1987b8ef7b7e6a0040e;p=profile%2Fiot%2Fapps%2Fdotnet%2Fnotifications.git The patch contains following changes: 1. Dark and Light Theme Implementation. 2. Detailed Notifications Option. Change-Id: Iff6b4059ea8eb5359bed027c01e181aa26558daa Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics --- diff --git a/.gitignore b/.gitignore index ec877b8..ea0b5ab 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .vscode/* **/[Bb]in/ **/[Oo]bj/ +**/*.csproj.user [Bb]uild/ [Dd]ebug/ .gn diff --git a/Notifications/Common/AppConstants.cs b/Notifications/Common/AppConstants.cs index 2fedf8f..501c7f1 100644 --- a/Notifications/Common/AppConstants.cs +++ b/Notifications/Common/AppConstants.cs @@ -8,20 +8,22 @@ namespace Notifications.Common public const string LightPlatformThemeId = "org.tizen.default-light-theme"; public const string DarkPlatformThemeId = "org.tizen.default-dark-theme"; + public static Color LightBorderColor = new Color(0.9804f, 0.9804f, 0.9804f, 0.35f); + public static Color DarkBorderColor = new Color(0.0863f, 0.0745f, 0.0980f, 0.50f); + public static Size2D DefaultWindowSize = new Size2D(960, 540); - public static Size2D IconSize = new Size2D(48, 48); - public static Size2D SmallIconSize = new Size2D(32, 32); - public static Size2D TextButtonSize = new Size2D(150, 48); public static Position2D DefaultWindowPosition = new Position2D(480, 170); public const int BorderHeight = 52; public const int HeaderHeight = 64; - public const int TitlePixelSize = 24; + public const int NotificationItemHeight = 80; + public static Vector4 BorderCornerRadius = new Vector4(24, 24, 24, 24); public static Vector4 BaseViewCornerRadius = new Vector4(24, 24, 24, 24); public static Extents BaseViewPadding = new Extents(0, 0, 20, 20); public static Extents HeaderPadding = new Extents(16, 16, 8, 8); + public static Extents DetailContentMargin = new Extents(64, 64, 8, 8); } } diff --git a/Notifications/CustomBorder.cs b/Notifications/CustomBorder.cs index bd7b293..d51f75d 100644 --- a/Notifications/CustomBorder.cs +++ b/Notifications/CustomBorder.cs @@ -6,6 +6,7 @@ namespace Notifications { class CustomBorder : DefaultBorder { + private ImageView minimizeIcon; private ImageView maximalizeIcon; private ImageView closeIcon; private ImageView leftCornerIcon; @@ -14,14 +15,26 @@ namespace Notifications public CustomBorder() : base() { + ThemeManager.ThemeChanged += OnThemeChanged; + } + + private void OnThemeChanged(object sender, ThemeChangedEventArgs e) + { + if (e.IsPlatformThemeChanged) + { + if (borderView != null) + { + borderView.BackgroundColor = ThemeManager.PlatformThemeId == AppConstants.LightPlatformThemeId ? AppConstants.LightBorderColor : AppConstants.DarkBorderColor; + } + } } public override void CreateBorderView(View borderView) { this.borderView = borderView; - borderView.CornerRadius = new Vector4(24, 24, 24, 24); + borderView.CornerRadius = AppConstants.BorderCornerRadius; borderView.CornerRadiusPolicy = VisualTransformPolicyType.Relative; - borderView.BackgroundColor = new Color(1, 1, 1, 0.3f); + borderView.BackgroundColor = ThemeManager.PlatformThemeId == AppConstants.LightPlatformThemeId ? AppConstants.LightBorderColor : AppConstants.DarkBorderColor; } public override bool CreateBottomBorderView(View bottomView) @@ -31,6 +44,14 @@ namespace Notifications return false; } bottomView.Layout = new RelativeLayout(); + + minimizeIcon = new ImageView() + { + Focusable = true, + ResourceUrl = Resources.GetImagePath() + "/minimize.png", + AccessibilityHighlightable = true, + }; + maximalizeIcon = new ImageView() { Focusable = true, @@ -59,6 +80,10 @@ namespace Notifications AccessibilityHighlightable = true, }; + RelativeLayout.SetRightTarget(minimizeIcon, maximalizeIcon); + RelativeLayout.SetRightRelativeOffset(minimizeIcon, 0.0f); + RelativeLayout.SetHorizontalAlignment(minimizeIcon, RelativeLayout.Alignment.End); + RelativeLayout.SetRightTarget(maximalizeIcon, closeIcon); RelativeLayout.SetRightRelativeOffset(maximalizeIcon, 0.0f); RelativeLayout.SetHorizontalAlignment(maximalizeIcon, RelativeLayout.Alignment.End); @@ -71,15 +96,23 @@ namespace Notifications RelativeLayout.SetHorizontalAlignment(rightCornerIcon, RelativeLayout.Alignment.End); bottomView.Add(leftCornerIcon); + bottomView.Add(minimizeIcon); bottomView.Add(maximalizeIcon); bottomView.Add(closeIcon); bottomView.Add(rightCornerIcon); + minimizeIcon.TouchEvent += OnMinimizeIconTouched; maximalizeIcon.TouchEvent += OnMaximizeIconTouched; closeIcon.TouchEvent += OnCloseIconTouched; leftCornerIcon.TouchEvent += OnLeftBottomCornerIconTouched; rightCornerIcon.TouchEvent += OnRightBottomCornerIconTouched; + + minimizeIcon.AccessibilityActivated += (s, e) => + { + MinimizeBorderWindow(); + }; + maximalizeIcon.AccessibilityActivated += (s, e) => { MaximizeBorderWindow(); @@ -90,6 +123,11 @@ namespace Notifications CloseBorderWindow(); }; + minimizeIcon.AccessibilityNameRequested += (s, e) => + { + e.Name = "Minimize"; + }; + maximalizeIcon.AccessibilityNameRequested += (s, e) => { e.Name = "Maximize"; @@ -110,6 +148,7 @@ namespace Notifications e.Name = "Resize"; }; + minimizeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name); maximalizeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name); closeIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name); leftCornerIcon.SetAccessibilityReadingInfoTypes(Tizen.NUI.BaseComponents.AccessibilityReadingInfoTypes.Name); diff --git a/Notifications/Models/NotificationsModel.cs b/Notifications/Models/NotificationsModel.cs index 541d273..072910a 100644 --- a/Notifications/Models/NotificationsModel.cs +++ b/Notifications/Models/NotificationsModel.cs @@ -10,13 +10,10 @@ namespace Notifications.Models { public event PropertyChangedEventHandler PropertyChanged; - private readonly string appId; - private readonly int uniqueNumber; - public NotificationsModel(string appId, int uniqueNumber, string title, string content) { - this.appId = appId; - this.uniqueNumber = uniqueNumber; + AppId = appId; + UniqueNumber = uniqueNumber; this.title = title ?? string.Empty; subTitle = content ?? string.Empty; ClearNotificationCommand = new Command(OnNotificationCleared); @@ -27,6 +24,9 @@ namespace Notifications.Models PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } + public string AppId { get; internal set; } + public int UniqueNumber { get; internal set; } + private string title; public string Title { @@ -64,7 +64,7 @@ namespace Notifications.Models { try { - NotificationListenerManager.Delete(appId, uniqueNumber); + NotificationListenerManager.Delete(AppId, UniqueNumber); } catch (Exception ex) { diff --git a/Notifications/Notifications.cs b/Notifications/Notifications.cs index aabc806..4af2278 100644 --- a/Notifications/Notifications.cs +++ b/Notifications/Notifications.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; +using Tizen.Applications; using Tizen.NUI; using Notifications.Common; -using Notifications.Views; -using Tizen.Applications; namespace Notifications { @@ -10,9 +9,11 @@ namespace Notifications { private Window window; private ViewManager viewManager; + public Program() : base(AppConstants.DefaultWindowSize, AppConstants.DefaultWindowPosition, ThemeOptions.PlatformThemeEnabled, new CustomBorder()) { } + protected override void OnCreate() { base.OnCreate(); @@ -37,11 +38,8 @@ namespace Notifications UpdateWindowSize(); UpdateWindowPosition(); window.BackgroundColor = Color.Transparent; - window.KeyEvent += OnKeyEvent; - window.Resized += OnWindowResized; window.OrientationChanged += OnWindowOrientationChanged; viewManager = new ViewManager(); - Tizen.Log.Info(AppConstants.LogTag, "Show Window"); } private void UpdateWindowSize() @@ -71,27 +69,12 @@ namespace Notifications Tizen.Log.Info(AppConstants.LogTag, "position Y is: " + window.WindowPosition.Y); } - private void OnWindowResized(object sender, Window.ResizedEventArgs e) - { - Tizen.Log.Debug(AppConstants.LogTag, "Resized Event"); - viewManager.UpdateViewOnResize(); - } - private void OnWindowOrientationChanged(object sender, WindowOrientationChangedEventArgs e) { Tizen.Log.Debug(AppConstants.LogTag, "orientation changed" + e.WindowOrientation); DeviceInfo.UpdateDeviceInfo(); UpdateWindowSize(); UpdateWindowPosition(); - viewManager.UpdateViewOnResize(); - } - - public void OnKeyEvent(object sender, Window.KeyEventArgs e) - { - if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape")) - { - Exit(); - } } protected override void OnAppControlReceived(AppControlReceivedEventArgs e) @@ -112,4 +95,4 @@ namespace Notifications app.Run(args); } } -} +} \ No newline at end of file diff --git a/Notifications/Notifications.csproj b/Notifications/Notifications.csproj index 1a32e82..255472e 100644 --- a/Notifications/Notifications.csproj +++ b/Notifications/Notifications.csproj @@ -3,6 +3,7 @@ Exe tizen11.0 + Notifications @@ -11,10 +12,14 @@ None - + - - + + MSBuild:Compile + + + MSBuild:Compile + diff --git a/Notifications/ViewManager.cs b/Notifications/ViewManager.cs new file mode 100644 index 0000000..34b313c --- /dev/null +++ b/Notifications/ViewManager.cs @@ -0,0 +1,103 @@ +using System; +using System.IO; +using Tizen.Applications.NotificationEventListener; +using Tizen.NUI; +using Tizen.NUI.Xaml; +using Notifications.Common; +using Notifications.ViewModels; +using Notifications.Views; + +namespace Notifications +{ + class ViewManager + { + private NotificationsViewModel notificationsViewModel; + private NotificationsDetailViewModel notificationsDetailViewModel; + private BaseView baseView; + public ViewManager() + { + notificationsViewModel = new NotificationsViewModel(); + notificationsViewModel.NotificationSelected += OnNotificationSelected; + UpdateTheme(ThemeManager.PlatformThemeId); + baseView = new BaseView(); + baseView.BindingContext = notificationsViewModel; + baseView.BackKeyPressed += OnBackKeyPressed; + Window.Instance.Add(baseView); + + ThemeManager.ThemeChanged += OnThemeChanged; + } + + private void OnThemeChanged(object sender, ThemeChangedEventArgs e) + { + if (e.IsPlatformThemeChanged) + { + Tizen.Log.Info(AppConstants.LogTag, "Theme Changed: " + e.ThemeId); + UpdateTheme(e.PlatformThemeId); + } + } + + private void OnBackKeyPressed(object sender, EventArgs e) + { + if(baseView.BackKeyEventEmitted() == true) + { + Tizen.Applications.Application.Current.Exit(); + } + } + + private void OnNotificationSelected(object sender, NotificationEventArgs e) + { + notificationsDetailViewModel = new NotificationsDetailViewModel(e.AppID, e.Content); + notificationsDetailViewModel.DetailContentRemoved += OnDetailContentRemoved; + baseView.BindingContext = notificationsDetailViewModel; + baseView.AddDetailContentView(); + } + + private void OnDetailContentRemoved() + { + notificationsDetailViewModel.DetailContentRemoved -= OnDetailContentRemoved; + baseView.BindingContext = notificationsViewModel; + baseView.UpdateContent(); + } + + private void SetTheme(string path) + { + try + { + Theme theme = new Theme(path); + ThemeManager.ApplyTheme(theme); + } + catch (ArgumentNullException e) + { + Tizen.Log.Error(AppConstants.LogTag, "ArgumentNullException: " + e.ParamName); + } + catch (IOException e) + { + Tizen.Log.Error(AppConstants.LogTag, "IOException: " + e.Message); + } + catch (XamlParseException e) + { + Tizen.Log.Error(AppConstants.LogTag, "XamlParseException: " + e.Message); + if (e.XmlInfo != null) + { + Tizen.Log.Error(AppConstants.LogTag, "XamlParseException, LineNo." + e.XmlInfo.LineNumber + " Pos: " + e.XmlInfo.LinePosition + " HasInfo: " + e.XmlInfo.HasLineInfo().ToString()); + } + } + } + private void UpdateTheme(string platformThemeId) + { + if (platformThemeId == null) + { + Tizen.Log.Error(AppConstants.LogTag, "Platform theme id is null"); + return; + } + if (platformThemeId.Equals(AppConstants.LightPlatformThemeId)) + { + SetTheme(Resources.GetThemePath() + "light.xaml"); + } + else if (platformThemeId.Equals(AppConstants.DarkPlatformThemeId)) + { + SetTheme(Resources.GetThemePath() + "dark.xaml"); + } + } + } +} diff --git a/Notifications/ViewModels/NotificationsDetailViewModel.cs b/Notifications/ViewModels/NotificationsDetailViewModel.cs new file mode 100644 index 0000000..9cb5611 --- /dev/null +++ b/Notifications/ViewModels/NotificationsDetailViewModel.cs @@ -0,0 +1,84 @@ +using System; +using System.ComponentModel; +using Tizen.Applications; +using Tizen.NUI.Binding; +using Notifications.Common; + +namespace Notifications.ViewModels +{ + class NotificationsDetailViewModel : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + public event Action DetailContentRemoved; + + public NotificationsDetailViewModel(string appId, string text) + { + AppId = appId; + DetailContent = text ?? "Detail Content Absent"; + BackCommand = new Command(OnBackPressed); + AppLaunchCommand = new Command(OnAppLaunched); + } + + public string AppId { get; internal set; } + + private void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private string detailContent; + public string DetailContent + { + get => detailContent; + set + { + detailContent = value; + OnPropertyChanged("DetailContent"); + } + } + + private Command backCommand; + public Command BackCommand + { + get => backCommand; + set + { + backCommand = value; + OnPropertyChanged("BackCommand"); + } + } + + private void OnBackPressed() + { + DetailContentRemoved.Invoke(); + } + + private Command appLaunchCommand; + public Command AppLaunchCommand + { + get => appLaunchCommand; + set + { + appLaunchCommand = value; + OnPropertyChanged("AppLaunchCommand"); + } + } + + private void OnAppLaunched() + { + AppControl appControl = new AppControl() + { + ApplicationId = AppId, + Operation = AppControlOperations.Default, + }; + try + { + AppControl.SendLaunchRequest(appControl); + } + catch (Exception ex) + { + Tizen.Log.Error(AppConstants.LogTag, "exception: " + ex.Message); + } + } + } +} diff --git a/Notifications/ViewModels/NotificationsViewModel.cs b/Notifications/ViewModels/NotificationsViewModel.cs index 5d7e051..8423fc5 100644 --- a/Notifications/ViewModels/NotificationsViewModel.cs +++ b/Notifications/ViewModels/NotificationsViewModel.cs @@ -3,12 +3,15 @@ using System.ComponentModel; using Tizen.Applications.NotificationEventListener; using Tizen.NUI; using Tizen.NUI.Binding; +using Tizen.NUI.Components; +using Notifications.Models; namespace Notifications.ViewModels { class NotificationsViewModel : IDisposable, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; + public event EventHandler NotificationSelected; public NotificationsViewModel() { @@ -17,6 +20,7 @@ namespace Notifications.ViewModels BackCommand = new Command(OnBackPressed); ClearAllNotificationsCommand = new Command(OnAllNotificationsCleared); + SelectionChangedCommand = new Command(OnSelectionChanged); NotificationListenerManager.Added += OnNotificationAdded; NotificationListenerManager.Deleted += OnNotificationDeleted; @@ -99,5 +103,34 @@ namespace Notifications.ViewModels { NotificationListenerManager.DeleteAll(); } + + private Command selectionChangedCommand; + public Command SelectionChangedCommand + { + get => selectionChangedCommand; + set + { + selectionChangedCommand = value; + OnPropertyChanged("SelectionChangedCommand"); + } + } + + private void OnSelectionChanged(object selectionChangedParameter) + { + if (selectionChangedParameter is SelectionChangedEventArgs e) + { + if (e.CurrentSelection.Count != 0 && e.CurrentSelection[0] is NotificationsModel notificationsModel) + { + var notificationsList = NotificationListenerManager.GetList(); + foreach (NotificationEventArgs notificationArgs in notificationsList) + { + if (notificationArgs.UniqueNumber == notificationsModel.UniqueNumber) + { + NotificationSelected?.Invoke(this, notificationArgs); + } + } + } + } + } } } diff --git a/Notifications/Views/BaseView.cs b/Notifications/Views/BaseView.cs index bb44e71..3c38778 100644 --- a/Notifications/Views/BaseView.cs +++ b/Notifications/Views/BaseView.cs @@ -25,15 +25,16 @@ namespace Notifications.Views private View topView; private Button backButton; private TextLabel titleText; - private CollectionView notificationsView; - private View bottomView; private Button clearAllButton; + private CollectionView notificationsView; private TextLabel noNotificationsText; + private Button detailContentView; public BaseView() : base() { - Size2D = new Size2D(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height); - BackgroundColor = new Color("#FAFAFA"); + StyleName = "BaseView"; + WidthResizePolicy = ResizePolicyType.FillToParent; + HeightResizePolicy = ResizePolicyType.FillToParent; CornerRadius = AppConstants.BaseViewCornerRadius; Layout = new LinearLayout() { @@ -47,6 +48,50 @@ namespace Notifications.Views this.SetBinding(IsContentAvailableProperty, "IsNotificationsPresent"); } + public void UpdateContent() + { + RemoveContent(); + + if (IsContentAvailable == true) + { + AddNotificationsView(); + AddClearAllButton(); + } + else + { + AddNoNotificationsText(); + } + } + + public void AddDetailContentView() + { + + RemoveContent(); + if (detailContentView == null) + { + detailContentView = new Button() + { + StyleName = "DetailContentView", + WidthSpecification = LayoutParamPolicies.MatchParent, + HeightSpecification = LayoutParamPolicies.WrapContent, + Margin = AppConstants.DetailContentMargin.SpToPx(), + }; + detailContentView.SetBinding(Button.TextProperty, "DetailContent"); + detailContentView.SetBinding(Control.CommandProperty, "AppLaunchCommand"); + } + Add(detailContentView); + } + + public bool BackKeyEventEmitted() + { + if (detailContentView != null && detailContentView.GetParent() == this) + { + backButton.Command.Execute(null); + return false; + } + return true; + } + private void AddTopView() { topView = new View() @@ -64,13 +109,7 @@ namespace Notifications.Views private void AddTopViewElements() { - backButton = new Button() - { - Size2D = AppConstants.IconSize.SpToPx(), - IconURL = Resources.GetImagePath() + "/light/back.png", - BackgroundColor = Color.Transparent, - }; - backButton.Icon.Size2D = AppConstants.IconSize.SpToPx(); + backButton = new Button("BackButton"); RelativeLayout.SetVerticalAlignment(backButton, RelativeLayout.Alignment.Center); RelativeLayout.SetHorizontalAlignment(backButton, RelativeLayout.Alignment.Start); backButton.SetBinding(Control.CommandProperty, "BackCommand"); @@ -78,38 +117,22 @@ namespace Notifications.Views titleText = new TextLabel() { + StyleName = "TitleText", Text = "Notifications", HeightSpecification = LayoutParamPolicies.MatchParent, VerticalAlignment = VerticalAlignment.Center, - FontFamily = "BreezeSans", - PixelSize = AppConstants.TitlePixelSize.SpToPx(), - TextColor = new Color("#090E21"), }; RelativeLayout.SetLeftTarget(titleText, backButton); RelativeLayout.SetLeftRelativeOffset(titleText, 1.0f); topView.Add(titleText); } - private void UpdateContent() - { - RemoveContent(); - - if (IsContentAvailable == true) - { - AddNotificationsView(); - AddBottomView(); - } - else - { - AddNoNotificationsText(); - } - } - private void RemoveContent() { Remove(noNotificationsText); Remove(notificationsView); - Remove(bottomView); + Remove(detailContentView); + topView?.Remove(clearAllButton); } private void AddNotificationsView() @@ -123,19 +146,16 @@ namespace Notifications.Views { DefaultLinearItem item = new DefaultLinearItem(); item.WidthSpecification = LayoutParamPolicies.MatchParent; + item.HeightSpecification = AppConstants.NotificationItemHeight.SpToPx(); + item.Label.StyleName = "TitleText"; item.Label.SetBinding(TextLabel.TextProperty, "Title"); item.Label.HorizontalAlignment = HorizontalAlignment.Begin; - item.Label.FontFamily = "BreezeSans"; + item.Label.VerticalAlignment = VerticalAlignment.Bottom; + item.SubLabel.StyleName = "TitleText"; item.SubLabel.SetBinding(TextLabel.TextProperty, "SubTitle"); item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin; - item.SubLabel.FontFamily = "BreezeSans"; - item.Extra = new Button() - { - Size2D = AppConstants.SmallIconSize.SpToPx().SpToPx(), - IconURL = Resources.GetImagePath() + "/light/clear.png", - BackgroundColor = Color.Transparent, - }; - (item.Extra as Button).Icon.Size2D = AppConstants.SmallIconSize.SpToPx().SpToPx(); + item.SubLabel.VerticalAlignment = VerticalAlignment.Top; + item.Extra = new Button("ClearButton"); item.Extra.SetBinding(Control.CommandProperty, "ClearNotificationCommand"); return item; }), @@ -145,41 +165,22 @@ namespace Notifications.Views SelectionMode = ItemSelectionMode.Single, }; notificationsView.SetBinding(RecyclerView.ItemsSourceProperty, "NotificationsListSource"); + notificationsView.SetBinding(CollectionView.SelectionChangedCommandProperty, "SelectionChangedCommand"); } + notificationsView.SelectedItem = null; Add(notificationsView); } - private void AddBottomView() + private void AddClearAllButton() { - if (bottomView == null) - { - bottomView = new View() - { - WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = AppConstants.HeaderHeight.SpToPx(), - Layout = new RelativeLayout() - { - Padding = AppConstants.HeaderPadding.SpToPx(), - }, - }; - } if (clearAllButton == null) { - clearAllButton = new Button() - { - Size2D = AppConstants.TextButtonSize.SpToPx(), - Text = "Clear All", - TextColor = new Color("#FF6200"), - FontFamily = "BreezeSans", - BackgroundColor = Color.Transparent, - TextAlignment = HorizontalAlignment.Center, - }; + clearAllButton = new Button("ClearAllButton"); RelativeLayout.SetVerticalAlignment(clearAllButton, RelativeLayout.Alignment.Center); RelativeLayout.SetHorizontalAlignment(clearAllButton, RelativeLayout.Alignment.End); clearAllButton.SetBinding(Control.CommandProperty, "ClearAllNotificationsCommand"); - bottomView.Add(clearAllButton); } - Add(bottomView); + topView?.Add(clearAllButton); } private void AddNoNotificationsText() @@ -188,14 +189,12 @@ namespace Notifications.Views { noNotificationsText = new TextLabel() { + StyleName = "TitleText", Text = "You don't have notifications", - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - FontFamily = "BreezeSans", - PixelSize = AppConstants.TitlePixelSize.SpToPx(), - TextColor = new Color("#090E21"), WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, }; } Add(noNotificationsText); diff --git a/Notifications/Views/ViewManager.cs b/Notifications/Views/ViewManager.cs deleted file mode 100644 index 8dd76d7..0000000 --- a/Notifications/Views/ViewManager.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Tizen.NUI; -using Notifications.ViewModels; - -namespace Notifications.Views -{ - class ViewManager - { - public NotificationsViewModel notificationsViewModel; - private BaseView baseView; - public ViewManager() - { - notificationsViewModel = new NotificationsViewModel(); - baseView = new BaseView(); - baseView.BindingContext = notificationsViewModel; - Window.Instance.Add(baseView); - } - - public void UpdateViewOnResize() - { - if (baseView != null) - { - baseView.Size2D = new Size2D(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height); - } - } - } -} diff --git a/Notifications/res/images/dark/clear.png b/Notifications/res/images/dark/clear.png new file mode 100644 index 0000000..095b683 Binary files /dev/null and b/Notifications/res/images/dark/clear.png differ diff --git a/Notifications/res/images/minimize.png b/Notifications/res/images/minimize.png new file mode 100644 index 0000000..266d548 Binary files /dev/null and b/Notifications/res/images/minimize.png differ diff --git a/Notifications/res/themes/dark.xaml b/Notifications/res/themes/dark.xaml new file mode 100644 index 0000000..cc25f78 --- /dev/null +++ b/Notifications/res/themes/dark.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Notifications/res/themes/light.xaml b/Notifications/res/themes/light.xaml new file mode 100644 index 0000000..be3f645 --- /dev/null +++ b/Notifications/res/themes/light.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Notifications/tizen-manifest.xml b/Notifications/tizen-manifest.xml index 9df3358..1a21a48 100644 --- a/Notifications/tizen-manifest.xml +++ b/Notifications/tizen-manifest.xml @@ -1,12 +1,14 @@  - + - + Notifications.png http://tizen.org/privilege/notification + http://tizen.org/privilege/packagemanager.info + http://tizen.org/privilege/appmanager.launch diff --git a/packaging/org.tizen.Notifications-1.0.0.tpk b/packaging/org.tizen.Notifications-1.0.0.tpk index c58b8f2..bca8b0f 100644 Binary files a/packaging/org.tizen.Notifications-1.0.0.tpk and b/packaging/org.tizen.Notifications-1.0.0.tpk differ