if (preSlice == VIEW_APPLIST)
{
NativeAbility::GetInstance().ChangeSlice(preSlice);
+ return true;
}
else
{
NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+ return true;
}
}
return false;
SystemViewOnDragListener() {}\r
~SystemViewOnDragListener() {}\r
bool OnDrag(UIView &view, const DragEvent &event) override;\r
+ bool OnDragEnd(UIView &view, const DragEvent &event) override;\r
};\r
\r
class SystemView;\r
/* ---------------------- SimplifiedChineseRadioButton ---------------------- */\r
RadioButtonConfig radioButtonConfig = {\r
.left = 300,\r
- .top = 120,\r
- .width = 100,\r
- .height = 100,\r
+ .top = 130,\r
+ .width = 80,\r
+ .height = 80,\r
.name = "LanguageCategory",\r
.viewId = SIMPLIFIED_CHINESE_CHECKBOX,\r
.select = "/user/res/CHECKBOX_ON.bin",\r
scrollView->Add(SimplifiedChineseRadioButton);\r
/* --------------------------- EnglishRadioButton --------------------------- */\r
radioButtonConfig.left = 300;\r
- radioButtonConfig.top = 240;\r
+ radioButtonConfig.top = 250;\r
radioButtonConfig.viewId = ENGLISH_CHECKBOX;\r
EnglishRadioButton = SetUpRadioButton(radioButtonConfig);\r
if (EnglishRadioButton == nullptr)\r
// 该拖拽是用来处理系统视图(slice)的左滑退出事件和子视图的左滑退出到系统视图区分开\r
bool SystemViewOnDragListener::OnDrag(UIView &view, const DragEvent &event)\r
{\r
- if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) &&\r
- (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))\r
+ return true;\r
+ }\r
+\r
+ bool SystemViewOnDragListener::OnDragEnd(UIView &view, const DragEvent &event)\r
+ {\r
+ if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT))\r
{\r
NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING);\r
}\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to English language");\r
}\r
m_label->SetTextId(11);\r
- //强制刷新\r
+ // 强制刷新\r
m_label->ForceResetText();\r
RootView::GetInstance()->Invalidate();\r
break;\r