/* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. * Description: Player view * Author: * Create: 2021-07-26 */ #ifndef PLAYERS_VIEW_H #define PLAYERS_VIEW_H #include #include "components/ui_image_view.h" #include "components/ui_label.h" #include "components/root_view.h" #include "components/ui_view_group.h" #include "components/ui_button.h" #include "components/ui_label_button.h" #include "components/ui_abstract_scroll.h" #include "components/ui_circle_progress.h" #include "components/ui_checkbox.h" #include "components/ui_list.h" #include "font/ui_font_bitmap.h" #include "font/ui_font.h" #include "graphic_config.h" #include "components/ui_card_page.h" #include "PlayersPresenter.h" namespace OHOS { #define PLAY_PROGRESS_MIN 0 #define PLAY_PROGRESS_MAX 100 class JumpView; class PlayersPresenter; class PlayersCaseListAdapter; class PlayersView : public UICardPage { public: PlayersView(); ~PlayersView() override; static PlayersView *GetInstance(void); bool InitView(void); void PreLoad(void) override; void UnLoad(void) override; bool OnDragEvent(const DragEvent& event) override; void SetUpLabel(const char *title, int16_t x, int16_t y); void ShowUpListView(void); void TitleSetText(const char *text); void PlayerModelButtonSetSrc(uint32_t playMode); int16_t GetVolumeRank(void); void SetVolumeRank(int16_t value); void SetVolumeAddOne(void); UILabelButton *GetBackButton(void); UIButton *GetPullButton(void); UIButton *GetOptionsButton(void); UIButton *GetPreButton(void); UIButton *GetNextButton(void); UILabel *GetTitleLabel(void); UICheckBox *GetPlayerButton(void); UIImageView *GetSoundButton(void); UIImageView *GetPlayerModelButton(void); UICircleProgress *GetPlaybackProgress(void); UICheckBox::UICheckBoxState GetPlayerButtonState(void); void SetPlayerButtonState(UICheckBox::UICheckBoxState state); UIList *GetPlayerList(void); void SetPlayerListGroupStatus(bool status); void SetPlayerCtrVolume(float leftVolume, float rightVolume); void CreateJumpView(void); void CreatePlayersPresenter(void); void CreatePlayerOnDragListener(void); private: bool InitBackGround(void); void TearDownView(); void CreatePlayerMusicName(); int ShowUpCheckBoxButton(); int ShowUpButton(); int ShowUpButtonOptions(); int ShowUpButtonView(); int ShowUpCircleProgress(); bool ShowUpPlayerMode(); void SetUpButton(UIButton *btn, const Point& point, int16_t width, int16_t height, UIView::OnClickListener *listener); bool LoadPlayerImage(UIImageView *View, uint32_t resId); bool LoadPlayerImage(UIButton *button, uint32_t resId, uint32_t hlResId); UIImageView *backGround{nullptr}; UILabel *subTitleLabel{nullptr}; PlayersCaseListAdapter *adapterText{nullptr}; UILabel *titleLabel{nullptr}; UILabelButton *backButton{nullptr}; UIButton *pullButton{nullptr}; UIButton *optionsButton{nullptr}; UIButton *preButton{nullptr}; UIButton *nextButton{nullptr}; UIViewGroup *listGroup{nullptr}; UIImageView *soundButton{nullptr}; UIImageView *playerModelButton{nullptr}; UICheckBox *playerButton{nullptr}; UICircleProgress *playbackProgress{nullptr}; int16_t volumeSet{0}; UIList *list{nullptr}; JumpView *jumpView{nullptr}; PlayersPresenter *playersPresenter{nullptr}; PlayerOnDragListener *playerOnDragListener{nullptr}; uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; UIView::OnClickListener *playerlistener{nullptr}; UIView::OnClickListener *soundlistener{nullptr}; UIView::OnClickListener *nextlistener{nullptr}; UIView::OnClickListener *prelistener{nullptr}; UIView::OnClickListener *modellistener{nullptr}; UIView::OnClickListener *optionslistener{nullptr}; bool viewiInitStatus{false}; }; } // namespace OHOS #endif // MAIN_VIEW_H