comparison android/DWindows.kt @ 2689:7127de139acf

Android: Implement groupbox using RadioGroup... still missing the title and visible border seen on most other platforms, but it works for making sure radiobuttons contained inside only have one selected.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 28 Oct 2021 17:27:59 +0000
parents c359cbd0b20f
children 755d9ad07aaf
comparison
equal deleted inserted replaced
2688:c359cbd0b20f 2689:7127de139acf
1633 box!!.setPadding(pad, pad, pad, pad) 1633 box!!.setPadding(pad, pad, pad, pad)
1634 } 1634 }
1635 return box 1635 return box
1636 } 1636 }
1637 1637
1638 fun groupBoxNew(type: Int, pad: Int, title: String?): LinearLayout? {
1639 var box: LinearLayout? = null
1640 waitOnUiThread {
1641 box = RadioGroup(this)
1642 val dataArrayMap = SimpleArrayMap<String, Long>()
1643
1644 box!!.tag = dataArrayMap
1645 box!!.layoutParams =
1646 LinearLayout.LayoutParams(
1647 LinearLayout.LayoutParams.WRAP_CONTENT,
1648 LinearLayout.LayoutParams.WRAP_CONTENT
1649 )
1650 if (type > 0) {
1651 box!!.orientation = LinearLayout.VERTICAL
1652 } else {
1653 box!!.orientation = LinearLayout.HORIZONTAL
1654 }
1655 box!!.setPadding(pad, pad, pad, pad)
1656 }
1657 return box
1658 }
1659
1638 fun scrollBoxNew(type: Int, pad: Int) : ScrollView? { 1660 fun scrollBoxNew(type: Int, pad: Int) : ScrollView? {
1639 var scrollBox: ScrollView? = null 1661 var scrollBox: ScrollView? = null
1640 1662
1641 waitOnUiThread { 1663 waitOnUiThread {
1642 val box = LinearLayout(this) 1664 val box = LinearLayout(this)