<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          LattekitAndroid UI 框架

          聯(lián)合創(chuàng)作 · 2023-09-24 08:50

          Lattekit 是采用 Kotlin 編寫的一個 Android UI 框架。

          快速示例學(xué)習(xí) :

          package io.lattekit.helloworld
          import android.app.Activity
          import android.os.Bundle
          import android.view.View
          import android.widget.EditText
          import io.lattekit.annotation.Bind
          import io.lattekit.plugin.css.declaration.css
          import io.lattekit.render
          import io.lattekit.view.LatteView
          
          class MainActivity : Activity() {
              override fun onCreate(savedInstanceState: Bundle?) {
                  super.onCreate(savedInstanceState)
                  render("<io.lattekit.helloworld.MyApp />")
              }
          }
          
          open class MyApp : LatteView() {
              @Bind("@id/myText") var myText : EditText? = null;
          
              init {
                  css("""
                      .question { font-size: 20sp; font-weight: bold;  }
                      .input { font-size: 14sp; margin-top:8dp;  width: match_parent; }
                      .answer { font-size: 20sp; font-weight: bold; margin-top: 10dp; color: #00AADE; }
                  """)
                  // or: css("com.my.package/file.css") 
              }
          
              override fun layout() = xml("""
                  <LinearLayout padding="30dp" orientation="vertical">
                      <TextView text="What's your name?" class="question"/>
                      <EditText id="@+id/myText" hint="Type your name here"
                          onTextChanged=${{ notifyStateChanged() }} class="input"/>
                      <TextView text=${"Hello ${myText?.text}"}
                          visibility=${if (myText?.text?.toString() == "") View.GONE else View.VISIBLE} class="answer"/>
                  </LinearLayout>
              """)
          
          }

          其他示例:

          Sample

          瀏覽 21
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  翔田千里在线一区二区三区 | 国产三级片在线观看视频成人电影 | 色婷婷视频网站 | 台湾成人视频 | 久草新在线 |