0

I want to change Groupview.visibility = View.VISIBLE to be GroupView.visibility = View.GONE. How should the code be?

this is my Activity.kt

if (viewModel.inputPosTableArea1.value !=  "") {
    btn_addtable1?.visibility = View.GONE
    table2?.visibility = View.VISIBLE
    btn_addtable2?.visibility = View.VISIBLE
}

I hope when the add button is "clicked" it will change to something like this:

btn_addtable1.visibility = View.GONE
table2.visibility = View.VISIBLE
btn_addtable2.visibility = View.VISIBLE
2
  • 1
    What would you like to achieve? I wrote about Groupview but there is no such view in (this part of) code. Where is the problem?
    – Boken
    Commented Mar 27, 2019 at 8:48
  • The problem is ViewGroup 2 (table2) does not appear even though inputPosTableArea has a value. This is my fragment.xml - pastebin.com/5D2v0791 - link . And this is my ViewModel pastebin.com/BUa5C3v7 - link. @Boken Commented Mar 28, 2019 at 9:58

0

Browse other questions tagged or ask your own question.