protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(STATE_CURRENT_PAGE, mViewPager.getCurrentItem());
- if (mAccountFilter != null)
- outState.putString(STATE_ACC_FILTER, mAccountFilter);
+ if (mAccountFilter != null) outState.putString(STATE_ACC_FILTER, mAccountFilter);
}
@Override
protected void onDestroy() {
profileListHeadArrow.clearAnimation();
profileListHeadArrow.setVisibility(View.GONE);
profileListHeadMore.setVisibility(View.GONE);
+ profileListHeadMore
+ .startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_out));
profileListHeadCancel.setVisibility(View.VISIBLE);
+ profileListHeadCancel
+ .startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in));
}
else {
profileListHeadArrow.setRotation(180f);
profileListHeadArrow.setVisibility(View.VISIBLE);
profileListHeadCancel.setVisibility(View.GONE);
+ profileListHeadCancel
+ .startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_out));
profileListHeadMore.setVisibility(View.GONE);
- profileListHeadMore
- .setVisibility(profileListExpanded ? View.VISIBLE : View.GONE);
+ if (profileListExpanded) {
+ profileListHeadMore.setVisibility(View.VISIBLE);
+ profileListHeadMore
+ .startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in));
+ }
+ else profileListHeadMore.setVisibility(View.GONE);
}
};
mProfileListAdapter.addEditingProfilesObserver(editingProfilesObserver);
Data.profiles.size()));
}
private void collapseProfileList() {
+ boolean wasExpanded = profileListExpanded;
profileListExpanded = false;
- final Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_up);
- animation.setAnimationListener(new Animation.AnimationListener() {
- @Override
- public void onAnimationStart(Animation animation) {
-
- }
- @Override
- public void onAnimationEnd(Animation animation) {
- profileListContainer.setVisibility(View.GONE);
- }
- @Override
- public void onAnimationRepeat(Animation animation) {
+ if (wasExpanded) {
+ final Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_up);
+ animation.setAnimationListener(new Animation.AnimationListener() {
+ @Override
+ public void onAnimationStart(Animation animation) {
- }
- });
- mProfileListAdapter.stopEditingProfiles();
+ }
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ profileListContainer.setVisibility(View.GONE);
+ }
+ @Override
+ public void onAnimationRepeat(Animation animation) {
- profileListContainer.startAnimation(animation);
- profileListHeadArrow.setRotation(0f);
- profileListHeadArrow
- .startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotate_180_back));
- profileListHeadMore.setVisibility(View.GONE);
+ }
+ });
+ mProfileListAdapter.stopEditingProfiles();
+
+ profileListContainer.startAnimation(animation);
+ profileListHeadArrow.setRotation(0f);
+ profileListHeadArrow
+ .startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotate_180_back));
+ final Animation moreAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_out);
+ moreAnimation.setAnimationListener(new Animation.AnimationListener() {
+ @Override
+ public void onAnimationStart(Animation animation) {
+ }
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ profileListHeadMore.setVisibility(View.GONE);
+ }
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+ }
+ });
+ profileListHeadMore.startAnimation(moreAnimation);
+ }
+ else {
+ profileListContainer.setVisibility(View.GONE);
+ profileListHeadArrow.setRotation(0f);
+ profileListHeadMore.setVisibility(View.GONE);
+ }
}
public void onAccountSummaryRowViewClicked(View view) {
ViewGroup row;