WearableRecyclerView

8928b5277aa7234dbca4ff782952343a?s=47 funnelbit
October 26, 2016

 WearableRecyclerView

8928b5277aa7234dbca4ff782952343a?s=128

funnelbit

October 26, 2016
Tweet

Transcript

  1. 4.
  2. 6.
  3. 9.
  4. 11.

    0⒎TFUUJOH)FMQFS w JUFNͷP⒎TFUΛࢦఆͰ͖Δ public class CustomOffsettingHelper extends DefaultOffsettingHelper {
 @Override


    public void updateChild(View child, WearableRecyclerView parent) {
 super.updateChild(child, 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.setScaleX(1 - mProgressToCenter);
 child.setScaleY(1 - mProgressToCenter);
 }
  5. 16.
  6. 18.

    BEKVTU"ODIPS0⒎TFU9: public class CustomOffsettingHelper extends DefaultOffsettingHelper {
 …
 
 @Override


    protected void adjustAnchorOffsetXY(View child, float[] anchorOffsetXY) {
 anchorOffsetXY[0] = child.getHeight() / 2.0f;
 } …
 }