コード例 #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();
            }
        }
コード例 #2
0
 /// <summary>
 /// This method updates values on the layout. As a result the layout is the representation of the
 /// given device action info.
 /// </summary>
 /// <param name="data">
 ///            DeviceActionsLayoutData object with parameters for the view to create
 ///  </param>
 public virtual void updateInfo(DeviceActionsLayoutData data)
 {
     this.mData.mSapaApp             = data.mSapaApp;
     this.mData.mActionList          = data.mActionList;
     this.mData.mInstanceIcon        = data.mInstanceIcon;
     this.mData.mInstancePackageName = data.mInstancePackageName;
     this.mData.loadActionMap();
     this.prepareActions(mParent.Orientation, true);
 }
コード例 #3
0
 public override bool Equals(object o)
 {
     if (o == null)
     {
         return(false);
     }
     if (this == o)
     {
         return(true);
     }
     if (o is DeviceActionsLayoutData)
     {
         DeviceActionsLayoutData obj = (DeviceActionsLayoutData)o;
         return(mInstancePackageName.Equals(obj.mInstancePackageName) && mSapaApp.Equals(obj.mSapaApp));
     }
     return(false);
 }
コード例 #4
0
 protected internal OrdinaryDeviceLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, bool isExpanded, int orientation, ControlBar bar) : base(context, data, sapaAppService, isExpanded, orientation, bar)
 {
 }
コード例 #5
0
		protected internal MainDeviceLayout(Context context, DeviceActionsLayoutData data, SapaAppService sapaAppService, bool isExpanded, int orientation, ControlBar bar) : base(context, data, sapaAppService, isExpanded, orientation, bar)
		{
		}
コード例 #6
0
 public virtual bool equalsActionsOfInstance(DeviceActionsLayoutData data)
 {
     return(this.mData.mSapaApp.Equals(data.mSapaApp) && this.mData.mActionList.Equals(data.mActionList) && this.mData.mInstanceIcon.Equals(data.mInstanceIcon) && this.mData.mInstancePackageName.Equals(data.mInstancePackageName));
 }
コード例 #7
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)
 {
 }