-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
MountableLayoutResult
to Kotlin
Summary: as per title Reviewed By: zielinskimz Differential Revision: D52832106 fbshipit-source-id: 4a5d9576b5c1215217f6e33fb331d7c1f077e253
- Loading branch information
1 parent
8ef536f
commit 127b55a
Showing
2 changed files
with
57 additions
and
105 deletions.
There are no files selected for viewing
105 changes: 0 additions & 105 deletions
105
litho-rendercore/src/main/java/com/facebook/rendercore/MountableLayoutResult.java
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
litho-rendercore/src/main/java/com/facebook/rendercore/MountableLayoutResult.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.rendercore | ||
|
||
class MountableLayoutResult | ||
@JvmOverloads | ||
constructor( | ||
private val _renderUnit: RenderUnit<*>?, | ||
private val measuredWidth: Int, | ||
private val measuredHeight: Int, | ||
private val _layoutData: Any? = null | ||
) : LayoutResult { | ||
|
||
override fun getRenderUnit(): RenderUnit<*>? = _renderUnit | ||
|
||
override fun getLayoutData(): Any? = _layoutData | ||
|
||
override fun getChildrenCount(): Int = 0 | ||
|
||
override fun getChildAt(index: Int): LayoutResult { | ||
throw IllegalArgumentException("A MountableLayoutResult has no children") | ||
} | ||
|
||
override fun getXForChildAtIndex(index: Int): Int { | ||
throw IllegalArgumentException("A MountableLayoutResult has no children") | ||
} | ||
|
||
override fun getYForChildAtIndex(index: Int): Int { | ||
throw IllegalArgumentException("A MountableLayoutResult has no children") | ||
} | ||
|
||
override fun getWidth(): Int = measuredWidth | ||
|
||
override fun getHeight(): Int = measuredHeight | ||
|
||
override fun getPaddingTop(): Int = 0 | ||
|
||
override fun getPaddingRight(): Int = 0 | ||
|
||
override fun getPaddingBottom(): Int = 0 | ||
|
||
override fun getPaddingLeft(): Int = 0 | ||
} |