diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 61fbf55179..f8c91e1268 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -932,7 +932,7 @@ void Layout::requestDoLayout() _doLayoutDirty = true; } -const Size Layout::getLayoutContentSize()const +Size Layout::getLayoutContentSize()const { return this->getSize(); } diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index e869f4f108..09086cbea7 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -40,7 +40,7 @@ public: virtual ~LayoutProtocol(){} virtual LayoutExecutant* createLayoutExecutant() = 0; - virtual const Size getLayoutContentSize()const = 0; + virtual Size getLayoutContentSize()const = 0; virtual const Vector& getLayoutElements()const = 0; virtual void doLayout() = 0; }; @@ -329,7 +329,7 @@ protected: virtual void doLayout()override; virtual LayoutExecutant* createLayoutExecutant()override; - virtual const Size getLayoutContentSize()const override; + virtual Size getLayoutContentSize()const override; virtual const Vector& getLayoutElements()const override; //clipping diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 780b34ea1d..53a0bd5ff2 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -596,6 +596,10 @@ public: } Widget* getCurrentFocusedWidget()const; + /* + * call this method with parameter true to enable the Android Dpad focus navigation feature + *@param enable set true to enable dpad focus navigation, otherwise disenable dpad focus navigation + */ static void enableDpadNavigation(bool enable); std::function onFocusChanged;