private AlbumDetailViewModel albumDetailViewModel;
private WallpaperViewModel wallpaperViewModel;
- private Button saveButton;
-
private Window customWindow;
private IBorderInterface appCustomBorder;
return wallpaperView;
}
- public Button GetSaveButton()
- {
- if (saveButton == null)
- {
- saveButton = new Button()
- {
- Text = "Save",
- IsEnabled = true,
- };
- saveButton.BindingContext = wallpaperViewModel;
- saveButton.SetBinding(Control.CommandProperty, "SetWallpaperCommand");
- }
- saveButton.Hide();
- return saveButton;
- }
-
private void OnFolderClicked()
{
CreateCustomWindow();
{
if (url != SystemSettings.WallpaperHomeScreen)
{
- saveButton.Show();
+ wallpaperView?.SaveButton.Show();
}
else
{
- saveButton.Hide();
+ wallpaperView?.SaveButton.Hide();
}
wallpaperView.ResourceUrl = url;
}
}
appCustomBorder?.Dispose();
appCustomBorder = null;
- if (saveButton != null)
- {
- saveButton.BindingContext = null;
- saveButton.Dispose();
- saveButton = null;
- }
ThemeManager.ThemeChanged -= OnThemeChanged;
if(wallpaperViewModel != null)
{
using Tizen.NUI.Components;
using Tizen.System;
using SettingWallpaper.Common;
+using SettingCore;
namespace SettingWallpaper.Views
{
private View bottomView;
private View wallpaperListView;
+ private AppBar appBar;
+
private TextLabel centerText;
+ public Button SaveButton { get; private set; }
private Button albumFolder;
private Button previousButton;
private Button nextButton;
wallpaperList = new List<object>();
AddTextLabel();
AddBottomView();
+ AddAppBar();
ThemeChangeSensitive = true;
}
previewMode = !previewMode;
}
+ private void AddAppBar()
+ {
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar") as AppBarStyle;
+ appBarStyle.ActionButton.BackgroundColor = ThemeManager.PlatformThemeId == Resources.LightPlatformThemeId ? new Color("#FF6200") : new Color("#FF8A00");
+ appBarStyle.ActionButton.Text.TextColor = ThemeManager.PlatformThemeId == Resources.LightPlatformThemeId ? new Color("#FDFDFD") : new Color("#16131A");
+ appBarStyle.ActionButton.CornerRadius = 12f.SpToPx();
+ appBarStyle.ActionButton.SizeHeight = 48f.SpToPx();
+ appBarStyle.ActionButton.Margin = new Extents(0, 64, 16, 0).SpToPx();
+ appBarStyle.ActionButton.Icon = null;
+ appBarStyle.TitleTextLabel.PixelSize = 24f.SpToPx();
+
+ var backButton = new SettingCore.Views.BackButton();
+ backButton.Margin = new Extents(16, 0, 0, 0).SpToPx();
+ backButton.Clicked += (s, e) => GadgetNavigation.NavigateBack();
+
+ SaveButton = new Button()
+ {
+ Text = "Save",
+ IsEnabled = true,
+ };
+ SaveButton.SetBinding(Control.CommandProperty, "SetWallpaperCommand");
+ SaveButton.Hide();
+
+ appBar = new AppBar(appBarStyle)
+ {
+ Size = new Size(-1, 64).SpToPx(),
+ Padding = new Extents(0, 0, 0, 0).SpToPx(),
+ NavigationContent = backButton,
+ BackgroundColor = Color.Transparent,
+ ThemeChangeSensitive = true,
+ Actions = new List<View> { SaveButton },
+ };
+
+ Add(appBar);
+ }
+
private void HideItems()
{
centerText.Hide();
bottomView.Hide();
+ appBar.Hide();
}
private void ShowItems()
{
centerText.Show();
bottomView.Show();
+ appBar.Show();
}
private IEnumerable wallpaperList;
albumFolder?.Dispose();
albumFolder = null;
+ if (SaveButton != null)
+ {
+ SaveButton.BindingContext = null;
+ SaveButton.Dispose();
+ SaveButton = null;
+ }
+
if (wallpaperListView != null)
{
while (wallpaperListView.ChildCount != 0)