{
const int _defaultHeight = 55;
- public ImageCellRenderer() : this(Device.Idiom == TargetIdiom.Watch ? "1icon_2text" : (Device.Idiom == TargetIdiom.Phone ? "double_label" : "default"))
+ public ImageCellRenderer() : this("1icon_2text")
{
ImagePart = "elm.swallow.icon";
}
toggle.SetBinding(Switch.OnColorProperty, new Binding(SwitchCell.OnColorProperty.PropertyName));
var nativeView = Platform.GetOrCreateRenderer(toggle).NativeView;
- if (Device.Idiom == TargetIdiom.Watch)
- {
- nativeView.MinimumWidth += 8;
- }
-
- //It is a temporary way to prevent that the check of the Cell gets focus until the UX about views in the Cell for TV is defined.
- if (Device.Idiom == TargetIdiom.TV)
- {
- ((Check)nativeView).AllowFocus(false);
- }
- else
- {
- nativeView.PropagateEvents = false;
- }
+ nativeView.MinimumWidth += 8;
+ nativeView.PropagateEvents = false;
+
return nativeView;
}
return null;
public class TextCellRenderer : CellRenderer
{
bool _groupMode = false;
- // TextCell.Detail property is not supported on TV profile due to UX limitation.
- public TextCellRenderer() : this(Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.Watch ? "double_label" : "default") { }
+
+ public TextCellRenderer() : this("double_label") { }
protected TextCellRenderer(string style) : base(style)
{
else
{
Class = null;
- Style = Device.Idiom == TargetIdiom.Phone ? "double_label" : "default";
+ Style = "default";
DetailPart = "elm.text.sub";
}
}
public static class Forms
{
- static Lazy<string> s_profile = new Lazy<string>(() =>
- {
- //TODO : Fix me if elm_config_profile_get() unavailable
- return Elementary.GetProfile();
- });
-
static Lazy<int> s_dpi = new Lazy<int>(() =>
{
int dpi = 0;
- if (s_profile.Value == "tv")
- {
- // Use fixed DPI value (72) if TV profile
- return 72;
- }
TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.dpi", out dpi);
return dpi;
});
readonly double scalingFactor;
- readonly string profile;
-
public override Size PixelScreenSize
{
get
}
}
- public string Profile
- {
- get
- {
- return this.profile;
- }
- }
-
public TizenDeviceInfo() : this(getScreenWidth(), getScreenHeight())
{
}
}
scaledScreenSize = new Size(width / scalingFactor, height / scalingFactor);
- profile = s_profile.Value;
}
public TizenDeviceInfo RefreshByDIP()
if (!Forms.IsInitialized)
{
- string profile = ((TizenDeviceInfo)Device.Info).Profile;
- if (profile == "mobile")
- {
- Device.SetIdiom(TargetIdiom.Phone);
- }
- else if (profile == "tv")
- {
- Device.SetIdiom(TargetIdiom.TV);
- }
- else if (profile == "desktop")
- {
- Device.SetIdiom(TargetIdiom.Desktop);
- }
- else if (profile == "wearable")
- {
- Device.SetIdiom(TargetIdiom.Watch);
- }
- else
- {
- Device.SetIdiom(TargetIdiom.Unsupported);
- }
- Color.SetAccent(GetAccentColor(profile));
+ Device.SetIdiom(TargetIdiom.Watch);
+ Color.SetAccent(Color.FromRgba(10, 27, 41, 255)); // Theme A (Default) 1st HSB: 207 75 16
ExpressionSearch.Default = new TizenExpressionSearch();
IsInitialized = true;
}
}
- static Color GetAccentColor(string profile)
- {
- // On Windows Phone, this is the complementary color chosen by the user.
- // Good Windows Phone applications use this as part of their styling to provide a native look and feel.
- // On iOS and Android this instance is set to a contrasting color that is visible on the default
- // background but is not the same as the default text color.
-
- switch (profile)
- {
- case "mobile":
- // [Tizen_3.0]Basic_Interaction_GUI_[REF].xlsx Theme 001 (Default) 1st HSB: 188 70 80
- return Color.FromRgba(61, 185, 204, 255);
- case "tv":
- return Color.FromRgba(15, 15, 15, 230);
- case "wearable":
- // Theme A (Default) 1st HSB: 207 75 16
- return Color.FromRgba(10, 27, 41, 255);
- default:
- return Color.Black;
- }
- }
-
/// <summary>
/// Converts the dp into pixel considering current DPI value.
/// </summary>
return eflPt / s_elmScale.Value;
}
- /// <summary>
- /// Get the EFL's profile
- /// </summary>
- /// <returns></returns>
- public static string GetProfile()
- {
- return s_profile.Value;
- }
-
// for internal use only
[EditorBrowsable(EditorBrowsableState.Never)]
public static void Preload()
/// </summary>
public static Dialog CreateDialog(EvasObject parent, bool hasAcceptButton = false)
{
- if (Device.Idiom == TargetIdiom.Watch)
- {
- return new Watch.WatchDialog(Forms.NativeParent, hasAcceptButton);
- }
- else
- {
- return new Dialog(Forms.NativeParent);
- }
+ return new Watch.WatchDialog(Forms.NativeParent, hasAcceptButton);
}
/// <summary>
protected virtual void ApplyTitleColor(EColor color)
{
- SetPartColor(Device.Idiom == TargetIdiom.TV ? "text_title" : "text_maintitle", color);
+ SetPartColor("text_maintitle", color);
}
/// <summary>
BackgroundColor = EColor.Transparent
};
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _pageBusyDialog.SetPartColor("bg_title", EColor.Transparent);
- _pageBusyDialog.SetPartColor("bg_content", EColor.Transparent);
- }
- else if (Device.Idiom == TargetIdiom.Watch)
- {
- _pageBusyDialog.Style = "circle";
- }
+ _pageBusyDialog.Style = "circle";
var activity = new EProgressBar(_pageBusyDialog)
{
protected virtual EButton CreateNativeControl()
{
- if (Device.Idiom == TargetIdiom.Watch)
- return new Native.Watch.WatchButton(Forms.NativeParent);
- else
- return new Native.Button(Forms.NativeParent);
+ return new Native.Watch.WatchButton(Forms.NativeParent);
}
protected override Size MinimumSize()
if (Control == null)
{
// Multiline EditField style is only available on Mobile and TV profile
- var entry = Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV ? new Native.EditfieldEntry(Forms.NativeParent, "multiline") : new Native.Entry(Forms.NativeParent)
+ var entry = new Native.Entry(Forms.NativeParent)
{
IsSingleLine = false,
};
const int _shadow_shift = 2;
const int _shadow_thickness = _thickness + 2;
- static readonly EColor s_DefaultColor = Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Watch ? EColor.Gray : EColor.Black;
+ static readonly EColor s_DefaultColor = EColor.Gray;
static readonly EColor s_ShadowColor = EColor.FromRgba(80, 80, 80, 50);
Polygon _shadow = null;
public class SwitchRenderer : ViewRenderer<Switch, Check>
{
readonly string _onColorPart;
- readonly bool _isTV;
string _onColorEdjePart;
public SwitchRenderer()
{
- _isTV = Device.Idiom == TargetIdiom.TV;
- _onColorPart = _isTV ? "slider_on" : Device.Idiom == TargetIdiom.Watch ? "outer_bg_on" : "bg_on";
+ _onColorPart = "outer_bg_on";
RegisterPropertyHandler(Switch.IsToggledProperty, HandleToggled);
RegisterPropertyHandler(Switch.OnColorProperty, UpdateOnColor);
}
if (Element.OnColor.IsDefault)
{
Control.EdjeObject.DeleteColorClass(_onColorEdjePart);
- if (_isTV)
- Control.EdjeObject.DeleteColorClass(_onColorEdjePart.Replace(_onColorPart, "slider_focused_on"));
}
else
{
EColor color = Element.OnColor.ToNative();
Control.SetPartColor(_onColorPart, color);
- if (_isTV)
- Control.SetPartColor("slider_focused_on", color);
}
}
}
_title = new Native.Label(Forms.NativeParent)
{
- FontSize = Device.Idiom == TargetIdiom.TV ? 60 : 23,
+ FontSize = 23,
VerticalTextAlignment = Native.TextAlignment.Center,
TextColor = _backgroudColor,
FontAttributes = FontAttributes.Bold,
switch (size)
{
case NamedSize.Micro:
- pt = Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Watch ? 24 : 19;
+ pt = 24;
break;
case NamedSize.Small:
- pt = Device.Idiom == TargetIdiom.TV ? 26 : (Device.Idiom == TargetIdiom.Watch ? 30 : 22);
+ pt = 30;
break;
case NamedSize.Default:
case NamedSize.Medium:
- pt = Device.Idiom == TargetIdiom.TV ? 28 : (Device.Idiom == TargetIdiom.Watch ? 32 : 25);
+ pt = 32;
break;
case NamedSize.Large:
- pt = Device.Idiom == TargetIdiom.TV ? 32 : (Device.Idiom == TargetIdiom.Watch ? 36 : 31);
+ pt = 36;
break;
case NamedSize.Body:
- pt = Device.Idiom == TargetIdiom.TV ? 30 : (Device.Idiom == TargetIdiom.Watch ? 32 : 28);
+ pt = 32;
break;
case NamedSize.Caption:
- pt = Device.Idiom == TargetIdiom.TV ? 26 : (Device.Idiom == TargetIdiom.Watch ? 24 : 22);
+ pt = 24;
break;
case NamedSize.Header:
- pt = Device.Idiom == TargetIdiom.TV ? 84 : (Device.Idiom == TargetIdiom.Watch ? 36 : 138);
+ pt = 36;
break;
case NamedSize.Subtitle:
- pt = Device.Idiom == TargetIdiom.TV ? 30 : (Device.Idiom == TargetIdiom.Watch ? 30 : 28);
+ pt = 30;
break;
case NamedSize.Title:
- pt = Device.Idiom == TargetIdiom.TV ? 42 : (Device.Idiom == TargetIdiom.Watch ? 36 : 40);
+ pt = 36;
break;
default:
throw new ArgumentOutOfRangeException(nameof(size));