提交 5edde4cd 编写于 作者: G guyuanzhang

Description:add rotate log

Sig:graphic
Feature or Bugfix:Feature
Binary Source:No
Signed-off-by: Nguyuanzhang <zhangguyuan@huawei.com>
上级 17aca158
......@@ -582,11 +582,11 @@ void UISwipeView::Vibrator()
VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc();
if (vibratorFunc != nullptr && isRotating_) {
if (!loop_ && (curIndex_ == 0 || curIndex_ == childrenNum_ - 1)) {
vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE);
GRAPHIC_LOGI("UISwipeView::Vibrator calls TYPE_THREE vibrator");
vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE);
} else {
vibratorFunc(VibratorType::VIBRATOR_TYPE_ONE);
GRAPHIC_LOGI("UISwipeView::Vibrator calls TYPE_ONE vibrator");
vibratorFunc(VibratorType::VIBRATOR_TYPE_ONE);
}
}
}
......
......@@ -26,18 +26,14 @@ namespace OHOS {
* @since 5.0
* @version 3.0
*/
enum class VibratorType {
VIBRATOR_TYPE_ONE,
VIBRATOR_TYPE_TWO,
VIBRATOR_TYPE_THREE
};
enum class VibratorType { VIBRATOR_TYPE_ONE, VIBRATOR_TYPE_TWO, VIBRATOR_TYPE_THREE };
/**
* @brief vibrator function.
*
* @param vibratorType vibrator type.
*/
typedef void(*VibratorFunc)(VibratorType vibratorType);
typedef void (*VibratorFunc)(VibratorType vibratorType);
class VibratorManager {
public:
......@@ -52,6 +48,7 @@ public:
void RegisterVibratorFunc(VibratorFunc vibratorFunc)
{
GRAPHIC_LOGI("VibratorManager::RegisterVibratorFunc");
vibratorFunc_ = vibratorFunc;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册