-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlin…
…eImageViewManager.java (#47561) Summary: Pull Request resolved: #47561 Convert Java to Kotlin Changelog: [Android][Breaking] changed visibility of FrescoBasedReactTextInlineImageViewManager to internal Reviewed By: javache Differential Revision: D65606954 fbshipit-source-id: bfdb5624a104029c8d667ddb9262c862ab846a61
- Loading branch information
1 parent
088fcb1
commit d5f33c1
Showing
3 changed files
with
50 additions
and
82 deletions.
There are no files selected for viewing
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
70 changes: 0 additions & 70 deletions
70
...m/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
...com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.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,50 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.views.text.frescosupport | ||
|
||
import android.view.View | ||
import com.facebook.drawee.backends.pipeline.Fresco | ||
import com.facebook.drawee.controller.AbstractDraweeControllerBuilder | ||
import com.facebook.react.module.annotations.ReactModule | ||
import com.facebook.react.uimanager.BaseViewManager | ||
import com.facebook.react.uimanager.ThemedReactContext | ||
|
||
/** | ||
* Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes | ||
* any type of native view operation will throw an [IllegalStateException]. | ||
*/ | ||
@ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS) | ||
internal class FrescoBasedReactTextInlineImageViewManager | ||
@JvmOverloads | ||
constructor( | ||
private val draweeControllerBuilder: | ||
@JvmSuppressWildcards | ||
AbstractDraweeControllerBuilder<*, *, *, *>? = | ||
null, | ||
private val callerContext: Any? = null | ||
) : BaseViewManager<View, FrescoBasedReactTextInlineImageShadowNode>() { | ||
|
||
override fun getName(): String = REACT_CLASS | ||
|
||
public override fun createViewInstance(context: ThemedReactContext): View { | ||
throw IllegalStateException("RCTTextInlineImage doesn't map into a native view") | ||
} | ||
|
||
override fun createShadowNodeInstance(): FrescoBasedReactTextInlineImageShadowNode = | ||
FrescoBasedReactTextInlineImageShadowNode( | ||
draweeControllerBuilder ?: Fresco.newDraweeControllerBuilder(), callerContext) | ||
|
||
override fun getShadowNodeClass(): Class<FrescoBasedReactTextInlineImageShadowNode> = | ||
FrescoBasedReactTextInlineImageShadowNode::class.java | ||
|
||
override fun updateExtraData(root: View, extraData: Any) = Unit | ||
|
||
public companion object { | ||
public const val REACT_CLASS: String = "RCTTextInlineImage" | ||
} | ||
} |