Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update KotlinHybridObject.ts
Browse files Browse the repository at this point in the history
mrousavy committed Jan 9, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 75add5b commit 756629e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/nitrogen/src/syntax/kotlin/KotlinHybridObject.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,12 @@ export function createKotlinHybridObject(spec: HybridObjectSpec): SourceFile[] {
kotlinBase = getHybridObjectName(base).HybridTSpec
}

const imports: string[] = []
imports.push('import com.margelo.nitro.core.*')
if (spec.isHybridView) {
imports.push('import com.margelo.nitro.views.*')
}

// 1. Create Kotlin abstract class definition
const abstractClassCode = `
${createFileMetadataString(`${name.HybridTSpec}.kt`)}
@@ -44,8 +50,7 @@ import android.util.Log
import androidx.annotation.Keep
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.margelo.nitro.core.*
import com.margelo.nitro.views.*
${imports.join('\n')}
/**
* A Kotlin class representing the ${spec.name} HybridObject.

0 comments on commit 756629e

Please sign in to comment.