!40738 bugfix cj swiper enabled

Merge pull request !40738 from Ad0nis/bugfix_enabled_5.0
This commit is contained in:
openharmony_ci 2024-08-22 13:32:32 +00:00 committed by Gitee
commit 0a8bd2dc1d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "core/components/text/text_component.h"
#include "core/components/theme/theme_manager.h"
#include "core/components_ng/base/view_abstract.h"
#include "core/components_ng/base/view_abstract_model.h"
#include "core/components_ng/base/view_stack_processor.h"
#include "core/components_v2/extensions/events/on_area_change_extension.h"
#include "core/gestures/long_press_gesture.h"
@ -60,4 +61,9 @@ RefPtr<ThemeConstants> ViewAbstract::GetThemeConstants()
return themeManager->GetThemeConstants();
}
void ViewAbstract::CjEnabled(bool enabled)
{
ViewAbstractModel::GetInstance()->SetEnabled(enabled);
}
} // namespace OHOS::Ace::Framework

View File

@ -90,6 +90,7 @@ public:
}
static RefPtr<ThemeConstants> GetThemeConstants();
static void CjEnabled(bool enabled);
};
} // namespace OHOS::Ace::Framework

View File

@ -18,6 +18,7 @@
#include <cinttypes>
#include "bridge/cj_frontend/cppview/swiper_controller.h"
#include "bridge/cj_frontend/cppview/view_abstract.h"
#include "cj_lambda.h"
#include "bridge/cj_frontend/interfaces/cj_ffi/utils.h"
#include "bridge/common/utils/utils.h"
@ -166,6 +167,7 @@ void FfiOHOSAceFrameworkSwiperSetCachedCount(int32_t cachedCount)
void FfiOHOSAceFrameworkSwiperSetEnabled(bool value)
{
ViewAbstract::CjEnabled(value);
SwiperModel::GetInstance()->SetEnabled(value);
}