Ejemplo n.º 1
0
        public CardboardOverlayView(Context context, AttributeSet attrs)
            : base(context, attrs)
        {
            setOrientation(HORIZONTAL);

            LayoutParams @params = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f);

            @params.setMargins(0, 0, 0, 0);

            leftView = new CardboardOverlayEyeView(context, attrs);
            leftView.setLayoutParams(@params);
            addView(leftView);

            rightView = new CardboardOverlayEyeView(context, attrs);
            rightView.setLayoutParams(@params);
            addView(rightView);

            // Set some reasonable defaults.
            setDepthOffset(0.016f);
            setColor(Color.rgb(150, 255, 180));
            setVisibility(View.VISIBLE);

            textFadeAnimation = new AlphaAnimation(1.0f, 0.0f);
            textFadeAnimation.setDuration(5000);
        }
        public CardboardOverlayView(Context context, AttributeSet attrs)
            : base(context, attrs)
        {
            setOrientation(HORIZONTAL);

            LayoutParams @params = new LayoutParams(
              LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f);
            @params.setMargins(0, 0, 0, 0);

            leftView = new CardboardOverlayEyeView(context, attrs);
            leftView.setLayoutParams(@params);
            addView(leftView);

            rightView = new CardboardOverlayEyeView(context, attrs);
            rightView.setLayoutParams(@params);
            addView(rightView);

            // Set some reasonable defaults.
            setDepthOffset(0.016f);
            setColor(Color.rgb(150, 255, 180));
            setVisibility(View.VISIBLE);

            textFadeAnimation = new AlphaAnimation(1.0f, 0.0f);
            textFadeAnimation.setDuration(5000);
        }