-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Converts DefaultDiffNode to Kotlin Reviewed By: zielinskimz Differential Revision: D47226237 fbshipit-source-id: a77e1ff5273a143cb2915e87710ab5622fab85d9
- Loading branch information
1 parent
dbddd68
commit 9999481
Showing
2 changed files
with
57 additions
and
220 deletions.
There are no files selected for viewing
220 changes: 0 additions & 220 deletions
220
litho-core/src/main/java/com/facebook/litho/DefaultDiffNode.java
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
litho-core/src/main/java/com/facebook/litho/DefaultDiffNode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* 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 com.facebook.litho | ||
|
||
import com.facebook.rendercore.Mountable | ||
import com.facebook.rendercore.primitives.Primitive | ||
import com.facebook.rendercore.visibility.VisibilityOutput | ||
import java.util.ArrayList | ||
|
||
class DefaultDiffNode | ||
internal constructor( | ||
override val component: Component, | ||
override val componentGlobalKey: String, | ||
override val scopedComponentInfo: ScopedComponentInfo | ||
) : DiffNode { | ||
|
||
private val _children: MutableList<DiffNode> = ArrayList(4) | ||
override var contentOutput: LithoRenderUnit? = null | ||
override var backgroundOutput: LithoRenderUnit? = null | ||
override var foregroundOutput: LithoRenderUnit? = null | ||
override var borderOutput: LithoRenderUnit? = null | ||
override var hostOutput: LithoRenderUnit? = null | ||
override var visibilityOutput: VisibilityOutput? = null | ||
override var mountable: Mountable<*>? = null | ||
override var primitive: Primitive? = null | ||
override var lastMeasuredWidth: Float = 0f | ||
override var lastMeasuredHeight: Float = 0f | ||
override var lastWidthSpec: Int = 0 | ||
override var lastHeightSpec: Int = 0 | ||
override var layoutData: Any? = null | ||
|
||
override val childCount: Int | ||
get() = _children.size | ||
|
||
override fun getChildAt(i: Int): DiffNode = _children[i] | ||
|
||
override val children: List<DiffNode> | ||
get() = _children | ||
|
||
override fun addChild(node: DiffNode) { | ||
_children.add(node) | ||
} | ||
} |