using System;
+using System.ComponentModel;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
public event EventHandler<ClickedEventArgs> Clicked;
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<EventArgs> MultiTap;
+ private int multiTapCounter;
+ private DateTime multiTapLast = DateTime.MinValue;
+
protected bool isClickedEventEmpty => Clicked is null;
private bool touchStarted = false;
private bool OnTouchEvent(object source, TouchEventArgs e)
{
+ if (MultiTap != null)
+ {
+ var now = DateTime.Now;
+ if (now - multiTapLast > TimeSpan.FromSeconds(2))
+ {
+ multiTapCounter = 0;
+ Logger.Verbose("multitap zeroed");
+ }
+
+ if (e.Touch.GetState(0) == PointStateType.Down)
+ {
+ multiTapLast = now;
+ ++multiTapCounter;
+ Logger.Verbose($"multitap {multiTapCounter}");
+ }
+
+ if (multiTapCounter >= 5)
+ {
+ Logger.Verbose("multitap invoke");
+ var handler = MultiTap;
+ handler?.Invoke(this, EventArgs.Empty);
+ }
+ return false;
+ }
+
if (isClickedEventEmpty)
{
return false;
--- /dev/null
+using SettingCore;
+using SettingCore.Views;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace SettingMainGadget.About
+{
+ public class AboutScalableGadget : SettingCore.MenuGadget
+ {
+ public override string ProvideTitle() => "Scalable UI for Developers";
+
+ protected override View OnCreate()
+ {
+ base.OnCreate();
+
+ var content = new ScrollableBase()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ HideScrollbar = false,
+ ThemeChangeSensitive = true,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ },
+ };
+
+ var scalable = new (string, string)[]
+ {
+ ("Scaling Factor", $"{GraphicsTypeManager.Instance.ScalingFactor}"),
+ ("DPI", $"{GraphicsTypeManager.Instance.Dpi}"),
+ ("Scaled DPI", $"{GraphicsTypeManager.Instance.ScaledDpi}"),
+ ("Baseline DPI", $"{GraphicsTypeManager.Instance.BaselineDpi}"),
+ ("Density", $"{GraphicsTypeManager.Instance.Density}"),
+ ("Scaled Density", $"{GraphicsTypeManager.Instance.ScaledDensity}"),
+ ("100dp scaled is displayed as:", $"{GraphicsTypeManager.Instance.ConvertScriptToPixel("100dp")}px"),
+ ("100sp scaled is displayed as:", $"{GraphicsTypeManager.Instance.ConvertScriptToPixel("100sp")}px"),
+ };
+ foreach (var (title, value) in scalable)
+ {
+ var row = TextListItem.CreatePrimaryTextItemWithSecondaryText(title, value);
+ content.Add(row);
+ }
+
+ var hideButton = new Button()
+ {
+ Text = "Hide menu: Scalable UI for Developers",
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ };
+ hideButton.TextLabel.PixelSize = 24.SpToPx();
+ hideButton.TextLabel.Margin = new Extents(0, 0, 16, 16).SpToPx();
+ hideButton.Clicked += (s, e) =>
+ {
+ GadgetManager.Instance.ChangeMenuPathOrder(MainMenuProvider.About_ScalableUI, -30);
+ NavigateBack();
+ };
+ content.Add(hideButton);
+
+ return content;
+ }
+ }
+}
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
using Tizen.System;
+using System;
namespace Setting.Menu
{
};
sections.Add(MainMenuProvider.About_OpenSourceLicenses, openSourceLicenses);
+ var scalableUI = TextListItem.CreatePrimaryTextItem("Scalable UI for Developers");
+ scalableUI.Clicked += (s, e) =>
+ {
+ NavigateTo(MainMenuProvider.About_ScalableUI);
+ };
+ sections.Add(MainMenuProvider.About_ScalableUI, scalableUI);
+
var deviceInfo = new TextHeaderListItem(Resources.IDS_ST_BODY_DEVICE_INFO);
sections.Add(MainMenuProvider.About_DeviceInfo, deviceInfo);
result = Tizen.System.Information.TryGetValue<string>("http://tizen.org/feature/platform.version", out string platformVersionText);
var platformVersion = TextListItem.CreatePrimaryTextItemWithSecondaryText(Resources.IDS_ST_MBODY_TIZEN_VERSION, result ? platformVersionText : Resources.IDS_ST_HEADER_UNAVAILABLE);
+ platformVersion.MultiTap += (s, e) =>
+ {
+ GadgetManager.Instance.ChangeMenuPathOrder(MainMenuProvider.About_ScalableUI, 30);
+
+ var toast = Notification.MakeToast("Scalable UI for Developers menu enabled", Notification.ToastCenter);
+ toast.Post(1000);
+ };
sections.Add(MainMenuProvider.About_TizenVersion, platformVersion);
result = Tizen.System.Information.TryGetValue<string>("http://tizen.org/system/platform.processor", out string platformProcessorText);
public static string About = "About";
public static string About_ManageCertificates = "About.ManageCertificates";
public static string About_OpenSourceLicenses = "About.OpenSourceLicenses";
+ public static string About_ScalableUI = "About.ScalableUI";
public static string About_DeviceInfo = "About.DeviceInfo";
public static string About_RenameDevice = "About.RenameDevice";
public static string About_ModelNumber = "About.ModelNumber";
new SettingMenu(path: Language_TTS, defaultOrder: 68),
new SettingMenu(path: Language_STT, defaultOrder: 69),
new SettingMenu(path: About, defaultOrder: 70, type: typeof(Setting.Menu.AboutGadget)),
- new SettingMenu(path: About_ManageCertificates, defaultOrder: 71),
- new SettingMenu(path: About_OpenSourceLicenses, defaultOrder: 72, type: typeof(Setting.Menu.AboutLegalInfoGadget)),
- new SettingMenu(path: About_DeviceInfo, defaultOrder: 73),
- new SettingMenu(path: About_RenameDevice, defaultOrder: 74),
- new SettingMenu(path: About_ModelNumber, defaultOrder: 75),
- new SettingMenu(path: About_TizenVersion, defaultOrder: 76),
- new SettingMenu(path: About_Cpu, defaultOrder: 77),
- new SettingMenu(path: About_Ram, defaultOrder: 78),
- new SettingMenu(path: About_Resolution, defaultOrder: 79),
- new SettingMenu(path: About_DeviceStatus, defaultOrder: 80, type: typeof(Setting.Menu.AboutDeviceStatusGadget)),
- new SettingMenu(path: About_DeviceStatus_bt_address, defaultOrder: 81),
- new SettingMenu(path: About_DeviceStatus_wifi_mac_address, defaultOrder: 82),
- new SettingMenu(path: About_DeviceStatus_storage, defaultOrder: 83),
- new SettingMenu(path: About_DeviceStatus_cpu_usage, defaultOrder: 84),
+ new SettingMenu(path: About_ManageCertificates, defaultOrder: 10),
+ new SettingMenu(path: About_OpenSourceLicenses, defaultOrder: 20, type: typeof(Setting.Menu.AboutLegalInfoGadget)),
+ new SettingMenu(path: About_ScalableUI, defaultOrder: -30, type: typeof(SettingMainGadget.About.AboutScalableGadget)),
+ new SettingMenu(path: About_DeviceInfo, defaultOrder: 40),
+ new SettingMenu(path: About_RenameDevice, defaultOrder: 50),
+ new SettingMenu(path: About_ModelNumber, defaultOrder: 60),
+ new SettingMenu(path: About_TizenVersion, defaultOrder: 70),
+ new SettingMenu(path: About_Cpu, defaultOrder: 80),
+ new SettingMenu(path: About_Ram, defaultOrder: 90),
+ new SettingMenu(path: About_Resolution, defaultOrder: 100),
+ new SettingMenu(path: About_DeviceStatus, defaultOrder: 110, type: typeof(Setting.Menu.AboutDeviceStatusGadget)),
+ new SettingMenu(path: About_DeviceStatus_bt_address, defaultOrder: 10),
+ new SettingMenu(path: About_DeviceStatus_wifi_mac_address, defaultOrder: 20),
+ new SettingMenu(path: About_DeviceStatus_storage, defaultOrder: 30),
+ new SettingMenu(path: About_DeviceStatus_cpu_usage, defaultOrder: 40),
};
}
}
<privilege>http://tizen.org/privilege/network.profile</privilege>
<privilege>http://tizen.org/privilege/volume.set</privilege>
+
+ <privilege>http://tizen.org/privilege/window.priority.set</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />