Android How to slide row when previous row visibility set to Visible?



i am using table and using different control in rows as to perform like tree view functionality as i have not found any control to perform it.


i am doing programmatically so as to hide and view row on click text view my method is,



public void onClick(View v) {
// TODO Auto-generated method stub
TextView tx;
TableRow Row1, Row2;
tx = (TextView) findViewById(R.id.textView2);
Row1 = (TableRow) findViewById(R.id.tableRow3);
Row2 = (TableRow) findViewById(R.id.tableRow4);


int rowOne = Row1.getVisibility();
int rowTwo = Row2.getVisibility();
if (rowOne == 0) {
Row1.setVisibility(View.INVISIBLE);
Row2.setVisibility(View.INVISIBLE);
tx.setText("+ Building Replacement");
}
else
{
Row1.setVisibility(View.VISIBLE);
Row2.setVisibility(View.VISIBLE);
tx.setText("- Building Replacement");
}
}


on lick method to make table row visible.


But issue is table row is invisible initially on program load. Then there is empty space in it i wanna do some thing so that its row drag when previous row visibility set to visible.


How would can i do that ?


Hopes for your suggestion


Thanks


No comments:

Post a Comment