You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally you size a root table to the entire area for your UI, then you add everything to that table. From the screenshots it looks like it is sized to the screen but to be sure, are you sizing the root-most table?
I'm afraid I don't have an Android development environment setup, so I can't test things right now. Also it's been a long time since I punished myself with Android's UI toolkit! If we can get you rolling with TableLayout though, much of the pain goes away.
BaseTableLayout uses AndroidToolkit#getPrefWidth/Height which is using view.getMeasuredWidth/Height() -- are those values what you'd expect? If they were large, it could explain why the buttons overlap: TableLayout thinks the button's preferred size is very large, larger than the available space.
Can you check AndroidToolkit.density? Does it help if you set it to 1 after calling setup?
setting AndroidToolkit.density to 1F (short for 1.toFloat() or 1 as Float )appears to help with the button overlap
OK. I don't remember what the density stuff was about, so I'll add a commit to keep it at 1.
it.tableLayout.debug()
Now that we have delegate methods, you can just use it.debug().
now, how to i make sure that i am sizing the root most table?
You use whatever Android UI stuff to make the root table the size you want, in the position you want.
I'm afraid the Android UI XML doesn't mean anything to me (that is some nasty stuff). The Android UI layouting is poor, TableLayout replaces it (once you have sized and positioned the root table). Also ConstraintOnly addView, LinearLayout, stretchColumns, layout_weight, etc are unfamiliar to me.
Not any time soon, I don't have Android stuff setup (and I honestly hate it). Replace the table with a button (or ViewGroup or anything else). Make the button take up the whole screen (or whatever area you want for your UI). Once you have that working, replace the button with the table and that is your root table. Add the rest of your UI to the root table and mostly you never have to deal with nasty Android UI again.
Activity
mgood7123 commentedon May 13, 2019
https://s.amsu.ng/7imFzw7HHTxN
and buttons overlap
mgood7123 commentedon May 13, 2019
this is fixed for buttons by specifying both fill and expand but it does not work for textview as it aligns to the top left/right of the cell
NathanSweet commentedon May 13, 2019
Generally you size a root table to the entire area for your UI, then you add everything to that table. From the screenshots it looks like it is sized to the screen but to be sure, are you sizing the root-most table?
I'm afraid I don't have an Android development environment setup, so I can't test things right now. Also it's been a long time since I punished myself with Android's UI toolkit! If we can get you rolling with TableLayout though, much of the pain goes away.
BaseTableLayout uses AndroidToolkit#getPrefWidth/Height which is using view.getMeasuredWidth/Height() -- are those values what you'd expect? If they were large, it could explain why the buttons overlap: TableLayout thinks the button's preferred size is very large, larger than the available space.
Can you check AndroidToolkit.density? Does it help if you set it to 1 after calling
setup?mgood7123 commentedon May 13, 2019
this is confusing but ill try
mgood7123 commentedon May 13, 2019
setting AndroidToolkit.density to 1F (short for
1.toFloat()or1 as Float)appears to help with the button overlaphttps://s.amsu.ng/iJpYtBV1XR1N
mgood7123 commentedon May 13, 2019
now, how to i make sure that i am sizing the root most table?
mgood7123 commentedon May 13, 2019
layout/table_empty.xml (R.layout.table_empty)
com/example/broadcastConsole/grid/MainActivity.kt
app/src/main/AndroidManifest.xml
https://s.amsu.ng/2kWP2TrSonqN
mgood7123 commentedon May 14, 2019
table.xml
setContentView(R.layout.table)https://s.amsu.ng/QXUJaxWg1IgN
and this is what i get if i attempt to recreate it
https://s.amsu.ng/TDVVVLJxcw4N
mgood7123 commentedon May 14, 2019
it may be due to the
layout_weight,weightSum, andstretchColumnsbeing unsettable in the api, im not sureall i know is that
TableLayouthasand
TableRowhasmgood7123 commentedon May 14, 2019
in which
results in https://s.amsu.ng/gm0o3mJc2wqN
and
results in https://s.amsu.ng/MtMIFlFPyimN
NathanSweet commentedon May 14, 2019
OK. I don't remember what the density stuff was about, so I'll add a commit to keep it at 1.
Now that we have delegate methods, you can just use
it.debug().You use whatever Android UI stuff to make the root table the size you want, in the position you want.
I'm afraid the Android UI XML doesn't mean anything to me (that is some nasty stuff). The Android UI layouting is poor, TableLayout replaces it (once you have sized and positioned the root table). Also ConstraintOnly addView, LinearLayout, stretchColumns, layout_weight, etc are unfamiliar to me.
mgood7123 commentedon May 15, 2019
ok, can you give me an example of a root most table
NathanSweet commentedon May 15, 2019
Not any time soon, I don't have Android stuff setup (and I honestly hate it). Replace the table with a button (or ViewGroup or anything else). Make the button take up the whole screen (or whatever area you want for your UI). Once you have that working, replace the button with the table and that is your root table. Add the rest of your UI to the root table and mostly you never have to deal with nasty Android UI again.
Leave density=1.