128 lines
3.3 KiB
C++
128 lines
3.3 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2024. All rights reserved.
|
|
*
|
|
* Description:
|
|
*
|
|
* Author: huangshuyi
|
|
*
|
|
* Create: 2024-4
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include <string>
|
|
#include <iostream>
|
|
#include "View.h"
|
|
|
|
#include "components/root_view.h"
|
|
#include "ChangeSliceListener.h"
|
|
#include "TjdUiMessageParticularPresenter.h"
|
|
#include "TjdUiAppMainView.h"
|
|
#include "TjdUiAppIds.h"
|
|
#include "NativeAbility.h"
|
|
#include "TransitionType.h"
|
|
#include "dock/input_device.h"
|
|
#include "sys_config.h"
|
|
#include "TjdUiScreenManage.h"
|
|
#include "TjdUiRegisterManager.h"
|
|
|
|
using namespace OHOS;
|
|
namespace TJD {
|
|
|
|
TJD_REGIST_SLICE(TJD_APP_VIEW_MESSAGE_PARTICULAR, TjdUiMessageParticularView, TjdUiMessageParticularPresenter);
|
|
|
|
#define ENABLE_PRINT_INFO 1
|
|
#if ENABLE_PRINT_INFO
|
|
#define static_print_info(...) sys_ui_log_i(__VA_ARGS__) //一般信息打印宏控制
|
|
#define static_print_warn(...) sys_ui_log_w(__VA_ARGS__) //警告信息打印一般常开
|
|
#define static_print_error(...) sys_ui_log_e(__VA_ARGS__) //错误信息打印一般常开
|
|
#define static_print_debug(...) sys_ui_log_d(__VA_ARGS__)
|
|
#else
|
|
#define static_print_info(...)
|
|
#define static_print_warn(...)
|
|
#define static_print_error(...)
|
|
#define static_print_debug(...)
|
|
#endif
|
|
|
|
|
|
static TjdUiMessageParticularPresenter *g_pMessageParticularPresenter = nullptr;
|
|
|
|
TjdUiMessageParticularPresenter::TjdUiMessageParticularPresenter()
|
|
{
|
|
g_pMessageParticularPresenter = this;
|
|
}
|
|
|
|
TjdUiMessageParticularPresenter::~TjdUiMessageParticularPresenter()
|
|
{
|
|
g_pMessageParticularPresenter = nullptr;
|
|
}
|
|
|
|
TjdUiMessageParticularPresenter *TjdUiMessageParticularPresenter::GetInstance(void)
|
|
{
|
|
return g_pMessageParticularPresenter;
|
|
}
|
|
|
|
void TjdUiMessageParticularPresenter::OnStart()
|
|
{
|
|
TjdUiCommonOnKeyListener::GetInstance()->SetOnKeyActListener(this, KeyModelType::APP_KEY_TYPE);
|
|
static_print_debug("TjdUiMessageParticularPresenter::OnStart");
|
|
}
|
|
|
|
void TjdUiMessageParticularPresenter::OnPause()
|
|
{
|
|
|
|
}
|
|
|
|
void TjdUiMessageParticularPresenter::OnResume()
|
|
{
|
|
|
|
}
|
|
|
|
bool TjdUiMessageParticularPresenter::OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event)
|
|
{
|
|
static_print_debug("drag start\n");
|
|
|
|
return false;
|
|
}
|
|
|
|
bool TjdUiMessageParticularPresenter::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event)
|
|
{
|
|
static_print_debug("drag end\n");
|
|
return false;
|
|
}
|
|
|
|
bool TjdUiMessageParticularPresenter::OnDrag(OHOS::UIView& view, const OHOS::DragEvent& event)
|
|
{
|
|
static_print_debug("draging\n");
|
|
return false;
|
|
}
|
|
|
|
void TjdUiMessageParticularPresenter::OnSwipe(UISwipeView &view)
|
|
{
|
|
int page = view.GetCurrentPage();
|
|
static_print_debug("swipe done page:%d\n", page);
|
|
}
|
|
|
|
void TjdUiMessageParticularPresenter::OnStop()
|
|
{
|
|
TjdUiCommonOnKeyListener::GetInstance()->ClearOnKeyActListener(KeyModelType::APP_KEY_TYPE);
|
|
}
|
|
|
|
bool TjdUiMessageParticularPresenter::OnClick(UIView &view, const ClickEvent &event)
|
|
{
|
|
|
|
return true;
|
|
}
|
|
|
|
bool TjdUiMessageParticularPresenter::OnKeyAct(OHOS::UIView& view, const OHOS::KeyEvent& event)
|
|
{
|
|
if(!TjdUiCommonOnKeyListener::CheckIsExitEvent(event)) {
|
|
return true;
|
|
}
|
|
OHOS::NativeAbility::GetInstance().ChangePreSlice();
|
|
return false;
|
|
}
|
|
|
|
} // namespace OHOS
|
|
|