Ejemplo n.º 1
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(com.opentok.android.demo.opentoksamples.R.layout.layout_fragment_sub_control, container, false);

            mSubContainer = (RelativeLayout)openTokActivity.findViewById(com.opentok.android.demo.opentoksamples.R.id.fragment_sub_container);

            showSubscriberWidget(mSubscriberWidgetVisible, false);

            mSubscriberMute = (ImageButton)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.muteSubscriber);
            mSubscriberMute.OnClickListener = this;

            mSubscriberName = (TextView)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.subscriberName);

            if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
            {
                RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams)container.LayoutParams;

                DisplayMetrics metrics = new DisplayMetrics();
                openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

                @params.width          = metrics.widthPixels - openTokActivity.dpToPx(48);
                container.LayoutParams = @params;
            }

            return(rootView);
        }
		public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			View rootView = inflater.inflate(com.opentok.android.demo.opentoksamples.R.layout.layout_fragment_sub_control, container, false);

			mSubContainer = (RelativeLayout) openTokActivity.findViewById(com.opentok.android.demo.opentoksamples.R.id.fragment_sub_container);

			showSubscriberWidget(mSubscriberWidgetVisible, false);

			mSubscriberMute = (ImageButton) rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.muteSubscriber);
			mSubscriberMute.OnClickListener = this;

			mSubscriberName = (TextView) rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.subscriberName);

			if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
			{
				RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams) container.LayoutParams;

				DisplayMetrics metrics = new DisplayMetrics();
				openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

				@params.width = metrics.widthPixels - openTokActivity.dpToPx(48);
				container.LayoutParams = @params;
			}

			return rootView;
		}
Ejemplo n.º 3
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            ContentView = R.layout.activity_main;
            base.onCreate(savedInstanceState);

            // Views are being set from the layout.

            this.mVolDownButton = (ImageButton)findViewById(R.id.vDownButton);
            this.mVolUpButton   = (ImageButton)findViewById(R.id.vUpButton);
            this.mVolTextView   = (TextView)findViewById(R.id.current_value_textview);
        }
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			ContentView = R.layout.activity_main;
			base.onCreate(savedInstanceState);

			// Views are being set from the layout.

			this.mVolDownButton = (ImageButton) findViewById(R.id.vDownButton);
			this.mVolUpButton = (ImageButton) findViewById(R.id.vUpButton);
			this.mVolTextView = (TextView) findViewById(R.id.current_value_textview);
		}
Ejemplo n.º 5
0
 protected internal override void onFinishInflate()
 {
     mImageButton = (android.widget.ImageButton)findViewById([email protected]
                                                             );
     mTextButton = (android.widget.Button)findViewById([email protected]
                                                       );
     mImageButton.setOnClickListener(this);
     mTextButton.setOnClickListener(this);
     mImageButton.setOnLongClickListener(this);
     setOnClickListener(this);
     setOnLongClickListener(this);
 }
Ejemplo n.º 6
0
		protected internal override void onFinishInflate()
		{
			mImageButton = (android.widget.ImageButton)findViewById([email protected]
				);
			mTextButton = (android.widget.Button)findViewById([email protected]
				);
			mImageButton.setOnClickListener(this);
			mTextButton.setOnClickListener(this);
			mImageButton.setOnLongClickListener(this);
			setOnClickListener(this);
			setOnLongClickListener(this);
		}
Ejemplo n.º 7
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            Log.d(TAG, "onCreate");
            ContentView = R.layout.activity_main;
            base.onCreate(savedInstanceState);
            this.mService = null;



            // binding to local service.
            this.bindService(new Intent(this, typeof(MainService)), this.mConnection, 0);

            // Views are being set from the layout.
            mFloatingController = (FloatingController)findViewById(R.id.jam_control);
            //Load position form shared preference
            SharedPreferences preferences = getPreferences(Context.MODE_PRIVATE);
            int barAlignment = preferences.getInt(FLOATING_ALIGNMENT_STATE_TAG, mFloatingController.BarAlignment);

            /// <summary>
            ///This method is used to set floating controller position
            /// To set position you must used one of below value:
            /// HORIZONTAL POSITION
            /// 5 - BOTTOM RIGHT
            /// 6 - BOTTOM LEFT
            /// 4 - TOP RIGHT
            /// 7 - TOP LEFT
            ///
            /// VERTICAL POSITION
            /// 15 - BOTTOM RIGHT
            /// 16 - BOTTOM LEFT
            /// 14 - TOP RIGHT
            /// 17 - TOP LEFT
            /// </summary>
            mFloatingController.loadBarState(barAlignment);
            this.mPlayButton = (ImageButton)findViewById(R.id.playButton);
            this.mStopButton = (ImageButton)findViewById(R.id.stopButton);

            // Received intent is being read.
            Intent intent = Intent;

            if (intent != null)
            {
                this.readIntent(intent);
                changeTitle();
            }

            // Controls actions are being set.
            // Only one button is visible at a time, so visibility needs to be
            // changed.
            this.mPlayButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
            this.mStopButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
        }
