kotlin
赵小玉的小太阳
简单生活造就美丽人生~
展开
-
kotlin解构
kotlin解构指的是将对象的多个属性分别赋值给多个变量的过程class Student(val id: Int, val name: String, val sex: Char) { //其中的固定格式为 operator fun component[num],其中component为固定写法不能改变 operator fun component1(): Int = id operator fun component2(): String = name opera原创 2022-01-04 22:21:48 · 2161 阅读 · 0 评论 -
BottomNavigationView长按弹出Toast
/** * 移除长按点击弹出Toast */fun BottomNavigationView.removeLongTouchToast() { val bottomNavigationMenuView = this.getChildAt(0) as ViewGroup val size = bottomNavigationMenuView.childCount for (index in 0 until size) { bottomNavigationMenu.原创 2021-12-29 15:27:18 · 529 阅读 · 1 评论