577 lines
18 KiB
C++
577 lines
18 KiB
C++
#include "TjdUiAppVideoCtrlView.h"
|
|
#include "NativeAbility.h"
|
|
#include "TjdUiImageIds.h"
|
|
#include "TjdUiMultiLanguageExt.h"
|
|
#include "common/image_cache_manager.h"
|
|
#include "sys_config.h"
|
|
#include "ble_port_protocol.h"
|
|
#include "ble_api.h"
|
|
// #include "gfx_utils/mem_check.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include "ble_api.h"
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
using namespace OHOS;
|
|
|
|
#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
|
|
|
|
typedef struct {
|
|
uint8_t report_id; // Report ID (0x01 for Input report)
|
|
uint8_t buttons; // Bit fields for mouse buttons
|
|
int8_t wheel; // Scroll wheel value
|
|
int8_t pan; // Pan value (for example, horizontal pan)
|
|
} MouseButtonsReport;
|
|
|
|
// Report ID 2: Mouse motion
|
|
typedef struct {
|
|
int32_t report_id:8; // Report ID (0x01 for Input report)
|
|
int32_t x:12; // X-axis motion
|
|
int32_t y:12; // Y-axis motion
|
|
} MouseMotionReport;
|
|
|
|
// Report ID 3: Advanced buttons
|
|
typedef struct {
|
|
uint8_t report_id; // Report ID (0x01 for Input report)
|
|
uint8_t playPause:1; // Play/Pause button (1 bit)
|
|
uint8_t consumerControlConfig:1; // Consumer Control Configuration (1 bit)
|
|
uint8_t scanNextTrack:1; // Scan Next Track (1 bit)
|
|
uint8_t scanPreviousTrack:1; // Scan Previous Track (1 bit)
|
|
uint8_t volumeDown:1; // Volume Down (1 bit)
|
|
uint8_t volumeUp:1; // Volume Up (1 bit)
|
|
uint8_t forward:1; // AC Forward (1 bit)
|
|
uint8_t back:1; // AC Back (1 bit)
|
|
} AdvancedButtonsReport;
|
|
|
|
namespace TJD {
|
|
|
|
#define IMAGE_BIN_PATH TJD_IMAGE_PATH "img_video_ctrl.bin"
|
|
|
|
static TjdUiAppVideoCtrlView *g_pv_AppVideoCtrlView = nullptr;
|
|
|
|
void touch_up(void)
|
|
{
|
|
// MouseMotionReport mouse_motion_report = {0};
|
|
// mouse_motion_report.report_id = 2;
|
|
// mouse_motion_report.x = -1500;
|
|
// mouse_motion_report.y = -2000;
|
|
// tjd_ble_hid_server_send_input_report(&mouse_motion_report, sizeof(mouse_motion_report));
|
|
|
|
// osDelay(150);
|
|
|
|
MouseButtonsReport mouse_report = {0};
|
|
mouse_report.report_id = 1;
|
|
mouse_report.buttons = 0;
|
|
mouse_report.wheel = 40;
|
|
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
mouse_report.wheel = 60;
|
|
for(int i = 1; i < 3; i++) {
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
osDelay(150);
|
|
mouse_report.wheel = 60;
|
|
}
|
|
memset_s(&mouse_report, sizeof(mouse_report), 0, sizeof(mouse_report));
|
|
mouse_report.report_id = 1;
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
}
|
|
|
|
void touch_down(void)
|
|
{
|
|
// MouseMotionReport mouse_motion_report = {0};
|
|
// mouse_motion_report.report_id = 2;
|
|
// mouse_motion_report.x = 500;
|
|
// mouse_motion_report.y = 500;
|
|
// tjd_ble_hid_server_send_input_report(&mouse_motion_report, sizeof(mouse_motion_report));
|
|
|
|
// osDelay(150);
|
|
|
|
MouseButtonsReport mouse_report = {0};
|
|
mouse_report.report_id = 1;
|
|
mouse_report.buttons = 0;
|
|
mouse_report.wheel = -40;
|
|
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
mouse_report.wheel = -60;
|
|
for(int i = 1; i < 3; i++) {
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
osDelay(150);
|
|
mouse_report.wheel = -60;
|
|
}
|
|
memset_s(&mouse_report, sizeof(mouse_report), 0, sizeof(mouse_report));
|
|
mouse_report.report_id = 1;
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
}
|
|
|
|
void touch_one_click(void)
|
|
{
|
|
// MouseMotionReport mouse_motion_report = {0};
|
|
// mouse_motion_report.report_id = 2;
|
|
// mouse_motion_report.x = 2047;
|
|
// mouse_motion_report.y = 0;
|
|
|
|
// tjd_ble_hid_server_send_input_report(&mouse_motion_report, sizeof(mouse_motion_report));
|
|
|
|
// osDelay(150);
|
|
|
|
MouseButtonsReport mouse_report = {0};
|
|
mouse_report.report_id = 1;
|
|
mouse_report.buttons = 1;
|
|
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
osDelay(150);
|
|
|
|
memset_s(&mouse_report, sizeof(mouse_report), 0, sizeof(mouse_report));
|
|
mouse_report.report_id = 1;
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
}
|
|
|
|
void touch_double_click(void)
|
|
{
|
|
MouseButtonsReport mouse_report = {0};
|
|
mouse_report.report_id = 1;
|
|
mouse_report.buttons = 1;
|
|
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
memset_s(&mouse_report, sizeof(mouse_report), 0, sizeof(mouse_report));
|
|
mouse_report.report_id = 1;
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
osDelay(150);
|
|
mouse_report.report_id = 1;
|
|
mouse_report.buttons = 1;
|
|
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
|
|
memset_s(&mouse_report, sizeof(mouse_report), 0, sizeof(mouse_report));
|
|
mouse_report.report_id = 1;
|
|
tjd_ble_hid_server_send_input_report(&mouse_report, sizeof(mouse_report));
|
|
}
|
|
|
|
void volume_up(void)
|
|
{
|
|
AdvancedButtonsReport advanced_report = {0};
|
|
advanced_report.report_id = 3;
|
|
advanced_report.volumeUp = 1;
|
|
tjd_ble_hid_server_send_input_report(&advanced_report, sizeof(advanced_report));
|
|
|
|
osDelay(150);
|
|
|
|
memset_s(&advanced_report, sizeof(advanced_report), 0, sizeof(advanced_report));
|
|
advanced_report.report_id = 3;
|
|
tjd_ble_hid_server_send_input_report(&advanced_report, sizeof(advanced_report));
|
|
}
|
|
|
|
void volume_down(void)
|
|
{
|
|
AdvancedButtonsReport advanced_report = {0};
|
|
advanced_report.report_id = 3;
|
|
advanced_report.volumeDown = 1;
|
|
tjd_ble_hid_server_send_input_report(&advanced_report, sizeof(advanced_report));
|
|
|
|
osDelay(150);
|
|
|
|
memset_s(&advanced_report, sizeof(advanced_report), 0, sizeof(advanced_report));
|
|
advanced_report.report_id = 3;
|
|
tjd_ble_hid_server_send_input_report(&advanced_report, sizeof(advanced_report));
|
|
}
|
|
|
|
static int16_t HorizontalCenter(int16_t width) { return (OHOS::HORIZONTAL_RESOLUTION - width) / 2; }
|
|
|
|
static void TimerCallback_(void *param) { TjdUiAppVideoCtrlView::GetInstance()->TimerToReturn(); }
|
|
|
|
class VideoCtrlOnClickedListener : public UIView::OnClickListener
|
|
{
|
|
public:
|
|
VideoCtrlOnClickedListener() {}
|
|
virtual ~VideoCtrlOnClickedListener() {}
|
|
virtual bool OnClick(UIView &view, const ClickEvent &event)
|
|
{
|
|
if (view.GetViewId() == "playOrPause") {
|
|
static_print_debug("playOrPause");
|
|
touch_one_click();
|
|
}else if(view.GetViewId() == "nextTrack") {
|
|
static_print_debug("nextTrack");
|
|
touch_down();
|
|
}else if (view.GetViewId() == "previousTrack") {
|
|
static_print_debug("previousTrack");
|
|
touch_up();
|
|
}else if (view.GetViewId() == "volumeUp") {
|
|
static_print_debug("volumeUp");
|
|
volume_up();
|
|
}else if (view.GetViewId() == "volumeDown") {
|
|
static_print_debug("volumeDown");
|
|
volume_down();
|
|
}else if (view.GetViewId() == "like") {
|
|
static_print_debug("like");
|
|
touch_double_click();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private:
|
|
};
|
|
|
|
static void InitLabel(OHOS::UILabel &label, uint8_t size, int16_t y, const char *text)
|
|
{
|
|
label.SetFont(TJD_VECTOR_FONT_FILENAME, size);
|
|
label.SetText(text);
|
|
label.SetLineBreakMode(OHOS::UILabel::LINE_BREAK_ADAPT);
|
|
label.SetAlign(OHOS::TEXT_ALIGNMENT_CENTER, OHOS::TEXT_ALIGNMENT_CENTER);
|
|
label.SetPosition(HorizontalCenter(label.GetWidth()), y);
|
|
}
|
|
|
|
static void InitImage(OHOS::UIImageView &imageView, int16_t x, int16_t y, uint32_t resId, const char *imageViewId)
|
|
{
|
|
imageView.SetPosition(x, y);
|
|
OHOS::ImageInfo *imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, IMAGE_BIN_PATH);
|
|
if (imgInfo != nullptr) {
|
|
imageView.SetSrc(imgInfo);
|
|
}
|
|
imageView.SetTouchable(true);
|
|
imageView.SetViewId(imageViewId);
|
|
imageView.SetOnClickListener(new VideoCtrlOnClickedListener());
|
|
}
|
|
|
|
static void InitButton(OHOS::UIButton &button, int16_t x, int16_t y, int16_t width, int16_t height,
|
|
uint32_t defaultResId, uint32_t traResId, const char *buttonViewId)
|
|
{
|
|
button.SetPosition(x, y, width, height);
|
|
button.SetViewId(buttonViewId);
|
|
button.SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
button.SetStyleForState(STYLE_BACKGROUND_OPA, 0, OHOS::UIButton::PRESSED);
|
|
OHOS::ImageInfo *defaultImgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(defaultResId, IMAGE_BIN_PATH);
|
|
OHOS::ImageInfo *traImgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(traResId, IMAGE_BIN_PATH);
|
|
if (defaultImgInfo != nullptr && traImgInfo != nullptr) {
|
|
button.SetImageSrc(defaultImgInfo, traImgInfo);
|
|
}
|
|
button.SetOnClickListener(new VideoCtrlOnClickedListener());
|
|
button.SetVisible(true);
|
|
}
|
|
|
|
TjdUiAppVideoCtrlView::TjdUiAppVideoCtrlView()
|
|
{
|
|
// OHOS::MemCheck::GetInstance()->EnableLeakCheck(true);
|
|
g_pv_AppVideoCtrlView = this;
|
|
}
|
|
|
|
TjdUiAppVideoCtrlView::~TjdUiAppVideoCtrlView()
|
|
{
|
|
g_pv_AppVideoCtrlView = nullptr;
|
|
// OHOS::MemCheck::GetInstance()->EnableLeakCheck(false);
|
|
}
|
|
|
|
TjdUiAppVideoCtrlView *TjdUiAppVideoCtrlView::GetInstance(void) { return g_pv_AppVideoCtrlView; }
|
|
|
|
void TjdUiAppVideoCtrlView::OnStart()
|
|
{
|
|
static_print_debug("TjdUiAppVideoCtrlView::OnStart()");
|
|
|
|
if (container_ == nullptr) {
|
|
container_ = new UIViewGroup();
|
|
}
|
|
|
|
if (onClickListener_ == nullptr) {
|
|
onClickListener_ = dynamic_cast<UIView::OnClickListener *>(TjdUiAppVideoCtrlPresenter::GetInstance());
|
|
}
|
|
|
|
if (OnDragListener_ == nullptr) {
|
|
OnDragListener_ = dynamic_cast<UIView::OnDragListener *>(TjdUiAppVideoCtrlPresenter::GetInstance());
|
|
}
|
|
groupList_[VideoCtrlView::VIDEOCTRL_LINKVIEW] = InitLinkBleView();
|
|
groupList_[VideoCtrlView::VIDEOCTRL_CTRLVIEW] = InitVideoCtrlView();
|
|
container_->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION);
|
|
container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
container_->SetOnDragListener(TjdUiAppVideoCtrlPresenter::GetInstance());
|
|
container_->Add(groupList_[VideoCtrlView::VIDEOCTRL_LINKVIEW]);
|
|
container_->Add(groupList_[VideoCtrlView::VIDEOCTRL_CTRLVIEW]);
|
|
// RootView::GetInstance()->Add(container_);
|
|
AddViewToRootContainer(container_);
|
|
if (tjd_get_ble_is_connect()) {
|
|
ShowVideoCtrlView(VideoCtrlView::VIDEOCTRL_LINKVIEW);
|
|
} else {
|
|
ShowLinkBleView(VideoCtrlView::VIDEOCTRL_CTRLVIEW);
|
|
if (timerToReturn_ == nullptr) {
|
|
timerToReturn_ = new OHOS::GraphicTimer(2000, TimerCallback_, nullptr, false);
|
|
}
|
|
timerToReturn_->Start();
|
|
}
|
|
}
|
|
|
|
void TjdUiAppVideoCtrlView::OnStop()
|
|
{
|
|
printf("TjdUiAppVideoCtrlView::OnStop()\n");
|
|
// RootView::GetInstance()->Remove(container_);
|
|
if (container_ != nullptr) {
|
|
container_->RemoveAll();
|
|
delete container_;
|
|
container_ = nullptr;
|
|
}
|
|
|
|
for (int i = 0; i < VIDEOCTRL_MAXTHVIEW; i++) {
|
|
if (groupList_[i] == nullptr) {
|
|
continue;
|
|
}
|
|
groupList_[i]->RemoveAll();
|
|
delete groupList_[i];
|
|
groupList_[i] = nullptr;
|
|
}
|
|
|
|
if (onClickListener_ != nullptr) {
|
|
delete onClickListener_;
|
|
onClickListener_ = nullptr;
|
|
}
|
|
|
|
if (OnDragListener_ != nullptr) {
|
|
delete OnDragListener_;
|
|
OnDragListener_ = nullptr;
|
|
}
|
|
|
|
if (linkBleView_ != nullptr) {
|
|
delete linkBleView_;
|
|
linkBleView_ = nullptr;
|
|
}
|
|
|
|
if (ctrlView_ != nullptr) {
|
|
delete ctrlView_;
|
|
ctrlView_ = nullptr;
|
|
}
|
|
|
|
if (playOrPause != nullptr) {
|
|
delete playOrPause;
|
|
playOrPause = nullptr;
|
|
}
|
|
|
|
if (nextTrack != nullptr) {
|
|
delete nextTrack;
|
|
nextTrack = nullptr;
|
|
}
|
|
|
|
if (previousTrack != nullptr) {
|
|
delete previousTrack;
|
|
previousTrack = nullptr;
|
|
}
|
|
|
|
if (volumeUp != nullptr) {
|
|
delete volumeUp;
|
|
volumeUp = nullptr;
|
|
}
|
|
|
|
if (volumeDown != nullptr) {
|
|
delete volumeDown;
|
|
volumeDown = nullptr;
|
|
}
|
|
|
|
if (like != nullptr) {
|
|
delete like;
|
|
like = nullptr;
|
|
}
|
|
|
|
if (linkBleView != nullptr) {
|
|
delete linkBleView;
|
|
linkBleView = nullptr;
|
|
}
|
|
|
|
if (ctrlViewBJ != nullptr) {
|
|
delete ctrlViewBJ;
|
|
ctrlViewBJ = nullptr;
|
|
}
|
|
|
|
if (lblTip_linkBleView != nullptr) {
|
|
delete lblTip_linkBleView;
|
|
lblTip_linkBleView = nullptr;
|
|
}
|
|
|
|
if (lblTitle_ctrlView != nullptr) {
|
|
delete lblTitle_ctrlView;
|
|
lblTitle_ctrlView = nullptr;
|
|
}
|
|
|
|
if (timerToReturn_ != nullptr) {
|
|
delete timerToReturn_;
|
|
timerToReturn_ = nullptr;
|
|
}
|
|
}
|
|
|
|
void TjdUiAppVideoCtrlView::ChangedView(VideoCtrlView view, VideoCtrlView hideView)
|
|
{
|
|
static_print_debug("TjdUiAppVideoCtrlView::ChangedView...");
|
|
if (view >= VIDEOCTRL_MAXTHVIEW) {
|
|
return;
|
|
}
|
|
if (viewMapper_[view] == nullptr) {
|
|
return;
|
|
}
|
|
(GetInstance()->*viewMapper_[view])(hideView);
|
|
}
|
|
|
|
void TjdUiAppVideoCtrlView::TimerToReturn()
|
|
{
|
|
timerToReturn_->Stop();
|
|
delete timerToReturn_;
|
|
timerToReturn_ = nullptr;
|
|
OHOS::NativeAbility::GetInstance().ChangePreSlice();
|
|
}
|
|
|
|
OHOS::UIViewGroup *TjdUiAppVideoCtrlView::InitLinkBleView()
|
|
{
|
|
static_print_info("TjdUiAppVideoCtrlView::InitLinkBleView()");
|
|
if (linkBleView_ == nullptr) {
|
|
linkBleView_ = new UIViewGroup();
|
|
}
|
|
linkBleView_->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION);
|
|
linkBleView_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
linkBleView_->SetVisible(false);
|
|
|
|
if (lblTip_linkBleView == nullptr) {
|
|
lblTip_linkBleView = new UILabel();
|
|
}
|
|
InitLabel(*lblTip_linkBleView, 28, 305, "请连接APP");
|
|
linkBleView_->Add(lblTip_linkBleView);
|
|
|
|
if (linkBleView == nullptr) {
|
|
linkBleView = new UIImageView();
|
|
}
|
|
linkBleView->SetPosition(67, 155);
|
|
imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMAGES_VIDEO_CTRL_SUCCESS, IMAGE_BIN_PATH);
|
|
if (imgInfo != nullptr) {
|
|
linkBleView->SetSrc(imgInfo);
|
|
}
|
|
linkBleView_->Add(linkBleView);
|
|
|
|
return linkBleView_;
|
|
}
|
|
|
|
OHOS::UIViewGroup *TjdUiAppVideoCtrlView::InitVideoCtrlView()
|
|
{
|
|
static_print_info("TjdUiAppVideoCtrlView::InitVideoCtrlView()");
|
|
if (ctrlView_ == nullptr) {
|
|
ctrlView_ = new UIScrollView();
|
|
}
|
|
ctrlView_->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION);
|
|
ctrlView_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
ctrlView_->SetOnDragListener(onDragListener_);
|
|
ctrlView_->SetVisible(false);
|
|
|
|
if(ctrlViewBJ == nullptr){
|
|
ctrlViewBJ = new UIImageView();
|
|
}
|
|
InitImage(*ctrlViewBJ, 0, 0, IMAGES_VIDEO_CTRL_BJ, "ctrlViewBJ");
|
|
ctrlView_->Add(ctrlViewBJ);
|
|
|
|
if (lblTitle_ctrlView == nullptr) {
|
|
lblTitle_ctrlView = new UILabel();
|
|
}
|
|
InitLabel(*lblTitle_ctrlView, 28, 17, "短视频遥控");
|
|
lblTitle_ctrlView->SetTextColor(Color::GetColorFromRGBA(0xE9, 0x42, 0x00, 0xff));
|
|
ctrlView_->Add(lblTitle_ctrlView);
|
|
|
|
if (playOrPause == nullptr) {
|
|
playOrPause = new UIButton();
|
|
}
|
|
InitButton(*playOrPause, 116, 110, 235, 235, IMAGES_VIDEO_CTRL_PLAY_PAUSE, IMAGES_VIDEO_CTRL_PLAY_PAUSE_CLICK,
|
|
"playOrPause");
|
|
ctrlView_->Add(playOrPause);
|
|
|
|
if (nextTrack == nullptr) {
|
|
nextTrack = new UIButton();
|
|
}
|
|
InitButton(*nextTrack, 311, 69, 131, 131, IMAGES_VIDEO_CTRL_GO, IMAGES_VIDEO_CTRL_GO_CLICK, "nextTrack");
|
|
ctrlView_->Add(nextTrack);
|
|
|
|
if (previousTrack == nullptr) {
|
|
previousTrack = new UIButton();
|
|
}
|
|
InitButton(*previousTrack, 25, 69, 131, 131, IMAGES_VIDEO_CTRL_BACK, IMAGES_VIDEO_CTRL_BACK_CLICK, "previousTrack");
|
|
ctrlView_->Add(previousTrack);
|
|
|
|
if (volumeUp == nullptr) {
|
|
volumeUp = new UIButton();
|
|
}
|
|
InitButton(*volumeUp, 311, 254, 131, 131, IMAGES_VIDEO_CTRL_ADD, IMAGES_VIDEO_CTRL_ADD_CLICK, "volumeUp");
|
|
ctrlView_->Add(volumeUp);
|
|
|
|
if (volumeDown == nullptr) {
|
|
volumeDown = new UIButton();
|
|
}
|
|
InitButton(*volumeDown, 25, 254, 131, 131, IMAGES_VIDEO_CTRL_REDUCE, IMAGES_VIDEO_CTRL_REDUCE_CLICK, "volumeDown");
|
|
ctrlView_->Add(volumeDown);
|
|
|
|
if (like == nullptr) {
|
|
like = new UIButton();
|
|
}
|
|
InitButton(*like, 52, 380, 362, 86, IMAGES_VIDEO_CTRL_LIKE, IMAGES_VIDEO_CTRL_LIKE_CLICK, "like");
|
|
ctrlView_->Add(like);
|
|
|
|
return ctrlView_;
|
|
}
|
|
|
|
bool TjdUiAppVideoCtrlView::ShowLinkBleView(VideoCtrlView hideView)
|
|
{
|
|
static_print_info("TjdUiAppVideoCtrlView::ShowLinkBleView()");
|
|
|
|
if (groupList_[hideView] == nullptr) {
|
|
static_print_info("groupList_ is nullptr");
|
|
return false;
|
|
}
|
|
groupList_[hideView]->SetVisible(false);
|
|
|
|
if (groupList_[VideoCtrlView::VIDEOCTRL_LINKVIEW] == nullptr) {
|
|
static_print_info("groupList_ is nullptr");
|
|
return false;
|
|
}
|
|
groupList_[VideoCtrlView::VIDEOCTRL_LINKVIEW]->SetVisible(true);
|
|
groupList_[VideoCtrlView::VIDEOCTRL_LINKVIEW]->Invalidate();
|
|
|
|
return true;
|
|
}
|
|
|
|
bool TjdUiAppVideoCtrlView::ShowVideoCtrlView(VideoCtrlView hideView)
|
|
{
|
|
static_print_info("TjdUiAppVideoCtrlView::ShowVideoCtrlView()");
|
|
|
|
if (groupList_[hideView] == nullptr) {
|
|
static_print_info("groupList_ is nullptr");
|
|
return false;
|
|
}
|
|
groupList_[hideView]->SetVisible(false);
|
|
|
|
if (groupList_[VideoCtrlView::VIDEOCTRL_CTRLVIEW] == nullptr) {
|
|
static_print_info("groupList_ is nullptr");
|
|
return false;
|
|
}
|
|
groupList_[VideoCtrlView::VIDEOCTRL_CTRLVIEW]->SetVisible(true);
|
|
groupList_[VideoCtrlView::VIDEOCTRL_CTRLVIEW]->Invalidate();
|
|
|
|
return true;
|
|
}
|
|
|
|
} // namespace TJD
|
|
|
|
// void tjd_into_photo(void)
|
|
// {
|
|
// OHOS::NativeAbility::GetInstance().ChangeSlice(TJD_APP_VIEW_VIDEOCTRL);
|
|
// }
|