/foundation/arkui/ace_engine/frameworks/core/animation/ |
H A D | friction_motion.cpp | 29 FrictionMotion::FrictionMotion(double friction, double initPosition, double initVelocity) in FrictionMotion() argument 31 Reset(friction, initPosition, initVelocity); in FrictionMotion() 34 void FrictionMotion::Reset(double friction, double initPosition, double initVelocity, double threshold) in Reset() argument 36 if (!IsValid(friction)) { in Reset() 39 friction_ = friction * FRICTION_SCALE; in Reset() 57 bool FrictionMotion::IsValid(double friction) const in IsValid() 59 if (friction < 0.0 || NearZero(friction)) { in IsValid() 60 LOGE("Invalid friction:%{public}lf.", friction); in IsValid() [all...] |
H A D | friction_motion.h | 27 FrictionMotion(double friction, double initPosition, double initVelocity); 30 // Called when do a new friction motion 31 void Reset(double friction, double initPosition, double initVelocity, double threshold = DEFAULT_MULTIPLIER); 51 bool IsValid(double friction) const;
|
/foundation/arkui/ace_engine/test/unittest/core/pattern/scrollable/ |
H A D | scrollable_fling_test_ng.cpp | 93 * Set the friction is 0.6 in HWTEST_F() 102 float friction = 0.6f; in HWTEST_F() local 104 float finalPosition = correctVelocity / (friction * -frictionScale); in HWTEST_F() 107 scrollable->SetFriction(friction); in HWTEST_F() 178 * Set the friction is 0.6 in HWTEST_F() 187 float friction = 0.6f; in HWTEST_F() local 189 float finalPosition = correctVelocity / (friction * -frictionScale); in HWTEST_F() 192 scrollable->SetFriction(friction); in HWTEST_F() 265 * Set the friction is 0.6 in HWTEST_F() 274 float friction in HWTEST_F() local 371 float friction = 0.6f; HWTEST_F() local 458 float friction = 0.6f; HWTEST_F() local 548 float friction = 0.6f; HWTEST_F() local 626 float friction = 0.6f; HWTEST_F() local 716 float friction = 0.6f; HWTEST_F() local 804 float friction = 0.6f; HWTEST_F() local 896 float friction = 0.6f; HWTEST_F() local 981 float friction = 0.9f; HWTEST_F() local 1017 float friction = 0.9f; HWTEST_F() local 1102 float friction = 0.9f; HWTEST_F() local 1189 float friction = 0.9f; HWTEST_F() local 1286 float friction = 0.9f; HWTEST_F() local 1373 float friction = 0.9f; HWTEST_F() local 1463 float friction = 0.9f; HWTEST_F() local 1541 float friction = 0.6f; HWTEST_F() local [all...] |
/foundation/arkui/ace_engine/frameworks/bridge/cj_frontend/interfaces/cj_ffi/ |
H A D | cj_refresh_ffi.cpp | 27 void FfiOHOSAceFrameworkRefreshCreate(bool refreshing, double offsetValue, int32_t offsetUnit, int32_t friction) in FfiOHOSAceFrameworkRefreshCreate() argument 58 RefreshModel::GetInstance()->SetFriction(friction); in FfiOHOSAceFrameworkRefreshCreate() 59 if (friction <= 0) { in FfiOHOSAceFrameworkRefreshCreate() 65 int32_t offsetUnit, int32_t friction, void (*callback)(bool isRefreshing)) in FfiOHOSAceFrameworkRefreshCreateWithChangeEvent() 106 RefreshModel::GetInstance()->SetFriction(friction); in FfiOHOSAceFrameworkRefreshCreateWithChangeEvent() 107 if (friction <= 0) { in FfiOHOSAceFrameworkRefreshCreateWithChangeEvent() 64 FfiOHOSAceFrameworkRefreshCreateWithChangeEvent(bool refreshing, double offsetValue, int32_t offsetUnit, int32_t friction, void (*callback)(bool isRefreshing)) FfiOHOSAceFrameworkRefreshCreateWithChangeEvent() argument
|
H A D | cj_refresh_ffi.h | 26 bool refreshing, double offsetValue, int32_t offsetUnit, int32_t friction); 28 bool refreshing, double offsetValue, int32_t offsetUnit, int32_t friction, void (*callback)(bool isRefreshing));
|
/foundation/arkui/ace_engine/frameworks/core/components/refresh/ |
H A D | refresh_component.h | 228 void SetFriction(int32_t friction) in SetFriction() argument 230 if (friction >= MIN_FRICTION_RATIO && friction <= MAX_FRICTION_RATIO) { in SetFriction() 231 friction_ = friction; in SetFriction() 232 } else if (friction < MIN_FRICTION_RATIO) { in SetFriction()
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/scrollable/ |
H A D | scrollable.h | 87 TRANSITION, // in between two animations, i.e. from friction to spring 163 void SetUnstaticFriction(double friction) in SetUnstaticFriction() argument 165 friction_ = friction > 0.0 ? friction : -1.0; in SetUnstaticFriction() 170 double friction = friction_; in GetFriction() local 171 if (friction == -1.0) { in GetFriction() 173 friction = !NearZero(ret) ? ret : defaultFriction_; in GetFriction() 175 return friction; in GetFriction() 519 void TriggerFrictionAnimation(float mainPosition, float friction, float correctVelocity); 527 float final, float position, float signum, float friction, floa [all...] |
H A D | scrollable.cpp | 513 float friction = sFriction_.value_or(frictionTmp); in StartScrollAnimation() local 515 finalPosition_ = mainPosition + correctVelocity / (friction * -FRICTION_SCALE); in StartScrollAnimation() 537 TriggerFrictionAnimation(mainPosition, friction, correctVelocity); in StartScrollAnimation() 540 void Scrollable::TriggerFrictionAnimation(float mainPosition, float friction, float correctVelocity) in TriggerFrictionAnimation() argument 548 float response = fabs(2 * M_PI / (FRICTION_SCALE * friction)); in TriggerFrictionAnimation() 556 ACE_SCOPED_TRACE("Scrollable friction animation start, start:%f, end:%f, vel:%f, id:%d, tag:%s", mainPosition, in TriggerFrictionAnimation() 565 "Scrollable friction animation finish, id:%d, tag:%s", scroll->nodeId_, scroll->nodeTag_.c_str()); in TriggerFrictionAnimation() 663 float final, float position, float friction, float signum, float threshold) in GetFrictionVelocityByFinalPosition() 665 return DEFAULT_THRESHOLD * threshold * signum - (final - position) * friction; in GetFrictionVelocityByFinalPosition() 668 void Scrollable::InitFriction(double friction) in InitFriction() argument 662 GetFrictionVelocityByFinalPosition( float final, float position, float friction, float signum, float threshold) GetFrictionVelocityByFinalPosition() argument 688 float friction = sFriction_.value_or(friction_); FixScrollMotion() local [all...] |
/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/jsview/ |
H A D | js_refresh.cpp | 157 auto friction = paramObject->GetProperty("friction"); in Create() local 179 ParsFrictionData(friction); in Create() 299 void JSRefresh::ParsFrictionData(const JsiRef<JsiValue>& friction) in ParsFrictionData() argument 302 if (friction->IsString()) { in ParsFrictionData() 303 frictionNumber = StringUtils::StringToInt(friction->ToString()); in ParsFrictionData() 304 if ((frictionNumber == 0 && friction->ToString() != "0") || frictionNumber < 0 || in ParsFrictionData() 308 } else if (friction->IsNumber()) { in ParsFrictionData() 309 frictionNumber = friction->ToNumber<int32_t>(); in ParsFrictionData()
|
H A D | js_water_flow.cpp | 245 JSClass<JSWaterFlow>::StaticMethod("friction", &JSWaterFlow::SetFriction); in JSBind() 385 double friction = -1.0; in SetFriction() local 386 if (!JSViewAbstract::ParseJsDouble(info[0], friction)) { in SetFriction() 388 friction = -1.0; in SetFriction() 390 WaterFlowModel::GetInstance()->SetFriction(friction); in SetFriction()
|
/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/jsview/models/ |
H A D | refresh_model_impl.cpp | 80 void RefreshModelImpl::SetFriction(int32_t friction) in SetFriction() argument 85 component->SetFriction(friction); in SetFriction()
|
H A D | refresh_model_impl.h | 35 void SetFriction(int32_t friction) override;
|
H A D | scroll_model_impl.h | 52 void SetFriction(double friction) override {};
|
H A D | water_flow_model_impl.h | 53 void SetFriction(double friction) override {};
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/scroll/ |
H A D | scroll_model_ng.h | 55 void SetFriction(double friction) override; 68 static void SetFriction(FrameNode* frameNode, double friction);
|
H A D | scroll_model_ng.cpp | 322 void ScrollModelNG::SetFriction(FrameNode* frameNode, double friction) in SetFriction() argument 327 pattern->SetFriction(friction); in SetFriction() 429 void ScrollModelNG::SetFriction(double friction) in SetFriction() argument 435 pattern->SetFriction(friction); in SetFriction()
|
/foundation/arkui/ace_engine/frameworks/core/components/tab_bar/ |
H A D | render_tab_content.cpp | 355 double friction = GetFriction(std::abs(scrollOffset_) / contentHeight_); in GetOffset() local 356 return friction * delta; in GetOffset() 360 double friction = GetFriction(std::abs(scrollOffset_) / contentWidth_); in GetOffset() local 361 return friction * delta; in GetOffset()
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/grid/ |
H A D | grid_model_ng.cpp | 192 void GridModelNG::SetFriction(double friction) in SetFriction() argument 198 pattern->SetFriction(friction); in SetFriction() 496 void GridModelNG::SetFriction(FrameNode* frameNode, double friction) in SetFriction() argument 500 if (LessOrEqual(friction, 0.0)) { in SetFriction() 503 pattern->SetFriction(friction); in SetFriction()
|
H A D | grid_model_ng.h | 57 void SetFriction(double friction) override; 101 static void SetFriction(FrameNode* frameNode, double friction);
|
/foundation/arkui/ace_engine/test/unittest/core/pattern/scroll/ |
H A D | scroll_layout_test_ng.cpp | 31 * @tc.steps: step1. set friction less than 0 in HWTEST_F() 36 double friction = -1; in HWTEST_F() local 38 model.SetFriction(friction); in HWTEST_F() 43 * @tc.steps: step1. set friction more than 0 in HWTEST_F() 44 * @tc.expected: friction should be more than 0.0,if out of range,should be default value. in HWTEST_F() 46 friction = 10; in HWTEST_F() 48 model.SetFriction(friction); in HWTEST_F() 50 EXPECT_DOUBLE_EQ(pattern_->GetFriction(), friction); in HWTEST_F()
|
/foundation/arkui/ace_engine/frameworks/core/components/list/ |
H A D | layout_manager.h | 270 void SetFriction(double friction) in SetFriction() argument 272 friction_ = friction; in SetFriction()
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/waterflow/ |
H A D | water_flow_model_ng.h | 56 void SetFriction(double friction) override; 79 static void SetFriction(FrameNode* frameNode, double friction);
|
/foundation/arkui/ace_engine/frameworks/core/components_ng/pattern/refresh/ |
H A D | refresh_model.h | 40 virtual void SetFriction(int32_t friction) = 0;
|
/foundation/arkui/ace_engine/frameworks/core/components/scroll/ |
H A D | render_scroll.cpp | 399 double friction = easing ? CalculateFriction((overscrollPast - std::abs(offset)) / viewPortSize) in AdjustOffset() local 402 offset = direction * CalculateOffsetByFriction(overscrollPast, std::abs(offset), friction); in AdjustOffset() 411 double RenderScroll::CalculateOffsetByFriction(double extentOffset, double delta, double friction) in CalculateOffsetByFriction() argument 414 if (extentOffset > 0.0 && !NearZero(friction)) { in CalculateOffsetByFriction() 415 double deltaToLimit = extentOffset / friction; in CalculateOffsetByFriction() 417 return delta * friction; in CalculateOffsetByFriction()
|
/foundation/arkui/ace_engine/frameworks/core/interfaces/native/node/ |
H A D | grid_modifier.cpp | 330 void SetFriction(ArkUINodeHandle node, ArkUI_Float32 friction) in SetFriction() argument 334 GridModelNG::SetFriction(frameNode, friction); in SetFriction() 341 ArkUI_Float32 friction = -1.0; in ResetFriction() local 342 GridModelNG::SetFriction(frameNode, friction); in ResetFriction()
|