linfaxin / AndroidUIX

Make a high-performance mobile web app / SPA with Android UI
http://linfaxin.github.io/AndroidUIX/
MIT License
509 stars 90 forks source link

How to develop AndroidUIX app in Kotlin. (instuction) #11

Open uglyer opened 7 years ago

uglyer commented 7 years ago

1.Install ts2kt https://github.com/Kotlin/ts2kt 2.Converter of android-ui.d.ts to Kotlin declarations (stubs) 3.Dev in Kotlin your app. 4.Build KotlinJS project.

wait bug fixed https://github.com/Kotlin/ts2kt/issues/53

linfaxin commented 7 years ago

Amazing~ 👍 :)

uglyer commented 6 years ago

image 等ts2kt修复bug遥不可及,手动翻译了一下.d.ts文件,成功的用kotlin尝试,但是有些问题,譬如调用super的方法 super.onCreate kotlin 编译后的js 是 this.onCreate(savedInstanceState, android.app.Activity.prototype.onCreate$default.bind(this)); 执行就报错了 Cannot read property 'bind' of undefined 手动把mCalled改为true发现可以用,很意外。

uglyer commented 6 years ago

image 移植anko成功.