feat: fix typo
This commit is contained in:
parent
3b901cae90
commit
62a8357d77
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright [2021] [Doric.Pub]
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package pub.doric.shader;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.github.pengfeizhou.jscore.JSObject;
|
||||
import com.github.pengfeizhou.jscore.JSValue;
|
||||
|
||||
import pub.doric.DoricContext;
|
||||
import pub.doric.extension.bridge.DoricPlugin;
|
||||
import pub.doric.utils.DoricUtils;
|
||||
|
||||
/**
|
||||
* @Description: Describe the effect view
|
||||
* @Author: pengfei.zhou
|
||||
* @CreateDate: 2021/11/24
|
||||
*/
|
||||
@DoricPlugin(name = "AeroEffect")
|
||||
public class AeroEffectViewNode extends StackNode {
|
||||
public AeroEffectViewNode(DoricContext doricContext) {
|
||||
super(doricContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FrameLayout build() {
|
||||
return new BlurEffectView(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void blend(FrameLayout view, String name, JSValue prop) {
|
||||
if ("radius".equals(name)) {
|
||||
if (prop.isNumber()) {
|
||||
((BlurEffectView) view).setRadius(prop.asNumber().toInt());
|
||||
}
|
||||
} else if ("effectiveRect".equals(name)) {
|
||||
if (prop.isObject()) {
|
||||
int x = DoricUtils.dp2px(prop.asObject().getProperty("x").asNumber().toFloat());
|
||||
int y = DoricUtils.dp2px(prop.asObject().getProperty("x").asNumber().toFloat());
|
||||
int width = DoricUtils.dp2px(prop.asObject().getProperty("width").asNumber().toFloat());
|
||||
int height = DoricUtils.dp2px(prop.asObject().getProperty("height").asNumber().toFloat());
|
||||
((BlurEffectView) view).setEffectiveRect(new Rect(x, y, x + width, y + height));
|
||||
}
|
||||
} else {
|
||||
super.blend(view, name, prop);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void blendSubNode(JSObject subProp) {
|
||||
super.blendSubNode(subProp);
|
||||
mView.invalidate();
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@
|
||||
#import "DoricRemoteResourceLoader.h"
|
||||
#import "DoricCommonBundleResourceLoader.h"
|
||||
#import "DoricBlurEffectViewNode.h"
|
||||
#import "DoricAreoEffectViewNode.h"
|
||||
#import "DoricAeroEffectViewNode.h"
|
||||
|
||||
@interface DoricRegistry ()
|
||||
|
||||
@ -136,7 +136,7 @@ - (void)innerRegister {
|
||||
[self registerViewNode:DoricFlexNode.class withName:@"FlexLayout"];
|
||||
[self registerViewNode:DoricGestureContainerNode.class withName:@"GestureContainer"];
|
||||
[self registerViewNode:DoricBlurEffectViewNode.class withName:@"BlurEffect"];
|
||||
[self registerViewNode:DoricAreoEffectViewNode.class withName:@"AreoEffect"];
|
||||
[self registerViewNode:DoricAeroEffectViewNode.class withName:@"AeroEffect"];
|
||||
|
||||
[self.loaderManager registerLoader:[[DoricBundleResourceLoader alloc]
|
||||
initWithResourceType:@"mainBundle"
|
||||
|
@ -20,5 +20,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DoricStackNode.h"
|
||||
|
||||
@interface DoricAreoEffectViewNode : DoricStackNode
|
||||
@end
|
||||
@interface DoricAeroEffectViewNode : DoricStackNode
|
||||
@end
|
@ -17,13 +17,13 @@
|
||||
// Created by pengfei.zhou on 2021/11/24.
|
||||
//
|
||||
|
||||
#import "DoricAreoEffectViewNode.h"
|
||||
#import "DoricAeroEffectViewNode.h"
|
||||
|
||||
@interface DoricAreoEffectViewNode ()
|
||||
@interface DoricAeroEffectViewNode ()
|
||||
@property(nonatomic, strong) UIVisualEffectView *visualEffectView;
|
||||
@end
|
||||
|
||||
@implementation DoricAreoEffectViewNode
|
||||
@implementation DoricAeroEffectViewNode
|
||||
|
||||
- (UIView *)build {
|
||||
UIView *ret = [super build];
|
@ -3634,6 +3634,17 @@ var BlurEffect = /** @class */ (function (_super) {
|
||||
], BlurEffect.prototype, "radius", void 0);
|
||||
return BlurEffect;
|
||||
}(Stack));
|
||||
var AeroEffect = /** @class */ (function (_super) {
|
||||
__extends$2(AeroEffect, _super);
|
||||
function AeroEffect() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], AeroEffect.prototype, "effectiveRect", void 0);
|
||||
return AeroEffect;
|
||||
}(Stack));
|
||||
function blurEffect(views, config) {
|
||||
var ret = new BlurEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
@ -3650,6 +3661,22 @@ function blurEffect(views, config) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function aeroEffect(views, config) {
|
||||
var ret = new AeroEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views);
|
||||
}
|
||||
else {
|
||||
views.forEach(function (e) {
|
||||
ret.addChild(e);
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function modal(context) {
|
||||
return {
|
||||
@ -4459,6 +4486,7 @@ var ModularPanel = /** @class */ (function (_super) {
|
||||
return ModularPanel;
|
||||
}(Module));
|
||||
|
||||
exports.AeroEffect = AeroEffect;
|
||||
exports.AlphaAnimation = AlphaAnimation;
|
||||
exports.AnimationSet = AnimationSet;
|
||||
exports.AssetResource = AssetResource;
|
||||
@ -4526,6 +4554,7 @@ exports.View = View;
|
||||
exports.ViewComponent = ViewComponent;
|
||||
exports.ViewHolder = ViewHolder;
|
||||
exports.ViewModel = ViewModel;
|
||||
exports.aeroEffect = aeroEffect;
|
||||
exports.animate = animate;
|
||||
exports.blurEffect = blurEffect;
|
||||
exports.coordinator = coordinator;
|
||||
|
@ -2742,6 +2742,12 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], BlurEffect.prototype, "radius", void 0);
|
||||
class AeroEffect extends Stack {
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], AeroEffect.prototype, "effectiveRect", void 0);
|
||||
function blurEffect(views, config) {
|
||||
const ret = new BlurEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
@ -2758,6 +2764,22 @@ function blurEffect(views, config) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function aeroEffect(views, config) {
|
||||
const ret = new AeroEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views);
|
||||
}
|
||||
else {
|
||||
views.forEach(e => {
|
||||
ret.addChild(e);
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function modal(context) {
|
||||
return {
|
||||
@ -3407,6 +3429,7 @@ class ModularPanel extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
exports.AeroEffect = AeroEffect;
|
||||
exports.AlphaAnimation = AlphaAnimation;
|
||||
exports.AnimationSet = AnimationSet;
|
||||
exports.AssetResource = AssetResource;
|
||||
@ -3474,6 +3497,7 @@ exports.View = View;
|
||||
exports.ViewComponent = ViewComponent;
|
||||
exports.ViewHolder = ViewHolder;
|
||||
exports.ViewModel = ViewModel;
|
||||
exports.aeroEffect = aeroEffect;
|
||||
exports.animate = animate;
|
||||
exports.blurEffect = blurEffect;
|
||||
exports.coordinator = coordinator;
|
||||
|
@ -4263,6 +4263,12 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], BlurEffect.prototype, "radius", void 0);
|
||||
class AeroEffect extends Stack {
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], AeroEffect.prototype, "effectiveRect", void 0);
|
||||
function blurEffect(views, config) {
|
||||
const ret = new BlurEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
@ -4279,6 +4285,22 @@ function blurEffect(views, config) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function aeroEffect(views, config) {
|
||||
const ret = new AeroEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views);
|
||||
}
|
||||
else {
|
||||
views.forEach(e => {
|
||||
ret.addChild(e);
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function modal(context) {
|
||||
return {
|
||||
@ -5169,6 +5191,7 @@ global$1.nativeEmpty = () => {
|
||||
}, 0);
|
||||
};
|
||||
|
||||
exports.AeroEffect = AeroEffect;
|
||||
exports.AlphaAnimation = AlphaAnimation;
|
||||
exports.AnimationSet = AnimationSet;
|
||||
exports.AssetResource = AssetResource;
|
||||
@ -5236,6 +5259,7 @@ exports.View = View;
|
||||
exports.ViewComponent = ViewComponent;
|
||||
exports.ViewHolder = ViewHolder;
|
||||
exports.ViewModel = ViewModel;
|
||||
exports.aeroEffect = aeroEffect;
|
||||
exports.animate = animate;
|
||||
exports.blurEffect = blurEffect;
|
||||
exports.coordinator = coordinator;
|
||||
|
13
doric-js/index.d.ts
vendored
13
doric-js/index.d.ts
vendored
@ -1110,7 +1110,20 @@ declare module 'doric/lib/src/widget/effect' {
|
||||
*/
|
||||
radius?: number;
|
||||
}
|
||||
export class AeroEffect extends Stack {
|
||||
/**
|
||||
* Specify the effective rectangle.
|
||||
* If not set, the default is the entire area.
|
||||
*/
|
||||
effectiveRect?: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
export function blurEffect(views: View | View[], config?: Partial<BlurEffect>): BlurEffect;
|
||||
export function aeroEffect(views: View | View[], config?: Partial<AeroEffect>): AeroEffect;
|
||||
}
|
||||
|
||||
declare module 'doric/lib/src/native/modal' {
|
||||
|
13
doric-js/lib/src/widget/effect.d.ts
vendored
13
doric-js/lib/src/widget/effect.d.ts
vendored
@ -18,4 +18,17 @@ export declare class BlurEffect extends Stack {
|
||||
*/
|
||||
radius?: number;
|
||||
}
|
||||
export declare class AeroEffect extends Stack {
|
||||
/**
|
||||
* Specify the effective rectangle.
|
||||
* If not set, the default is the entire area.
|
||||
*/
|
||||
effectiveRect?: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
export declare function blurEffect(views: View | View[], config?: Partial<BlurEffect>): BlurEffect;
|
||||
export declare function aeroEffect(views: View | View[], config?: Partial<AeroEffect>): AeroEffect;
|
||||
|
@ -35,6 +35,12 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], BlurEffect.prototype, "radius", void 0);
|
||||
export class AeroEffect extends Stack {
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], AeroEffect.prototype, "effectiveRect", void 0);
|
||||
export function blurEffect(views, config) {
|
||||
const ret = new BlurEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
@ -51,3 +57,19 @@ export function blurEffect(views, config) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
export function aeroEffect(views, config) {
|
||||
const ret = new AeroEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views);
|
||||
}
|
||||
else {
|
||||
views.forEach(e => {
|
||||
ret.addChild(e);
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -38,6 +38,22 @@ export class BlurEffect extends Stack {
|
||||
radius?: number
|
||||
}
|
||||
|
||||
|
||||
export class AeroEffect extends Stack {
|
||||
/**
|
||||
* Specify the effective rectangle.
|
||||
* If not set, the default is the entire area.
|
||||
*/
|
||||
@Property
|
||||
effectiveRect?: {
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function blurEffect(views: View | View[], config?: Partial<BlurEffect>) {
|
||||
const ret = new BlurEffect
|
||||
ret.layoutConfig = layoutConfig().fit()
|
||||
@ -52,4 +68,20 @@ export function blurEffect(views: View | View[], config?: Partial<BlurEffect>) {
|
||||
ret.apply(config)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
export function aeroEffect(views: View | View[], config?: Partial<AeroEffect>) {
|
||||
const ret = new AeroEffect
|
||||
ret.layoutConfig = layoutConfig().fit()
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views)
|
||||
} else {
|
||||
views.forEach(e => {
|
||||
ret.addChild(e)
|
||||
})
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config)
|
||||
}
|
||||
return ret
|
||||
}
|
24
doric-web/dist/index.js
vendored
24
doric-web/dist/index.js
vendored
@ -4317,6 +4317,12 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], BlurEffect.prototype, "radius", void 0);
|
||||
class AeroEffect extends Stack {
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], AeroEffect.prototype, "effectiveRect", void 0);
|
||||
function blurEffect(views, config) {
|
||||
const ret = new BlurEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
@ -4333,6 +4339,22 @@ function blurEffect(views, config) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function aeroEffect(views, config) {
|
||||
const ret = new AeroEffect;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
if (views instanceof View) {
|
||||
ret.addChild(views);
|
||||
}
|
||||
else {
|
||||
views.forEach(e => {
|
||||
ret.addChild(e);
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function modal(context) {
|
||||
return {
|
||||
@ -4982,6 +5004,7 @@ class ModularPanel extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
exports.AeroEffect = AeroEffect;
|
||||
exports.AlphaAnimation = AlphaAnimation;
|
||||
exports.AnimationSet = AnimationSet;
|
||||
exports.AssetResource = AssetResource;
|
||||
@ -5049,6 +5072,7 @@ exports.View = View;
|
||||
exports.ViewComponent = ViewComponent;
|
||||
exports.ViewHolder = ViewHolder;
|
||||
exports.ViewModel = ViewModel;
|
||||
exports.aeroEffect = aeroEffect;
|
||||
exports.animate = animate;
|
||||
exports.blurEffect = blurEffect;
|
||||
exports.coordinator = coordinator;
|
||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user