Esempio n. 1
0
            public override void onServiceConnected(ComponentName className, IBinder binder)
            {
                Log.d(TAG, "onServiceConnected");
                outerInstance.mService = new WeakReference <MainService>(((MainService.LocalBinder)binder).getMainService(outerInstance));
                //Connection bridge is set to the FloatingController.
                //You can have only one AudioAppConnectionBridge in the application
                //so you need to pass it from service to FloatingController.

                if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
                {
                    try
                    {
                        outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
                    }
                    catch (System.NullReferenceException)
                    {
                        ;
                    }
                }

                if (outerInstance.mService != null && outerInstance.mService.get() != null)
                {
                    try
                    {
                        Log.d(TAG, "Connection bridge set " + outerInstance.mService.get().SapaAppService);
                    }
                    catch (System.NullReferenceException)
                    {
                        ;
                    }
                }
            }
Esempio n. 2
0
        //
        // RecyclerView.Adapter base class
        //

        public override BaseViewHolder onCreateViewHolder(ViewGroup parent, int type)
        {
            if (FcConstants.OPT_DETAILED_LOGS)
            {
                Log.d(TAG, "onCreateViewHolder: type=" + type);
            }
            BaseViewHolder holder = null;

            switch (type)
            {
            case FcConstants.APP_TYPE_MAIN:
            {
                holder = createMainAppHolder(parent);
            }
            break;

            case FcConstants.APP_TYPE_ORDINAL:
            {
                holder = createOrdinalAppHolder(parent);
            }
            break;

            case FcConstants.APP_TYPE_SPACER:
            {
                holder = createSpacerHolder(parent);
            }
            break;
            }

            return(holder);
        }
Esempio n. 3
0
 public override void onServiceConnected(ComponentName className, IBinder binder)
 {
     Log.d(TAG, "onServiceConnected");
     outerInstance.mService = new WeakReference <MainService>(((MainService.LocalBinder)binder).getMainService(outerInstance));
     // Connection bridge is set to the FloatingController.
     // You can have only one AudioAppConnectionBridge in the application
     // so you need to pass it from service to FloatingController.
     if (outerInstance.mService != null && outerInstance.mService.get() != null && outerInstance.mFloatingController != null)
     {
         try
         {
             outerInstance.mFloatingController.SapaAppService = outerInstance.mService.get().SapaAppService;
         }
         catch (System.NullReferenceException)
         {
             ;
         }
     }
     // Set buttons in state from the service.
     if (outerInstance.mVisibleAppInfo != null)
     {
         outerInstance.CurrentState = outerInstance.mVisibleAppInfo.App;
     }
     if (outerInstance.mService != null && outerInstance.mService.get() != null)
     {
         try
         {
             outerInstance.updateVolumeTextView(outerInstance.mService.get().getVolumeText(outerInstance.mVisibleAppInfo));
         }
         catch (System.NullReferenceException)
         {
             ;
         }
     }
 }
        /// <summary>
        /// @brief Starts the activity in the sapa environment
        ///
        /// Setup intent by adding custom class loader and extras edit_mode
        /// TODO: Description on what's the edit_mode
        /// </summary>
        /// <param name="mode"> </param>
        private bool startSapaActivity(string instanceId, int mode)
        {
            Context context = Context;

            Log.d(TAG, "Start sapa app");
            Log.d(TAG, "instanceId:" + instanceId);
            if (null == context)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": null context");
                return(false);
            }

            if (null == mSapaServiceConnector)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": service connector not set to the FC context");
                return(false);
            }

            Intent intent = mSapaServiceConnector.getLaunchIntent(instanceId);

            if (null == intent)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": launch intent is null");
                return(false);
            }

            intent.ExtrasClassLoader = typeof(SapaAppInfo).ClassLoader;
            intent.putExtra("Edit_mode", mode);
            intent.Flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT;

            context.startActivity(intent);

            return(true);
        }
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            mGoogleApiClient = (new GoogleApiClient.Builder(this)).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build();

            mGoogleLoginClicked = true;
            if (!mGoogleApiClient.Connecting)
            {
                if (mGoogleConnectionResult != null)
                {
                    resolveSignInError();
                }
                else if (mGoogleApiClient.Connected)
                {
                    GoogleOAuthTokenAndLogin;
                }
                else
                {
                    /* connect API now */
                    Log.d(TAG, "Trying to connect to Google API");
                    mGoogleApiClient.connect();
                }
            }
        }
