@Override public void onBackPressed() { if (sv_bottom_content.getVisibility() == View.VISIBLE) { doReverseAnimation(); } else { super.onBackPressed(); } }
public void backToDisplay(View v) // work's on back click { if (llForAdding.getVisibility() == View.VISIBLE) { llForAdding.setVisibility(View.GONE); llForDisplay.setVisibility(View.VISIBLE); tvAddItem.setVisibility(View.VISIBLE); } }
private void changeVisibility() { scrollView.setVisibility(View.VISIBLE); if (selectAddressChild.getVisibility() == View.GONE) { selectAddress.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_minus, 0, 0, 0); if (addNewAddressChild.getVisibility() == View.GONE) { expand(selectAddressChild); } else { expand(selectAddressChild); selectAddress.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_plus, 0, 0, 0); // // addNewAddressChild.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_plus,0,0,0); collapse(addNewAddressChild); } } // if it is visible then execute the else part and collapse it else { selectAddress.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_plus, 0, 0, 0); collapse(selectAddressChild); } }