Ejemplo n.º 8
0
 public virtual void updateArchivingUI(bool archivingOn)
 {
     archiving        = (ImageButton)openTokActivity.findViewById(R.id.archiving);
     this.archivingOn = archivingOn;
     if (archivingOn)
     {
         statusText.Text         = [email protected];
         archiving.ImageResource = R.drawable.archiving_on;
         showPubStatusWidget(true);
         initPubStatusUI();
     }
     else
     {
         showPubStatusWidget(false);
     }
 }
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(com.opentok.android.demo.opentoksamples.R.layout.layout_fragment_pub_control, container, false);

            mPublisherContainer = (RelativeLayout)openTokActivity.findViewById(com.opentok.android.demo.opentoksamples.R.id.fragment_pub_container);

            mPublisherMute = (ImageButton)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.mutePublisher);
            mPublisherMute.OnClickListener = this;

            mSwapCamera = (ImageButton)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.swapCamera);
            mSwapCamera.OnClickListener = this;

            mEndCall = (Button)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.endCall);
            mEndCall.OnClickListener = this;

            return(rootView);
        }
		public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			View rootView = inflater.inflate(com.opentok.android.demo.opentoksamples.R.layout.layout_fragment_pub_control, container, false);

			mPublisherContainer = (RelativeLayout) openTokActivity.findViewById(com.opentok.android.demo.opentoksamples.R.id.fragment_pub_container);

			mPublisherMute = (ImageButton) rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.mutePublisher);
			mPublisherMute.OnClickListener = this;

			mSwapCamera = (ImageButton) rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.swapCamera);
			mSwapCamera.OnClickListener = this;

			mEndCall = (Button) rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.endCall);
			mEndCall.OnClickListener = this;

			return rootView;
		}
Ejemplo n.º 11
0
        protected internal override ImageButton createDeviceButton()
        {
            ImageButton button   = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.main_app_view, this, false);
            Drawable    drawable = this.mData.mInstanceIcon;

            if (drawable.IntrinsicHeight > mDeviceIconMaxSize)
            {
                drawable.setBounds(0, 0, mDeviceIconMaxSize, mDeviceIconMaxSize);
            }
            button.ImageDrawable = drawable;
            button.Clickable     = false;
            button.LongClickable = true;

            Resources res = Resources;

            perpendicular = res.getDimensionPixelSize(R.dimen.default_controlbar_widget);
            along         = res.getDimensionPixelSize(R.dimen.main_app_btn_length);
            return(button);
        }
		public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View rootView = inflater.inflate(R.layout.layout_fragment_pub_status, container, false);

			mPubStatusContainer = (RelativeLayout) openTokActivity.findViewById(R.id.fragment_pub_status_container);
			archiving = (ImageButton) rootView.findViewById(R.id.archiving);

			statusText = (TextView) rootView.findViewById(R.id.statusLabel);

			if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
			{
				RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams) container.LayoutParams;

				DisplayMetrics metrics = new DisplayMetrics();
				openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

				@params.width = metrics.widthPixels - openTokActivity.dpToPx(48);
				container.LayoutParams = @params;
			}

			return rootView;
		}
        protected internal override ImageButton createDeviceButton()
        {
            ImageButton button = (ImageButton)LayoutInflater.from(Context).inflate(R.layout.app_view, this, false);

            button.ImageDrawable = this.mData.mInstanceIcon;

            if (mData.mActionList.size() > 0)
            {
                button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
            }
            else
            {
                button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
            }

            Resources res = Resources;

            perpendicular = res.getDimensionPixelSize(R.dimen.max_app_ic_size);
            along         = res.getDimensionPixelSize(R.dimen.max_app_ic_size);

            return(button);
        }