Esempio n. 6
0
            public override void onLogMessage(int level, string area, string message)
            {
                switch (level)
                {
                case Log.DEBUG:
                    Log.d(area, message);
                    break;

                case Log.ERROR:
                    Log.e(area, message);
                    break;

                case Log.INFO:
                    Log.i(area, message);
                    break;

                case Log.VERBOSE:
                    Log.v(area, message);
                    break;

                case Log.WARN:
                    Log.w(area, message);
                    break;
                }
            }
Esempio n. 7
0
        /// <summary>
        /// @brief Create animator to hide specified app actions
        /// </summary>
        /// <param name="toShow">        View to be shown </param>
        /// <param name="duration">      Animation duration of each sub animator
        /// </param>
        /// <returns>  Sequential animator to show the hidden element </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public android.animation.Animator createExpandAnimator(final android.view.View toShow, long duration)
        public virtual Animator createExpandAnimator(View toShow, long duration)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int fromWidth = toShow.getWidth();
            int fromWidth = toShow.Width;

            toShow.LayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
            toShow.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int toWidth = toShow.getMeasuredWidth();
            int toWidth = toShow.MeasuredWidth;

            if (FcConstants.OPT_DETAILED_LOGS)
            {
                Log.d(TAG, "createExpandAnimator(" + toShow + ")");
                Log.d(TAG, "    duration: " + duration);
                Log.d(TAG, "    width: " + fromWidth + " -> " + toWidth);
            }

            ValueAnimator expandAnimator = ValueAnimator.ofFloat(0f, 1f);

            expandAnimator.Duration = duration;
            expandAnimator.addUpdateListener(new AnimatorUpdateListenerAnonymousInnerClassHelper3(this, toShow, fromWidth, toWidth));
            expandAnimator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper3(this, toShow, fromWidth));

            return(expandAnimator);
        }
Esempio n. 8
0
        /// <summary>
        /// @brief Create animator to hide specified app actions
        /// </summary>
        /// <param name="toShow">        View to be shown </param>
        /// <param name="toDimension"> </param>
        /// <param name="duration">      Animation duration of each sub animator
        /// </param>
        /// <returns>  Sequential animator to show the hidden element </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public android.animation.Animator createExpandAnimator(final android.view.View toShow, final int toDimension, long duration)
        public virtual Animator createExpandAnimator(View toShow, int toDimension, long duration)
        {
            Log.d(TAG, "View params:");
            Log.d(TAG, "  before measure getWidth: " + toShow.Width);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final float fromWidth = toShow.getWidth();
            float fromWidth = toShow.Width;

            toShow.LayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
            toShow.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));

            float toMeasuredWidth = toShow.MeasuredWidth;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final float toWidth = (toDimension < toMeasuredWidth) ? toDimension : toMeasuredWidth;
            float toWidth = (toDimension < toMeasuredWidth) ? toDimension : toMeasuredWidth;

            ValueAnimator expandAnimator = ValueAnimator.ofFloat(0f, 1f);

            expandAnimator.Duration = duration;
            expandAnimator.addUpdateListener(new AnimatorUpdateListenerAnonymousInnerClassHelper2(this, toShow, toWidth));

            expandAnimator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper2(this, toShow));

            return(expandAnimator);
        }
