90 lines
2.7 KiB
C++
90 lines
2.7 KiB
C++
#ifndef TJD_UI_APP_FLASHLIGHT_VIEW_H
|
|
#define TJD_UI_APP_FLASHLIGHT_VIEW_H
|
|
|
|
#include "View.h"
|
|
#include "TjdUiAppFlashlightPresenter.h"
|
|
#include "components/ui_label.h"
|
|
#include "components/ui_label_button_ext.h"
|
|
#include "components/ui_list.h"
|
|
#include "components/ui_scroll_view.h"
|
|
#include "components/ui_image_view.h"
|
|
#include "common/image.h"
|
|
#include "components/ui_view.h"
|
|
#include "gfx_utils/graphic_types.h"
|
|
#include "TjdUiMemManage.h"
|
|
#include "components/ui_button.h"
|
|
#include "components/ui_checkbox.h"
|
|
#include "components/ui_edit_text.h"
|
|
#include "components/ui_image_animator.h"
|
|
#include "components/ui_view_group.h"
|
|
#include "cmsis_os.h"
|
|
#include "ui_swipe_view.h"
|
|
|
|
#if ENABLE_ROTATE_INPUT
|
|
#include "events/rotate_event.h"
|
|
#endif
|
|
|
|
namespace TJD {
|
|
|
|
enum FlashlightViewIndex
|
|
{
|
|
Flashlight_VIEW,
|
|
WRITE_Elliptical_VIEW,
|
|
BLACK_Elliptical_VIEW,
|
|
FLASHLIGHT_ON_VIEW,
|
|
FLASHLIGHT_OFF_VIEW,
|
|
FLASHLIGHT_ON_TO_OFF_VIEW,
|
|
FLASHLIGHT_BIG_VIEW,
|
|
Flashlight_VIEW_COUNT
|
|
};
|
|
|
|
class FlashLightUIScrollView : public OHOS::UIScrollView
|
|
{
|
|
public:
|
|
FlashLightUIScrollView() {}
|
|
~FlashLightUIScrollView() {}
|
|
|
|
private:
|
|
bool OnRotateEvent(const OHOS::RotateEvent& event) ;
|
|
|
|
};
|
|
|
|
class TjdUiAppFlashlightPresenter;
|
|
class TjdUiAppFlashlightView : public OHOS::View<TjdUiAppFlashlightPresenter>, public OHOS::UIViewGroup
|
|
{
|
|
public:
|
|
TjdUiAppFlashlightView();
|
|
~TjdUiAppFlashlightView();
|
|
static TjdUiAppFlashlightView *GetInstance(void);
|
|
void OnStart() override;
|
|
void OnStop() override;
|
|
void ShowView(FlashlightViewIndex hideView, FlashlightViewIndex showView);
|
|
void ShowView_(FlashlightViewIndex hideView1, FlashlightViewIndex hideView2, FlashlightViewIndex showView);
|
|
void Changestatus();
|
|
FlashlightViewIndex GetCurrentView() { return currentView_; }
|
|
|
|
private:
|
|
FlashlightViewIndex currentView_{FlashlightViewIndex::FLASHLIGHT_ON_VIEW};
|
|
OHOS::UIScrollView *containerAll_{nullptr};
|
|
OHOS::UIViewGroup *flashlightView[Flashlight_VIEW_COUNT]{nullptr};
|
|
OHOS::UIScrollView *InitFlashlightUiView();
|
|
OHOS::UIScrollView *InitFlashlightOnView();
|
|
OHOS::UIScrollView *InitFlashlightOffView();
|
|
OHOS::UIScrollView *InitFlashlightOnToOffView();
|
|
OHOS::UIImageView *writeElliptical{nullptr};
|
|
OHOS::UIImageView *blackElliptical{nullptr};
|
|
OHOS::UIImageView *writeElliptical_{nullptr};
|
|
OHOS::UIImageView *blackElliptical_{nullptr};
|
|
OHOS::UIImageView *writeElliptical1_{nullptr};
|
|
OHOS::UIImageView *blackElliptical1_{nullptr};
|
|
OHOS::UIImageView *flashlight_{nullptr};
|
|
OHOS::UIImageView *lighton{nullptr};
|
|
OHOS::UIImageView *lightoff{nullptr};
|
|
OHOS::UIImageView *lighton1{nullptr};
|
|
OHOS::UIView::OnDragListener *OnDragListener_{nullptr};
|
|
void InitImage();
|
|
|
|
};
|
|
|
|
}
|
|
#endif |