¡@

Home 

2014/10/16 ¤W¤È 08:11:09

android Programming Glossary: childpositionabs

Android Gallery zoom in/out

http://stackoverflow.com/questions/11468536/android-gallery-zoom-in-out

2 1 0 1 2 ... 0 being the middle final int childPosition getSelectedItemPosition getPositionForView child final int childPositionAbs int Math.abs childPosition final float left child.getLeft final float top child.getTop final float right child.getRight.. int height child.getMeasuredHeight final int width child.getMeasuredWidth Scale the size. float scaledSize 1.0f childPositionAbs SIZE_SCALE_MULTIPLIER if scaledSize 0 scaledSize 0 matrix.setScale scaledSize scaledSize float moveX 0 float moveY 0 .. to left linear move since the scaling is done with respect to top left corner of the view. if childPosition 0 moveX childPositionAbs 1 SIZE_SCALE_MULTIPLIER width X_OFFSET moveX 1 else Moving from left to right sum of the previous positions' x displacements...