Ejemplo n.º 1
0
        private void init(Context context, Android.Util.IAttributeSet attrs, int defStyle)
        {
            LayoutInflater.From(context).Inflate(Resource.Layout.sat_main, this, true);
            imgMain = FindViewById <ImageView>(Resource.Id.sat_main);

            if (attrs != null)
            {
                TypedArray typedArray = context.ObtainStyledAttributes(attrs, Resource.Styleable.SatelliteMenu, defStyle, 0);
                satelliteDistance  = typedArray.GetDimensionPixelSize(Resource.Styleable.SatelliteMenu_satelliteDistance, DEFAULT_SATELLITE_DISTANCE);
                totalSpacingDegree = typedArray.GetFloat(Resource.Styleable.SatelliteMenu_totalSpacingDegree, DEFAULT_TOTAL_SPACING_DEGREES);
                closeItemsOnClick  = typedArray.GetBoolean(Resource.Styleable.SatelliteMenu_closeOnClick, DEFAULT_CLOSE_ON_CLICK);
                expandDuration     = typedArray.GetInt(Resource.Styleable.SatelliteMenu_expandDuration, DEFAULT_EXPAND_DURATION);
                //float satelliteDistance = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 170, getResources().getDisplayMetrics());
                typedArray.Recycle();
            }


            mainRotateLeft  = SatelliteAnimationCreator.createMainButtonAnimation(context);
            mainRotateRight = SatelliteAnimationCreator.createMainButtonInverseAnimation(context);

            mainRotateLeft.SetAnimationListener(this);
            mainRotateRight.SetAnimationListener(this);
            imgMain.Click += (s, e) =>
            {
                onClick();
            };
            internalItemClickListener = new InternalSatelliteOnClickListener(this);
        }