90 lines
2.3 KiB
C++
90 lines
2.3 KiB
C++
#ifndef TJD_UI_APP_CHARGER_VIEW_H
|
|
#define TJD_UI_APP_CHARGER_VIEW_H
|
|
|
|
#include "TjdUiAppChargerPresenter.h"
|
|
#include "TjdUiMultiLanguageExt.h"
|
|
#include "View.h"
|
|
#include "components/ui_image_animator.h"
|
|
#include "components/ui_label.h"
|
|
#include "components/ui_transform_group.h"
|
|
#include "components/ui_view_group.h"
|
|
#include "components/ui_scroll_view.h"
|
|
#include <list>
|
|
|
|
namespace TJD {
|
|
|
|
class TjdUiAppChargerAnimatorView : public OHOS::UIScrollView
|
|
{
|
|
public:
|
|
TjdUiAppChargerAnimatorView(int value);
|
|
~TjdUiAppChargerAnimatorView();
|
|
void ShowView()
|
|
{
|
|
SetVisible(true);
|
|
animator_.Start();
|
|
}
|
|
void HideView()
|
|
{
|
|
SetVisible(false);
|
|
animator_.Stop();
|
|
}
|
|
void SetValue(int value);
|
|
|
|
private:
|
|
OHOS::UIImageAnimatorView animator_;
|
|
OHOS::ImageAnimatorInfo animatorInfo_[12];
|
|
OHOS::UILabel value_;
|
|
OHOS::UILabel status_;
|
|
std::string valueStr_;
|
|
};
|
|
|
|
class TjdUiAppBedSideClockView : public OHOS::UITransformGroup
|
|
{
|
|
public:
|
|
TjdUiAppBedSideClockView(int value, ChargerTime &time);
|
|
~TjdUiAppBedSideClockView();
|
|
void ShowView() { SetVisible(true); }
|
|
void HideView() { SetVisible(false); }
|
|
void SetValue(int value);
|
|
void SetTime(ChargerTime &time);
|
|
void SetRotateView(GsensorDir dir);
|
|
|
|
private:
|
|
OHOS::UIImageView hourFir_;
|
|
OHOS::UIImageView hourSec_;
|
|
OHOS::UIImageView minFir_;
|
|
OHOS::UIImageView minSec_;
|
|
OHOS::UIImageView split;
|
|
OHOS::UIImageView dateFir_;
|
|
OHOS::UIImageView dateSec_;
|
|
OHOS::UIImageView week_;
|
|
OHOS::UIImageView power_;
|
|
};
|
|
|
|
class ChargerMeassageView : public OHOS::UIScrollView
|
|
{
|
|
public:
|
|
ChargerMeassageView(int value);
|
|
~ChargerMeassageView();
|
|
void ShowStaticChargeView() { staticChargeView->Invalidate(); }
|
|
void SetOpa(uint32_t opa);
|
|
void SetValue(int value) { chargerView->SetValue(value); }
|
|
void SetChargeHide();
|
|
void SetRotateView(GsensorDir dir);
|
|
void StartAnimator(bool direction)
|
|
{
|
|
enterAnimatorCallback->SetDirection(direction);
|
|
enterAnimator->Start();
|
|
}
|
|
|
|
private:
|
|
TjdUiAppChargerAnimatorView *chargerView = nullptr;
|
|
OHOS::UIImageView *staticChargeView = nullptr;
|
|
OHOS::ImageInfo imageInfo_{};
|
|
ChargerExitAnimatorCallback *enterAnimatorCallback = nullptr;
|
|
OHOS::Animator *enterAnimator = nullptr;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |