More Related Content Similar to Butter android views Similar to Butter android views (20) More from Leonardo YongUk Kim More from Leonardo YongUk Kim (13) Butter android views2. ● Overdraws
● Hardware acceleration
● Layers
● ValueAnimators
● ObjectAnimators with DisplayList properties
● SurfaceView vs TextureView
7. 1x
2x
3x
● blue: 1x (2회)
● green: 2x
● light red: 3x 4x
● dark red: 4x
우리의 소원은 2x
8. 왜 배경이 1x일까요? 1x
2x
● window 배경 1회 3x
● view 배경 1회
● 1 + 1 = 귀요미?
4x
꼭 윈도우 배경 제거
합시다.
9. android: 1x
windowBackground 2x
@null 3x
getWindow().
setBackgroundDraw 4x
able(null);
transparent를 하지
맙시다.
16. Layer
하드웨어 레이어:
● 캐쉬를 FBO에 저장.
(FrameBufferObject)
● 한정된 영역.
● view.setLayerType
(View.LAYER.
HARDWARE, null)
소프트웨어 레이어:
● 비트맵 보관
● view.setLayerType
(View.LAYER.
SOFTWARE, null)
18. 다양한 속성에 대한 에니메이션
linear
non-linear
ValueAnimator: View 이외에도 대부분의 속성에
대해 적용가능한 에니메이터 객체. (HC 11)
19. ValueAnimator va = ValueAnimator.ofInt(0, height);
va.setDuration(700);
va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener()
{
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
v.getLayoutParams().height = value.intValue();
v.requestLayout();
}
});
21. 에니메이션을 빠르게 하는 방법은 없나
요? (JB)
객체의 프로퍼티
에 대한 디스플레
이 리스트가 확
장.
(DLProps)
● alpha
● translationX/Y
● scaleX/Y
● rotationX/YViewPropertyAnimator(HC 12), ObjectAnimator (HC 11)
26. 대안: TextureView
뷰의 모든 기능을 사용가능.
GLSurfaceView등의 확장이 없기 때문에 스스로
만들어 써야 함.
3D 그래픽을 하는 것만 조금 까다로움. (기본 코
드가 없음.)
젤리빈 이상만 가능.