Remove space of checkbox if it does not exist

By Dom

I have a listView populated with the help of a CustomAdapter.

I make a test while retrieving the values from my db.

One of the rows if ‘Homework’. If homework = 1, then I show a CheckBox in the beginning of the line of my listView. But if it’s 0 , I dont show anything. But I’d like to move all the text after the checkbox to the left. in my list_row.xml I declared a checkbox, so if homework is 0, i just setVisibility to INVISIBLE on my checkbox.

I can’t post images, so I’ll give an example :

if homework is 1 , my listView is like this :

Checkbox - Date of creation - Title

if Homework is 0, my row of the listview is like this :

         - Date of creation - Title

So you can see that there will have an empty space if Homework is 0. How can I change that so it stays like this:

-Date of creation - Title

Thank you !And tell me if you need the code my CustomAdapter please

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273