public static void Init(string resourcePath, InitializationOptions option = null) { if (!IsInitialized) { string fileName = "elmsharp-theme-material.edj"; switch (Profile) { case TargetProfile.TV: fileName = "elmsharp-theme-material-tv.edj"; break; case TargetProfile.Wearable: fileName = "elmsharp-theme-material-wearable.edj"; break; case TargetProfile.Mobile: TSystemInfo.TryGetValue("http://tizen.org/system/device_type", out string deviceType); if (deviceType.Contains("Refrigerator")) { fileName = "elmsharp-theme-material-fhub.edj"; } break; } Elementary.AddThemeOverlay(Path.Combine(resourcePath, fileName)); AppResourcePath = resourcePath; InitOptions = option; IsInitialized = true; } }
public static void AddThemeOverlay(string themeFilePath) { if (!IsInitialized) { Log.Error(Circular.Tag, $"ThemeLoader is not initialized properly"); return; } Elementary.AddThemeOverlay(Path.Combine(AppResourcePath, themeFilePath)); }
public static void Initialize(string resourcePath) { if (string.IsNullOrEmpty(resourcePath)) { throw new InvalidOperationException($"{nameof(resourcePath)} could not be null."); } if (!IsInitialized) { AppResourcePath = resourcePath; Elementary.AddThemeOverlay(Path.Combine(AppResourcePath, CommonThemeFile)); IsInitialized = true; } else { Log.Error(CommonUI.Tag, $"Common theme is already added."); } }
public static void Initialize(string resourcePath) { if (!IsInitialized) { string fileName = "elmsharp-theme-material.edj"; switch (Profile) { case TargetProfile.TV: fileName = "elmsharp-theme-material-tv.edj"; Elementary.AddThemeOverlay("elmsharp-theme-material-tv.edj"); break; case TargetProfile.Wearable: fileName = "elmsharp-theme-material-wearable.edj"; Elementary.AddThemeOverlay("elmsharp-theme-material-wearable.edj"); break; } Elementary.AddThemeOverlay(Path.Combine(resourcePath, fileName)); AppResourcePath = resourcePath; IsInitialized = true; } }