#ifndef UI_RESOURCE_IMAGE_H\r
#define UI_RESOURCE_IMAGE_H\r
#include <cstdint>\r
-namespace OHOS {\r
+namespace OHOS\r
+{\r
static const int DIR_MASK = 0xfff00000;\r
static const int PNG_MASK = 0x000fffff;\r
\r
static const int HEART_HEARTRATECOOR = 0x100001;\r
static const int HEART_HEARTRATE_BOTTOM = 0x100002;\r
static const int HEART_HEARTRATE_TOP = 0x100003;\r
- static const int PLAYER_PLAYERSMODEL_RANDOM = 0x200001;\r
- static const int PLAYER_INCREASE_BUTTON = 0x200002;\r
- static const int PLAYER_PLAYERSMODEL_SEQUENCE = 0x200003;\r
- static const int PLAYER_DECREASE_BUTTON = 0x200004;\r
- static const int PLAYER_PLAYERSMODEL_LOOP = 0x200005;\r
- static const int PLAYER_PLAYER = 0x200006;\r
- static const int PLAYER_BACK_GROUND = 0x200007;\r
- static const int PLAYER_SOUND_IMAGE = 0x200008;\r
- static const int PLAYER_MUTE_BUTTON = 0x200009;\r
- static const int PLAYER_OPTIONS_IMAGE = 0x20000a;\r
- static const int PLAYER_NEXT_BUTTON = 0x20000b;\r
- static const int PLAYER_PLAYERSMODEL_REPEATS = 0x20000c;\r
- static const int PLAYER_PLAYERHIGHLIGHT = 0x20000d;\r
- static const int PLAYER_PRE_BUTTOW = 0x20000e;\r
+ /* -------------------------------------------------------------------------- */\r
+ static const int PLAYER_BACKGROUND = 0x200001; // 音乐背景\r
+ static const int PLAYER_DECREASE_BUTTON = 0x200002; // 点击后声音减少\r
+ static const int PLAYER_EARPHONE = 0x200003; // 大的蓝牙耳机的icon\r
+ static const int PLAYER_EARPHONE_COLOR = 0x200004; // 蓝牙耳机模式绿色图片\r
+ static const int PLAYER_EARPHONE_WHITE = 0x200005; // 蓝牙耳机模式白色图片\r
+ static const int PLAYER_ELLIPSE = 0x200006; // 椭圆\r
+ static const int PLAYER_INCREASE_BUTTON = 0x200007; // 点击后声音加\r
+ static const int PLAYER_LOCAL_MUSIC_COLOR = 0x200008; // 本地音乐模式绿色图片,默认本地模式\r
+ static const int PLAYER_LOCAL_MUSIC_WHITE = 0x200009; // 本地音乐模式白色图片\r
+ static const int PLAYER_MUSIC_DELETE = 0x20000a; // 删除音乐\r
+ static const int PLAYER_MUSIC_LIST = 0x20000b; // 音乐列表\r
+ static const int PLAYER_MUSIC_NEXT = 0x20000c; // 下一首音乐\r
+ static const int PLAYER_MUSIC_PROVE = 0x20000d; // 上一首音乐\r
+ static const int PLAYER_MUSIC_VOICE = 0x20000e; // 音量\r
+ static const int PLAYER_MUTE_BUTTON = 0x20000f; // 静音\r
+ static const int PLAYER_PAUSE = 0x200010; // 播放暂停\r
+ static const int PLAYER_PHONE_COLOR = 0x200011; // 手机音乐模式绿色图片\r
+ static const int PLAYER_PHONE_WHITE = 0x200012; // 手机音乐模式白色图片\r
+ static const int PLAYER_PLAY = 0x200013; // 播放音乐\r
+ static const int PLAYER_PLAYERSMODEL_LOOP = 0x200014; // 播放模式:循环播放\r
+ static const int PLAYER_PLAYERSMODEL_RANDOM = 0x200015; // 播放模式:随机播放\r
+ static const int PLAYER_PLAYERSMODEL_REPEATS = 0x200016; // 播放模式:单曲循环\r
+ static const int PLAYER_PLAYERSMODEL_SEQUENCE = 0x200017; // 播放模式循序播放\r
+ static const int PLAYER_PLAYING = 0x200018; // 播放音乐中\r
+ /* -------------------------------------------------------------------------- */\r
static const int CLOCK_HAND24HOUR_IMAGE_PATH = 0x300001;\r
static const int CLOCK_BIGCIRCLE_IMAGE_PATH = 0x300002;\r
static const int CLOCK_PROGRESS_IMAGE_PATH = 0x300003;\r
//复选框:选中播放未选中暂停\r
int PlayersView::ShowUpCheckBoxButton()\r
{\r
- ImageInfo *image;\r
- ImageInfo *hlImage;\r
+ ImageInfo *ImagePlay;\r
+ ImageInfo *ImagerPause;\r
if (playerButton == nullptr) {\r
playerButton = new UICheckBox();\r
}\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playerlistener new fail");\r
return OHOS_FAILURE;\r
}\r
- playerButton->SetPosition(140, 139, 172, 172); // 140:x 139:y 172:width 172:height\r
+ playerButton->SetPosition(195, 195, 80, 80); // 140:x 139:y 172:width 172:height\r
playerButton->SetOnClickListener(playerlistener);\r
- image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYER, PLAYER_IAMGES); //播放图片\r
- hlImage = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYERHIGHLIGHT, PLAYER_IAMGES);//暂停图片\r
- playerButton->SetImages(hlImage, image);\r
+ ImagePlay = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAY, PLAYER_IAMGES); //播放图片\r
+ ImagerPause = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PAUSE, PLAYER_IAMGES);//暂停图片\r
+ playerButton->SetImages(ImagePlay, ImagerPause);\r
Add(playerButton);\r
\r
soundlistener = new ButtonOnClickListener(reinterpret_cast<UIView*>(soundButton));\r
return OHOS_FAILURE;\r
}\r
soundButton->SetTouchable(true);\r
- soundButton->SetPosition(178, 316, 95, 76); // 178:x 316:y 95:width 76:height\r
+ soundButton->SetPosition(321, 321, 60, 60); \r
soundButton->SetOnClickListener(soundlistener);\r
- if (LoadPlayerImage(soundButton, PLAYER_SOUND_IMAGE) == false) {\r
+ if (LoadPlayerImage(soundButton, PLAYER_MUSIC_VOICE) == false) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playerModelButton LoadPlayerImage fail");\r
return false;\r
}\r
{\r
struct Point pointBtn;\r
ImageInfo *image;\r
- pointBtn.x = 331; // 331:x\r
- pointBtn.y = 168; // 168:y\r
+ pointBtn.x = 366; // 366:x\r
+ pointBtn.y = 213; // 213:y\r
nextlistener = new ButtonOnClickListener(reinterpret_cast<UIView*>(nextButton));\r
if (nextlistener == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "nextlistener new fail");\r
return OHOS_FAILURE;\r
}\r
- SetUpButton(nextButton, pointBtn, 93, 116, nextlistener); // 93:width 116:height\r
- image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_NEXT_BUTTON, PLAYER_IAMGES);\r
+ SetUpButton(nextButton, pointBtn, 60, 60, nextlistener); // 93:width 116:height\r
+ image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUSIC_NEXT, PLAYER_IAMGES);\r
nextButton->SetImageSrc(image, image);\r
- pointBtn.x = 31; // 31:x\r
- pointBtn.y = 168; // 168:y\r
+ nextButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);\r
+ nextButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+ nextButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED);\r
+ nextButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);\r
+ nextButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+ pointBtn.x = 60; // 60:x\r
+ pointBtn.y = 213; // 213:y\r
prelistener = new ButtonOnClickListener(reinterpret_cast<UIView*>(preButton));\r
if (prelistener == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "prelistener new fail");\r
return OHOS_FAILURE;\r
}\r
- SetUpButton(preButton, pointBtn, 86, 116, prelistener); // 86:width 116:height\r
- image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PRE_BUTTOW, PLAYER_IAMGES);\r
+ SetUpButton(preButton, pointBtn, 60, 60, prelistener); // 86:width 116:height\r
+ image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUSIC_PROVE, PLAYER_IAMGES);\r
preButton->SetImageSrc(image, image);\r
-\r
- pointBtn.x = 87; // 87:x\r
- pointBtn.y = 316; // 316:y\r
+ preButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);\r
+ preButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+ preButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED);\r
+ preButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);\r
+ preButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+ pointBtn.x = 105; // 105:x\r
+ pointBtn.y = 321; // 321:y\r
modellistener = new ButtonOnClickListener(reinterpret_cast<UIView*>(playerModelButton));\r
if (modellistener == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "modellistener new fail");\r
return OHOS_FAILURE;\r
}\r
playerModelButton->SetTouchable(true);\r
- playerModelButton->SetPosition(pointBtn.x, pointBtn.y, 95, 76); // 95:width 76:height\r
+ playerModelButton->SetPosition(pointBtn.x, pointBtn.y, 60, 60); \r
playerModelButton->SetOnClickListener(modellistener);\r
if (ShowUpPlayerMode() == false) {\r
return OHOS_FAILURE;\r
if (optionsButton == nullptr) {\r
optionsButton = new UIButton();\r
}\r
+ if (music_list_button == nullptr) {\r
+ music_list_button = new UIButton();\r
+ }\r
if (pullButton == nullptr) {\r
pullButton = new UIButton();\r
}\r
if (ret == OHOS_FAILURE) {\r
return OHOS_FAILURE;\r
}\r
+ ret = ShowUpMusicListbutton();\r
+ if (ret == OHOS_FAILURE) {\r
+ return OHOS_FAILURE;\r
+ }\r
+ return OHOS_SUCCESS;\r
+}\r
+\r
+//显示音乐列表按钮\r
+int PlayersView::ShowUpMusicListbutton()\r
+{\r
+ struct Point pointBtn;\r
+ pointBtn.x = 213; \r
+ pointBtn.y = 35; \r
+ music_list_button_listener = new ButtonOnClickListener(reinterpret_cast<UIView*>(music_list_button));\r
+ if (music_list_button_listener == nullptr) {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "music_list_button_listener new fail");\r
+ return OHOS_FAILURE;\r
+ }\r
+ SetUpButton(music_list_button, pointBtn, 60, 60, music_list_button_listener); // 75:width 76:height\r
+ ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUSIC_LIST, PLAYER_IAMGES);\r
+ music_list_button->SetImageSrc(image, image);\r
+ music_list_button->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);\r
+ music_list_button->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+ music_list_button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED);\r
+ music_list_button->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);\r
+ music_list_button->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+\r
return OHOS_SUCCESS;\r
}\r
/*\r
int PlayersView::ShowUpButtonOptions()\r
{\r
struct Point pointBtn;\r
- pointBtn.x = 284; // 284 : x\r
- pointBtn.y = 316; // 316 : y\r
+ pointBtn.x = 213; \r
+ pointBtn.y = 366; \r
optionslistener = new ButtonOnClickListener(reinterpret_cast<UIView*>(optionsButton));\r
if (optionslistener == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "optionslistener new fail");\r
return OHOS_FAILURE;\r
}\r
- SetUpButton(optionsButton, pointBtn, 75, 76, optionslistener); // 75:width 76:height\r
- ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_OPTIONS_IMAGE, PLAYER_IAMGES);\r
+ SetUpButton(optionsButton, pointBtn, 60, 60, optionslistener); // 75:width 76:height\r
+ ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_LOCAL_MUSIC_COLOR, PLAYER_IAMGES);\r
optionsButton->SetImageSrc(image, image);\r
+ optionsButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);\r
+ optionsButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+ optionsButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED);\r
+ optionsButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);\r
+ optionsButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
\r
pointBtn.x = 178; // 178:x\r
pointBtn.y = 394; // 394:y\r
return OHOS_FAILURE;\r
}\r
}\r
- playbackProgress->SetPosition(140, 139, 172, 172); // 140:x 139:y 172:width 172:height\r
- playbackProgress->SetCenterPosition(86, 86); // 86:x 86:y\r
+ playbackProgress->SetPosition(158, 158, 150, 150); \r
+ playbackProgress->SetCenterPosition(75, 75);\r
playbackProgress->SetRange(PLAY_PROGRESS_MAX, PLAY_PROGRESS_MIN);\r
- playbackProgress->SetRadius(86); // 86:radius\r
+ playbackProgress->SetRadius(70); \r
playbackProgress->SetStartAngle(0);\r
playbackProgress->SetEndAngle(360); // 360: end angle\r
playbackProgress->SetValue(0);\r
- playbackProgress->SetBackgroundStyle(STYLE_LINE_COLOR, Color::Gray().full);\r
- playbackProgress->SetForegroundStyle(STYLE_LINE_COLOR, Color::Red().full);\r
- playbackProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, 3); // 3:width\r
- playbackProgress->SetForegroundStyle(STYLE_LINE_WIDTH, 3); // 3:width\r
+ playbackProgress->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+ playbackProgress->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
+ playbackProgress->SetBackgroundStyle(STYLE_LINE_COLOR, 0xfff61313);\r
+ playbackProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, 0);\r
+ playbackProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xfffbfbfb);\r
+ playbackProgress->SetForegroundStyle(STYLE_BORDER_COLOR, 0xffffffff);\r
+ playbackProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xffffffff);\r
+ playbackProgress->SetForegroundStyle(STYLE_LINE_WIDTH, 6); // 6:width\r
Add(playbackProgress);\r
return OHOS_SUCCESS;\r
}\r
}\r
}\r
backGround->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);\r
- if (LoadPlayerImage(backGround, PLAYER_BACK_GROUND) == false) {\r
+ if (LoadPlayerImage(backGround, PLAYER_BACKGROUND) == false) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "backGround LoadPlayerImage fail");\r
return false;\r
}\r
+ /* -------------------------------------------------------------------------- */\r
+ if(elipse == nullptr){\r
+ elipse = new UIImageView();\r
+ if(elipse ==nullptr) {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "elipse new fail");\r
+ return false;\r
+ }\r
+ }\r
+ elipse->SetPosition(173,173,120,120);\r
+ if (LoadPlayerImage(elipse, PLAYER_ELLIPSE) == false) {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "elipse LoadPlayerImage fail");\r
+ return false;\r
+ }\r
Add(backGround);\r
+ Add(elipse);\r
return true;\r
}\r
//创建音乐名,作者名\r
return false;\r
}\r
\r
+//初始化音乐播放器主视图\r
bool PlayersView::InitView(void)\r
{\r
int ret;\r
return false;\r
}\r
\r
- CreatePlayerMusicName();\r
+ //CreatePlayerMusicName();\r
// changeView\r
CreateJumpView();\r
// OnClick\r