Code example for FrameLayout

Methods: addView

0
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final BitmapsView view = new BitmapsView(this);
        final FrameLayout layout = new FrameLayout(this);
 
        layout.addView(view, new FrameLayout.LayoutParams(480, 800, Gravity.CENTER));
 
        setContentView(layout);
 
        mAnimator = ObjectAnimator.ofInt(view, "offset", 0, PATTERN_SIZE - 1);
        mAnimator.setDuration(1500);
        mAnimator.setRepeatCount(ObjectAnimator.INFINITE);
        mAnimator.setRepeatMode(ObjectAnimator.REVERSE);
        mAnimator.start();
    } 
 
    @Override 
    protected void onDestroy() { 
        super.onDestroy();