fix crash caused by layoutanimationcontroller

This commit is contained in:
侯歌 2021-12-16 17:59:23 +08:00
parent e56f078fdd
commit bcfbfc126e
3 changed files with 6 additions and 4 deletions

View File

@ -72,6 +72,7 @@ Animation* AnimationUtils::loadAnimation(Context* context,const std::string&resi
}
LayoutAnimationController* AnimationUtils::loadLayoutAnimation(Context* context,const std::string&resid){
return nullptr;
}
Animation* AnimationUtils::makeInAnimation(Context* c, bool fromLeft){

View File

@ -79,7 +79,7 @@ bool ViewGroup::DEBUG_DRAW = false;
ViewGroup::ViewGroup(Context*ctx,const AttributeSet& attrs):View(ctx,attrs){
initGroup();
initFromAttributes(ctx,attrs);
initFromAttributes(ctx,attrs);
}
ViewGroup::ViewGroup(int w,int h)
@ -126,8 +126,8 @@ void ViewGroup::initGroup(){
}
void ViewGroup::initFromAttributes(Context*ctx,const AttributeSet&atts){
setClipChildren(atts.getBoolean("clipChildren",false));
setClipToPadding(atts.getBoolean("clipToPadding",false));
setClipChildren(atts.getBoolean("clipChildren",true));
setClipToPadding(atts.getBoolean("clipToPadding",true));
//setAnimationCacheEnabled
std::string resid=atts.getString("layoutAnimation");
setLayoutAnimation(AnimationUtils::loadLayoutAnimation(ctx,resid));

View File

@ -119,7 +119,8 @@ View& Window::setSize(int cx,int cy){
}
void Window::onFinishInflate(){
requestLayout();
requestLayout();
startLayoutAnimation();
}
Canvas*Window::getCanvas(){