예제 #1
0
        /// <summary>
        /// This Ctor creates device info that represents given device action info and calls actions by
        /// jam connection service.
        /// </summary>
        /// <param name="context">
        ///            Context in which layout is created. </param>
        /// <param name="data">
        ///            DeviceActionsLayoutData object with parameters for the view to create </param>
        /// <param name="sapaAppService">
        ///            Instance of SapaAppService of this application </param>
        /// <param name="isExpanded">
        ///             Boolean indicating whether the bar should be expanded </param>
        /// <param name="orientation">
        ///            Orientation of the bar. </param>
        /// <param name="controlbar">
        ///            Reference to parent controlbar widget </param>
        protected internal DeviceActionsLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, bool isExpanded, int orientation, ControlBar controlbar) : base(context)
        {
            initAppIconMaxSize();
            mParent = controlbar;

            this.mData             = data;
            this.HorizontalGravity = Gravity.CENTER_HORIZONTAL;
            this.VerticalGravity   = Gravity.CENTER_VERTICAL;
            this.Orientation       = orientation;
            this.LayoutDirection   = LayoutDirection.INHERIT;


            // mActionButtons = new ArrayList<ImageButton>();
            this.mIsExpanded = isExpanded;
            mButtonsView     = createOpenButtonLayout();
            this.mAppButton  = createDeviceButton();
            string appName = AppName;

            if (appName != null && appName.Length > 0)
            {
                this.mAppButton.ContentDescription = Resources.getString([email protected]_btn_options, appName);
            }
            this.LayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
            this.addView(this.mAppButton, getAppBtnLayoutParams(Orientation));
            this.mSapaAppService = sapaAppService;
            createActionList();
            int buttonsNo = this.mData.mActionList != null ? (this.mData.mActionList.size() + 1) : 0;

            this.mAnimationTime = ControlBar.ANIM_TIME * buttonsNo;
            if (this.mIsExpanded)
            {
                show();
            }
        }
        /// <summary>
        /// This method sets bar on an appropriate border.
        /// </summary>
        /// <param name="alignment">
        ///            This parameter shall be RelativeLayout alignment. It indicates on which border
        ///            floating controller shall be placed initially. Its value ma be:
        ///            RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.ALIGN_PARENT_RIGHT,
        ///            RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.ALIGN_PARENT_BOTTOM. </param>
        private void putBarOnBoard(int alignment)
        {
            FrameLayout hLayout      = mPanelMap[alignment];
            View        CurrentChild = null;

            if (hLayout != null)
            {
                CurrentChild = hLayout.getChildAt(0);
            }

            if (this.mBarAlignment == alignment && CurrentChild != null && CurrentChild.Visibility == View.VISIBLE)
            {
                return;
            }

            ControlBar visibleBar = null;

            FrameLayout.LayoutParams @params;

            if (hLayout != null)
            {
                FrameLayout parentLayout = null;
                int         size         = mControlBar.Context.Resources.getDimensionPixelSize(R.dimen.default_controlbar_thickness);

                mBarAlignment = alignment;
                mOrientation  = HORIZONTAL;
                visibleBar    = mControlBar;

                @params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, size, mGravityMap[alignment]);

                if (visibleBar != null)
                {
                    parentLayout = (FrameLayout)visibleBar.Parent;
                }

                if (parentLayout != null)
                {
                    parentLayout.removeView(visibleBar);
                }

                hLayout.addView(visibleBar, @params);

                if (visibleBar != null)
                {
                    visibleBar.CurrentPosition = mBarAlignment;
                    visibleBar.Visibility      = View.INVISIBLE;
                    visibleBar.getChildAt(0).forceLayout();
                }
            }

            if (visibleBar != null)
            {
                visibleBar.CurrentPosition = mBarAlignment;
                visibleBar.Visibility      = View.VISIBLE;
                visibleBar.expand();
            }
        }
 protected internal OrdinaryDeviceLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, bool isExpanded, int orientation, ControlBar bar) : base(context, data, sapaAppService, isExpanded, orientation, bar)
 {
 }
		protected internal MainDeviceLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, bool isExpanded, int orientation, ControlBar bar) : base(context, data, sapaAppService, isExpanded, orientation, bar)
		{
		}
예제 #5
0
			public OnClickListenerAnonymousInnerClassHelper(ControlBar outerInstance)
			{
				this.outerInstance = outerInstance;
			}
예제 #6
0
			public MyLongTounchListener(ControlBar outerInstance)
			{
				this.outerInstance = outerInstance;
			}
예제 #7
0
			public OnLayoutChangeListenerAnonymousInnerClassHelper(ControlBar outerInstance)
			{
				this.outerInstance = outerInstance;
			}
예제 #8
0
 public OnClickListenerAnonymousInnerClassHelper(ControlBar outerInstance)
 {
     this.outerInstance = outerInstance;
 }
예제 #9
0
 public MyLongTounchListener(ControlBar outerInstance)
 {
     this.outerInstance = outerInstance;
 }
예제 #10
0
 public OnLayoutChangeListenerAnonymousInnerClassHelper(ControlBar outerInstance)
 {
     this.outerInstance = outerInstance;
 }
예제 #11
0
 /// <summary>
 /// This Ctor creates device info that represents given device action info and calls actions by
 /// jam connection service. Layout is created with buttons of actions hidden.
 /// </summary>
 /// <param name="context">
 ///            Context in which layout is created. </param>
 /// <param name="data">
 ///            DeviceActionsLayoutData object with parameters for the view to create </param>
 /// <param name="sapaAppService">
 ///            Instance of SapaAppService of this application </param>
 /// <param name="orientation">
 ///            Orientation of the bar. </param>
 /// <param name="controlbar">
 ///            Local instance of ControlBar </param>
 protected internal DeviceActionsLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, int orientation, ControlBar controlbar) : this(context, data, sapaAppService, false, orientation, controlbar)
 {
 }