Improve: IExtraButton toString()
This commit is contained in:
@ -77,7 +77,7 @@ class NeoExtraKey {
|
||||
}
|
||||
|
||||
// We must cal toDouble() before toInt()
|
||||
// Because in NeoLang, numbers are default convert into Double
|
||||
// Because in NeoLang, numbers are default to Double
|
||||
version = getMetaByVisitor(visitor, EKS_META_VERSION)?.toDouble()?.toInt() ?: 0
|
||||
withDefaultKeys = "true" == getMetaByVisitor(visitor, EKS_META_WITH_DEFAULT)
|
||||
return true
|
||||
|
@ -18,6 +18,10 @@ abstract class IExtraButton : View.OnClickListener {
|
||||
var buttonText: String? = null
|
||||
var displayText: String? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return "${this.javaClass.simpleName} { display: $displayText, code: $buttonText }"
|
||||
}
|
||||
|
||||
abstract override fun onClick(view: View)
|
||||
|
||||
abstract fun makeButton(context: Context?, attrs: AttributeSet?, defStyleAttr: Int): Button
|
||||
|
@ -49,7 +49,10 @@ class ConfigureFileTest {
|
||||
|
||||
val extraKey = NeoExtraKey()
|
||||
if (extraKey.loadConfigure(File("NeoLang/example/extra-key.nl"))) {
|
||||
println(extraKey)
|
||||
println("programs: ${extraKey.programNames}")
|
||||
println("version: ${extraKey.version}")
|
||||
println("with-default:${extraKey.withDefaultKeys}")
|
||||
println("keys: ${extraKey.shortcutKeys}")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user