mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-23 15:36:57 +00:00
Animate secondary controls toggle
This commit is contained in:
parent
243f539439
commit
3868243c2a
@ -119,6 +119,7 @@ import static android.text.TextUtils.isEmpty;
|
|||||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
|
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
|
||||||
import static org.schabi.newpipe.extractor.stream.StreamExtractor.NO_AGE_LIMIT;
|
import static org.schabi.newpipe.extractor.stream.StreamExtractor.NO_AGE_LIMIT;
|
||||||
import static org.schabi.newpipe.ktx.ViewUtils.animate;
|
import static org.schabi.newpipe.ktx.ViewUtils.animate;
|
||||||
|
import static org.schabi.newpipe.ktx.ViewUtils.animateRotation;
|
||||||
import static org.schabi.newpipe.player.helper.PlayerHelper.globalScreenOrientationLocked;
|
import static org.schabi.newpipe.player.helper.PlayerHelper.globalScreenOrientationLocked;
|
||||||
import static org.schabi.newpipe.player.helper.PlayerHelper.isClearingQueueConfirmationRequired;
|
import static org.schabi.newpipe.player.helper.PlayerHelper.isClearingQueueConfirmationRequired;
|
||||||
import static org.schabi.newpipe.player.playqueue.PlayQueueItem.RECOVERY_UNSET;
|
import static org.schabi.newpipe.player.playqueue.PlayQueueItem.RECOVERY_UNSET;
|
||||||
@ -570,13 +571,13 @@ public final class VideoDetailFragment
|
|||||||
private void toggleTitleAndSecondaryControls() {
|
private void toggleTitleAndSecondaryControls() {
|
||||||
if (binding.detailSecondaryControlPanel.getVisibility() == View.GONE) {
|
if (binding.detailSecondaryControlPanel.getVisibility() == View.GONE) {
|
||||||
binding.detailVideoTitleView.setMaxLines(10);
|
binding.detailVideoTitleView.setMaxLines(10);
|
||||||
binding.detailToggleDescriptionView.setImageResource(
|
animateRotation(binding.detailToggleSecondaryControlsView,
|
||||||
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_expand_less));
|
Player.DEFAULT_CONTROLS_DURATION, 180);
|
||||||
binding.detailSecondaryControlPanel.setVisibility(View.VISIBLE);
|
binding.detailSecondaryControlPanel.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
binding.detailVideoTitleView.setMaxLines(1);
|
binding.detailVideoTitleView.setMaxLines(1);
|
||||||
binding.detailToggleDescriptionView.setImageResource(
|
animateRotation(binding.detailToggleSecondaryControlsView,
|
||||||
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_expand_more));
|
Player.DEFAULT_CONTROLS_DURATION, 0);
|
||||||
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
updateTabLayoutVisibility();
|
updateTabLayoutVisibility();
|
||||||
@ -1406,7 +1407,7 @@ public final class VideoDetailFragment
|
|||||||
binding.detailVideoTitleView.setMaxLines(1);
|
binding.detailVideoTitleView.setMaxLines(1);
|
||||||
animate(binding.detailVideoTitleView, true, 0);
|
animate(binding.detailVideoTitleView, true, 0);
|
||||||
|
|
||||||
binding.detailToggleDescriptionView.setVisibility(View.GONE);
|
binding.detailToggleSecondaryControlsView.setVisibility(View.GONE);
|
||||||
binding.detailTitleRootLayout.setClickable(false);
|
binding.detailTitleRootLayout.setClickable(false);
|
||||||
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
||||||
|
|
||||||
@ -1511,9 +1512,8 @@ public final class VideoDetailFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.detailTitleRootLayout.setClickable(true);
|
binding.detailTitleRootLayout.setClickable(true);
|
||||||
binding.detailToggleDescriptionView.setImageResource(
|
binding.detailToggleSecondaryControlsView.setRotation(0);
|
||||||
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_expand_more));
|
binding.detailToggleSecondaryControlsView.setVisibility(View.VISIBLE);
|
||||||
binding.detailToggleDescriptionView.setVisibility(View.VISIBLE);
|
|
||||||
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
binding.detailSecondaryControlPanel.setVisibility(View.GONE);
|
||||||
|
|
||||||
sortedVideoStreams = ListHelper.getSortedStreamVideosList(
|
sortedVideoStreams = ListHelper.getSortedStreamVideosList(
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero." />
|
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero." />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/detail_toggle_description_view"
|
android:id="@+id/detail_toggle_secondary_controls_view"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="top|end"
|
android:layout_gravity="top|end"
|
||||||
|
@ -180,7 +180,7 @@
|
|||||||
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero." />
|
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum. Nunc eleifend est quis ipsum porttitor egestas. Sed facilisis, nisl quis eleifend pellentesque, orci metus egestas dolor, at accumsan eros metus quis libero." />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/detail_toggle_description_view"
|
android:id="@+id/detail_toggle_secondary_controls_view"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="top|end"
|
android:layout_gravity="top|end"
|
||||||
|
Loading…
Reference in New Issue
Block a user