Esempio n. 9
0
        private void requestScreenCapturePermission()
        {
            Log.d(TAG, "Requesting permission to capture screen");
            MediaProjectionManager mediaProjectionManager = (MediaProjectionManager)getSystemService(Context.MEDIA_PROJECTION_SERVICE);

            // This initiates a prompt dialog for the user to confirm screen projection.
            startActivityForResult(mediaProjectionManager.createScreenCaptureIntent(), REQUEST_MEDIA_PROJECTION);
        }
        public override void onConnected(Session session)
        {
            Log.d(LOGTAG, "The session is connected.");

            mLoadingBar.Visibility = View.GONE;
            //loading text-chat ui component
            loadTextChatFragment();
        }
Esempio n. 11
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public void onFcModelChanged(final int index)
        public virtual void onFcModelChanged(int index)
        {
            mContext.runOnMainThread(() =>
            {
                Log.d(TAG, "onFcModelChanged(" + index + ")");
                notifyItemChanged(index);
            });
        }
Esempio n. 12
0
        //
        // FcModelChangedListener interface
        //

        public virtual void onFcModelChanged()
        {
            mContext.runOnMainThread(() =>
            {
                Log.d(TAG, "onFcModelChanged()");
                notifyDataSetChanged();
            });
        }
        public override void onReceive(Context context, Intent intent)
        {
            bool isConnected = intent.getBooleanExtra("isConnected", false);

            Log.d(TAG, "Connected : " + isConnected);

            Toast.makeTextuniquetempvar.show();
        }
Esempio n. 14
0
 public override void onClientStarted(SinchClient client)
 {
     Log.d(TAG, "SinchClient started");
     if (outerInstance.mListener != null)
     {
         outerInstance.mListener.onStarted();
     }
 }
Esempio n. 15
0
            public override void onIncomingCall(CallClient callClient, Call call)
            {
                Log.d(TAG, "onIncomingCall: " + call.CallId);
                Intent intent = new Intent(outerInstance, typeof(IncomingCallScreenActivity));

                intent.putExtra(CALL_ID, call.CallId);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                outerInstance.startActivity(intent);
            }
Esempio n. 16
0
        protected internal override void onDestroy()
        {
            Log.d(TAG, "onDestroy");
            unbindService(mConnection);
            SharedPreferences preferences = getPreferences(Context.MODE_PRIVATE);

            preferences.edit().putInt(FLOATING_ALIGNMENT_STATE_TAG, mFloatingController.BarAlignment).apply();
            base.onDestroy();
        }
Esempio n. 17
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public void onFcModelItemRemoved(final int index)
        public virtual void onFcModelItemRemoved(int index)
        {
            mContext.runOnMainThread(() =>
            {
                Log.d(TAG, "onFcModelItemRemoved(" + index + ")");
                // Invalidating whole model to recalculate number icons
                notifyDataSetChanged();
            });
        }
Esempio n. 18
0
 private void start(string username)
 {
     if (mSinchClient == null)
     {
         mSettings.Username = username;
         createClient(username);
     }
     Log.d(TAG, "Starting SinchClient");
     mSinchClient.start();
 }
        public virtual bool onMessageReadyToSend(ChatMessage msg)
        {
            Log.d(LOGTAG, "TextChat listener: onMessageReadyToSend: " + msg.Text);

            if (mSession != null)
            {
                mSession.sendSignal(SIGNAL_TYPE, msg.Text);
            }
            return(msgError);
        }
        public override void onTokenRefresh()
        {
            base.onTokenRefresh();

            Log.d(TAG, "onTokenRefresh");

            Intent intent = new Intent(this, typeof(GCMRegistrationService));

            startService(intent);
        }
 public override void onClick(View v)
 {
     Log.d(TAG, "Device " + outerInstance.mData.mSapaApp + " clicked.");
     if (outerInstance.mIsExpanded)
     {
         outerInstance.collapse();
     }
     else
     {
         outerInstance.expand();
     }
 }
