Scrolling AppBarLayout and NestedScrollView in Sketchware

Опубликовано: 05 Октябрь 2025
на канале: Sanjeev Kumar
3,139
74

This video shows how to create a Scrolling AppBar and NestedScrollView in Sketchware.

The codes used are:

com.google.android.material.appbar.AppBarLayout.LayoutParams params = (com.google.android.material.appbar.AppBarLayout.LayoutParams)_toolbar.getLayoutParams();

params.setScrollFlags(com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);

androidx.core.widget.NestedScrollView nestedScrollView = new androidx.core.widget.NestedScrollView(this);

LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
nestedScrollView.setLayoutParams(layoutParams);

nestedScrollView.setBackgroundColor(Color.WHITE);

linear1.removeAllViews();
linear1.addView(nestedScrollView);
nestedScrollView.addView(linear2);