Skip to content

Commit

Permalink
added simple factory method for parsing the templates (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
susonthapa authored Oct 28, 2022
1 parent 74ac06e commit 52576e9
Show file tree
Hide file tree
Showing 8 changed files with 551 additions and 398 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.facebook.react.bridge.*
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
import com.facebook.react.modules.debug.DevSettingsModule
import com.reactnativeandroidauto.template.TemplateFactory
import java.util.*

@ReactModule(name = AndroidAutoModule.MODULE_NAME)
Expand Down Expand Up @@ -139,8 +140,8 @@ class AndroidAutoModule internal constructor(private val reactContext: ReactAppl
renderMap: ReadableMap,
reactCarRenderContext: ReactCarRenderContext
): Template {
val templateParser = TemplateParser(carContext, reactCarRenderContext)
return templateParser.parseTemplate(renderMap)
val factory = TemplateFactory(carContext, reactCarRenderContext)
return factory.getTemplate(renderMap)
}

private fun getScreen(name: String): CarScreen? {
Expand Down
Loading

0 comments on commit 52576e9

Please sign in to comment.