From c9b938ae55473af6aa5749bef5e77d97672531e6 Mon Sep 17 00:00:00 2001 From: Ritvik Saraf <13ritvik@gmail.com> Date: Tue, 25 Dec 2018 15:36:15 +0530 Subject: [PATCH] readded animations --- .../fragments/detail/VideoDetailFragment.java | 3 ++- .../list/comments/CommentsFragment.java | 4 ++++ .../list/videos/RelatedVideosFragment.java | 7 +++++++ .../schabi/newpipe/util/AnimationUtils.java | 21 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 7a821f548..c007789e5 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -75,6 +75,7 @@ import org.schabi.newpipe.player.playqueue.PlayQueue; import org.schabi.newpipe.player.playqueue.SinglePlayQueue; import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.report.UserAction; +import org.schabi.newpipe.util.AnimationUtils; import org.schabi.newpipe.util.Constants; import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.ImageDisplayConstants; @@ -956,7 +957,7 @@ public class VideoDetailFragment } private void showContent() { - contentRootLayoutHiding.setVisibility(View.VISIBLE); + AnimationUtils.slideUp(contentRootLayoutHiding,120, 96, 0.06f); } protected void setInitialData(int serviceId, String url, String name) { diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java index c930888f2..956e6c1c8 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java @@ -16,6 +16,7 @@ import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.comments.CommentsInfo; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; import org.schabi.newpipe.report.UserAction; +import org.schabi.newpipe.util.AnimationUtils; import org.schabi.newpipe.util.ExtractorHelper; import io.reactivex.Single; @@ -92,6 +93,8 @@ public class CommentsFragment extends BaseListInfoFragment { public void handleResult(@NonNull CommentsInfo result) { super.handleResult(result); + AnimationUtils.slideUp(getView(),120, 96, 0.06f); + if (!result.getErrors().isEmpty()) { showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0); } @@ -120,6 +123,7 @@ public class CommentsFragment extends BaseListInfoFragment { protected boolean onError(Throwable exception) { if (super.onError(exception)) return true; + hideLoading(); showSnackBarError(exception, UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(serviceId), url, R.string.error_unable_to_load_comments); return true; } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java index 5675bb81b..c8fc2197a 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java @@ -20,6 +20,7 @@ import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; import org.schabi.newpipe.report.UserAction; +import org.schabi.newpipe.util.AnimationUtils; import org.schabi.newpipe.util.RelatedStreamInfo; import java.io.Serializable; @@ -110,12 +111,17 @@ public class RelatedVideosFragment extends BaseListInfoFragment