Mercurial > dwindows
comparison android/DWindows.kt @ 2590:8352c38bc20b
Android: Turn off Android's forcing buttons and tabs to be all caps.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 25 May 2021 01:25:32 +0000 |
parents | 01fca1937806 |
children | 2c15b3d41fe4 |
comparison
equal
deleted
inserted
replaced
2589:e879afecf3ab | 2590:8352c38bc20b |
---|---|
1391 waitOnUiThread { | 1391 waitOnUiThread { |
1392 button = Button(this) | 1392 button = Button(this) |
1393 val dataArrayMap = SimpleArrayMap<String, Long>() | 1393 val dataArrayMap = SimpleArrayMap<String, Long>() |
1394 | 1394 |
1395 button!!.tag = dataArrayMap | 1395 button!!.tag = dataArrayMap |
1396 button!!.isAllCaps = false | |
1396 button!!.text = text | 1397 button!!.text = text |
1397 button!!.id = cid | 1398 button!!.id = cid |
1398 button!!.setOnClickListener { | 1399 button!!.setOnClickListener { |
1399 eventHandlerSimple(button!!, 8) | 1400 eventHandlerSimple(button!!, 8) |
1400 } | 1401 } |
1765 } | 1766 } |
1766 } | 1767 } |
1767 return pageID | 1768 return pageID |
1768 } | 1769 } |
1769 | 1770 |
1771 fun notebookCapsOff(view: View?) { | |
1772 if (view !is ViewGroup) { | |
1773 return | |
1774 } | |
1775 for (i in 0 until view.childCount) { | |
1776 val child = view.getChildAt(i) | |
1777 if (child is TextView) { | |
1778 child.isAllCaps = false | |
1779 } else { | |
1780 notebookCapsOff(child) | |
1781 } | |
1782 } | |
1783 } | |
1784 | |
1770 fun notebookPageDestroy(notebook: RelativeLayout, pageID: Long) | 1785 fun notebookPageDestroy(notebook: RelativeLayout, pageID: Long) |
1771 { | 1786 { |
1772 waitOnUiThread { | 1787 waitOnUiThread { |
1773 var pager: ViewPager2? = null | 1788 var pager: ViewPager2? = null |
1774 var tabs: TabLayout? = null | 1789 var tabs: TabLayout? = null |
1815 val tab = tabs.getTabAt(index) | 1830 val tab = tabs.getTabAt(index) |
1816 | 1831 |
1817 if (tab != null) { | 1832 if (tab != null) { |
1818 tab.text = text | 1833 tab.text = text |
1819 } | 1834 } |
1835 | |
1836 notebookCapsOff(tabs) | |
1820 } | 1837 } |
1821 } | 1838 } |
1822 } | 1839 } |
1823 | 1840 |
1824 fun notebookPagePack(notebook: RelativeLayout, pageID: Long, box: LinearLayout) | 1841 fun notebookPagePack(notebook: RelativeLayout, pageID: Long, box: LinearLayout) |