Ejemplo n.º 14
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(R.layout.layout_fragment_pub_status, container, false);

            mPubStatusContainer = (RelativeLayout)openTokActivity.findViewById(R.id.fragment_pub_status_container);
            archiving           = (ImageButton)rootView.findViewById(R.id.archiving);

            statusText = (TextView)rootView.findViewById(R.id.statusLabel);

            if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
            {
                RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams)container.LayoutParams;

                DisplayMetrics metrics = new DisplayMetrics();
                openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

                @params.width          = metrics.widthPixels - openTokActivity.dpToPx(48);
                container.LayoutParams = @params;
            }

            return(rootView);
        }
Ejemplo n.º 15
0
		/// <summary>Create a new number picker</summary>
		/// <param name="context">the application environment.</param>
		/// <param name="attrs">a collection of attributes.</param>
		/// <param name="defStyle">The default style to apply to this view.</param>
		public NumberPicker(android.content.Context context, android.util.AttributeSet attrs
			, int defStyle) : base(context, attrs, defStyle)
		{
			android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
				, [email protected], defStyle, 0);
			mSolidColor = attributesArray.getColor([email protected]_solidColor
				, 0);
			mFlingable = attributesArray.getBoolean([email protected]_flingable
				, true);
			mSelectionDivider = attributesArray.getDrawable([email protected]_selectionDivider
				);
			int defSelectionDividerHeight = (int)android.util.TypedValue.applyDimension(android.util.TypedValue
				.COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT, getResources().getDisplayMetrics
				());
			mSelectionDividerHeight = attributesArray.getDimensionPixelSize([email protected]
				.styleable.NumberPicker_selectionDividerHeight, defSelectionDividerHeight);
			attributesArray.recycle();
			mShowInputControlsAnimimationDuration = getResources().getInteger([email protected]
				.integer.config_longAnimTime);
			setWillNotDraw(false);
			setSelectorWheelState(SELECTOR_WHEEL_STATE_NONE);
			android.view.LayoutInflater inflater = (android.view.LayoutInflater)getContext().
				getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE);
			inflater.inflate([email protected]_picker, this, true);
			android.view.View.OnClickListener onClickListener = new _OnClickListener_537(this
				);
			android.view.View.OnLongClickListener onLongClickListener = new _OnLongClickListener_552
				(this);
			mIncrementButton = (android.widget.ImageButton)findViewById([email protected]
				.increment);
			mIncrementButton.setOnClickListener(onClickListener);
			mIncrementButton.setOnLongClickListener(onLongClickListener);
			mDecrementButton = (android.widget.ImageButton)findViewById([email protected]
				.decrement);
			mDecrementButton.setOnClickListener(onClickListener);
			mDecrementButton.setOnLongClickListener(onLongClickListener);
			mInputText = (android.widget.EditText)findViewById([email protected]_input
				);
			mInputText.setOnFocusChangeListener(new _OnFocusChangeListener_576(this));
			mInputText.setFilters(new android.text.InputFilter[] { new android.widget.NumberPicker
				.InputTextFilter(this) });
			mInputText.setRawInputType(android.text.InputTypeClass.TYPE_CLASS_NUMBER);
			mTouchSlop = android.view.ViewConfiguration.getTapTimeout();
			android.view.ViewConfiguration configuration = android.view.ViewConfiguration.get
				(context);
			mTouchSlop = configuration.getScaledTouchSlop();
			mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
			mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity() / SELECTOR_MAX_FLING_VELOCITY_ADJUSTMENT;
			mTextSize = (int)mInputText.getTextSize();
			android.graphics.Paint paint = new android.graphics.Paint();
			paint.setAntiAlias(true);
			paint.setTextAlign(android.graphics.Paint.Align.CENTER);
			paint.setTextSize(mTextSize);
			paint.setTypeface(mInputText.getTypeface());
			android.content.res.ColorStateList colors = mInputText.getTextColors();
			int color = colors.getColorForState(ENABLED_STATE_SET, android.graphics.Color.WHITE
				);
			paint.setColor(color);
			mSelectorWheelPaint = paint;
			mDimSelectorWheelAnimator = android.animation.ObjectAnimator.ofInt(this, PROPERTY_SELECTOR_PAINT_ALPHA
				, SELECTOR_WHEEL_BRIGHT_ALPHA, SELECTOR_WHEEL_DIM_ALPHA);
			android.animation.ObjectAnimator showIncrementButton = android.animation.ObjectAnimator
				.ofFloat(mIncrementButton, PROPERTY_BUTTON_ALPHA, BUTTON_ALPHA_TRANSPARENT, BUTTON_ALPHA_OPAQUE
				);
			android.animation.ObjectAnimator showDecrementButton = android.animation.ObjectAnimator
				.ofFloat(mDecrementButton, PROPERTY_BUTTON_ALPHA, BUTTON_ALPHA_TRANSPARENT, BUTTON_ALPHA_OPAQUE
				);
			mShowInputControlsAnimator = new android.animation.AnimatorSet();
			mShowInputControlsAnimator.playTogether(mDimSelectorWheelAnimator, showIncrementButton
				, showDecrementButton);
			mShowInputControlsAnimator.addListener(new _AnimatorListenerAdapter_626(this));
			// create the fling and adjust scrollers
			mFlingScroller = new android.widget.Scroller(getContext(), null, true);
			mAdjustScroller = new android.widget.Scroller(getContext(), new android.view.animation.DecelerateInterpolator
				(2.5f));
			updateInputTextView();
			updateIncrementAndDecrementButtonsVisibilityState();
			if (mFlingable)
			{
				if (isInEditMode())
				{
					setSelectorWheelState(SELECTOR_WHEEL_STATE_SMALL);
				}
				else
				{
					// Start with shown selector wheel and hidden controls. When made
					// visible hide the selector and fade-in the controls to suggest
					// fling interaction.
					setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE);
					hideInputControls();
				}
			}
		}
