const uint TOTAL_COLUMNS_COUNT = 80;
const uint DURATION_PER_COLUMNS = 50; // miliseconds
// Increase animation time cause OnTick time can be delayed.
- const uint DURATION_OF_ANIMATION = (DURATION_PER_COLUMNS*(COLUMNS_COUNT * 4 / 3)); // miliseconds.
+ const uint DURATION_OF_ANIMATION = (DURATION_PER_COLUMNS * (COLUMNS_COUNT * 4 / 3)); // miliseconds.
const float VIEW_MARGIN_RATE = 0.2f;
- enum ViewTestType{
+ enum ViewTestType
+ {
TEST_TYPE_COLOR = 0, ///< Test with simple color
TEST_TYPE_IMAGE, ///< Test with simple image
TEST_TYPE_TEXT, ///< Test with simple text label
}
static string IMAGE_DIR = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "image/";
- readonly static string[] IMAGE_PATH = {
+ readonly static string[] IMAGE_PATH =
+ {
IMAGE_DIR + "gallery-small-1.jpg",
};
uint mRowsCount = COLUMNS_COUNT;
uint mTotalColumnsCount = TOTAL_COLUMNS_COUNT;
uint mDurationPerColumns = DURATION_PER_COLUMNS; // miliseconds
-
- uint tickCount;
uint mCreateCount = 0u;
uint mDeleteCount = 0u;
timer.Tick += OnTick;
mTimerList.AddLast(timer);
- tickCount = 0;
mDeleteCount = 0;
mCreationStatistic = new Statistic();
var currentControl = mRemovingControlList.First.Value;
mRemovingControlList.RemoveFirst();
- // We can assume that front of mViewLIst must be deleted.
+ // We can assume that front of mViewList must be deleted.
currentControl.Unparent();
currentControl.DisposeRecursively();
private View CreateColor()
{
- View bgView = new View(){
+ View bgView = new View()
+ {
BackgroundColor = Color.Yellow,
ParentOrigin = Position.ParentOriginTopLeft,
}
private View CreateImage()
{
- ImageView bgView = new ImageView(){
- BackgroundColor = Color.Yellow,
+ ImageView bgView = new ImageView()
+ {
ResourceUrl = IMAGE_PATH[(mImageCount++) % (IMAGE_PATH.Length)],
ParentOrigin = Position.ParentOriginTopLeft,
}
private View CreateTextLabel()
{
- TextLabel bgView = new TextLabel(){
+ TextLabel bgView = new TextLabel()
+ {
Text = "Hello, World!",
ParentOrigin = Position.ParentOriginTopLeft,
}
private View CreateRoundedColor()
{
- View bgView = new View(){
+ View bgView = new View()
+ {
BackgroundColor = Color.Yellow,
CornerRadius = 0.5f,
CornerRadiusPolicy = VisualTransformPolicyType.Relative,
private View CreateBorderColor(float requiredBorderlineWidth)
{
- View bgView = new View(){
+ View bgView = new View()
+ {
BackgroundColor = Color.Yellow,
BorderlineColor = Color.Red,
BorderlineWidth = requiredBorderlineWidth,
}
private View CreateRoundedBorderColor(float requiredBorderlineWidth)
{
- View bgView = new View(){
+ View bgView = new View()
+ {
BackgroundColor = Color.Yellow,
CornerRadius = 0.5f,
CornerRadiusPolicy = VisualTransformPolicyType.Relative,
{
CreateScene();
}
- public void FullGC(){
+ public void FullGC()
+ {
global::System.GC.Collect();
global::System.GC.WaitForPendingFinalizers();
global::System.GC.Collect();
{
DestroyScene();
}
+
+ private void CleanList<T>(ref global::System.Collections.Generic.LinkedList<T> list) where T : BaseHandle
+ {
+ while(list.Count > 0)
+ {
+ list.First.Value.Dispose();
+ list.RemoveFirst();
+ }
+ list = null;
+ }
+
private void DestroyScene()
{
+ // Dereference safety
+ CleanList(ref mCreatingControlList);
+ CleanList(ref mRemovingControlList);
+ CleanList(ref mTimerList);
+ CleanList(ref mCreatingAnimationList);
+ CleanList(ref mRemovingAnimationList);
}
protected override void OnCreate()