N
N
N
getTop();
vscroll3.setOnScrollChangeListener(new
NestedScrollView.OnScrollChangeListener() {
@Override
public void onScrollChange(NestedScrollView v, int scrollX, int
scrollY, int oldScrollX, int oldScrollY) {
int lastScrollY = 0;
int scrollThreshold = dpToPx(200);
if (scrollDistance > 0) {
linear1.setBackgroundColor(0x80000000);
requireActivity().getWindow()
.getDecorView()
.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
Window w = requireActivity(). getWindow();
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
w.setStatusBarColor(Color.parseColor("#00000000"));
} else {
linear1.setBackgroundColor(Color.TRANSPARENT);
requireActivity().getWindow()
.getDecorView()
.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
Window w = requireActivity(). getWindow();
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
w.setStatusBarColor(Color.parseColor("#00000000"));
}
}
lastScrollY = scrollY;
linear1.setTranslationY(scrollY - initialLinear1Top);
/* if (scrollY > initialLinear1Top) {
linear1.setTranslationY(scrollY - initialLinear1Top);
} else {
linear1.setTranslationY(0);
}*/
}