90 lines
2.4 KiB
C++
90 lines
2.4 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2025. All rights reserved.
|
|
*
|
|
* Description: TjdUiAppPlayerAdapter.h
|
|
*
|
|
* Author: luziquan@ss-tjd.com
|
|
*
|
|
* Create: 2025-01-02
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#ifndef TJD_UI_APP_PLAYER_ADAPTER_H
|
|
#define TJD_UI_APP_PLAYER_ADAPTER_H
|
|
|
|
#include "TjdUiAppPlayerModel.h"
|
|
#include "TjdUiAppPlayerPresenter.h"
|
|
#include "components/abstract_adapter.h"
|
|
#include "components/tjd_ui_transform_list_group.h"
|
|
#include "components/ui_image_animator.h"
|
|
#include "components/ui_image_view.h"
|
|
#include "components/ui_label.h"
|
|
#include "components/ui_list.h"
|
|
#include "components/ui_view.h"
|
|
#include "components/ui_view_group.h"
|
|
#include "cstdint"
|
|
#include "gfx_utils/sys_info.h"
|
|
|
|
namespace TJD {
|
|
|
|
enum class PlayerDeviceType
|
|
{
|
|
DEVICE_PHONE = 0,
|
|
DEVICE_WATCH,
|
|
DEVICE_HEADSET,
|
|
};
|
|
|
|
struct DeviceSelectListItemInfo
|
|
{
|
|
PlayerDeviceType deviceIndex;
|
|
uint16_t textId;
|
|
bool state;
|
|
bool active;
|
|
OHOS::ImageInfo *iconInfo;
|
|
OHOS::ImageInfo *selectInfo;
|
|
OHOS::ImageInfo *unSelectInfo;
|
|
};
|
|
|
|
class DeviceSelectListItemView : public ItemConstructor<DeviceSelectListItemInfo>
|
|
{
|
|
public:
|
|
DeviceSelectListItemView(const DeviceSelectListItemInfo &itemInfo);
|
|
~DeviceSelectListItemView();
|
|
void RefreshItem(const DeviceSelectListItemInfo &info, int16_t index);
|
|
bool OnClickEvent(const OHOS::ClickEvent &event);
|
|
DeviceSelectListItemInfo GetItemInfo() const { return itemInfo_; }
|
|
|
|
private:
|
|
void RefreshPos(bool isBtItem);
|
|
OHOS::UIImageView icon_;
|
|
OHOS::UILabelExt name_;
|
|
OHOS::UILabelExt state_;
|
|
OHOS::UIImageView select_;
|
|
OHOS::ImageInfo *selectRes_{nullptr};
|
|
OHOS::ImageInfo *unSelectRes_{nullptr};
|
|
};
|
|
|
|
struct HeadsetListItemInfo
|
|
{
|
|
OHOS::ImageInfo *iconInfo;
|
|
OHOS::ImageInfo *moreInfo;
|
|
HeadsetInfo *headsetInfo;
|
|
};
|
|
|
|
class HeadsetListItemView : public ItemConstructor<HeadsetListItemInfo>
|
|
{
|
|
public:
|
|
HeadsetListItemView(const HeadsetListItemInfo &itemInfo);
|
|
~HeadsetListItemView();
|
|
void RefreshItem(const HeadsetListItemInfo &info, int16_t index);
|
|
bool OnClickEvent(const OHOS::ClickEvent &event);
|
|
|
|
private:
|
|
OHOS::UILabel name_;
|
|
OHOS::UILabelExt state_;
|
|
OHOS::UIImageView icon_;
|
|
OHOS::UIImageView more_;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |