예제 #1
0
        private void prepareCallActions(FcContext fcContext, SapaAppInfo appInfo)
        {
            FcActionFactory factory = fcContext.ActionFactory;
            SparseArray <SapaActionInfo> actions = appInfo.Actions;

            for (int i = 0; i < actions.size(); ++i)
            {
                SapaActionInfo actionInfo = actions.get(i);
                FcActionItem   action     = factory.newAppItem(appInfo, actionInfo);
                string         actionName = actionInfo.Id;

                // Volume buttons needs to be separated from the rest of actions
                if (FcConstants.ACTION_VOLUME_UP.Equals(actionName))
                {
                    mVolumeActions[VOLUME_UP_INDEX] = action;
                }
                else if (FcConstants.ACTION_VOLUME_DOWN.Equals(actionName))
                {
                    mVolumeActions[VOLUME_DOWN_INDEX] = action;
                }
                else
                {
                    mCallActions.Add(action);
                }
            }
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addBypassAction(FcContext fcContext, android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, int buttonText)
        private void addBypassAction(FcContext fcContext, LinearLayout linearLayout, FcActionItem fcActionItem, int buttonText)
        {
            Button bypassButton = (Button)LayoutInflater.from(fcContext.Context).inflate(R.layout.bypass_action_button, mDeviceActions, false);

            //        bypassButton.setBackground(fcActionItem.getIcon(fcContext));
            bypassButton.Enabled         = fcActionItem.Enabled;
            bypassButton.Visibility      = fcActionItem.Visible ? View.VISIBLE : View.GONE;
            bypassButton.Text            = fcContext.Context.Resources.getString(buttonText);
            bypassButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this, fcActionItem);

            DrawableTool.setBackground(bypassButton, 0, 1, fcContext);
            linearLayout.addView(bypassButton);
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addActionButton(final android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, final int resId, final int index, final int numberOfElements, final FcContext fcContext, final boolean adjustBackgroundToPositionInLayout)
        private void addActionButton(LinearLayout linearLayout, FcActionItem fcActionItem, int resId, int index, int numberOfElements, FcContext fcContext, bool adjustBackgroundToPositionInLayout)
        {
            ImageButton imageButton = (ImageButton)LayoutInflater.from(fcContext.Context).inflate(resId, mDeviceActions, false);

            imageButton.ImageDrawable   = fcActionItem.getIcon(fcContext);
            imageButton.Enabled         = fcActionItem.Enabled;
            imageButton.Visibility      = fcActionItem.Visible ? View.VISIBLE : View.GONE;
            imageButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper3(this, fcActionItem);

            if (adjustBackgroundToPositionInLayout)
            {
                DrawableTool.setBackground(imageButton, index, numberOfElements, fcContext);
            }

            linearLayout.addView(imageButton);
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addActionButton(final android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, final int resId, final int index, final int numberOfElements, final FcContext fcContext, final boolean adjustBackgroundToPositionInLayout)
		private void addActionButton(LinearLayout linearLayout, FcActionItem fcActionItem, int resId, int index, int numberOfElements, FcContext fcContext, bool adjustBackgroundToPositionInLayout)
		{
			ImageButton imageButton = (ImageButton) LayoutInflater.from(fcContext.Context).inflate(resId, mDeviceActions, false);
			imageButton.ImageDrawable = fcActionItem.getIcon(fcContext);
			imageButton.Enabled = fcActionItem.Enabled;
			imageButton.Visibility = fcActionItem.Visible ? View.VISIBLE : View.GONE;
			imageButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper3(this, fcActionItem);

			if (adjustBackgroundToPositionInLayout)
			{
				DrawableTool.setBackground(imageButton, index, numberOfElements, fcContext);
			}

			linearLayout.addView(imageButton);
		}
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addBypassAction(FcContext fcContext, android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, int buttonText)
		private void addBypassAction(FcContext fcContext, LinearLayout linearLayout, FcActionItem fcActionItem, int buttonText)
		{
			Button bypassButton = (Button) LayoutInflater.from(fcContext.Context).inflate(R.layout.bypass_action_button, mDeviceActions, false);

	//        bypassButton.setBackground(fcActionItem.getIcon(fcContext));
			bypassButton.Enabled = fcActionItem.Enabled;
			bypassButton.Visibility = fcActionItem.Visible ? View.VISIBLE : View.GONE;
			bypassButton.Text = fcContext.Context.Resources.getString(buttonText);
			bypassButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this, fcActionItem);

			DrawableTool.setBackground(bypassButton, 0, 1, fcContext);
			linearLayout.addView(bypassButton);
		}