Skip to content

Commit 84ec787

Browse files
kingsleyadiofacebook-github-bot
authored andcommitted
Convert LithoScrollView to Kotlin
Summary: $title Reviewed By: astreet Differential Revision: D73105620 fbshipit-source-id: 9c7ba680a954a67790d33ee4c6736db2729f6b7d
1 parent 5a8ffbd commit 84ec787

5 files changed

Lines changed: 226 additions & 321 deletions

File tree

litho-core/src/main/java/com/facebook/litho/ComponentUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ object ComponentUtils {
498498
fun wrapWithMetadata(c: ComponentContext?, e: Exception): LithoMetadataExceptionWrapper =
499499
when (e) {
500500
is LithoMetadataExceptionWrapper -> e
501-
else -> LithoMetadataExceptionWrapper(c, e)
501+
else -> LithoMetadataExceptionWrapper(c, cause = e)
502502
}
503503

504504
/**
@@ -510,7 +510,7 @@ object ComponentUtils {
510510
when (view) {
511511
is LithoView -> wrapWithMetadata(view.componentTree, e)
512512
// TODO T149859358 support other implementations of BaseMountingView
513-
else -> LithoMetadataExceptionWrapper(e)
513+
else -> LithoMetadataExceptionWrapper(cause = e)
514514
}
515515

516516
/**

litho-core/src/main/java/com/facebook/litho/LithoMetadataExceptionWrapper.kt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ package com.facebook.litho
1919
import android.annotation.SuppressLint
2020

2121
/** Exception class used to add additional Litho metadata to a crash. */
22-
class LithoMetadataExceptionWrapper
23-
internal constructor(
22+
class LithoMetadataExceptionWrapper(
2423
private val componentContext: ComponentContext? = null,
2524
private val root: String? = null,
2625
private val logTag: String? = null,
@@ -35,25 +34,6 @@ internal constructor(
3534
stackTrace = emptyArray()
3635
}
3736

38-
internal constructor(
39-
cause: Throwable
40-
) : this(
41-
null,
42-
null,
43-
null,
44-
cause,
45-
)
46-
47-
internal constructor(
48-
componentContext: ComponentContext?,
49-
cause: Throwable,
50-
) : this(
51-
componentContext,
52-
null,
53-
null,
54-
cause,
55-
)
56-
5737
constructor(
5838
componentTree: ComponentTree?,
5939
cause: Throwable

litho-widget/src/main/java/com/facebook/litho/widget/ExperimentalVerticalScroll.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.facebook.litho.widget
1818

1919
import android.view.MotionEvent
20-
import android.view.View
2120
import android.view.ViewGroup
2221
import androidx.annotation.ColorInt
2322
import androidx.core.widget.NestedScrollView
@@ -62,7 +61,7 @@ class ExperimentalVerticalScroll(
6261
val eventsController: VerticalScrollEventsController?,
6362
val onScrollChange: ((NestedScrollView, scrollY: Int, oldScrollY: Int) -> Unit)?,
6463
val onInterceptTouch: ((NestedScrollView, event: MotionEvent) -> Boolean)?,
65-
val onScrollStateChange: ((View, Int) -> Unit)?,
64+
val onScrollStateChange: ScrollStateListener?,
6665
val incrementalMountEnabled: Boolean = true,
6766
val child: Component,
6867
val style: Style?,
@@ -203,7 +202,7 @@ internal class VerticalScrollLayoutBehavior(
203202
val height = min(sizeConstraints.MaxPossibleHeightValue, sizeConstraints.maxHeight)
204203
if (height != sizeConstraints.maxHeight) {
205204
DebugInfoReporter.report(category = "SizeConstraintViolation") {
206-
this["component"] = resolveResult.component.getSimpleName()
205+
this["component"] = resolveResult.component.simpleName
207206
this["sizeConstraints"] = sizeConstraints.toString()
208207
this["MaxPossibleHeightValue"] = sizeConstraints.MaxPossibleHeightValue
209208
}

litho-widget/src/main/java/com/facebook/litho/widget/LithoScrollView.java

Lines changed: 0 additions & 295 deletions
This file was deleted.

0 commit comments

Comments
 (0)