What i am doing is Setting a ListView with custom Adapter and each item has a button and other components. on click of that button i want a Linear layout to be visible and and when again i click i want it to be Gone.
I am able to achieve it but what i want is to set animations for this Linear layout i.e when it's visibility is set to visible it must look like a drop down and when it is Gone it must go above and hide.
How could i do this, i have never used animations in android so can anyone help me with this
Here is what i am doing to set its visibility to be Visible and Gone
holder.readmoreBT.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ViewHolder holder = (ViewHolder) v.getTag();
ItemsAllPost itemToCount = holder.item;
hitCountApi(holder);
if (holder.contactsLV.getVisibility() == View.GONE) {
holder.readmoreBT.setText("Read Less");
holder.contactsLV.setVisibility(View.VISIBLE);
if (itemToCount.user_email.equals("")
|| itemToCount.user_email.equals("null")) {
holder.imageViewEmail.setVisibility(View.GONE);
holder.emailRL.setVisibility(View.GONE);
}
if (itemToCount.user_address.equals("")
|| itemToCount.user_address.equals("null")) {
holder.imageViewAddress.setVisibility(View.GONE);
holder.addressRL.setVisibility(View.GONE);
}
if (itemToCount.user_ph_no.equals("")
|| itemToCount.user_ph_no.equals("null")) {
holder.imageViewPhone.setVisibility(View.GONE);
holder.phoneRL.setVisibility(View.GONE);
}
holder.emailTV.setText(itemToCount.user_email);
holder.phoneTV.setText(itemToCount.user_ph_no);
holder.addressTV.setText(itemToCount.user_address);
holder.postviewcountTV.setText(itemToCount.view_count);
} else {
holder.readmoreBT.setText("Read More");
holder.postviewcountTV.setText(itemToCount.view_count);
holder.contactsLV.setVisibility(View.GONE);
}
}
});
any help would be greatly appreciated.
I have never used animations before so kindly answer me.
its contactsLV whose Animation i want to set