diff --git a/features/search/Index.ets b/features/search/Index.ets index 1b7653c737b23055fc11ef760c80410c588fdaf8..dc98a585272ca5a8f769a6ac5dc469688d33a609 100644 --- a/features/search/Index.ets +++ b/features/search/Index.ets @@ -1 +1,2 @@ -export { SearchView } from './src/main/ets/view/SearchView'; \ No newline at end of file +export { SearchView } from './src/main/ets/view/SearchView'; +export { SearchViewForTv } from './src/main/ets/view/SearchViewForTv'; \ No newline at end of file diff --git a/features/search/src/main/ets/constants/SearchConstants.ets b/features/search/src/main/ets/constants/SearchConstants.ets index 61f952e807c16eeebc85286d3cd55c711cbe810b..d223255ec68a270d538c89a55f453f4cec61e1a1 100644 --- a/features/search/src/main/ets/constants/SearchConstants.ets +++ b/features/search/src/main/ets/constants/SearchConstants.ets @@ -14,6 +14,22 @@ */ export class SearchConstants { + /** + * hot search. + */ + static readonly HOT_ACTION: ResourceStr[] = [$r('app.string.title_content'), $r('app.string.title_content'), $r('app.string.title_content'), $r('app.string.title_content'), $r('app.string.title_content'), $r('app.string.title_content')] + /** + * History action button. + */ + static readonly SEARCH_ACTION: ResourceStr[] = [$r('app.string.clear'), $r('app.string.delete')] + /** + * History list. + */ + static readonly SEARCH_HISTORY: ResourceStr[] = [$r('app.string.content'), $r('app.string.content')] + /** + * History list for tv. + */ + static readonly SEARCH_HISTORY_AND_DISCOVERY: ResourceStr[] = [$r('app.string.history_del'), $r('app.string.content'), $r('app.string.content'), $r('app.string.content'), $r('app.string.history_search'), $r('app.string.history_record'), $r('app.string.history_record')] /** * Searching for a recommendation list in large devices. */ @@ -33,6 +49,10 @@ export class SearchConstants { static readonly HUA_LIST: ResourceStr[] = [ $r('app.string.tv'), $r('app.string.tv'), $r('app.string.tv'), $r('app.string.conference'), $r('app.string.tv'), $r('app.string.tv')]; + + static readonly HUA_LIST_FOR_HUA: ResourceStr[] = + [ $r('app.string.conference'), + $r('app.string.tv'), $r('app.string.tv')]; /** * Search result tab List. */ @@ -44,6 +64,14 @@ export class SearchConstants { [$r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural')]; + + /** + * Search result img title list. + */ + static readonly SEARCH_RESULT_IMG_TITLES: ResourceStr[] = + [$r('app.string.product_launch'), $r('app.string.product_launch'), $r('app.string.product_launch'), $r('app.string.product_launch'), + $r('app.string.product_launch')]; + /** * Search video img content list. */ @@ -75,11 +103,11 @@ export class SearchConstants { /** * Search recommend list lanes. */ - static readonly SEARCH_LIST_LANES: number[] = [3, 2, 1]; + static readonly SEARCH_LIST_LANES: number[] = [3, 3, 2, 1, 1]; /** * Hot trending list spaces. */ - static readonly HOT_TRENDING_LIST_SPACES: string[] = ['16vp', '24vp', '36vp']; + static readonly HOT_TRENDING_LIST_SPACES: string[] = ['16vp', '16vp', '24vp', '36vp', '36vp']; /** * Search recommend divider padding. */ @@ -111,9 +139,13 @@ export class SearchConstants { /** * Search input list. */ - static readonly SEARCH_INPUT_LIST: ResourceStr[] = ['华', '华为发布会']; + static readonly SEARCH_INPUT_LIST: ResourceStr[] = ['华', '华为发布会', 'H']; /** * Hot video divider stroke width. */ static readonly DIVIDER_STROKE_WIDTH: string = '0.5vp'; + /** + * Search decor height. + */ + static readonly SEARCH_DECOR_HEIGHT: number = 56; } \ No newline at end of file diff --git a/features/search/src/main/ets/view/SearchContent.ets b/features/search/src/main/ets/view/SearchContent.ets index e5ccfbb55cd316937cdfaf54d4091e6645550504..3f40ded0f839a3903fc1a24fefedccf052f401fc 100644 --- a/features/search/src/main/ets/view/SearchContent.ets +++ b/features/search/src/main/ets/view/SearchContent.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BreakpointConstants, CommonConstants } from '@ohos/commons'; +import { BreakpointConstants, CommonConstants, WindowInfo } from '@ohos/commons'; import { BreakpointType } from '@ohos/commons'; import { SearchConstants } from '../constants/SearchConstants'; import { SearchVideoImg } from '../viewmodel/SearchVideoImgViewModel'; @@ -23,6 +23,7 @@ export struct SearchContent { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @State currentIndex: number = 0; @Link searchVideoList: SearchVideoImg[]; + @ObjectLink mainWindowInfo: WindowInfo; build() { Scroll() { @@ -73,11 +74,11 @@ export struct SearchContent { .justifyContent(FlexAlign.Center) .width($r('app.float.search_history_content_row_width')) .height($r('app.float.search_history_content_row_height')) - .borderRadius($r('app.float.search_history_content_row_radius')) + .borderRadius( this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_XL ? $r('app.float.search_history_content_row_radius_xl') : $r('app.float.search_history_content_row_radius')) .backgroundColor($r('app.color.result_background')) - .margin({ right: new BreakpointType($r('app.float.search_content_margin_right_sm'), - $r('app.float.search_content_margin_right_md'), $r('app.float.search_content_margin_right_lg')) - .getValue(this.currentWidthBreakpoint) }) + .margin({ right: new BreakpointType($r('app.float.search_content_margin_right_sm'),$r('app.float.search_content_margin_right_sm'), + $r('app.float.search_content_margin_right_md'), $r('app.float.search_content_margin_right_lg'), $r('app.float.search_content_margin_right_lg')) + .getValue(this.mainWindowInfo.widthBp) }) } // [Start search_discovery] @@ -88,18 +89,19 @@ export struct SearchContent { .fontSize('20fp') .fontWeight(500) Blank() - Image($r('app.media.ic_public_rotate')) - .height('16vp') - .width('16vp') - .margin({ right: '24vp' }) - .fillColor('#ED6F21') + if(this.mainWindowInfo.widthBp !== WidthBreakpoint.WIDTH_XL){ + Image($r('app.media.ic_public_rotate1')) + .height('24vp') + .width('24vp') + } + } .height('24vp') .width('100%') .margin({ top: '24vp' }) List() { - ForEach(this.currentWidthBreakpoint === 'lg' ? SearchConstants.SEARCH_DISCOVERY_LARGE : + ForEach(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG || this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_XL ? SearchConstants.SEARCH_DISCOVERY_LARGE : SearchConstants.SEARCH_DISCOVERY_LARGE.slice(0, 6), (item: string, index: number) => { ListItem() { // [StartExclude search_discovery] @@ -108,7 +110,7 @@ export struct SearchContent { .fontSize('16vp') .fontWeight(500) } - .padding({ right: this.getDividerPadding(this.currentWidthBreakpoint, index) }) + .padding({ right: this.getDividerPadding(this.mainWindowInfo.widthBp, index) }) .height('21vp') .width('100%') .margin({ top: '12vp' }) @@ -118,15 +120,16 @@ export struct SearchContent { }, (item: string, index: number) => index + JSON.stringify(item)) } .width('100%') - .lanes(this.currentWidthBreakpoint === 'lg' ? 3 : 2) + .lanes(new BreakpointType(2, 2, 2, 3, 3).getValue(this.mainWindowInfo.widthBp)) + // .lanes(this.currentWidthBreakpoint === 'lg' ? 3 : 2) } // [End search_discovery] @Builder searchHotTrending() { List({ space: new BreakpointType(SearchConstants.HOT_TRENDING_LIST_SPACES[0], - SearchConstants.HOT_TRENDING_LIST_SPACES[1], SearchConstants.HOT_TRENDING_LIST_SPACES[2]) - .getValue(this.currentWidthBreakpoint) }) { + SearchConstants.HOT_TRENDING_LIST_SPACES[1], SearchConstants.HOT_TRENDING_LIST_SPACES[2], SearchConstants.HOT_TRENDING_LIST_SPACES[3], SearchConstants.HOT_TRENDING_LIST_SPACES[4]) + .getValue(this.mainWindowInfo.widthBp) }) { ForEach(SearchConstants.SEARCH_TABS, (item: string, index: number) => { ListItem() { Column() { @@ -174,7 +177,7 @@ export struct SearchContent { .lineHeight($r('app.float.hot_video_title_line')) .maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis }) - .margin({ top: $r('app.float.hot_video_title_margin') }) + // .margin({ top: $r('app.float.hot_video_title_margin') }) Text(item.getContent()) .fontSize($r('app.float.hot_video_content_font')) .fontWeight(FontWeight.Normal) @@ -200,18 +203,23 @@ export struct SearchContent { .width(CommonConstants.FULL_PERCENT) .height(this.currentWidthBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? $r('app.float.hot_video_list_height_sm') : $r('app.float.hot_video_list_height')) - .lanes(new BreakpointType(SearchConstants.SEARCH_LIST_LANES[2], SearchConstants.SEARCH_LIST_LANES[1], - SearchConstants.SEARCH_LIST_LANES[0]).getValue(this.currentWidthBreakpoint), $r('app.float.hot_video_list_lane_space')) + .lanes(new BreakpointType(SearchConstants.SEARCH_LIST_LANES[4], SearchConstants.SEARCH_LIST_LANES[3], SearchConstants.SEARCH_LIST_LANES[2], SearchConstants.SEARCH_LIST_LANES[1], + SearchConstants.SEARCH_LIST_LANES[0]).getValue(this.mainWindowInfo.widthBp), $r('app.float.hot_video_list_lane_space')) .padding({ top: $r('app.float.hot_video_list_padding'), bottom: $r('app.float.hot_video_list_padding') }) + .divider({ + strokeWidth: 1, + color: $r('app.color.hot_video_list_divider_color'), + startMargin: $r('app.float.hot_video_list_divider_start_margin') + }) .scrollBar(BarState.Off) .edgeEffect(EdgeEffect.None) } - getDividerPadding(breakpoint: string, index: number): string { - if (breakpoint === BreakpointConstants.BREAKPOINT_LG) { + getDividerPadding(breakpoint: WidthBreakpoint, index: number): string { + if (breakpoint === WidthBreakpoint.WIDTH_LG || breakpoint === WidthBreakpoint.WIDTH_XL) { if (index % SearchConstants.SEARCH_LIST_LANES[0] !== 2) { return SearchConstants.SEARCH_RECOMMEND_DIVIDER_PADDING; } diff --git a/features/search/src/main/ets/view/SearchContentForTv.ets b/features/search/src/main/ets/view/SearchContentForTv.ets new file mode 100644 index 0000000000000000000000000000000000000000..139fabf291f7e451a00190c906729eedf2e537af --- /dev/null +++ b/features/search/src/main/ets/view/SearchContentForTv.ets @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CommonConstants } from '@ohos/commons' +import { SearchConstants } from '../constants/SearchConstants' +import { SearchVideoImg, SearchVideoImgModel } from '../viewmodel/SearchVideoImgViewModel' +import { SearchTabs } from './SearchTabs' +import { SearchVideos } from './SearchVideos'; + +@Component +export struct SearchContentForTv{ + @State currentIndex: number = 0; + private model: SearchVideoImgModel = new SearchVideoImgModel(); + build() { + Column(){ + this.searchHistory() + this.searchDiscovery() + this.searchHotTrending() + } + } + @Builder + searchHistory(){ + List({ space: 32 }){ + ForEach(SearchConstants.SEARCH_HISTORY_AND_DISCOVERY, (item: ResourceStr, index: number) => { + ListItem(){ + Row(){ + if(index == 0){ + Image($r('app.media.ic_public_delete1')) + .height($r('app.float.search_history_img_size')) + .width($r('app.float.search_history_img_size')) + .margin({right: 3}) + .opacity(CommonConstants.TEXT_OPACITY[5]) + } + Text(item) + .fontSize($r('app.float.search_hua_list_font_tv')) + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + } + .height($r('app.float.search_hua_row_height_tv')) + .borderRadius($r('app.float.search_hua_row_radius_tv')) + .padding({left: $r('app.float.search_hua_item_padding_h_tv'), right: $r('app.float.search_hua_item_padding_h_tv')}) + .backgroundColor($r('app.color.search_history_bg_color')) + .hoverEffect(HoverEffect.Highlight) + .border({ + color: $r('app.color.search_history_border_color'), + width: $r('app.float.search_history_border_width_tv') + }) + } + }, (item: ResourceStr, index: number) => index + String(item)) + } + .width(CommonConstants.FULL_PERCENT) + .alignListItem(ListItemAlign.Start) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + .padding({left: $r('app.float.search_tab_list_padding_h_tv')}) + .margin({top: $r('app.float.search_section_margin_top_tv')}) + } + @Builder + searchHotTrending() { + SearchTabs({ + currentIndex: this.currentIndex, + list: SearchConstants.SEARCH_TABS, + }) + SearchVideos({ videoList: this.model.getHotSearchList() }) + } + + @Builder + searchDiscovery(){ + Text('大家都在搜') + .fontWeight(CommonConstants.FONT_WEIGHT_700) + .fontSize($r('app.float.search_discovery_title_font_tv')) + .lineHeight($r('app.float.search_discovery_title_line_tv')) + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .padding({ + top: $r('app.float.search_discovery_title_padding_top_tv'), + bottom: $r('app.float.search_discovery_title_padding_bottom_tv'), + left: $r('app.float.search_tab_list_padding_h_tv') + }) + .width(CommonConstants.FULL_PERCENT) + .textAlign(TextAlign.Start) + List({ space: 32 }){ + ForEach(this.model.getDiscoverSearchList(), (item: SearchVideoImg, index: number) => { + ListItem(){ + Column(){ + Image(item.getImgSrc()) + .width($r('app.float.discover_video_img_width_tv')) + .height($r('app.float.discover_video_img_height_tv')) + .borderRadius($r('app.float.discover_video_img_radius_tv')) + .margin({bottom: $r('app.float.discover_video_img_margin_bottom_tv')}) + .hoverEffect(HoverEffect.Scale) + Text(item.getTitle()) + .fontSize($r('app.float.hot_video_title_font_tv')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .lineHeight($r('app.float.hot_video_title_line_tv')) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width(CommonConstants.FULL_PERCENT) + } + } + .width($r('app.float.discover_card_width_tv')) + .clip(false) + }, (item: SearchVideoImg, index: number) => index + JSON.stringify(item)) + } + .width(CommonConstants.FULL_PERCENT) + .alignListItem(ListItemAlign.Start) + .listDirection(Axis.Horizontal) + .clip(false) + .padding({left: $r('app.float.search_tab_list_padding_h_tv'), right: $r('app.float.search_tab_list_padding_h_tv')}) + } +} \ No newline at end of file diff --git a/features/search/src/main/ets/view/SearchHeader.ets b/features/search/src/main/ets/view/SearchHeader.ets index 2816c88d8885bfbc94cb1df183d71010ae8d76ec..9b2366f139148d569cc9a9316262806a1ea4b739 100644 --- a/features/search/src/main/ets/view/SearchHeader.ets +++ b/features/search/src/main/ets/view/SearchHeader.ets @@ -14,7 +14,7 @@ */ import { deviceInfo } from '@kit.BasicServicesKit'; -import { CommonConstants } from '@ohos/commons'; +import { BreakpointConstants, CommonConstants, WindowInfo, WindowUtil } from '@ohos/commons'; import { SearchConstants } from '../constants/SearchConstants'; @Component @@ -22,17 +22,27 @@ export struct SearchHeader { @Link isSearching: boolean; @Link searchInput: string; @Link currentTopIndex: number; + @StorageLink('windowUtil') windowUtil: WindowUtil | undefined = undefined; + @ObjectLink mainWindowInfo: WindowInfo; build() { Row() { - Image($r('app.media.ic_public_back')) - .height($r('app.float.search_header_back_img_size')) - .width($r('app.float.search_header_back_img_size')) - .margin({ right: $r('app.float.search_header_back_img_margin') }) - .onClick(() => { - this.isSearching = false; - this.searchInput = ''; - }) + Row() { + Image($r('app.media.ic_public_arrow_left1')) + .height($r('app.float.search_header_back_img_size')) + .width($r('app.float.search_header_back_img_size')) + } + .justifyContent(FlexAlign.Center) + .height($r('app.float.search_header_back_size')) + .width($r('app.float.search_header_back_size')) + .margin({ right: $r('app.float.search_header_back_img_margin') }) + .onClick(() => { + this.isSearching = false; + this.searchInput = ''; + this.windowUtil!.mainWindow.setWindowDecorVisible(this.mainWindowInfo.widthBp !== WidthBreakpoint.WIDTH_XL); + }) + .backgroundColor($r('app.color.search_header_background')) + .borderRadius($r('app.float.search_header_back_border_radius')) Stack({ alignContent: Alignment.Start }) { // Search box. @@ -58,13 +68,17 @@ export struct SearchHeader { .width($r('app.float.search_header_search_img_size')) .height($r('app.float.search_header_search_img_size')) .margin({ left: $r('app.float.search_header_search_img_margin') }) + .fillColor($r('app.color.type_tabs_font')) } .alignSelf(ItemAlign.Center) .layoutWeight(1) } - .padding({ top: deviceInfo.deviceType === CommonConstants.DEVICE_TYPE ? 0 : - $r('app.float.search_header_row_padding') }) - .height(deviceInfo.deviceType === CommonConstants.DEVICE_TYPE ? $r('app.float.search_header_row_height') : + + .padding({ top: deviceInfo.deviceType === CommonConstants.DEVICE_TYPE + || (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM && this.mainWindowInfo.heightBp === HeightBreakpoint.HEIGHT_MD) + ? 0 : + $r('app.float.search_header_row_padding'), right: deviceInfo.deviceType === CommonConstants.DEVICE_TYPE ? '146vp' : 0 }) + .height(deviceInfo.deviceType === CommonConstants.DEVICE_TYPE || (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM && this.mainWindowInfo.heightBp === HeightBreakpoint.HEIGHT_MD) ? $r('app.float.search_header_row_height') : $r('app.float.search_header_row_height_more')) .width(CommonConstants.FULL_PERCENT) } diff --git a/features/search/src/main/ets/view/SearchResult.ets b/features/search/src/main/ets/view/SearchResult.ets index 89dd5005d9cee2044fe63e19928ddfa2549eca17..c33f0abf3ff01b2408b67dd8bebe895ead530a2e 100644 --- a/features/search/src/main/ets/view/SearchResult.ets +++ b/features/search/src/main/ets/view/SearchResult.ets @@ -13,16 +13,16 @@ * limitations under the License. */ -import { BreakpointConstants, CommonConstants, VideoNavPathStack } from '@ohos/commons'; +import { BreakpointConstants, CommonConstants, VideoNavPathStack, WindowInfo } from '@ohos/commons'; import { BreakpointType } from '@ohos/commons'; import { SearchConstants } from '../constants/SearchConstants'; import { SearchVideoImg, SearchVideoImgModel } from '../viewmodel/SearchVideoImgViewModel'; @Component export struct SearchResult { - @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @State resultTabIndex: number = 0; @Consume('pageInfo') pageInfo: VideoNavPathStack; + @ObjectLink mainWindowInfo: WindowInfo; build() { Scroll() { @@ -117,34 +117,34 @@ export struct SearchResult { Row() { Image(item.getImgSrc()) .objectFit(ImageFit.Fill) - .margin({ right: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + .margin({ right: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM ? $r('app.float.previous_one_image_margin_sm') : $r('app.float.previous_one_image_margin') }) .layoutWeight(CommonConstants.THREE) .height(CommonConstants.FULL_PERCENT) Column() { Text(item.getTitle()) - .fontSize(new BreakpointType($r('app.float.search_result_title_font_sm'), - $r('app.float.search_result_title_font_md'), $r('app.float.search_result_title_font_lg')) - .getValue(this.currentWidthBreakpoint)) + .fontSize(new BreakpointType($r('app.float.search_result_title_font_xs'), $r('app.float.search_result_title_font_sm'), + $r('app.float.search_result_title_font_md'), $r('app.float.search_result_title_font_lg'), $r('app.float.search_result_title_font_lg')) + .getValue(this.mainWindowInfo.widthBp)) .fontWeight(CommonConstants.FONT_WEIGHT_500) .maxLines(2) .textOverflow({ overflow: TextOverflow.Ellipsis }) Text(item.getContent()) - .fontSize(new BreakpointType($r('app.float.search_result_content_font_sm'), - $r('app.float.search_result_content_font_md'), $r('app.float.search_result_content_font_lg')) - .getValue(this.currentWidthBreakpoint)) - .lineHeight(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .fontSize(new BreakpointType($r('app.float.search_result_content_font_xs'), $r('app.float.search_result_content_font_sm'), + $r('app.float.search_result_content_font_md'), $r('app.float.search_result_content_font_lg'), $r('app.float.search_result_content_font_xl')) + .getValue(this.mainWindowInfo.widthBp)) + .lineHeight(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.result_card_content_line_lg') : $r('app.float.result_card_content_line')) .opacity(CommonConstants.TEXT_OPACITY[1]) .fontWeight(FontWeight.Normal) .margin({ top: $r('app.float.search_result_content_margin') }) .maxLines(1) Text(item.getOtherInfo()) - .fontSize(new BreakpointType($r('app.float.search_result_content_font_sm'), - $r('app.float.search_result_content_font_md'), $r('app.float.search_result_content_font_lg')) - .getValue(this.currentWidthBreakpoint)) - .lineHeight(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .fontSize(new BreakpointType($r('app.float.search_result_content_font_xs'),$r('app.float.search_result_content_font_sm'), + $r('app.float.search_result_content_font_md'), $r('app.float.search_result_content_font_lg'), $r('app.float.search_result_content_font_xl')) + .getValue(this.mainWindowInfo.widthBp)) + .lineHeight(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.result_card_content_line_lg') : $r('app.float.result_card_content_line')) .opacity(CommonConstants.TEXT_OPACITY[1]) .fontWeight(FontWeight.Normal) @@ -156,9 +156,9 @@ export struct SearchResult { .backgroundColor($r('app.color.button_background_1')) .fontWeight(CommonConstants.FONT_WEIGHT_500) .borderRadius($r('app.float.search_result_button_radius')) - .fontSize(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .fontSize(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.search_result_button_font_lg') : $r('app.float.search_result_button_font')) - .height(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .height(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.search_result_button_height_lg') : $r('app.float.search_result_button_height')) .fontColor(Color.White) .layoutWeight(1) @@ -168,16 +168,16 @@ export struct SearchResult { }) Blank() - .width(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD ? + .width(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_MD ? $r('app.float.search_result_button_blank_md') : $r('app.float.search_result_button_blank')) Button(SearchConstants.SEARCH_RESULT_BUTTON_TEXTS[1]) .backgroundColor($r('app.color.button_background_2')) .fontWeight(CommonConstants.FONT_WEIGHT_500) .borderRadius($r('app.float.search_result_button_radius')) - .fontSize(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .fontSize(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.search_result_button_font_lg') : $r('app.float.search_result_button_font')) - .height(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + .height(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? $r('app.float.search_result_button_height_lg') : $r('app.float.search_result_button_height')) .fontColor($r('app.color.button_background_1')) .layoutWeight(1) @@ -191,18 +191,18 @@ export struct SearchResult { .layoutWeight(3) } .aspectRatio(CommonConstants.PREVIOUS_ONE_ROW_RATIO) - .height(new BreakpointType($r('app.float.result_list_row_height_sm'), - $r('app.float.result_list_row_height_md'), $r('app.float.result_list_row_height_lg')) - .getValue(this.currentWidthBreakpoint)) + .height(new BreakpointType($r('app.float.result_list_row_height_xs'), $r('app.float.result_list_row_height_sm'), + $r('app.float.result_list_row_height_md'), $r('app.float.result_list_row_height_lg'), $r('app.float.result_list_row_height_xl')) + .getValue(this.mainWindowInfo.widthBp)) .width(CommonConstants.FULL_PERCENT) .padding({ - top: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + top: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM ? $r('app.float.result_list_row_padding_sm') : $r('app.float.result_list_row_padding'), - bottom: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + bottom: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM ? $r('app.float.result_list_row_padding_sm') : $r('app.float.result_list_row_padding'), - left: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + left: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM ? $r('app.float.result_list_row_padding_sm') : $r('app.float.result_list_row_padding'), - right: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + right: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_SM ? $r('app.float.result_list_row_padding_sm') : $r('app.float.result_list_row_padding') }) .backgroundColor($r('app.color.result_background')) diff --git a/features/search/src/main/ets/view/SearchResultForTv.ets b/features/search/src/main/ets/view/SearchResultForTv.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c245b6a4340f6995227d0b85acd29166ac42d3d --- /dev/null +++ b/features/search/src/main/ets/view/SearchResultForTv.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CommonConstants, VideoNavPathStack } from '@ohos/commons' +import { SearchConstants } from '../constants/SearchConstants' +import { SearchVideoImgModel } from '../viewmodel/SearchVideoImgViewModel'; +import { SearchTabs } from './SearchTabs' +import { SearchVideos } from './SearchVideos'; + +@Component +export struct SearchResultForTv{ + @State currentIndex: number = 0; + @Consume('pageInfo') pageInfo: VideoNavPathStack; + build() { + Column(){ + this.SearchForHua() + this.SearchResult() + } + } + @Builder + SearchForHua() { + List({ space: 32 }){ + ForEach(SearchConstants.HUA_LIST_FOR_HUA, (item: ResourceStr, index: number) => { + ListItem(){ + Row(){ + Text(item) + .fontSize($r('app.float.search_hua_list_font_tv')) + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + } + .height($r('app.float.search_hua_row_height_tv')) + .borderRadius($r('app.float.search_hua_row_radius_tv')) + .padding({left: $r('app.float.search_hua_item_padding_h_tv'), right: $r('app.float.search_hua_item_padding_h_tv')}) + .backgroundColor($r('app.color.search_history_bg_color'),) + .border({ + color: $r('app.color.search_history_border_color'), + width: 1 + }) + .hoverEffect(HoverEffect.Highlight) + } + }, (item: ResourceStr, index: number) => index + String(item)) + } + .width(CommonConstants.FULL_PERCENT) + .alignListItem(ListItemAlign.Start) + .listDirection(Axis.Horizontal) + .padding({left: $r('app.float.search_tab_list_padding_h_tv')}) + .margin({top: $r('app.float.search_section_margin_top_tv')}) + } + @Builder + SearchResult(){ + SearchTabs({ + currentIndex: this.currentIndex, + list: SearchConstants.SEARCH_RESULT_TAB_LIST, + }) + SearchVideos({ + videoList: new SearchVideoImgModel().getSearchResultList() + }) + } +} \ No newline at end of file diff --git a/features/search/src/main/ets/view/SearchTabs.ets b/features/search/src/main/ets/view/SearchTabs.ets new file mode 100644 index 0000000000000000000000000000000000000000..d62b0420b1fc473920ca11d3922fe45db758661b --- /dev/null +++ b/features/search/src/main/ets/view/SearchTabs.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CommonConstants } from '@ohos/commons' + +@Component +export struct SearchTabs{ + @Link currentIndex: number; + @Prop list: ResourceStr[] = []; + build() { + List({ space: 16 }) { + ForEach(this.list, (item: ResourceStr, index: number) => { + ListItem() { + Column() { + Text(item) + .fontSize($r('app.float.hot_trending_font_tv')) + .lineHeight($r('app.float.hot_trending_line_tv')) + .fontWeight(index === this.currentIndex ? CommonConstants.FONT_WEIGHT_700 : FontWeight.Normal) + .fontColor(index === this.currentIndex ? $r('app.color.type_tabs_font_selected') : $r('app.color.type_tabs_font')).fontColor($r('app.color.color_white')) + .opacity(index === this.currentIndex ? CommonConstants.TEXT_OPACITY[5] : CommonConstants.TEXT_OPACITY[2]) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + } + .padding({top: $r('app.float.search_tab_item_padding_v_tv'), bottom: $r('app.float.search_tab_item_padding_v_tv'), left: $r('app.float.search_tab_item_padding_h_tv'), right: $r('app.float.search_tab_item_padding_h_tv')}) + .height($r('app.float.hot_trending_tab_height_tv')) + .justifyContent(FlexAlign.Start) + } + .onClick(() => { + this.currentIndex = index; + }) + }, (item: ResourceStr, index: number) => index + String(item)) + } + .margin({ top: $r('app.float.tab_list_margin_tv') }) + .padding({top: $r('app.float.search_tab_list_padding_v_tv'), left: $r('app.float.search_tab_list_padding_h_tv'), right: $r('app.float.search_tab_list_padding_h_tv'), bottom: $r('app.float.search_tab_list_padding_v_tv')}) + .listDirection(Axis.Horizontal) + .width(CommonConstants.FULL_PERCENT) + .scrollBar(BarState.Off) + } +} \ No newline at end of file diff --git a/features/search/src/main/ets/view/SearchVideos.ets b/features/search/src/main/ets/view/SearchVideos.ets new file mode 100644 index 0000000000000000000000000000000000000000..bd339e0c33d8d75591354c526d2c1a0b14909e13 --- /dev/null +++ b/features/search/src/main/ets/view/SearchVideos.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CommonConstants, VideoNavPathStack } from '@ohos/commons' +import { SearchVideoImgModel, SearchVideoImg } from '../viewmodel/SearchVideoImgViewModel' + +@Component +export struct SearchVideos{ + @Consume('pageInfo') pageInfo: VideoNavPathStack; + private searchVideoImgModel: SearchVideoImgModel = new SearchVideoImgModel(); + @Prop videoList: SearchVideoImg[] = []; + + build() { + this.resultVideos() + } + + @Builder + resultVideos() { + List({ space: 32 }) { + ForEach(this.videoList || this.searchVideoImgModel.getSearchResultList(), (item: SearchVideoImg, index: number) => { + ListItem() { + Column() { + Image(item.getImgSrc()) + .height($r('app.float.hot_video_img_height')) + .width($r('app.float.hot_video_img_with')) + .borderRadius(12) + .margin({ bottom: $r('app.float.hot_video_img_margin_tv') }) + + Text(item.getTitle()) + .fontSize($r('app.float.hot_video_title_font_tv')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .lineHeight($r('app.float.hot_video_title_line_tv')) + .maxLines(1) + .width(CommonConstants.FULL_PERCENT) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + } + } + .width($r('app.float.hot_video_img_with')) + .onClick(() =>{ + this.pageInfo.setPageName(CommonConstants.PAGE_NAMES[1]); + this.pageInfo.pushPath({ name: CommonConstants.PAGE_NAMES[1] }); + }) + }, (item: SearchVideoImg, index: number) => index + JSON.stringify(item)) + } + .width(CommonConstants.FULL_PERCENT) + .padding({ + top: $r('app.float.hot_video_list_padding'), + left: $r('app.float.search_tab_list_padding_h_tv'), + right: $r('app.float.search_tab_list_padding_h_tv'), + bottom: $r('app.float.hot_video_list_padding') + }) + .clip(false) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.None) + } +} \ No newline at end of file diff --git a/features/search/src/main/ets/view/SearchView.ets b/features/search/src/main/ets/view/SearchView.ets index 2eb2de735f727cbfe4752eef127f00a80fea8c6b..3ef5d29b5d1684665f5b53e4c953d5f68c3b8086 100644 --- a/features/search/src/main/ets/view/SearchView.ets +++ b/features/search/src/main/ets/view/SearchView.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BreakpointConstants, BreakpointType, CommonConstants } from '@ohos/commons'; +import { BreakpointConstants, BreakpointType, CommonConstants, WindowInfo, WindowUtil } from '@ohos/commons'; import { SearchConstants } from '../constants/SearchConstants'; import { SearchVideoImg, SearchVideoImgModel } from '../viewmodel/SearchVideoImgViewModel'; import { SearchContent } from './SearchContent'; @@ -23,31 +23,38 @@ import { SearchResult } from './SearchResult'; @Component export struct SearchView { - @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; + @StorageLink('windowUtil') windowUtil: WindowUtil | undefined = undefined; @StorageLink('currentTopIndex') currentTopIndex: number = 0; + @ObjectLink mainWindowInfo: WindowInfo; @State currentIndex: number = 0; @State searchVideoList: SearchVideoImg[] = []; @State searchInput: string = ''; @Link isSearching: boolean; - + aboutToAppear(): void { + this.windowUtil!.mainWindow.setWindowDecorHeight(SearchConstants.SEARCH_DECOR_HEIGHT); + } build() { GridRow({ columns: { + xs: BreakpointConstants.GRID_ROW_COLUMNS[2], sm: BreakpointConstants.GRID_ROW_COLUMNS[2], md: BreakpointConstants.GRID_ROW_COLUMNS[0], - lg: BreakpointConstants.GRID_ROW_COLUMNS[0] + lg: BreakpointConstants.GRID_ROW_COLUMNS[0], + xl: BreakpointConstants.GRID_ROW_COLUMNS[0], } }) { GridCol({ span: { + xs: BreakpointConstants.GRID_COLUMN_SPANS[5], sm: BreakpointConstants.GRID_COLUMN_SPANS[5], md: BreakpointConstants.GRID_COLUMN_SPANS[0], - lg: BreakpointConstants.GRID_COLUMN_SPANS[0] + lg: BreakpointConstants.GRID_COLUMN_SPANS[0], + xl: BreakpointConstants.GRID_COLUMN_SPANS[0] } }) { Column() { - SearchHeader({ isSearching: $isSearching, searchInput: $searchInput, currentTopIndex: $currentTopIndex }) - SearchContent({ searchVideoList: $searchVideoList }) + SearchHeader({ isSearching: $isSearching, searchInput: $searchInput, currentTopIndex: $currentTopIndex, mainWindowInfo: this.mainWindowInfo }) + SearchContent({ searchVideoList: $searchVideoList, mainWindowInfo: this.mainWindowInfo }) .layoutWeight(1) .visibility(this.searchInput === SearchConstants.SEARCH_INPUT_LIST[0] || this.searchInput === SearchConstants.SEARCH_INPUT_LIST[1] ? Visibility.None : Visibility.Visible) @@ -55,7 +62,9 @@ export struct SearchView { .layoutWeight(1) .visibility(this.searchInput === SearchConstants.SEARCH_INPUT_LIST[0] ? Visibility.Visible : Visibility.None) - SearchResult() + SearchResult({ + mainWindowInfo: this.windowUtil?.mainWindowInfo + }) .layoutWeight(1) .visibility(this.searchInput === SearchConstants.SEARCH_INPUT_LIST[1] ? Visibility.Visible : Visibility.None) @@ -63,14 +72,14 @@ export struct SearchView { .height(CommonConstants.FULL_PERCENT) .width(CommonConstants.FULL_PERCENT) .padding({ - left: new BreakpointType($r('app.float.view_grid_col_padding_sm'), $r('app.float.view_grid_col_padding_md'), - $r('app.float.view_grid_col_padding_lg')).getValue(this.currentWidthBreakpoint), - right: new BreakpointType($r('app.float.view_grid_col_padding_sm'), $r('app.float.view_grid_col_padding_md'), - $r('app.float.view_grid_col_padding_lg')).getValue(this.currentWidthBreakpoint) + left: new BreakpointType($r('app.float.view_grid_col_padding_xs'), $r('app.float.view_grid_col_padding_sm'), $r('app.float.view_grid_col_padding_md'), + $r('app.float.view_grid_col_padding_lg'), $r('app.float.view_grid_col_padding_xl')).getValue(this.mainWindowInfo.widthBp), + right: new BreakpointType($r('app.float.view_grid_col_padding_xs'), $r('app.float.view_grid_col_padding_sm'), $r('app.float.view_grid_col_padding_md'), + $r('app.float.view_grid_col_padding_lg'), $r('app.float.view_grid_col_padding_xl')).getValue(this.mainWindowInfo.widthBp) }) } } - .padding({ left: (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG) && (this.currentTopIndex === 2) ? + .padding({ left: (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG || this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_XL) && (this.currentTopIndex === 2) ? $r('app.float.search_view_grid_row_padding') : 0 }) .onBreakpointChange((breakPoints) => { this.searchVideoList = new SearchVideoImgModel().getTrendSearchList(breakPoints); diff --git a/features/search/src/main/ets/view/SearchViewForTv.ets b/features/search/src/main/ets/view/SearchViewForTv.ets new file mode 100644 index 0000000000000000000000000000000000000000..bcb0c56356f04e7b5b771c5ccc13338a3eb32740 --- /dev/null +++ b/features/search/src/main/ets/view/SearchViewForTv.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonConstants, VideoNavPathStack } from '@ohos/commons'; +import { SearchConstants } from '../constants/SearchConstants'; +import { SearchVideoImg, SearchVideoImgModel } from '../viewmodel/SearchVideoImgViewModel'; +import { SearchContentForTv } from './SearchContentForTv'; +import { SearchResultForTv } from './SearchResultForTv'; +import { SearchKeyboardViewModel, KeyboardItem } from '../viewmodel/SearchKeyboardViewModel'; +@Entry +@Component +export struct SearchViewForTv { + @State isHover: boolean = false; + private keyboard: SearchKeyboardViewModel = new SearchKeyboardViewModel(); + private videoImgModel: SearchVideoImgModel = new SearchVideoImgModel(); + @State searchInput: string = ''; + @Link isSearching: boolean; + @State selectionStart: number = 0; + @State selectionEnd: number = 0; + @State nextCaret: number = -1; + private textInputController: TextInputController = new TextInputController(); + + build() { + Column(){ + this.searchHeader() + this.KeyBoardGrid() + SearchContentForTv() + .visibility(this.searchInput === SearchConstants.SEARCH_INPUT_LIST[2] ? Visibility.None : + Visibility.Visible) + SearchResultForTv() + .visibility(this.searchInput === SearchConstants.SEARCH_INPUT_LIST[2] ? Visibility.Visible : + Visibility.None) + } + .margin({ top: $r('app.float.search_header_margin_top_tv') }) + .padding({ bottom: $r('app.float.search_body_scroll_padding_bottom_tv')}) + .width(CommonConstants.FULL_PERCENT) + } + + @Builder + searchHeader(){ + Stack({ alignContent: Alignment.Start }){ + TextInput({ placeholder: $r('app.string.search2'), text: this.searchInput, controller: this.textInputController }) + .placeholderFont({ + size: $r('app.float.search_header_text_font_tv'), + weight: FontWeight.Normal + }) + .placeholderColor($r('app.color.search_placeholder')) + .fontColor(Color.White) + .fontSize($r('app.float.search_header_text_font_tv')) + .width(CommonConstants.FULL_PERCENT) + .backgroundColor(this.isHover ? Color.Transparent: Color.Transparent) + .enableKeyboardOnFocus(false) + .padding({left: $r('app.float.search_input_padding_tv'), top: 0, bottom: 0}) + .onChange((value: string) => { + this.searchInput = value; + this.setCaret() + }) + .onHover((isHover) => { + this.isHover = isHover + }) + .onTouch((event)=>{ + this.isHover = event.type === TouchType.Down; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=> { + this.selectionStart = selectionStart; + this.selectionEnd = selectionEnd; + }) + .alignSelf(ItemAlign.Center) + .layoutWeight(1) + + Image($r("app.media.ic_public_search2")) + .width($r('app.float.search_header_search_img_size_tv')) + .height($r('app.float.search_header_search_img_size_tv')) + } + .alignSelf(ItemAlign.Center) + .width($r('app.float.search_header_width')) + .height($r('app.float.search_header_height')) + // .margin({ top: $r('app.float.search_header_margin_top_tv') }) + .padding({ bottom: $r('app.float.search_header_padding_bottom_tv') }) + .border({ width: { bottom: $r('app.float.search_header_border_bottom_width_tv') }, color: { bottom: $r('app.color.search_header_border_tv') } }) + } + @Styles + TextInputOnClicked(){ + .backgroundColor(Color.Black) + } + @Builder + KeyBoardGrid(){ + Row(){ + Grid(){ + ForEach(this.keyboard.getLetterList(), (item: KeyboardItem)=> { + GridItem(){ + this.KeyBoardGridItem(item) + } + .backgroundColor('rgba(241,243,245,0.2)') + .borderRadius($r('app.float.keyboard_key_radius_tv')) + .columnStart(item.columnStart) + .columnEnd(item.columnEnd) + .clip(false) + }, (item: KeyboardItem, index: number) => item.label + JSON.stringify(item)) + } + .clip(false) + .width($r('app.float.keyboard_letters_grid_width_tv')) + .height($r('app.float.keyboard_grid_height_tv')) + .rowsGap($r('app.float.keyboard_grid_gap_tv')) + .columnsGap($r('app.float.keyboard_grid_gap_tv')) + .rowsTemplate('1fr 1fr 1fr') + .columnsTemplate('repeat(10, 1fr)') + + Grid(){ + ForEach(this.keyboard.getDigitList(), (item: KeyboardItem)=> { + GridItem(){ + this.KeyBoardGridItem(item) + } + .backgroundColor('rgba(241,243,245,0.2)') + .borderRadius(8) + .columnStart(item.columnStart) + .columnEnd(item.columnEnd) + .clip(false) + }, (item: KeyboardItem, index: number) => index + JSON.stringify(item)) + } + .width(318) + .height(138) + .clip(false) + .rowsGap(5) + .columnsGap(5) + .rowsTemplate('1fr 1fr 1fr') + .columnsTemplate('1fr 1fr 1fr 1fr') + } + .padding({ + left: $r('app.float.search_tab_list_padding_h_tv'), right: $r('app.float.search_tab_list_padding_h_tv') + }) + .margin({top: $r('app.float.search_keyboard_margin_top_tv')}) + .justifyContent(FlexAlign.SpaceBetween) + .width(CommonConstants.FULL_PERCENT) + } + + @Builder + KeyBoardGridItem(item:KeyboardItem){ + Row(){ + if(item.label === SearchConstants.SEARCH_ACTION[0]){ + this.KeyBoardImg($r("app.media.ic_public_trash_fill")) + }else if (item.label === SearchConstants.SEARCH_ACTION[1]){ + Row(){ + this.KeyBoardImg($r("app.media.ic_public_delete_left_fill")) + Text('退格') + .fontColor($r('app.color.color_white')) + .opacity(CommonConstants.TEXT_OPACITY[5]) + .fontSize($r('app.float.keyboard_action_text_font_tv')) + .margin({left: 4}) + } + }else{ + Text(item.label) + .fontColor(Color.White) + .fontSize($r('app.float.keyboard_key_text_font_tv')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + } + } + .hoverEffect(HoverEffect.Highlight) + .height(CommonConstants.FULL_PERCENT) + .width(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.Center) + .onClick(()=>{ + this.onKeyPress(item.label) + }) + } + + @Builder + KeyBoardImg(img: ResourceStr){ + Image(img) + .width($r('app.float.keyboard_img_size_tv')) + .height($r('app.float.keyboard_img_size_tv')) + } + + @Builder + searchDiscovery(){ + Text('大家都在搜') + .fontWeight(CommonConstants.FONT_WEIGHT_700) + .fontSize($r('app.float.search_discovery_title_font_tv')) + .lineHeight($r('app.float.search_discovery_title_line_tv')) + .padding({ + top: $r('app.float.search_discovery_title_padding_top_tv'), + bottom: $r('app.float.search_discovery_title_padding_bottom_tv'), + left: $r('app.float.search_tab_list_padding_h_tv') + }) + .width(CommonConstants.FULL_PERCENT) + .textAlign(TextAlign.Start) + List({ space: 32 }){ + ForEach(this.videoImgModel.getDiscoverSearchList(), (item: SearchVideoImg, index: number) => { + ListItem(){ + Column(){ + Image(item.getImgSrc()) + .width($r('app.float.discover_video_img_width_tv')) + .borderRadius($r('app.float.discover_video_img_radius_tv')) + .margin({bottom: $r('app.float.discover_video_img_margin_bottom_tv')}) + Text(item.getTitle()) + .fontSize($r('app.float.hot_video_title_font_tv')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .lineHeight($r('app.float.hot_video_title_line_tv')) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width(CommonConstants.FULL_PERCENT) + } + } + .width($r('app.float.discover_card_width_tv')) + }, (item: SearchVideoImg, index: number) => index + JSON.stringify(item)) + } + .width(CommonConstants.FULL_PERCENT) + .alignListItem(ListItemAlign.Start) + .listDirection(Axis.Horizontal) + .padding({left: $r('app.float.search_tab_list_padding_h_tv'), right: $r('app.float.search_tab_list_padding_h_tv')}) + } + + private onKeyPress(key: ResourceStr): void { + const len = this.selectionEnd - this.selectionStart; + switch (key) { + case SearchConstants.SEARCH_ACTION[0]: { + this.searchInput = ''; + break; + } + case SearchConstants.SEARCH_ACTION[1]: { + if (len > 0) { + this.nextCaret = this.selectionStart + this.searchInput = this.searchInput.slice(0, this.selectionStart) + this.searchInput.slice(this.selectionEnd); + } else if (this.selectionStart > 0) { + this.nextCaret = this.selectionStart - 1 + this.searchInput = this.searchInput.slice(0, this.selectionStart - 1) + this.searchInput.slice(this.selectionEnd); + } + break; + } + default: { + const beforeCursor = this.searchInput.slice(0, this.selectionStart); + const afterCursor = this.searchInput.slice(this.selectionEnd); + this.searchInput = beforeCursor + key + afterCursor; + this.nextCaret = this.selectionStart + 1 + break; + } + } + } + setCaret() { + if (this.nextCaret !== -1) { + console.info('to keep caret position right, change caret to', this.nextCaret) + this.textInputController.caretPosition(this.nextCaret) + this.nextCaret = -1 + } + } +} diff --git a/features/search/src/main/ets/viewmodel/SearchKeyboardViewModel.ets b/features/search/src/main/ets/viewmodel/SearchKeyboardViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c53b91b7ab93ef598bb31b48c182f5d997eee4b3 --- /dev/null +++ b/features/search/src/main/ets/viewmodel/SearchKeyboardViewModel.ets @@ -0,0 +1,42 @@ +import { SearchConstants } from '../constants/SearchConstants'; + +// 统一的键盘项类型 +export interface KeyboardItem { + label: ResourceStr; + columnStart?: number; + columnEnd?: number; +} + +export class SearchKeyboardViewModel { + // 特殊键布局常量 + private static readonly BACKSPACE_START = 7; + private static readonly BACKSPACE_END = 10; + private static readonly ZERO_START = 1; + private static readonly ZERO_END = 4; + + private letterKeys: ResourceStr[] = [ + 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', + 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', SearchConstants.SEARCH_ACTION[0], + 'Z', 'X', 'C', 'V', 'B', 'N', 'M', SearchConstants.SEARCH_ACTION[1] + ]; + private digitKeys: ResourceStr[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; + + // 统一构造 KeyboardItem + private makeItem(label: ResourceStr): KeyboardItem { + if (label === SearchConstants.SEARCH_ACTION[1]) { + return { label, columnStart: SearchKeyboardViewModel.BACKSPACE_START, columnEnd: SearchKeyboardViewModel.BACKSPACE_END }; + } + if (label === '0') { + return { label, columnStart: SearchKeyboardViewModel.ZERO_START, columnEnd: SearchKeyboardViewModel.ZERO_END }; + } + return { label }; + } + + getLetterList(): KeyboardItem[] { + return this.letterKeys.map((k) => this.makeItem(k)); + } + + getDigitList(): KeyboardItem[] { + return this.digitKeys.map((k) => this.makeItem(k)); + } +} \ No newline at end of file diff --git a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets index 7e268f5cd0a012b231b14f8a28a03c896e9cd02c..4909aa03385de0a08cacee21072d620fe1470681 100644 --- a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets +++ b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets @@ -20,6 +20,10 @@ export class SearchVideoImgModel { private trendingSearchList: SearchVideoImg[] = []; private searchResultImgList: SearchVideoImg[] = []; + private discoverSearchList: SearchVideoImg[] = []; + private hotSearchList: SearchVideoImg[] = []; + private searchResultList: SearchVideoImg[] = []; + constructor() { this.trendingSearchList.push(new SearchVideoImg($r('app.media.search_video_1'), SearchConstants.SEARCH_IMG_IMG_TITLES[0], SearchConstants.SEARCH_IMG_IMG_CONTENTS[0], '')); @@ -54,6 +58,42 @@ export class SearchVideoImgModel { this.searchResultImgList.push(new SearchVideoImg($r('app.media.search_result_3'), SearchConstants.SEARCH_RESULT_TITLES[2], SearchConstants.SEARCH_RESULT_CONTENTS[2], SearchConstants.SEARCH_RESULT_MORE[2])); + + + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_1'), + SearchConstants.HOT_ACTION[0], '', '')); + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_2'), + SearchConstants.HOT_ACTION[0], '', '')); + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_3'), + SearchConstants.HOT_ACTION[0], '', '')); + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_4'), + SearchConstants.HOT_ACTION[0], '', '')); + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_5'), + SearchConstants.HOT_ACTION[0], '', '')); + this.discoverSearchList.push(new SearchVideoImg($r('app.media.discover_6'), + SearchConstants.HOT_ACTION[0], '', '')); + + this.hotSearchList.push(new SearchVideoImg($r('app.media.peripheral_video_1'), + SearchConstants.SEARCH_IMG_IMG_TITLES[0], '', '')); + this.hotSearchList.push(new SearchVideoImg($r('app.media.peripheral_video_2'), + SearchConstants.SEARCH_IMG_IMG_TITLES[0], '', '')); + this.hotSearchList.push(new SearchVideoImg($r('app.media.peripheral_video_3'), + SearchConstants.SEARCH_IMG_IMG_TITLES[0], '', '')); + this.hotSearchList.push(new SearchVideoImg($r('app.media.peripheral_video_4'), + SearchConstants.SEARCH_IMG_IMG_TITLES[0], '', '')); + this.hotSearchList.push(new SearchVideoImg($r('app.media.peripheral_video_5'), + SearchConstants.SEARCH_IMG_IMG_TITLES[0], '', '')); + + this.searchResultList.push(new SearchVideoImg($r('app.media.peripheral_video_1'), + SearchConstants.SEARCH_RESULT_IMG_TITLES[0], '', '')); + this.searchResultList.push(new SearchVideoImg($r('app.media.peripheral_video_2'), + SearchConstants.SEARCH_RESULT_IMG_TITLES[0], '', '')); + this.searchResultList.push(new SearchVideoImg($r('app.media.peripheral_video_3'), + SearchConstants.SEARCH_RESULT_IMG_TITLES[0], '', '')); + this.searchResultList.push(new SearchVideoImg($r('app.media.peripheral_video_4'), + SearchConstants.SEARCH_RESULT_IMG_TITLES[0], '', '')); + this.searchResultList.push(new SearchVideoImg($r('app.media.peripheral_video_5'), + SearchConstants.SEARCH_RESULT_IMG_TITLES[0], '', '')); } getTrendSearchList(currentWidthBreakpoint: string): SearchVideoImg[] { @@ -69,6 +109,16 @@ export class SearchVideoImgModel { getSearchResultImgList(): SearchVideoImg[] { return this.searchResultImgList; } + + getDiscoverSearchList(): SearchVideoImg[] { + return this.discoverSearchList; + } + getHotSearchList(): SearchVideoImg[] { + return this.hotSearchList; + } + getSearchResultList(): SearchVideoImg[] { + return this.searchResultList; + } } export class SearchVideoImg { diff --git a/features/search/src/main/resources/base/element/color.json b/features/search/src/main/resources/base/element/color.json index 02a3a2ab8e2d2290a63353bae8a7f3f263f53f4e..ccbaf3420800f7003c0bf6c9dcda17a4ea4acb21 100644 --- a/features/search/src/main/resources/base/element/color.json +++ b/features/search/src/main/resources/base/element/color.json @@ -19,6 +19,50 @@ { "name": "result_background", "value": "#F1F3F5" + }, + { + "name": "search_header_background", + "value": "#0D000000" + }, + { + "name": "search_header_img_color", + "value": "#99000000" + }, + { + "name": "hot_video_list_divider_color", + "value": "#0D000000" + }, + { + "name": "search_placeholder", + "value": "#99ffffff" + }, + { + "name": "search_border", + "value": "#26FFFFFF" + }, + { + "name": "search_background", + "value": "#1AFFFFFF" + }, + { + "name": "search_title", + "value": "#E6ffffff" + }, + { + "name": "color_white", + "value": "#FFFFFF" + }, + { + "name": "search_history_border_color", + "value": "#26FFFFFF" + }, + { + "name": "search_history_bg_color", + "value": "#1AFFFFFF" + }, + { + "name": "search_header_border_tv", + "value": "#33FFFFFF" } ] } \ No newline at end of file diff --git a/features/search/src/main/resources/base/element/float.json b/features/search/src/main/resources/base/element/float.json index 4e540261bc867bd420ac4825cdd7fccadb05143d..c8f101bfb9207c42032c56ece4d6008be1eb01b5 100644 --- a/features/search/src/main/resources/base/element/float.json +++ b/features/search/src/main/resources/base/element/float.json @@ -40,6 +40,14 @@ "name": "search_history_content_row_radius", "value": "14vp" }, + { + "name": "search_history_content_row_radius_xl", + "value": "8vp" + }, + { + "name": "search_content_margin_right_xs", + "value": "8vp" + }, { "name": "search_content_margin_right_sm", "value": "8vp" @@ -50,7 +58,11 @@ }, { "name": "search_content_margin_right_lg", - "value": "24vp" + "value": "16vp" + }, + { + "name": "search_content_margin_right_xl", + "value": "16vp" }, { "name": "search_discovery_img_size", @@ -156,6 +168,10 @@ "name": "hot_video_list_padding", "value": "12vp" }, + { + "name": "hot_video_list_divider_start_margin", + "value": "63vp" + }, { "name": "search_hua_list_font", "value": "16fp" @@ -180,13 +196,21 @@ "name": "search_hua_list_padding", "value": "16vp" }, + { + "name": "search_header_back_size", + "value": "40vp" + }, + { + "name": "search_header_back_border_radius", + "value": "1000vp" + }, { "name": "search_header_back_img_size", "value": "24vp" }, { "name": "search_header_back_img_margin", - "value": "24vp" + "value": "8vp" }, { "name": "search_header_text_font", @@ -196,6 +220,10 @@ "name": "search_header_text_height", "value": "40vp" }, + { + "name": "search_header_text_height_tv", + "value": "32vp" + }, { "name": "search_header_text_left", "value": "36vp" @@ -292,6 +320,10 @@ "name": "grid_row_gutter", "value": "12vp" }, + { + "name": "search_result_title_font_xs", + "value": "14fp" + }, { "name": "search_result_title_font_sm", "value": "14fp" @@ -304,6 +336,14 @@ "name": "search_result_title_font_lg", "value": "18fp" }, + { + "name": "search_result_title_font_xl", + "value": "18fp" + }, + { + "name": "search_result_content_font_xs", + "value": "10fp" + }, { "name": "search_result_content_font_sm", "value": "10fp" @@ -316,6 +356,10 @@ "name": "search_result_content_font_lg", "value": "14fp" }, + { + "name": "search_result_content_font_xl", + "value": "14fp" + }, { "name": "search_result_content_margin", "value": "4vp" @@ -352,6 +396,10 @@ "name": "search_result_button_blank", "value": "6vp" }, + { + "name": "result_list_row_height_xs", + "value": "179vp" + }, { "name": "result_list_row_height_sm", "value": "179vp" @@ -364,6 +412,10 @@ "name": "result_list_row_height_lg", "value": "238vp" }, + { + "name": "result_list_row_height_xl", + "value": "238vp" + }, { "name": "result_list_row_padding_sm", "value": "10vp" @@ -380,6 +432,10 @@ "name": "result_grid_row_margin", "value": "12vp" }, + { + "name": "view_grid_col_padding_xs", + "value": "16vp" + }, { "name": "view_grid_col_padding_sm", "value": "16vp" @@ -392,6 +448,10 @@ "name": "view_grid_col_padding_lg", "value": "32vp" }, + { + "name": "view_grid_col_padding_xl", + "value": "32vp" + }, { "name": "previous_one_image_margin_sm", "value": "10vp" @@ -403,6 +463,231 @@ { "name": "search_view_grid_row_padding", "value": "96vp" + }, + { + "name": "hot_video_row_height_tv", + "value": "80vp" + }, + { + "name": "hot_video_row_width_tv", + "value": "397vp" + }, + + { + "name": "search_header_width", + "value": "757vp" + }, + { + "name": "search_header_height", + "value": "48vp" + }, + { + "name": "search_header_search_img_size_tv", + "value": "32vp" + }, + { + "name": "search_input_padding_tv", + "value": "50vp" + }, + { + "name": "hot_video_img_with", + "value": "208vp" + }, + { + "name": "hot_video_img_height", + "value": "290vp" + }, + { + "name": "hot_video_img_margin_tv", + "value": "16vp" + }, + { + "name": "tab_list_margin_tv", + "value": "16vp" + }, + { + "name": "hot_trending_tab_height_tv", + "value": "48vp" + }, + { + "name": "hot_trending_line_tv", + "value": "32vp" + }, + { + "name": "hot_trending_font_tv", + "value": "24fp" + }, + { + "name": "hot_video_title_font_tv", + "value": "18fp" + }, + { + "name": "hot_video_title_line_tv", + "value": "24vp" + }, + { + "name": "search_header_text_font_tv", + "value": "24fp" + }, + { + "name": "search_tab_list_space_tv", + "value": "16vp" + }, + { + "name": "search_tab_list_padding_v_tv", + "value": "19vp" + }, + { + "name": "search_tab_list_padding_h_tv", + "value": "56vp" + }, + { + "name": "search_tab_item_padding_v_tv", + "value": "8vp" + }, + { + "name": "search_tab_item_padding_h_tv", + "value": "22vp" + }, + { + "name": "search_result_list_space_tv", + "value": "32vp" + }, + { + "name": "search_hua_list_font_tv", + "value": "24fp" + }, + { + "name": "search_hua_row_height_tv", + "value": "56vp" + }, + { + "name": "search_hua_row_radius_tv", + "value": "28vp" + }, + { + "name": "search_hua_item_padding_h_tv", + "value": "16vp" + }, + { + "name": "search_section_margin_top_tv", + "value": "32vp" + }, + { + "name": "search_discovery_title_font_tv", + "value": "26fp" + }, + { + "name": "search_discovery_title_line_tv", + "value": "35vp" + }, + { + "name": "search_discovery_title_padding_top_tv", + "value": "35vp" + }, + { + "name": "search_discovery_title_padding_bottom_tv", + "value": "16vp" + }, + { + "name": "discover_video_img_width_tv", + "value": "168vp" + }, + { + "name": "discover_video_img_height_tv", + "value": "232vp" + }, + { + "name": "discover_video_img_radius_tv", + "value": "16vp" + }, + { + "name": "discover_video_img_margin_bottom_tv", + "value": "16vp" + }, + { + "name": "discover_card_width_tv", + "value": "168vp" + }, + { + "name": "hot_video_img_radius_tv", + "value": "12vp" + }, + { + "name": "search_history_border_width_tv", + "value": "1vp" + }, + { + "name": "keyboard_img_size_tv", + "value": "28vp" + }, + { + "name": "keyboard_delete_img_size_tv", + "value": "26vp" + }, + { + "name": "keyboard_action_text_font_tv", + "value": "18fp" + }, + { + "name": "keyboard_key_text_font_tv", + "value": "20fp" + }, + { + "name": "keyboard_action_text_margin_left_tv", + "value": "2vp" + }, + { + "name": "keyboard_key_radius_tv", + "value": "8vp" + }, + { + "name": "keyboard_grid_gap_tv", + "value": "5vp" + }, + { + "name": "keyboard_letters_grid_width_tv", + "value": "804vp" + }, + { + "name": "keyboard_digits_grid_width_tv", + "value": "318vp" + }, + { + "name": "keyboard_grid_height_tv", + "value": "138vp" + }, + { + "name": "search_header_margin_top_tv", + "value": "128vp" + }, + { + "name": "search_header_padding_bottom_tv", + "value": "16vp" + }, + { + "name": "search_header_border_bottom_width_tv", + "value": "2vp" + }, + { + "name": "search_body_scroll_padding_bottom_tv", + "value": "48vp" + }, + { + "name": "search_root_padding_top_tv", + "value": "32vp" + }, + { + "name": "search_keyboard_margin_top_tv", + "value": "24vp" + }, + { + "name": "search_debug_placeholder_width_tv", + "value": "562vp" + }, + { + "name": "search_debug_placeholder_height_tv", + "value": "54vp" } - ] -} \ No newline at end of file + ] + } \ No newline at end of file diff --git a/features/search/src/main/resources/base/element/string.json b/features/search/src/main/resources/base/element/string.json index 5a8df8baffa27a35abfd5310dc11a0c3121ef4e4..96355bf4031588832cd881cfd5bbdcec52f3fbb9 100644 --- a/features/search/src/main/resources/base/element/string.json +++ b/features/search/src/main/resources/base/element/string.json @@ -48,6 +48,14 @@ "name": "history_search", "value": "搜索历史" }, + { + "name": "history_del", + "value": "删除历史" + }, + { + "name": "history_record", + "value": "搜索历史记录内容" + }, { "name": "content", "value": "搜索内容" @@ -99,6 +107,26 @@ { "name": "cache", "value": "缓存" + }, + { + "name": "search2", + "value": "搜索片名、演员或导演" + }, + { + "name": "clear", + "value": "CLEAR" + }, + { + "name": "delete", + "value": "DELETE" + }, + { + "name": "title_content", + "value": "标题内容" + }, + { + "name": "product_launch", + "value": "HUAWEI P60系列发布会…" } ] } \ No newline at end of file diff --git a/features/search/src/main/resources/base/media/discover_1.png b/features/search/src/main/resources/base/media/discover_1.png new file mode 100644 index 0000000000000000000000000000000000000000..35d47d00d4b5b30d3686fef0f48493cdaa13fa03 Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_1.png differ diff --git a/features/search/src/main/resources/base/media/discover_2.png b/features/search/src/main/resources/base/media/discover_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c0323f4793ddf9e18ee1f0e7e8ea08545944050a Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_2.png differ diff --git a/features/search/src/main/resources/base/media/discover_3.png b/features/search/src/main/resources/base/media/discover_3.png new file mode 100644 index 0000000000000000000000000000000000000000..4180b2054911ec6e0bf98b7757ab6ae93693e522 Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_3.png differ diff --git a/features/search/src/main/resources/base/media/discover_4.png b/features/search/src/main/resources/base/media/discover_4.png new file mode 100644 index 0000000000000000000000000000000000000000..f234ea2f4ff9cf22d6fb5e50fd3e4e958ea93f58 Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_4.png differ diff --git a/features/search/src/main/resources/base/media/discover_5.png b/features/search/src/main/resources/base/media/discover_5.png new file mode 100644 index 0000000000000000000000000000000000000000..d27057837163e75917e27d02cf2c0b8f82169d1b Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_5.png differ diff --git a/features/search/src/main/resources/base/media/discover_6.png b/features/search/src/main/resources/base/media/discover_6.png new file mode 100644 index 0000000000000000000000000000000000000000..2a484b6b412c947baa99c4f1adc9c4f7b6999c23 Binary files /dev/null and b/features/search/src/main/resources/base/media/discover_6.png differ diff --git a/features/search/src/main/resources/base/media/ic_public_arrow_left.svg b/features/search/src/main/resources/base/media/ic_public_arrow_left.svg new file mode 100644 index 0000000000000000000000000000000000000000..1e9405ce617d5dca35385a994b5ce7e384f78dd1 --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_arrow_left.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_arrow_left + + + + + + + + + + \ No newline at end of file diff --git a/features/search/src/main/resources/base/media/ic_public_arrow_left1.svg b/features/search/src/main/resources/base/media/ic_public_arrow_left1.svg new file mode 100644 index 0000000000000000000000000000000000000000..ff0d648a34d65bea63f7d68c138f1bf6b59016f6 --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_arrow_left1.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/features/search/src/main/resources/base/media/ic_public_delete1.svg b/features/search/src/main/resources/base/media/ic_public_delete1.svg new file mode 100644 index 0000000000000000000000000000000000000000..5ce444f0c6946e51cb6482f1d55804a223eef470 --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_delete1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/features/search/src/main/resources/base/media/ic_public_delete_left_fill.svg b/features/search/src/main/resources/base/media/ic_public_delete_left_fill.svg new file mode 100644 index 0000000000000000000000000000000000000000..557fef10a653c925e1fcf801bf4d4f8a5fe5e96b --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_delete_left_fill.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/features/search/src/main/resources/base/media/ic_public_rotate1.svg b/features/search/src/main/resources/base/media/ic_public_rotate1.svg new file mode 100644 index 0000000000000000000000000000000000000000..30317ef59f5017de3b636be675e4d56eb1b989da --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_rotate1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/features/search/src/main/resources/base/media/ic_public_search2.png b/features/search/src/main/resources/base/media/ic_public_search2.png new file mode 100644 index 0000000000000000000000000000000000000000..663074a8d119b54ea52d9ec608cd53299745c5a3 Binary files /dev/null and b/features/search/src/main/resources/base/media/ic_public_search2.png differ diff --git a/features/search/src/main/resources/base/media/ic_public_trash_fill.svg b/features/search/src/main/resources/base/media/ic_public_trash_fill.svg new file mode 100644 index 0000000000000000000000000000000000000000..210210c8cda4508c6cf96f12336d6e86872f97be --- /dev/null +++ b/features/search/src/main/resources/base/media/ic_public_trash_fill.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/features/search/src/main/resources/base/media/peripheral_video_1.png b/features/search/src/main/resources/base/media/peripheral_video_1.png new file mode 100644 index 0000000000000000000000000000000000000000..28e7f5ee960817f36460e3eba6f9dc67c197f54b Binary files /dev/null and b/features/search/src/main/resources/base/media/peripheral_video_1.png differ diff --git a/features/search/src/main/resources/base/media/peripheral_video_2.png b/features/search/src/main/resources/base/media/peripheral_video_2.png new file mode 100644 index 0000000000000000000000000000000000000000..a610c54fea006cac3603ae137a9030b5818c07ad Binary files /dev/null and b/features/search/src/main/resources/base/media/peripheral_video_2.png differ diff --git a/features/search/src/main/resources/base/media/peripheral_video_3.png b/features/search/src/main/resources/base/media/peripheral_video_3.png new file mode 100644 index 0000000000000000000000000000000000000000..d3c32b0efd898aeef11e64ce290c22eb9f693cf7 Binary files /dev/null and b/features/search/src/main/resources/base/media/peripheral_video_3.png differ diff --git a/features/search/src/main/resources/base/media/peripheral_video_4.png b/features/search/src/main/resources/base/media/peripheral_video_4.png new file mode 100644 index 0000000000000000000000000000000000000000..7e259fe31e462502e229354a3b029e2d9d02d0a1 Binary files /dev/null and b/features/search/src/main/resources/base/media/peripheral_video_4.png differ diff --git a/features/search/src/main/resources/base/media/peripheral_video_5.png b/features/search/src/main/resources/base/media/peripheral_video_5.png new file mode 100644 index 0000000000000000000000000000000000000000..6868a2e576e1b56b719310e9c71ec902db78e10d Binary files /dev/null and b/features/search/src/main/resources/base/media/peripheral_video_5.png differ diff --git a/features/search/src/main/resources/en_US/element/string.json b/features/search/src/main/resources/en_US/element/string.json index 557986b70b93b32e3443ea30df05b3dc79359dd3..b939be4de8b50854012626c96329aed2ed8c2c6d 100644 --- a/features/search/src/main/resources/en_US/element/string.json +++ b/features/search/src/main/resources/en_US/element/string.json @@ -4,6 +4,10 @@ "name": "search", "value": "Search 1" }, + { + "name": "search2", + "value": "Search by title, actor, or director" + }, { "name": "top", "value": "top" @@ -48,6 +52,14 @@ "name": "history_search", "value": "Search history" }, + { + "name": "history_del", + "value": "Delete history" + }, + { + "name": "history_record", + "value": "search history" + }, { "name": "content", "value": "content" @@ -99,6 +111,22 @@ { "name": "cache", "value": "cache" + }, + { + "name": "clear", + "value": "CLEAR" + }, + { + "name": "delete", + "value": "DELETE" + }, + { + "name": "title_content", + "value": "title content" + }, + { + "name": "product_launch", + "value": "HUAWEI P60 Series Launch Event" } ] } \ No newline at end of file diff --git a/features/search/src/main/resources/zh_CN/element/string.json b/features/search/src/main/resources/zh_CN/element/string.json index 5a8df8baffa27a35abfd5310dc11a0c3121ef4e4..b1d59073f21498c78b6092fdd54ad92ed272ffa8 100644 --- a/features/search/src/main/resources/zh_CN/element/string.json +++ b/features/search/src/main/resources/zh_CN/element/string.json @@ -4,6 +4,10 @@ "name": "search", "value": "搜索发现1" }, + { + "name": "search2", + "value": "搜索片名、演员或导演" + }, { "name": "top", "value": "热搜" @@ -48,6 +52,14 @@ "name": "history_search", "value": "搜索历史" }, + { + "name": "history_del", + "value": "删除历史" + }, + { + "name": "history_record", + "value": "搜索历史记录内容" + }, { "name": "content", "value": "搜索内容" @@ -99,6 +111,22 @@ { "name": "cache", "value": "缓存" + }, + { + "name": "clear", + "value": "CLEAR" + }, + { + "name": "delete", + "value": "DELETE" + }, + { + "name": "title_content", + "value": "标题内容" + }, + { + "name": "product_launch", + "value": "HUAWEI P60系列发布会…" } ] } \ No newline at end of file