namespace Tizen.NUI.Components
{
/// <summary>
- /// The Progress class of nui component. It's used to show the ongoing status with a long narrow bar.
+ /// The Progress class is used to show the ongoing status with a long narrow bar.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public class Progress : Control
{
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>
+ /// MaxValueProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
return instance.maxValue;
});
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>
+ /// MinValueProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
return instance.minValue;
});
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>
+ /// CurrentValueProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
return instance.currentValue;
});
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>
+ /// BufferValueProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BufferValueProperty = BindableProperty.Create(nameof(BufferValue), typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
return instance.bufferValue;
});
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <summary>
+ /// ProgressStateProperty
+ /// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty ProgressStateProperty = BindableProperty.Create(nameof(ProgressState), typeof(ProgressStatusType), typeof(Progress), ProgressStatusType.Indeterminate, propertyChanged: (bindable, oldValue, newValue) =>
{
InitializeTrack();
InitializeBuffer();
InitializeProgress();
+ InitializeIndeterminate();
+
+ indeterminateAnimation?.Stop();
+ indeterminateAnimation = null;
}
/// <inheritdoc/>
trackImage.ApplyStyle(progressStyle.Track);
progressImage.ApplyStyle(progressStyle.Progress);
bufferImage.ApplyStyle(progressStyle.Buffer);
+
+ if (null != indeterminateImage && null != progressStyle.Indeterminate)
+ {
+ indeterminateImage.URL = progressStyle.Indeterminate;
+ }
}
}
}
}
- private void Initialize()
- {
- // create necessary components
- InitializeTrack();
- InitializeBuffer();
- InitializeProgress();
- InitializeIndeterminate();
-
- indeterminateAnimation?.Stop();
- indeterminateAnimation = null;
- }
-
private void InitializeTrack()
{
if (null == trackImage)
SizePolicy = VisualTransformPolicyType.Relative,
Origin = Visual.AlignType.Center,
AnchorPoint = Visual.AlignType.Center,
- Opacity = 1.0f,
+ Opacity = 0.0f,
Size = new Size2D(1, 1),
URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "nui_component_default_progress_indeterminate.png"
};
AddVisual("Indeterminate", indeterminateImage);
- // TODO : Need to update Style for indeterminate state.
+ if (state == ProgressStatusType.Indeterminate)
+ {
+ indeterminateImage.Opacity = 1.0f;
+ }
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
/// <summary>
- /// Get or set track image.
+ /// Gets or sets track image.
/// </summary>
/// <since_tizen> 8 </since_tizen>
public ImageViewStyle Track { get; set; } = new ImageViewStyle();
/// <summary>
- /// Get or set progress image.
+ /// Gets or sets progress image.
/// </summary>
/// <since_tizen> 8 </since_tizen>
public ImageViewStyle Progress { get; set; } = new ImageViewStyle();
/// <summary>
- /// Get or set buffer image.
+ /// Gets or sets buffer image.
/// </summary>
/// <since_tizen> 8 </since_tizen>
public ImageViewStyle Buffer { get; set; } = new ImageViewStyle();
+ /// <summary>
+ /// Gets or sets indeterminate progress resource.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Indeterminate { get; set; }
+
/// <summary>
/// Style's clone function.
/// </summary>
Track.CopyFrom(progressStyle.Track);
Progress.CopyFrom(progressStyle.Progress);
Buffer.CopyFrom(progressStyle.Buffer);
+ Indeterminate = progressStyle.Indeterminate;
}
}
}
.AddSelector("/Progress/Background", (ViewStyle style, Selector<Color> value) => ((ProgressStyle)style).Progress.BackgroundColor = value)
.AddSelector("/Track/ResourceUrl", (ViewStyle style, Selector<string> value) => ((ProgressStyle)style).Track.ResourceUrl = value)
.AddSelector("/Buffer/ResourceUrl", (ViewStyle style, Selector<string> value) => ((ProgressStyle)style).Buffer.ResourceUrl = value)
- .AddSelector("/Progress/ResourceUrl", (ViewStyle style, Selector<string> value) => ((ProgressStyle)style).Progress.ResourceUrl = value),
+ .AddSelector("/Progress/ResourceUrl", (ViewStyle style, Selector<string> value) => ((ProgressStyle)style).Progress.ResourceUrl = value)
+ .Add<string>("/Indeterminate", (ViewStyle style, string value) => ((ProgressStyle)style).Indeterminate = value),
// Slider
(new ExternalThemeKeyList(typeof(Slider), typeof(SliderStyle)))
.AddSelector("/Thumb/Background", (ViewStyle style, Selector<Color> value) => ((SliderStyle)style).Thumb.BackgroundColor = value)
.AddSelector("/Thumb/ResourceUrl", (ViewStyle style, Selector<string> value) => ((SliderStyle)style).Thumb.ResourceUrl = value)
.AddSelector("/ValueIndicatorImage/ResourceUrl", (ViewStyle style, Selector<string> value) => ((SliderStyle)style).ValueIndicatorImage.ResourceUrl = value),
-
+
// Pagination
(new ExternalThemeKeyList(typeof(Pagination), typeof(PaginationStyle)))
.AddSelector("/IndicatorImageUrl", (ViewStyle style, Selector<string> value) => ((PaginationStyle)style).IndicatorImageUrl = value),
-
+
// Scrollbar
(new ExternalThemeKeyList(typeof(Scrollbar), typeof(ScrollbarStyle)))
.Add("/TrackColor", (ViewStyle style, Color value) => ((ScrollbarStyle)style).TrackColor = value)
.Add("/ThumbColor", (ViewStyle style, Color value) => ((ScrollbarStyle)style).ThumbColor = value),
-
+
// RecyclerViewItem
(new ExternalThemeKeyList(typeof(RecyclerViewItem), typeof(RecyclerViewItemStyle)))
.AddBackgroundSelector("/Background", SetBackgroundColor, SetBackgroundImage, ControlState.Selected)
.Add<Rectangle>("/BackgroundImageBorder", SetBackgroundBorder),
-
+
// DefaultTitleItem
(new ExternalThemeKeyList(typeof(DefaultTitleItem), typeof(DefaultTitleItemStyle)))
.AddBackgroundSelector("/Background", SetBackgroundColor, SetBackgroundImage)
{
BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
},
+ Indeterminate = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
});
theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
{
public class ProgressSample : IExample
{
- private TextLabel[] board = new TextLabel[3];
+ private TextLabel[] board = new TextLabel[4];
private Button[] button = new Button[2];
- private Progress[] progressBar = new Progress[3];
+ private Progress[] progressBar = new Progress[4];
private View[] layout = new View[4];
public void Activate()
CreatePropElements();
CreateAttrElements();
+ CreateIndeterminateProgress();
layout[1].Add(layout[2]);
layout[1].Add(layout[3]);
layout[3].Add(progressBar[2]);
}
+ private void CreateIndeterminateProgress()
+ {
+ board[3] = new TextLabel();
+ board[3].WidthSpecification = 380;
+ board[3].HeightSpecification = 70;
+ board[3].PointSize = 20;
+ board[3].HorizontalAlignment = HorizontalAlignment.Center;
+ board[3].VerticalAlignment = VerticalAlignment.Center;
+ board[3].BackgroundColor = Color.Magenta;
+ board[3].Text = "Indeterminate Progress";
+ layout[3].Add(board[3]);
+ board[3].Focusable = true;
+ board[3].FocusGained += Board_FocusGained; // Not sure to connect this event
+ board[3].FocusLost += Board_FocusLost;
+
+ progressBar[3] = new Progress();
+ progressBar[3].WidthSpecification = 240;
+ progressBar[3].HeightSpecification = 4;
+ progressBar[3].ProgressState = Progress.ProgressStatusType.Indeterminate;
+ layout[3].Add(progressBar[3]);
+ }
+
private void Board_FocusLost(object sender, global::System.EventArgs e)
{
board[0].BackgroundColor = Color.Magenta;