feat:Add Complext Demo
This commit is contained in:
parent
2e96912a99
commit
6d86b8cfeb
@ -30,6 +30,8 @@ import androidx.swiperefreshlayout.widget.CircularProgressDrawable;
|
|||||||
|
|
||||||
import android.view.animation.Animation.AnimationListener;
|
import android.view.animation.Animation.AnimationListener;
|
||||||
|
|
||||||
|
import pub.doric.utils.DoricUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: pub.doric.pullable
|
* @Description: pub.doric.pullable
|
||||||
* @Author: pengfei.zhou
|
* @Author: pengfei.zhou
|
||||||
@ -912,7 +914,7 @@ public class DoricSwipeLayout extends ViewGroup implements NestedScrollingParent
|
|||||||
ViewCompat.offsetTopAndBottom(mRefreshView, offset);
|
ViewCompat.offsetTopAndBottom(mRefreshView, offset);
|
||||||
mCurrentTargetOffsetTop = mRefreshView.getTop();
|
mCurrentTargetOffsetTop = mRefreshView.getTop();
|
||||||
if (mRefreshView.getMeasuredHeight() > 0) {
|
if (mRefreshView.getMeasuredHeight() > 0) {
|
||||||
mRefreshView.setPullingDistance((float) mRefreshView.getBottom());
|
mRefreshView.setPullingDistance(DoricUtils.px2dp(mRefreshView.getBottom()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Panel, Group, vlayout, image, layoutConfig, ScaleType, refreshable, Color, pullable, stack, Image, Refreshable, TranslationAnimation } from "doric";
|
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 { title, icon_refresh } from "./utils";
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ -23,8 +23,9 @@ class MyDemo extends Panel {
|
|||||||
},
|
},
|
||||||
stopAnimation: () => {
|
stopAnimation: () => {
|
||||||
},
|
},
|
||||||
setPullingDistance: (rotation: number) => {
|
setPullingDistance: (distance: number) => {
|
||||||
headerImage.scaleX = headerImage.scaleY = (headerImage.height + rotation) / headerImage.height
|
headerImage.scaleX = headerImage.scaleY = (headerImage.height + distance * 2) / headerImage.height
|
||||||
|
log(`Header Image scaleY:${headerImage.scaleY},height:${headerImage.height},distance:${distance}`)
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
content: vlayout([]).apply({
|
content: vlayout([]).apply({
|
||||||
|
@ -69,6 +69,9 @@ - (BOOL)requestFromSubview:(UIView *)subview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)layoutSelf:(CGSize)targetSize {
|
- (void)layoutSelf:(CGSize)targetSize {
|
||||||
|
if (self.contentOffset.y != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.width = targetSize.width;
|
self.width = targetSize.width;
|
||||||
self.height = targetSize.height;
|
self.height = targetSize.height;
|
||||||
[self.headerView also:^(UIView *it) {
|
[self.headerView also:^(UIView *it) {
|
||||||
|
Reference in New Issue
Block a user