提交 71427c2e 编写于 作者: S sunjiakun
上级 4686f719
......@@ -27,6 +27,10 @@ struct DatePickerExample {
@State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}
@State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}}
@State disappearTextStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title3"),weight:FontWeight.Lighter}}
@State textStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title2"),weight:FontWeight.Normal}}
@State selectedTextStyleDefault: PickerTextStyle ={color:$r("sys.color.ohos_id_color_text_primary_activated"),font:{size:$r("sys.float.ohos_id_text_size_headline8"),weight:FontWeight.Bold}}
private stateChangCallBack = (eventData) => {
console.info("select page state change called:" + JSON.stringify(eventData));
if (eventData != null) {
......@@ -73,6 +77,20 @@ struct DatePickerExample {
.onChange((date: DatePickerResult) => {
console.info( 'select current date is: ' + JSON.stringify(date))
})
DatePicker({
start: new Date('1970-1-1'),
end: new Date('2100-1-1'),
selected: this.selectedDate
})
.lunar(true)
.disappearTextStyle(this.disappearTextStyleDefault)
.textStyle(this.textStyleDefault)
.selectedTextStyle(this.selectedTextStyleDefault)
.key('datePickerDefault')
.onChange((date: DatePickerResult) => {
console.info( 'select current date is: ' + JSON.stringify(date))
})
}
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ import testsuite from '../../test/List.test'
@Component
struct progressTest {
@State progress: ProgressMask = new ProgressMask(10.0, 100.0, 0x01006CDE);
@State progress_default: ProgressMask = new ProgressMask(10.0, 100.0, $r('sys.color.ohos_id_color_mask_regular'));
aboutToAppear(){
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
......@@ -44,6 +45,13 @@ struct progressTest {
.backgroundColor(Color.Pink)
.width('500px').height('280px')
}
ListItem() {
Image($r('app.media.icon'))
.key("ArkUX_Stage_Progress_updateColor_default")
.mask(this.progress_default)
.backgroundColor(Color.Pink)
.width('500px').height('280px')
}
ListItem() {
Button("updateColor_restore")
.key("ArkUX_Stage_Progress_updateColor_restore")
......@@ -191,100 +199,6 @@ struct progressTest {
.fontSize(10)
}
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0100")
.borderColor(0x00ff00)
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0200")
.borderColor('#fffd0000')
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0300")
.borderColor("rgb(138,43,226)")
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0400")
.borderColor(Color.Pink)
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0500")
.borderColor($r("app.color.Progress_borderColor"))
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0600")
.borderColor("")
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0700")
.borderColor(null)
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0800")
.borderColor(undefined)
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_0900")
.borderColor("rgb(138,43,226)")
.borderColor("#FFFD0000")
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_1000")
.borderColor(Color.Pink)
.borderColor("")
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_1100")
.borderColor('bgr(138,43,226)')
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_1200")
.borderColor(0x00ff00)
.backgroundColor(Color.Pink)
.width('500px')
.height('50px')
}
ListItem() {
Progress({ value: 20, total: 150, type: ProgressType.Capsule })
.key("ArkUX_Stage_Progress_borderColor_1300")
.width('500px')
.height('50px')
}
}
}
.width('100%')
......
......@@ -59,6 +59,13 @@ struct TabsExample {
@State selfSubTabBorderRadiusStr: string = "20vp"
@State selfMarginTopStr: string = "10vp"
@State defaultDividerColor: Resource = $r("sys.color.ohos_id_color_list_separator")
@State defaultIndicatorColor: Resource = $r("sys.color.ohos_id_color_subtab_line_on")
@State defaultIndicatorMarginTop: Resource = $r("sys.float.ohos_id_subtab_line_gap")
@State defaultIndicatorHeight: Resource = $r("sys.float.ohos_id_subtab_line_height")
@State defaultSubTabBorderRadius: Resource = $r("sys.float.ohos_id_corner_radius_clicked")
@State defaultSubTabTextSize: Resource = $r("sys.float.ohos_id_text_size_body1")
@State selfSelectedMode: SelectedMode = SelectedMode.INDICATOR
private stateChangCallBack = (eventData) => {
......@@ -358,6 +365,43 @@ struct TabsExample {
.height('200vp')
.width('90%')
.key('tabsTest5')
Tabs({ barPosition: BarPosition.Start, controller: this.controller2 }) {
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Pink)
}
.key('defaultSubTab')
.tabBar(SubTabBarStyle.of('pink')
.indicator({
marginTop:this.defaultIndicatorMarginTop,
color: this.defaultIndicatorColor,
height: this.defaultIndicatorHeight
})
.board({
borderRadius:this.defaultSubTabBorderRadius
})
.labelStyle({
font: { size: this.defaultSubTabTextSize }
})
)
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Yellow)
}.tabBar('yellow')
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Blue)
}.tabBar('blue')
}
.vertical(true).scrollable(true).barMode(BarMode.Fixed)
.barWidth(70).barHeight('100%').animationDuration(400)
.onChange((index: number) => {
console.info(index.toString())
})
.divider({ strokeWidth: '1vp',
color: this.defaultDividerColor
})
.height('200vp')
.width('90%')
.key('defaultTabs')
}
}
......
......@@ -29,6 +29,9 @@ struct TextPickerExample {
@State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}
@State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}}
@State disappearTextStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title3"),weight:FontWeight.Lighter}}
@State textStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title2"),weight:FontWeight.Normal}}
@State selectedTextStyleDefault: PickerTextStyle ={color:$r("sys.color.ohos_id_color_text_primary_activated"),font:{size:$r("sys.float.ohos_id_text_size_headline8"),weight:FontWeight.Bold}}
private stateChangCallBack = (eventData) => {
console.info("select page state change called:" + JSON.stringify(eventData));
......@@ -71,6 +74,15 @@ struct TextPickerExample {
.onChange((value: string, index: number) => {
console.info('Picker item changed, value: ' + value + ', index: ' + index)
})
TextPicker({range: this.multipleColumns,selected: this.select})
.disappearTextStyle(this.disappearTextStyleDefault)
.textStyle(this.textStyleDefault)
.selectedTextStyle(this.selectedTextStyleDefault)
.key('textPickerDefault')
.onChange((value: string, index: number) => {
console.info('Picker item changed, value: ' + value + ', index: ' + index)
})
}
}
}
......@@ -27,6 +27,10 @@ struct TimePickerExample {
@State textStyle: PickerTextStyle = {color:Color.Red,font:{size:'10px',weight:FontWeight.Normal}}
@State selectedTextStyle: PickerTextStyle = {color:Color.Blue,font:{size:'20px',weight:FontWeight.Bold}}
@State disappearTextStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title3"),weight:FontWeight.Lighter}}
@State textStyleDefault: PickerTextStyle = {color:$r("sys.color.ohos_id_color_text_primary"),font:{size:$r("sys.float.ohos_id_text_size_sub_title2"),weight:FontWeight.Normal}}
@State selectedTextStyleDefault: PickerTextStyle ={color:$r("sys.color.ohos_id_color_text_primary_activated"),font:{size:$r("sys.float.ohos_id_text_size_headline8"),weight:FontWeight.Bold}}
private stateChangCallBack = (eventData) => {
console.info("select page state change called:" + JSON.stringify(eventData));
if (eventData != null) {
......@@ -68,6 +72,15 @@ struct TimePickerExample {
.onChange((date: TimePickerResult) => {
console.info('select current date is: ' + JSON.stringify(date))
})
TimePicker({selected: this.selectedTime})
.disappearTextStyle(this.disappearTextStyleDefault)
.textStyle(this.textStyleDefault)
.selectedTextStyle(this.selectedTextStyleDefault)
.key('timePickerDefault')
.onChange((date: TimePickerResult) => {
console.info('select current date is: ' + JSON.stringify(date))
})
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册