[TBT][DALi][NonACR][TSIX-2925 Change not to use deprecated APIs] 63/231663/5
authorSunghyun Kim <scholb.kim@samsung.com>
Thu, 23 Apr 2020 09:22:52 +0000 (18:22 +0900)
committerSunghyun Kim <scholb.kim@samsung.com>
Fri, 24 Apr 2020 07:27:55 +0000 (16:27 +0900)
If WidgetView launch before the app launches,sometimes it makes flick
issue.
Fixed TBT to avoid this issue.

Change-Id: Iad32ea9585c80799e52f897ed4a32127a62f7ca1

release/binary-armv7l/org.tizen.tbtcoreapp-dali-1.0.0-arm.tpk
tbtcoreapp-dali/inc/view/tbt-dali-widget-view.h
tbtcoreapp-dali/src/view/tbt-dali-widget-view.cpp

index e61ca60fa7ebc3c0e912afbf72c072fbda75eb13..4a790778c52c0ec417d124c6714e1b3cd850188c 100755 (executable)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-dali-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-dali-1.0.0-arm.tpk differ
index b7cd25cb7a84138671a1cc13417f7394b91d8f8e..486487d2b97ab4424a2149268fba0cf3ca373e78 100644 (file)
@@ -49,6 +49,7 @@ private:
        PushButton btnPause;
        PushButton btnResume;
        PushButton btnCancel;
+       PushButton btnLaunchWidget;
 
        WidgetView::WidgetViewManager mWidgetViewManager;
        WidgetView::WidgetView mWidgetView;
index e437eeafac2ebd8d577d89e8f411b57c54aef73e..f635c35e06d78371ce1e26e308cae216d683591e 100644 (file)
 
 #include "view/tbt-dali-widget-view.h"
 
+
+const Vector4 selectedRedColor=Vector4(0.9f, 0.55f, 0.55f, 1.0f);
+const Vector4 unSelectedRedColor=Vector4(0.9f, 0.8f, 0.8f, 1.0f);
+
 TBTDaliWidgetView::TBTDaliWidgetView(Application& mApplication, app_control_h _control) :
        UiUtils(mApplication, _control) {
 
@@ -32,11 +36,12 @@ TBTDaliWidgetView::TBTDaliWidgetView(Application& mApplication, app_control_h _c
        mInfoText=std::string("")+
                        "\nTo perform the test:"
                        "\n1.   Run DALi Widget View."
-                       "\n2.   Widget added signal will call after successfully launch widget on screen"
-                       "\n3.   Widget creation aborted signal will call after perform click on activate button"
-                       "\n4.   Pause/Resume button are perform widget pause/resume respectively."
-                       "\n5.   Cancel button un-set the widget touch event."
-                       "\n6.   If the corresponding event signals mgs "
+                       "\n2.   Click on launch button for launch WidgetView."
+                       "\n3.   Widget added signal will call after successfully launch widget on screen"
+                       "\n4.   Widget creation aborted signal will call after perform click on activate button"
+                       "\n5.   Pause/Resume button are perform widget pause/resume respectively."
+                       "\n6.   Cancel button un-set the widget touch event."
+                       "\n7.   If the corresponding event signals mgs "
                        "are changed then press <color value='green'><b>Pass</b></color>. "
                        "Otherwise, press <color value='red'><b>Fail</b></color>";
 
@@ -75,43 +80,8 @@ TBTDaliWidgetView::TBTDaliWidgetView(Application& mApplication, app_control_h _c
 //     mTableView.SetFixedHeight(2, 0.9*TEXTLABEL_HEIGHT * bodySize.height);
 //     mTableView.SetFixedHeight(3, 0.9*TEXTLABEL_HEIGHT * bodySize.height);
 
-       mWidgetViewManager = WidgetView::WidgetViewManager::New( mApplication, "org.tizen.tbtcoreapp-dali" );
-       if( !mWidgetViewManager )
-       {
-               DBG("Widget is not enabled!");
-               return;
-       }
-
-       //Add widget
-       //mWidgetView = mWidgetViewManager.AddWidget("org.tizen.calendar.widget", "", bodySize.width, 0.9*bodySize.width, 2000.0 );
-       mWidgetView = mWidgetViewManager.AddWidget("org.tizen.coretbtwidgetapp", "", bodySize.width, 0.9*bodySize.width/2, 2000.0 );
-
-       mWidgetView.SetParentOrigin( ParentOrigin::TOP_LEFT );
-       mWidgetView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-       mWidgetView.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) );
-       mWidgetView.SetPosition( 0.0f, 0.0f );
-
-       mWidgetView.WidgetAddedSignal().Connect( this, &TBTDaliWidgetView::OnWidgetAdded );
-       mWidgetView.WidgetDeletedSignal().Connect( this, &TBTDaliWidgetView::OnWidgetDeleted );
-       //mWidgetView.WidgetCreationAbortedSignal().Connect( this, &TBTDaliWidgetView::onWidgetCreationAbortedSignal );
-       mWidgetView.WidgetContentUpdatedSignal().Connect( this, &TBTDaliWidgetView::onWidgetContentUpdatedSignal );
-       mWidgetView.WidgetFaultedSignal().Connect( this, &TBTDaliWidgetView::onWidgetFaultedSignal );
-       //this->ctlBody.Add(mWidgetView);
-       mTableView.AddChild(mWidgetView, TableView::CellPosition(4,0));
-       mTableView.SetFixedHeight(4, 0.9*bodySize.width/2);
-
-       mWidgetView_1 = mWidgetViewManager.AddWidget("org.example.widget", "", bodySize.width, 0.9*bodySize.width/2, 2000.0 );
-       mWidgetView_1.SetParentOrigin( ParentOrigin::TOP_LEFT );
-       mWidgetView_1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-       mWidgetView_1.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) );
-       mWidgetView_1.SetPosition( 0.0f, 0.0f );
-       //mWidgetView_1.WidgetCreationAbortedSignal().Connect( this, &TBTDaliWidgetView::onWidgetCreationAbortedSignal );
-
-       mTableView.AddChild(mWidgetView_1, TableView::CellPosition(5,0));
-       mTableView.SetFixedHeight(5, 0.9*bodySize.width/2);
-
        //
