feat:sync lost changes
This commit is contained in:
parent
4a8aaebbc7
commit
82c338bf76
@ -1,5 +1,5 @@
|
||||
import { Panel, Group, vlayout, image, layoutConfig, ScaleType, refreshable, Color, pullable, stack, Image, Refreshable, TranslationAnimation, loge, log } from "doric";
|
||||
import { title, icon_refresh } from "./utils";
|
||||
import { Panel, Group, vlayout, image, layoutConfig, ScaleType, refreshable, Color, pullable, stack, Image, Refreshable, TranslationAnimation, loge, log, list, listItem, text } from "doric";
|
||||
import { title, icon_refresh, colors } from "./utils";
|
||||
|
||||
@Entry
|
||||
class MyDemo extends Panel {
|
||||
@ -11,7 +11,7 @@ class MyDemo extends Panel {
|
||||
onRefresh: () => {
|
||||
refreshed.setRefreshing(context, false)
|
||||
},
|
||||
header: pullable(context,
|
||||
header: pullable(
|
||||
stack([]).apply({
|
||||
backgroundColor: Color.RED,
|
||||
layoutConfig: layoutConfig().exactly(),
|
||||
@ -25,11 +25,21 @@ class MyDemo extends Panel {
|
||||
},
|
||||
setPullingDistance: (distance: number) => {
|
||||
headerImage.scaleX = headerImage.scaleY = (headerImage.height + distance * 2) / headerImage.height
|
||||
log(`Header Image scaleY:${headerImage.scaleY},height:${headerImage.height},distance:${distance}`)
|
||||
},
|
||||
}),
|
||||
content: vlayout([]).apply({
|
||||
backgroundColor: Color.YELLOW,
|
||||
content: list({
|
||||
itemCount: 20,
|
||||
renderItem: (idx) => {
|
||||
return listItem(text({
|
||||
text: `Item :${idx}`,
|
||||
layoutConfig: layoutConfig().exactly(),
|
||||
width: root.width,
|
||||
height: 50,
|
||||
textColor: Color.WHITE,
|
||||
backgroundColor: colors[idx % colors.length],
|
||||
}))
|
||||
}
|
||||
}).apply({
|
||||
}),
|
||||
}).apply({
|
||||
layoutConfig: layoutConfig().atmost(),
|
||||
|
@ -31,6 +31,12 @@ class CounterView extends ViewHolder<CountModel> {
|
||||
widthSpec: LayoutSpec.WRAP_CONTENT,
|
||||
heightSpec: LayoutSpec.WRAP_CONTENT,
|
||||
},
|
||||
padding: {
|
||||
left: 10,
|
||||
right: 10,
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
},
|
||||
shadow: {
|
||||
color: Color.parse("#00ff00"),
|
||||
opacity: 0.5,
|
||||
|
@ -91,7 +91,7 @@ class ListPanel extends Panel {
|
||||
})
|
||||
})
|
||||
},
|
||||
header: rotatedArrow(context),
|
||||
header: rotatedArrow(),
|
||||
content: list({
|
||||
itemCount: 0,
|
||||
renderItem: () => new ListItem,
|
||||
|
@ -13,7 +13,7 @@ class RefreshableDemo extends Panel {
|
||||
refreshView.setRefreshing(context, false)
|
||||
}, 5000)
|
||||
},
|
||||
header: pullable(context,
|
||||
header: pullable(
|
||||
stack([
|
||||
image({
|
||||
layoutConfig: layoutConfig().exactly().m({ top: 50, bottom: 10, }),
|
||||
|
@ -48,9 +48,9 @@ export function title(str: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function rotatedArrow(context: BridgeContext) {
|
||||
export function rotatedArrow() {
|
||||
let refreshImage: Image
|
||||
return pullable(context,
|
||||
return pullable(
|
||||
stack([
|
||||
image({
|
||||
layoutConfig: layoutConfig().exactly().m({ top: 50, bottom: 10, }),
|
||||
|
Reference in New Issue
Block a user