Esempio n. 22
0
        protected internal override void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
        {
            base.onMeasure(widthMeasureSpec, heightMeasureSpec);
            int measureWidth = MeasuredWidth;

            if (mMaxWidth != LayoutParams.MATCH_PARENT && measureWidth > mMaxWidth)
            {
                Log.d(TAG, "width:" + measureWidth);
                Log.d(TAG, "max width:" + mMaxWidth);
                setMeasuredDimension(mMaxWidth, MeasuredHeight);
            }
        }
Esempio n. 23
0
 public override void onBindViewHolder(BaseViewHolder viewHolder, int position)
 {
     lock (mModel)
     {
         if (FcConstants.OPT_DETAILED_LOGS)
         {
             Log.d(TAG, "onBindViewHolder: position=" + position);
         }
         FcModelItem item = (mModel.ItemCount > position) ? mModel.getItem(position) : null;
         viewHolder.prepareViewHolder(mContext, mModel, item);
     }
 }
Esempio n. 24
0
 protected internal virtual void cleanLayouts()
 {
     if (FcConstants.OPT_DETAILED_LOGS)
     {
         Log.d(TAG, "cleanLayouts");
     }
     itemView.Alpha        = FULL_COLOR;
     itemView.TranslationX = 0;
     itemView.TranslationY = 0;
     itemView.ScaleX       = 1f;
     itemView.ScaleY       = 1f;
 }
        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 override void onSignalReceived(Session session, string type, string data, Connection connection)
        {
            Log.d(LOGTAG, "onSignalReceived. Type: " + type + " data: " + data);
            ChatMessage msg = null;

            if (!connection.ConnectionId.Equals(mSession.Connection.ConnectionId))
            {
                // The signal was sent from another participant. The sender ID is set to the sender's
                // connection ID. The sender alias is the value added as connection data when you
                // created the user's token.
                msg = new ChatMessage(connection.ConnectionId, connection.Data, data);
                // Add the new ChatMessage to the text-chat component
                mTextChatFragment.addMessage(msg);
            }
        }
Esempio n. 27
0
            public virtual bool shouldOverrideUrlLoading(WebView view, string url)
            {
                Log.d(outerInstance.TAG, "Loading URL: " + url);

                // if we detect a redirect to our application URL, this is an indication
                // that the authN workflow was completed successfully
                if (url.Equals(URLDecoder.decode(AccessEnabler.ADOBEPASS_REDIRECT_URL)))
                {
                    // the authentication workflow is now complete - go back to the main activity
                    Intent result = new Intent(outerInstance, typeof(MainActivity));
                    setResult(RESULT_OK, result);
                    finish();
                }

                return(false);
            }
Esempio n. 28
0
        public virtual string getName(FcContext fcContext)
        {
            Log.d(TAG, "getName");
            string name = null;

            try
            {
                name = mActionInfo.getName(fcContext.Context);
            }
            catch (NameNotFoundException)
            {
                Log.w(TAG, "Cannot retrieve action name: name not found");
            }
            Log.d(TAG, "name:" + name);
            return(name);
        }
Esempio n. 29
0
 /// <summary>
 /// @brief
 /// </summary>
 public virtual void hideExpanded()
 {
     lock (this)
     {
         lock (mModel)
         {
             Log.d(TAG, "hideExpanded");
             for (int i = 0; i < mModel.ItemCount; ++i)
             {
                 FcModelItem item = mModel.getItem(i);
                 item.Expanded = false;
                 // Do not notify
             }
         }
     }
 }
Esempio n. 30
0
        /// <summary>
        /// @brief
        /// </summary>
        /// <param name="item"> </param>
        public virtual void notifyItemChanged(FcModelItem item)
        {
            lock (this)
            {
                lock (mModel)
                {
                    int position = mModel.getItemPosition(item);
                    Log.d(TAG, "notifyItemChanged(" + item + ") position = " + position);
                    if (position < 0)
                    {
                        Log.w(TAG, "The item " + item.InstanceId + " cannot be found in the model");
                        return;
                    }

                    notifyItemChanged(position);
                }
            }
        }