王士厅
... ... @@ -237,14 +237,13 @@ export struct MorningEveningPaperComponent {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getLargestProportionColor();
let color = colorPicker.getMainColorSync();
console.log(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
}
... ...
... ... @@ -98,18 +98,18 @@ export struct PaperTitleComponent {
})
.margin({ right: 16 })
Image($r('app.media.icon_share'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.alignRules({
right: { anchor: "img_close", align: HorizontalAlign.Start },
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('img_share')
.margin({ right: 16 })
.onClick(() => {
this.share()
})
// Image($r('app.media.icon_share'))
// .height($r('app.float.top_arrow_size'))
// .width($r('app.float.top_arrow_size'))
// .alignRules({
// right: { anchor: "img_close", align: HorizontalAlign.Start },
// center: { anchor: "__container__", align: VerticalAlign.Center }
// })
// .id('img_share')
// .margin({ right: 16 })
// .onClick(() => {
// this.share()
// })
}
// .margin({ left: 14, right: 14 })
.height($r('app.float.top_bar_height'))
... ...
... ... @@ -2,14 +2,15 @@ import { ENewspaperPageComponent } from 'wdComponent';
import { DateTimeUtils, Logger } from 'wdKit';
import common from '@ohos.app.ability.common';
import window from '@ohos.window';
import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
const TAG = 'ENewspaper';
//电子报主页面
@Entry
@Component
struct ENewspaper {
pageShowTime:number = 0;
pageShowTime: number = 0;
// 获取UIAbility上下文
context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
... ... @@ -49,15 +50,16 @@ struct ENewspaper {
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.setSystemBar('#80000000','#80000000', '#FFFFFFFF')
this.setSystemBar('#00000000', '#00000000', '#FFFFFFFF')
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
this.setSystemBar('#FFFFFFFF', '#00000000', '#000000')
Logger.info(TAG, 'onPageHide');
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage, Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000))
}
onBackPress() {
... ...
... ... @@ -14,6 +14,19 @@
}
},
{
"intentName": "ViewColumn",
"domain": "",
"intentVersion": "1.0.1",
"srcEntry": "./ets/utils/InsightIntentExecutorImpl.ets",
"uiAbility": {
"ability": "EntryAbility",
"executeMode": [
"background",
"foreground"
]
}
},
{
"intentName": "ViewColumnUpdate",
"domain": "",
"intentVersion": "1.0.1",
... ...