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);
profileListHeadArrow.setRotation(0f);
profileListHeadArrow
.startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotate_180_back));
- profileListHeadMore.setVisibility(View.GONE);
+ 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);
}
public void onAccountSummaryRowViewClicked(View view) {
ViewGroup row;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@NonNull RecyclerView.ViewHolder target) {
Data.profiles.blockNotifications();
try {
- Collections.swap(Data.profiles, viewHolder.getAdapterPosition(), target.getAdapterPosition());
+ Collections.swap(Data.profiles, viewHolder.getAdapterPosition(),
+ target.getAdapterPosition());
MobileLedgerProfile.storeProfilesOrder();
notifyItemMoved(viewHolder.getAdapterPosition(), target.getAdapterPosition());
}
holder.itemView
.setBackground(sameProfile ? new ColorDrawable(Colors.tableRowDarkBG) : null);
if (editingProfiles.get()) {
+ boolean wasHidden = holder.mEditButton.getVisibility() == View.GONE;
holder.mRearrangeHandle.setVisibility(View.VISIBLE);
holder.mEditButton.setVisibility(View.VISIBLE);
+ if (wasHidden) {
+ Animation a = AnimationUtils
+ .loadAnimation(holder.mRearrangeHandle.getContext(), R.anim.fade_in);
+ holder.mRearrangeHandle.startAnimation(a);
+ holder.mEditButton.startAnimation(a);
+ }
}
else {
+ boolean wasShown = holder.mEditButton.getVisibility() == View.VISIBLE;
holder.mRearrangeHandle.setVisibility(View.INVISIBLE);
holder.mEditButton.setVisibility(View.GONE);
+ if (wasShown) {
+ Animation a = AnimationUtils
+ .loadAnimation(holder.mRearrangeHandle.getContext(), R.anim.fade_out);
+ holder.mRearrangeHandle.startAnimation(a);
+ holder.mEditButton.startAnimation(a);
+ }
}
}
@Override
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:duration="@android:integer/config_mediumAnimTime"
- android:startOffset="@android:integer/config_shortAnimTime">
+ android:duration="@android:integer/config_mediumAnimTime">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0" />
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright © 2019 Damyan Ivanov.
+ ~ This file is part of MoLe.
+ ~ MoLe is free software: you can distribute it and/or modify it
+ ~ under the term of the GNU General Public License as published by
+ ~ the Free Software Foundation, either version 3 of the License, or
+ ~ (at your opinion), any later version.
+ ~
+ ~ MoLe is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU General Public License terms for details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:duration="@android:integer/config_mediumAnimTime">
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="0.0" />
+</set>
\ No newline at end of file