protected internal override void initControlBar(Activity activity, TypedArray array)
        {
            base.initControlBar(activity, array);
            mInitOrientation = array.getInt(R.styleable.FloatingControler_orientation, HORIZONTAL);
            int handleDrawable = array.getResourceId(R.styleable.FloatingControler_handle_drawable, 0);

            mBarAlignment = array.getInt(R.styleable.FloatingControler_bar_alignment, DEFAULT_POSITION);
            prepareBarState();
            try
            {
                mControlBar = createControlBar(activity, handleDrawable);
            }
            catch (NotActivityException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
            }
        }
        // because it is required to suppress
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unused") private int getAlignment(android.content.res.TypedArray array)
        private int getAlignment(TypedArray array)
        {
            if (array == null)
            {
                return(RelativeLayout.ALIGN_PARENT_TOP);
            }
            int alignment = array.getInt(R.styleable.FloatingControler_bar_alignment, 0);

            return(alignment);
        }
        /// <summary>
        /// @brief This method was c </summary>
        /// <param name="root"> </param>
        /// <param name="array"> </param>
        public virtual void prepareView(View root, TypedArray array)
        {
            View           dragReceiver = root.findViewById(R.id.for_content);
            OnDragListener dragListener = new OnDragListenerAnonymousInnerClassHelper(this);

            int barAlignment = array.getInt(R.styleable.FloatingControler_bar_alignment, ALIGN_PARENT_BOTTOM_RIGHT);

            mBarInitialAlignment = barAlignment;
            if (dragReceiver != null)
            {
                dragReceiver.OnDragListener = dragListener;
            }

            root.OnDragListener       = dragListener;
            mMainView                 = (ViewGroup)root;
            mMainAppImage.Id          = Context.GetHashCode();
            mDevicesActionLayoutWidth = mFcContext.getDimension(R.dimen.floating_controller_actions_length);

            putBarOnBoard(barAlignment);
        }
        /// <summary>
        /// This method sets layout of floating controller, creates control bar and puts it on its
        /// default position.
        /// </summary>
        /// <param name="barExpanded">
        ///            Whether or not control bar shall be expanded. </param>
        /// <param name="devicesExpanded">
        ///            Map describing which devices shall be expanded and which not. </param>
        private void initializeControl(TypedArray array)
        {
            int            type     = array.getInt(R.styleable.FloatingControler_type, 1);
            LayoutInflater inflater = (LayoutInflater)this.Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            int            resId;

            switch (type)
            {
            case 0:
                resId = R.layout.floating_controller_layout;
                break;

            case 1:
            default:                     // fall-through
                resId = R.layout.floating_controller_layout;
                break;
            }
            inflater.inflate(resId, this, true);
            mControlBar = (FcControlBar)findViewById(R.id.control_bar_layout);
            mControlBar.prepareView(this, array);
        }
示例#5
0
        protected internal virtual void initControlBar(Activity activity, bool barExpanded, IDictionary <string, bool?> devicesExpanded, TypedArray array)
        {
            base.initControlBar(activity, array);
            int handleDrawable = array.getResourceId(R.styleable.FloatingControler_handle_drawable, 0);

            mBarAlignment = array.getInt(R.styleable.FloatingControler_bar_alignment, ALIGN_PARENT_TOP);
            ControlBar.Info info = new ControlBar.Info(true, null, handleDrawable);
            try
            {
                this.mControlBar = new ControlBarAnonymousInnerClassHelper(this, activity, info);
                IDictionary <int?, int?> map = new SortedDictionary <int?, int?>();
                map[LinearLayout.HORIZONTAL] = R.drawable.ctrl_action_horiz_end;
                map[LinearLayout.VERTICAL]   = R.drawable.ctrl_action_vert_end;
                mControlBar.EndImageMap      = map;
            }
            catch (NotActivityException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
            }
        }
		/// <summary>
		/// This method sets layout of floating controller, creates control bar and puts it on its
		/// default position.
		/// </summary>
		/// <param name="barExpanded">
		///            Whether or not control bar shall be expanded. </param>
		/// <param name="devicesExpanded">
		///            Map describing which devices shall be expanded and which not. </param>
		private void initializeControl(TypedArray array)
		{

			int type = array.getInt(R.styleable.FloatingControler_type, 1);
			LayoutInflater inflater = (LayoutInflater) this.Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			int resId;
			switch (type)
			{
				case 0:
					resId = R.layout.floating_controller_layout;
					break;

				case 1:
				default: // fall-through
					resId = R.layout.floating_controller_layout;
					break;
			}
			inflater.inflate(resId, this, true);
			mControlBar = (FcControlBar) findViewById(R.id.control_bar_layout);
			mControlBar.prepareView(this, array);
		}
		/// <summary>
		/// @brief This method was c </summary>
		/// <param name="root"> </param>
		/// <param name="array"> </param>
		public virtual void prepareView(View root, TypedArray array)
		{
			View dragReceiver = root.findViewById(R.id.for_content);
			OnDragListener dragListener = new OnDragListenerAnonymousInnerClassHelper(this);

			int barAlignment = array.getInt(R.styleable.FloatingControler_bar_alignment, ALIGN_PARENT_BOTTOM_RIGHT);
			mBarInitialAlignment = barAlignment;
			if (dragReceiver != null)
			{
				dragReceiver.OnDragListener = dragListener;
			}

			root.OnDragListener = dragListener;
			mMainView = (ViewGroup) root;
			mMainAppImage.Id = Context.GetHashCode();
			mDevicesActionLayoutWidth = mFcContext.getDimension(R.dimen.floating_controller_actions_length);

			putBarOnBoard(barAlignment);
		}