-       Vector2 buttonSize=Vector2(bodySize.width/4, BUTTON_HEIGHT*bodySize.height);
+       Vector2 buttonSize=Vector2(bodySize.width/5, BUTTON_HEIGHT*bodySize.height);
        Vector2 position=Vector2(0.0f, 0.0f);
 
        btnActivate=CreateButton(AnchorPoint::TOP_LEFT, position, "Activate", selectedColor, unSelectedColor, buttonSize);
@@ -129,6 +99,10 @@ TBTDaliWidgetView::TBTDaliWidgetView(Application& mApplication, app_control_h _c
        btnCancel=CreateButton(AnchorPoint::TOP_LEFT, position, "Cancel", unSelectedColor, selectedColor, buttonSize);
        btnCancel.ClickedSignal().Connect( this, &TBTDaliWidgetView::OnButtonClicked );
        mTableView.AddChild(btnCancel,TableView::CellPosition(15,3));
+
+    btnLaunchWidget=CreateButton(AnchorPoint::TOP_LEFT, position, "launch", selectedRedColor, unSelectedRedColor, buttonSize);
+       btnLaunchWidget.ClickedSignal().Connect( this, &TBTDaliWidgetView::OnButtonClicked );
+       mTableView.AddChild(btnLaunchWidget,TableView::CellPosition(15,4));
 }
 void TBTDaliWidgetView::onWidgetCreationAbortedSignal(WidgetView::WidgetView widgetView)
 {
@@ -180,6 +154,43 @@ bool TBTDaliWidgetView::OnButtonClicked( Button button )
                mWidgetView_1.WidgetCreationAbortedSignal().Connect( this, &TBTDaliWidgetView::onWidgetCreationAbortedSignal );
                mWidgetView_1.ActivateFaultedWidget();
        }
+       else if(btnLaunchWidget==button)
+       {
+               DBG("btnLaunch click");
+               mWidgetViewManager = WidgetView::WidgetViewManager::New( mApplication, "org.tizen.tbtcoreapp-dali" );
+               if( !mWidgetViewManager )
+               {
+                       DBG("Widget is not enabled!");
+                       return false;
+               }
+
+               //Add widget
+               //mWidgetView = mWidgetViewManager.AddWidget("org.tizen.calendar.widget", "", bodySize.width, 0.9*bodySize.width, 2000.0 );
+               mWidgetView = mWidgetViewManager.AddWidget("org.tizen.coretbtwidgetapp", "", bodySize.width, 0.9*bodySize.width/2, 2000.0 );
+               mWidgetView.SetParentOrigin( ParentOrigin::TOP_LEFT );
+               mWidgetView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+               mWidgetView.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) );
+               mWidgetView.SetPosition( 0.0f, 0.0f );
+
+               mWidgetView.WidgetAddedSignal().Connect( this, &TBTDaliWidgetView::OnWidgetAdded );
+               mWidgetView.WidgetDeletedSignal().Connect( this, &TBTDaliWidgetView::OnWidgetDeleted );
+               //mWidgetView.WidgetCreationAbortedSignal().Connect( this, &TBTDaliWidgetView::onWidgetCreationAbortedSignal );
+               mWidgetView.WidgetContentUpdatedSignal().Connect( this, &TBTDaliWidgetView::onWidgetContentUpdatedSignal );
+               mWidgetView.WidgetFaultedSignal().Connect( this, &TBTDaliWidgetView::onWidgetFaultedSignal );
+               //this->ctlBody.Add(mWidgetView);
+               mTableView.AddChild(mWidgetView, TableView::CellPosition(4,0));
+               mTableView.SetFixedHeight(4, 0.9*bodySize.width/2);
+
+               mWidgetView_1 = mWidgetViewManager.AddWidget("org.example.widget", "", bodySize.width, 0.9*bodySize.width/2, 2000.0 );
+               mWidgetView_1.SetParentOrigin( ParentOrigin::TOP_LEFT );
+               mWidgetView_1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+               mWidgetView_1.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) );
+               mWidgetView_1.SetPosition( 0.0f, 0.0f );
+               //mWidgetView_1.WidgetCreationAbortedSignal().Connect( this, &TBTDaliWidgetView::onWidgetCreationAbortedSignal );
+
+               mTableView.AddChild(mWidgetView_1, TableView::CellPosition(5,0));
+               mTableView.SetFixedHeight(5, 0.9*bodySize.width/2);
+       }
 
        return true;
 }