This commit is contained in:
androiddevkkotlin 2020-10-14 22:17:14 +03:00
parent fd8df84e32
commit 85d5377340
2 changed files with 25 additions and 6 deletions

View file

@ -434,6 +434,21 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
return !app.getSettings().isLightContent();
}
private void testShadowOn() {
buttonsShadow.setVisibility(View.VISIBLE);
buttonsShadow.animate()
.alpha(0.8f)
.setDuration(200)
.setListener(null);
}
private void testShadowOff() {
buttonsShadow.animate()
.alpha(0f)
.setDuration(200);
}
private void setupScrollShadow(View view) {
final View scrollView;
if (useScrollableItemsContainer()) {
@ -446,7 +461,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
@Override
public void onScrollChanged() {
boolean scrollToBottomAvailable = scrollView.canScrollVertically(1);
AndroidUiHelper.updateVisibility(buttonsShadow, scrollToBottomAvailable);
if (scrollToBottomAvailable) {
testShadowOn();
} else {
testShadowOff();
}
}
});
}

View file

@ -182,11 +182,11 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
}
private void testShadowOn() {
// buttonsShadow.setAlpha(0f);
// buttonsShadow.setAlpha(0.3f);
buttonsShadow.setVisibility(View.VISIBLE);
buttonsShadow.animate()
.alpha(1f)
.setDuration(100)
.alpha(0.8f)
.setDuration(200)
.setListener(null);
}
@ -194,7 +194,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
// buttonsShadow.setAlpha(0.5f);
buttonsShadow.animate()
.alpha(0f)
.setDuration(100);
.setDuration(200);
}