Feature/update cli (#4)

* fix js api typo

* update doric-cli target file
This commit is contained in:
osborn 2019-12-23 17:29:42 +08:00 committed by GitHub
parent efe0756541
commit c1776f6f25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 17 additions and 16 deletions

View File

@ -28,8 +28,8 @@ android {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "pub.doric:core:0.1.2" implementation "pub.doric:core:0.2.0"
debugImplementation "pub.doric:core:0.1.2" debugImplementation "pub.doric:core:0.2.0"
} }
} }

View File

@ -21,6 +21,7 @@ allprojects {
maven { maven {
url "https://dl.bintray.com/osborn/Android" url "https://dl.bintray.com/osborn/Android"
} }
maven { url 'https://jitpack.io' }
} }
} }

View File

@ -6,5 +6,5 @@ target 'Example' do
use_frameworks! use_frameworks!
# Pods for Example # Pods for Example
pod 'Doric-framework' pod 'DoricCore', '~>0.2.0'
end end

View File

@ -21,13 +21,13 @@ class __$__ extends Panel {
onClick: () => { onClick: () => {
number.text = `${++count}` number.text = `${++count}`
}, },
layoutConfig: layoutConfig().exactly(), layoutConfig: layoutConfig().just(),
width: 200, width: 200,
height: 50, height: 50,
}), }),
]) ])
.apply({ .apply({
layoutConfig: layoutConfig().exactly().a(Gravity.Center), layoutConfig: layoutConfig().just().configAlignment(Gravity.Center),
width: 200, width: 200,
height: 200, height: 200,
space: 20, space: 20,

View File

@ -10,7 +10,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"doric": "0.1.3", "doric": "0.2.0",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rollup": "^1.27.14", "rollup": "^1.27.14",
"@rollup/plugin-commonjs": "^11.0.0", "@rollup/plugin-commonjs": "^11.0.0",

View File

@ -31,7 +31,7 @@ class FlowDemo extends Panel {
text: `${idx}`, text: `${idx}`,
textColor: Color.WHITE, textColor: Color.WHITE,
textSize: 20, textSize: 20,
layoutConfig: layoutConfig().fit().configAligmnet(Gravity.Center) layoutConfig: layoutConfig().fit().configAlignmnet(Gravity.Center)
})) }))
}) })
}, },
@ -51,7 +51,7 @@ class FlowDemo extends Panel {
text: 'load more', text: 'load more',
textColor: Color.WHITE, textColor: Color.WHITE,
textSize: 20, textSize: 20,
layoutConfig: layoutConfig().fit().configAligmnet(Gravity.Center) layoutConfig: layoutConfig().fit().configAlignmnet(Gravity.Center)
})) }))
}) })
}) })

View File

@ -33,7 +33,7 @@ class ListPanel extends Panel {
} }
it.loadMoreView = listItem(text({ it.loadMoreView = listItem(text({
text: "Loading", text: "Loading",
layoutConfig: layoutConfig().most().configHeight(LayoutSpec.JUST).configAligmnet(Gravity.Center), layoutConfig: layoutConfig().most().configHeight(LayoutSpec.JUST).configAlignmnet(Gravity.Center),
height: 50, height: 50,
})) }))
it.renderItem = (idx: number) => { it.renderItem = (idx: number) => {

View File

@ -19,7 +19,7 @@ class PopoverDemo extends Panel {
height: 50, height: 50,
backgroundColor: colors[0], backgroundColor: colors[0],
textColor: Color.WHITE, textColor: Color.WHITE,
layoutConfig: layoutConfig().just().configAligmnet(Gravity.Center), layoutConfig: layoutConfig().just().configAlignmnet(Gravity.Center),
text: "This is PopOver Window", text: "This is PopOver Window",
}).also(v => { }).also(v => {
let idx = 0 let idx = 0

View File

@ -34,7 +34,7 @@ class SliderPanel extends Panel {
return slideItem(image({ return slideItem(image({
imageUrl: imageUrls[idx % imageUrls.length], imageUrl: imageUrls[idx % imageUrls.length],
scaleType: ScaleType.ScaleAspectFit, scaleType: ScaleType.ScaleAspectFit,
layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST).configHeight(LayoutSpec.MOST).configAligmnet(gravity().center()), layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST).configHeight(LayoutSpec.MOST).configAlignmnet(gravity().center()),
})).also(it => { })).also(it => {
let start = idx let start = idx
it.onClick = () => { it.onClick = () => {

View File

@ -83,7 +83,7 @@ class StickDemo extends Panel {
text: `In Page ${idx},${itemIdx}`, text: `In Page ${idx},${itemIdx}`,
textColor: Color.WHITE, textColor: Color.WHITE,
textSize: 20, textSize: 20,
layoutConfig: layoutConfig().fit().configAligmnet(Gravity.Center) layoutConfig: layoutConfig().fit().configAlignmnet(Gravity.Center)
}).also(v => { }).also(v => {
v.onClick = () => { v.onClick = () => {
v.text = "Clicked" v.text = "Clicked"
@ -120,7 +120,7 @@ class StickDemo extends Panel {
e.textColor = Color.BLACK e.textColor = Color.BLACK
} }
}) })
this.indicator.layoutConfig = layoutConfig().just().configAligmnet(Gravity.Bottom).configMargin({ bottom: 13 }) this.indicator.layoutConfig = layoutConfig().just().configAlignmnet(Gravity.Bottom).configMargin({ bottom: 13 })
animate(context)({ animate(context)({
animations: () => { animations: () => {
this.indicator.centerX = this.getRootView().width / this.tabs.length * (page + 0.5) this.indicator.centerX = this.getRootView().width / this.tabs.length * (page + 0.5)

View File

@ -556,7 +556,7 @@ class LayoutConfigImpl {
this.margin = m; this.margin = m;
return this; return this;
} }
configAligmnet(a) { configAlignmnet(a) {
this.alignment = a; this.alignment = a;
return this; return this;
} }

View File

@ -2004,7 +2004,7 @@ class LayoutConfigImpl {
this.margin = m; this.margin = m;
return this; return this;
} }
configAligmnet(a) { configAlignmnet(a) {
this.alignment = a; this.alignment = a;
return this; return this;
} }

View File

@ -96,7 +96,7 @@ export class LayoutConfigImpl implements LayoutConfig, Modeling {
return this return this
} }
configAligmnet(a: Gravity) { configAlignmnet(a: Gravity) {
this.alignment = a this.alignment = a
return this return this
} }