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(); 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) { private void setupScrollShadow(View view) {
final View scrollView; final View scrollView;
if (useScrollableItemsContainer()) { if (useScrollableItemsContainer()) {
@ -446,7 +461,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
@Override @Override
public void onScrollChanged() { public void onScrollChanged() {
boolean scrollToBottomAvailable = scrollView.canScrollVertically(1); 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() { private void testShadowOn() {
// buttonsShadow.setAlpha(0f); // buttonsShadow.setAlpha(0.3f);
buttonsShadow.setVisibility(View.VISIBLE); buttonsShadow.setVisibility(View.VISIBLE);
buttonsShadow.animate() buttonsShadow.animate()
.alpha(1f) .alpha(0.8f)
.setDuration(100) .setDuration(200)
.setListener(null); .setListener(null);
} }
@ -194,7 +194,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
// buttonsShadow.setAlpha(0.5f); // buttonsShadow.setAlpha(0.5f);
buttonsShadow.animate() buttonsShadow.animate()
.alpha(0f) .alpha(0f)
.setDuration(100); .setDuration(200);
} }