Ejemplo n.º 16
0
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			Log.d(TAG, "onCreate");
			ContentView = R.layout.activity_main;
			base.onCreate(savedInstanceState);
			this.mService = null;



			// binding to local service.
			this.bindService(new Intent(this, typeof(MainService)), this.mConnection, 0);

			// Views are being set from the layout.
			mFloatingController = (FloatingController) findViewById(R.id.jam_control);
			//Load position form shared preference
			SharedPreferences preferences = getPreferences(Context.MODE_PRIVATE);
			int barAlignment = preferences.getInt(FLOATING_ALIGNMENT_STATE_TAG, mFloatingController.BarAlignment);
			/// <summary>
			///This method is used to set floating controller position
			/// To set position you must used one of below value:
			/// HORIZONTAL POSITION
			/// 5 - BOTTOM RIGHT
			/// 6 - BOTTOM LEFT
			/// 4 - TOP RIGHT
			/// 7 - TOP LEFT
			/// 
			/// VERTICAL POSITION
			/// 15 - BOTTOM RIGHT
			/// 16 - BOTTOM LEFT
			/// 14 - TOP RIGHT
			/// 17 - TOP LEFT
			/// </summary>
			mFloatingController.loadBarState(barAlignment);
			this.mPlayButton = (ImageButton) findViewById(R.id.playButton);
			this.mStopButton = (ImageButton) findViewById(R.id.stopButton);

			// Received intent is being read.
			Intent intent = Intent;
			if (intent != null)
			{
				this.readIntent(intent);
				changeTitle();
			}

			// Controls actions are being set.
			// Only one button is visible at a time, so visibility needs to be
			// changed.
			this.mPlayButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
			this.mStopButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
		}
		public virtual void updateArchivingUI(bool archivingOn)
		{

			archiving = (ImageButton) openTokActivity.findViewById(R.id.archiving);
			this.archivingOn = archivingOn;
			if (archivingOn)
			{
				statusText.Text = [email protected];
				archiving.ImageResource = R.drawable.archiving_on;
				showPubStatusWidget(true);
				initPubStatusUI();
			}
			else
			{
				showPubStatusWidget(false);
			}
		}