mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
Remove deprecated methods
commit_hash:71761a7acdae1649de07f6a52151b79d76dc5e13
This commit is contained in:
@@ -202,7 +202,7 @@ extension DivBase {
|
||||
_ context: DivBlockModelingContext,
|
||||
paddings: EdgeInsets
|
||||
) -> LayoutTrait {
|
||||
resolveWidthTrait(context).trim(paddings.horizontalInsets)
|
||||
resolveWidthTrait(context).trim(paddings.horizontal)
|
||||
}
|
||||
|
||||
func getTransformedHeight(_ context: DivBlockModelingContext) -> DivSize {
|
||||
@@ -221,7 +221,7 @@ extension DivBase {
|
||||
_ context: DivBlockModelingContext,
|
||||
paddings: EdgeInsets
|
||||
) -> LayoutTrait {
|
||||
resolveHeightTrait(context).trim(paddings.verticalInsets)
|
||||
resolveHeightTrait(context).trim(paddings.vertical)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,9 @@ final class DecoratingBlock: WrapperBlock {
|
||||
}
|
||||
|
||||
func intrinsicContentHeight(forWidth width: CGFloat) -> CGFloat {
|
||||
let childWidth = max(0, width - paddings.horizontalInsets.sum)
|
||||
let childWidth = max(0, width - paddings.horizontal.sum)
|
||||
return child.intrinsicContentHeight(forWidth: childWidth).roundedToScreenScale
|
||||
+ paddings.verticalInsets.sum
|
||||
+ paddings.vertical.sum
|
||||
}
|
||||
|
||||
var widthOfHorizontallyNonResizableBlock: CGFloat {
|
||||
@@ -95,11 +95,11 @@ final class DecoratingBlock: WrapperBlock {
|
||||
guard let childAscent = child.ascent(forWidth: width) else {
|
||||
return nil
|
||||
}
|
||||
return childAscent + paddings.verticalInsets.leading
|
||||
return childAscent + paddings.vertical.leading
|
||||
}
|
||||
|
||||
func laidOut(for width: CGFloat) -> Block {
|
||||
let childWidth = width - paddings.horizontalInsets.sum
|
||||
let childWidth = width - paddings.horizontal.sum
|
||||
return updatingChild(child.laidOut(for: childWidth))
|
||||
}
|
||||
|
||||
|
||||
@@ -178,8 +178,8 @@ public final class TextInputBlock: BlockWithTraits {
|
||||
case let .fixed(value):
|
||||
return value
|
||||
case let .intrinsic(_, minSize, maxSize):
|
||||
let width = width - (paddings?.horizontalInsets.sum ?? 0)
|
||||
let verticalPaddings = paddings?.verticalInsets.sum ?? 0
|
||||
let width = width - (paddings?.horizontal.sum ?? 0)
|
||||
let verticalPaddings = paddings?.vertical.sum ?? 0
|
||||
guard let maxVisibleLines else {
|
||||
let textHeight = ceil(textForMeasuring.sizeForWidth(width).height)
|
||||
return clamp(textHeight + verticalPaddings, min: minSize, max: maxSize)
|
||||
|
||||
@@ -199,7 +199,7 @@ final class TabContentsView: BlockView {
|
||||
pages: model.pages.map(\.block),
|
||||
footer: model.footer,
|
||||
size: collectionView.bounds.size,
|
||||
pagesInsets: model.contentInsets.horizontalInsets
|
||||
pagesInsets: model.contentInsets.horizontal
|
||||
)
|
||||
guard newLayout != layout else {
|
||||
return
|
||||
|
||||
@@ -45,7 +45,7 @@ struct TabContentsViewLayout: Equatable {
|
||||
footer: Block?,
|
||||
pagesInsets: EdgeInsets
|
||||
) -> CGFloat {
|
||||
let itemWidth = width - pagesInsets.horizontalInsets.sum
|
||||
let itemWidth = width - pagesInsets.horizontal.sum
|
||||
let listHeight: CGFloat = switch pagesHeightMode {
|
||||
case .byHighestPage:
|
||||
pages.map { $0.intrinsicContentHeight(forWidth: itemWidth) }.max()!
|
||||
@@ -56,7 +56,7 @@ struct TabContentsViewLayout: Equatable {
|
||||
)
|
||||
}
|
||||
let footerHeight = footer?.heightOfVerticallyNonResizableBlock(forWidth: width) ?? 0
|
||||
return listHeight + footerHeight + pagesInsets.verticalInsets.sum
|
||||
return listHeight + footerHeight + pagesInsets.vertical.sum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public struct TabViewLayout: Equatable {
|
||||
let contentsModel = model.contentsModel
|
||||
|
||||
let titlesHeight = listModel.tabs.reduce(CGFloat(0)) { max($0, $1.totalSize.height) }
|
||||
let listHeight = titlesHeight + listModel.listPaddings.verticalInsets.sum
|
||||
let listHeight = titlesHeight + listModel.listPaddings.vertical.sum
|
||||
|
||||
let separatorHeight: CGFloat
|
||||
let separatorInsets: EdgeInsets
|
||||
@@ -29,7 +29,7 @@ public struct TabViewLayout: Equatable {
|
||||
separatorInsets = .zero
|
||||
}
|
||||
|
||||
let newWidth = width ?? max(contentsModel.intrinsicWidth, separatorInsets.horizontalInsets.sum)
|
||||
let newWidth = width ?? max(contentsModel.intrinsicWidth, separatorInsets.horizontal.sum)
|
||||
|
||||
let height: CGFloat? = switch contentsModel.pagesHeight {
|
||||
case .byHighestPage:
|
||||
@@ -44,12 +44,12 @@ public struct TabViewLayout: Equatable {
|
||||
) +
|
||||
listHeight +
|
||||
separatorHeight +
|
||||
separatorInsets.verticalInsets.sum
|
||||
separatorInsets.vertical.sum
|
||||
|
||||
listFrame = CGRect(origin: .zero, size: CGSize(width: newWidth, height: listHeight))
|
||||
|
||||
let separatorY = listFrame.maxY + separatorInsets.top
|
||||
let separatorWidth = newWidth - separatorInsets.horizontalInsets.sum
|
||||
let separatorWidth = newWidth - separatorInsets.horizontal.sum
|
||||
|
||||
separatorFrame = CGRect(
|
||||
x: separatorInsets.left,
|
||||
@@ -89,7 +89,7 @@ extension TabContentsViewModel {
|
||||
TabContentsViewLayout.intrinsicWidth(
|
||||
for: pages.map(\.block),
|
||||
footer: footer,
|
||||
pagesInsets: contentInsets.horizontalInsets
|
||||
pagesInsets: contentInsets.horizontal
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user