content: package dev.dworks.apps.anexplorer.ui;
  
  import android.content.Context;
  import android.view.View;
  
  import androidx.recyclerview.widget.RecyclerView;
  import androidx.wear.widget.WearableLinearLayoutManager;
  
  public class LinearLayoutManagerCompat extends WearableLinearLayoutManager {
  
      public LinearLayoutManagerCompat(Context context, int orientation, boolean reverseLayout) {
          super(context);//, new CustomScrollingLayoutCallback());
      }
  
      public static class CustomScrollingLayoutCallback extends WearableLinearLayoutManager.LayoutCallback {
          /** How much should we scale the icon at most. */
          private static final float MAX_ICON_PROGRESS = 0.65f;
  
          private float mProgressToCenter;
  
          @Override
          public void onLayoutFinished(View child, RecyclerView parent) {
  
              // Figure out % progress from top to bottom
              float centerOffset = ((float) child.getHeight() / 2.0f) / (float) parent.getHeight();
              float yRelativeToCenterOffset = (child.getY() / parent.getHeight()) + centerOffset;
  
              // Normalize for center
              mProgressToCenter = Math.abs(0.5f - yRelativeToCenterOffset);
              // Adjust to the maximum scale
              mProgressToCenter = Math.min(mProgressToCenter, MAX_ICON_PROGRESS);
  
              child.setAlpha(1 - mProgressToCenter);
              child.setScaleX(1 - mProgressToCenter);
              child.setScaleY(1 - mProgressToCenter);
          }
      }
  }
  