From: luozheng <1732036298@qq.com> Date: Sat, 13 Apr 2024 11:32:32 +0000 (+0800) Subject: 删除130x130天气图片改用65x65天气图片 X-Git-Tag: release_V1.2.70_20241020_135402~1189^2~5 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=2e7c92e8d5407d57ee9afe991d20beafd6572301;p=mirrors%2FFD230.git 删除130x130天气图片改用65x65天气图片 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h index cdc5ee1c2..bca211e9a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-13 16:18:25 + * @LastEditTime: 2024-04-13 19:10:22 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h */ #ifndef FUTURE_WEATHER_VIEW_H @@ -19,22 +19,6 @@ namespace OHOS { -#define weather_src "/user/res/weather/weather65x65/" - static const char *weather65x65[] = - { - weather_src "weather_sunny.bin", // 晴天 - weather_src "weather_clear-cloudy.bin", // 多云 - weather_src "weather_rain.bin", // 阵雨 - weather_src "weather_thundershower.bin", - weather_src "weather_foggy.bin", - weather_src "weather_unknown.bin", - weather_src "weather_overcast.bin", - weather_src "weather_clear-sunny.bin", - weather_src "weather_duststorm.bin", - weather_src "weather_haze.bin", - weather_src "weather_snow.bin", - weather_src "weather_sunny-cloudy.bin", - }; class FutureWeatherView : public AppGroupView { diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h index 1c72c64c6..acaaa415a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:20 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-13 18:23:57 + * @LastEditTime: 2024-04-13 19:12:15 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h */ #ifndef WEATHER_MODEL_H @@ -61,20 +61,21 @@ namespace OHOS } #endif /* __cplusplus */ - static constexpr const char *weather130x130[] = + #define weather_src "/user/res/weather/weather65x65/" + static const char *weather65x65[] = { - "/user/res/weather/weather130x130/WEATHER_CLEAR-CLOUDY.bin", - "/user/res/weather/weather130x130/WEATHER_CLEAR-SUNNY.bin", // 晴 - "/user/res/weather/weather130x130/WEATHER_DUSTSTORM.bin", - "/user/res/weather/weather130x130/WEATHER_FOGGY.bin", - "/user/res/weather/weather130x130/WEATHER_HAZE.bin", - "/user/res/weather/weather130x130/WEATHER_OVERCAST.bin", - "/user/res/weather/weather130x130/WEATHER_RAIN.bin", - "/user/res/weather/weather130x130/WEATHER_SNOW.bin", - "/user/res/weather/weather130x130/WEATHER_SUNNY.bin", - "/user/res/weather/weather130x130/WEATHER_SUNNY-CLOUNDY.bin", - "/user/res/weather/weather130x130/WEATHER_THUNDERSHOWER.bin", - "/user/res/weather/weather130x130/WEATHER_UNKNOWN.bin", + weather_src "weather_sunny.bin", // 晴天 + weather_src "weather_clear-cloudy.bin", // 多云 + weather_src "weather_rain.bin", // 阵雨 + weather_src "weather_thundershower.bin", + weather_src "weather_foggy.bin", + weather_src "weather_unknown.bin", + weather_src "weather_overcast.bin", + weather_src "weather_clear-sunny.bin", + weather_src "weather_duststorm.bin", + weather_src "weather_haze.bin", + weather_src "weather_snow.bin", + weather_src "weather_sunny-cloudy.bin", }; /* -------------------------------------------------------------------------- */ class WeatherModel diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp index c71b9135a..7a2087494 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-12 20:00:56 + * @LastEditTime: 2024-04-13 19:23:06 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp */ #include "weather/include/GetWeatherDataErrorView.h" @@ -61,7 +61,9 @@ namespace OHOS return nullptr; } image->SetPosition(168, 127, 130, 130); - const char * ImgSr = "/user/res/weather/weather130x130/WEATHER_UNKNOWN.bin"; //天气数据获取失败 + const char *ImgSr = "/user/res/weather/weather65x65/weather_unknown.bin"; // 天气数据获取失败 + image->SetAutoEnable(false); + image->SetResizeMode(UIImageView::CONTAIN); image->SetSrc(ImgSr); scrollView->Add(image); /* -------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp index 4b37dba20..c8408ad08 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp @@ -69,7 +69,7 @@ namespace OHOS NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); return true; } - if (strcmp(view.GetViewId(), GETWEATHERDATAERRORVIEW) == 0) + if (strcmp(view.GetViewId(), GETWEATHERDATAERRORVIEW) == 0 && event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp index 0433e80ba..734f980b3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-13 17:51:01 + * @LastEditTime: 2024-04-13 19:27:19 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp */ #include "weather/include/MainWeatherView.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp index b9c182e67..d40c97a40 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:09 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-13 18:00:02 + * @LastEditTime: 2024-04-13 19:07:14 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp */ #include "weather/include/WeatherModel.h" @@ -127,7 +127,7 @@ namespace OHOS { int size = Weather_data_t_now.iconNight; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "iconNight:%d", size); - return weather130x130[size]; + return weather65x65[size]; } // 获取温度 diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp index adec552f9..837f6314c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp @@ -11,7 +11,7 @@ namespace OHOS { - /*主天气背景图片*/ + /*主天气背景图片*/ static constexpr int16_t WEATHER_BACKGROUND_IMAGE_X = 0; static constexpr int16_t WEATHER_BACKGROUND_IMAGE_Y = 0; static constexpr int16_t WEATHER_BACKGROUND_IMAGE_W = 466; @@ -20,8 +20,8 @@ namespace OHOS /*天气图片*/ static constexpr int16_t WEATHER_IMAGE_X = 77; static constexpr int16_t WEATHER_IMAGE_Y = 124; - static constexpr int16_t WEATHER_IMAGE_W = 100; - static constexpr int16_t WEATHER_IMAGE_H = 100; + static constexpr int16_t WEATHER_IMAGE_W = 130; + static constexpr int16_t WEATHER_IMAGE_H = 130; /*当前时间标签*/ static constexpr int16_t CURRENT_TIME_LABEL_X = 133; @@ -192,6 +192,8 @@ namespace OHOS return false; } showWeatherImage->SetPosition(WEATHER_IMAGE_X, WEATHER_IMAGE_Y, WEATHER_IMAGE_W, WEATHER_IMAGE_W); + showWeatherImage->SetAutoEnable(false); + showWeatherImage->SetResizeMode(UIImageView::CONTAIN); showWeatherImage->SetSrc(ImageCacheManager::GetInstance().LoadSingleRes(WeatherImag)); /* -------------------------------------------------------------------------- */ showCurrentTimeLabel = InitLabelExt(CURRENT_TIME_LABEL_X, CURRENT_TIME_LABEL_Y, CURRENT_TIME_LABEL_W, CURRENT_TIME_LABEL_H, "", diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-CLOUDY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-CLOUDY.bin deleted file mode 100644 index f253a7ea1..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-CLOUDY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-SUNNY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-SUNNY.bin deleted file mode 100644 index 150f9023d..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_CLEAR-SUNNY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_DUSTSTORM.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_DUSTSTORM.bin deleted file mode 100644 index f1a9c607e..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_DUSTSTORM.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_FOGGY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_FOGGY.bin deleted file mode 100644 index b16fc33fe..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_FOGGY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_HAZE.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_HAZE.bin deleted file mode 100644 index a77f3a7ad..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_HAZE.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_OVERCAST.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_OVERCAST.bin deleted file mode 100644 index e888f9c85..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_OVERCAST.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_RAIN.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_RAIN.bin deleted file mode 100644 index ede837596..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_RAIN.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SNOW.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SNOW.bin deleted file mode 100644 index 27d521ee2..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SNOW.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY-CLOUNDY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY-CLOUNDY.bin deleted file mode 100644 index 4460e9254..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY-CLOUNDY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY.bin deleted file mode 100644 index 75c954299..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_SUNNY.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_THUNDERSHOWER.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_THUNDERSHOWER.bin deleted file mode 100644 index 4954d5ee1..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_THUNDERSHOWER.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_UNKNOWN.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_UNKNOWN.bin deleted file mode 100644 index 604d809cf..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather130x130/WEATHER_UNKNOWN.bin and /dev/null differ