internal static void showDialog(FragmentManager manager, string title, string message)
		{
			MessageDialogFragment messageDialogFragment = new MessageDialogFragment();
			Bundle args = new Bundle();
			args.putString(KEY_TITLE, title);
			args.putString(KEY_MESSAGE, message);
			messageDialogFragment.Arguments = args;
			messageDialogFragment.show(manager, TAG);
		}
Example #2
0
        internal static void showDialog(FragmentManager manager, string title, string message)
        {
            MessageDialogFragment messageDialogFragment = new MessageDialogFragment();
            Bundle args = new Bundle();

            args.putString(KEY_TITLE, title);
            args.putString(KEY_MESSAGE, message);
            messageDialogFragment.Arguments = args;
            messageDialogFragment.show(manager, TAG);
        }
		internal static void showDialog(FragmentManager manager, string title, string[] items)
		{
			ListDialogFragment listDialogFragment = new ListDialogFragment();
			Bundle args = new Bundle();
			args.putString(KEY_TITLE, title);
			args.putStringArray(KEY_ITEMS, items);
			listDialogFragment.Arguments = args;
			listDialogFragment.show(manager, TAG);
		}
Example #4
0
        internal static void showDialog(FragmentManager manager, string title, string[] items)
        {
            ListDialogFragment listDialogFragment = new ListDialogFragment();
            Bundle             args = new Bundle();

            args.putString(KEY_TITLE, title);
            args.putStringArray(KEY_ITEMS, items);
            listDialogFragment.Arguments = args;
            listDialogFragment.show(manager, TAG);
        }
		public virtual SlookAirButton createRecipientListWidgetFromView(View v)
		{
			Bundle option = new Bundle();
			option.putString("MIME_TYPE", "vnd.android.cursor.item/phone_v2");
			SlookAirButton airButtonWidget = new SlookAirButton(v, new SlookAirButtonFrequentContactAdapter(v, null), SlookAirButton.UI_TYPE_LIST);
			// airButtonWidget.steDir
			airButtonWidget.Direction = SlookAirButton.DIRECTION_UPPER;
			airButtonWidget.ItemSelectListener = new ItemSelectListenerAnonymousInnerClassHelper2(this);

			return airButtonWidget;
		}
Example #6
0
 /// <summary>
 /// Notify when a push is received. </summary>
 /// <param name="extras"> push parameters. </param>
 public virtual void onPushReceived(Bundle extras)
 {
     /* Relay push to listeners if its an azme push */
     if (extras.containsKey(INTENT_EXTRA_AZME))
     {
         Intent intent = new Intent(INTENT_ACTION_MESSAGE);
         intent.Package = mContext.PackageName;
         extras.putString(INTENT_EXTRA_TYPE, INTENT_EXTRA_TYPE_PUSH);
         intent.putExtras(extras);
         mContext.sendBroadcast(intent);
     }
 }
        public virtual SlookAirButton createRecipientListWidgetFromView(View v)
        {
            Bundle option = new Bundle();

            option.putString("MIME_TYPE", "vnd.android.cursor.item/phone_v2");
            SlookAirButton airButtonWidget = new SlookAirButton(v, new SlookAirButtonFrequentContactAdapter(v, null), SlookAirButton.UI_TYPE_LIST);

            // airButtonWidget.steDir
            airButtonWidget.Direction          = SlookAirButton.DIRECTION_UPPER;
            airButtonWidget.ItemSelectListener = new ItemSelectListenerAnonymousInnerClassHelper2(this);

            return(airButtonWidget);
        }
	  /// <summary>
	  /// Notify when a push is received. </summary>
	  /// <param name="extras"> push parameters. </param>
	  public virtual void onPushReceived(Bundle extras)
	  {
		/* Relay push to listeners if its an azme push */
		if (extras.containsKey(INTENT_EXTRA_AZME))
		{
		  Intent intent = new Intent(INTENT_ACTION_MESSAGE);
		  intent.Package = mContext.PackageName;
		  extras.putString(INTENT_EXTRA_TYPE, INTENT_EXTRA_TYPE_PUSH);
		  intent.putExtras(extras);
		  mContext.sendBroadcast(intent);
		}
	  }
		/*
		 * Show the notification in the Android notification drawer
		 */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @TargetApi(android.os.Build.VERSION_CODES.KITKAT_WATCH) private void showNotification(com.twilio.voice.IncomingCallMessage incomingCallMessage, int notificationId)
		private void showNotification(IncomingCallMessage incomingCallMessage, int notificationId)
		{
			string callSid = incomingCallMessage.CallSid;

			if (!incomingCallMessage.Cancelled)
			{
				/*
				 * Create a PendingIntent to specify the action when the notification is
				 * selected in the notification drawer
				 */
				Intent intent = new Intent(this, typeof(VoiceActivity));
				intent.Action = VoiceActivity.ACTION_INCOMING_CALL;
				intent.putExtra(VoiceActivity.INCOMING_CALL_MESSAGE, incomingCallMessage);
				intent.putExtra(VoiceActivity.INCOMING_CALL_NOTIFICATION_ID, notificationId);
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);

				/*
				 * Pass the notification id and call sid to use as an identifier to cancel the
				 * notification later
				 */
				Bundle extras = new Bundle();
				extras.putInt(NOTIFICATION_ID_KEY, notificationId);
				extras.putString(CALL_SID_KEY, callSid);

				/*
				 * Create the notification shown in the notification drawer
				 */
				NotificationCompat.Builder notificationBuilder = (new NotificationCompat.Builder(this)).setSmallIcon(R.drawable.ic_call_white_24px).setContentTitle(getString([email protected]_name)).setContentTextuniquetempvar.setAutoCancel(true).setExtras(extras).setContentIntent(pendingIntent).setColor(Color.rgb(214, 10, 37));

				notificationManager.notify(notificationId, notificationBuilder.build());
			}
			else
			{
				if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
				{
					/*
					 * If the incoming call was cancelled then remove the notification by matching
					 * it with the call sid from the list of notifications in the notification drawer.
					 */
					StatusBarNotification[] activeNotifications = notificationManager.ActiveNotifications;
					foreach (StatusBarNotification statusBarNotification in activeNotifications)
					{
						Notification notification = statusBarNotification.Notification;
						Bundle extras = notification.extras;
						string notificationCallSid = extras.getString(CALL_SID_KEY);
						if (callSid.Equals(notificationCallSid))
						{
							notificationManager.cancel(extras.getInt(NOTIFICATION_ID_KEY));
						}
					}
				}
				else
				{
					/*
					 * Prior to Android M the notification manager did not provide a list of
					 * active notifications so we lazily clear all the notifications when
					 * receiving a cancelled call.
					 *
					 * In order to properly cancel a notification using
					 * NotificationManager.cancel(notificationId) we should store the call sid &
					 * notification id of any incoming calls using shared preferences or some other form
					 * of persistent storage.
					 */
					notificationManager.cancelAll();
				}
			}
		}
        /*
         * Show the notification in the Android notification drawer
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @TargetApi(android.os.Build.VERSION_CODES.KITKAT_WATCH) private void showNotification(com.twilio.voice.IncomingCallMessage incomingCallMessage, int notificationId)
        private void showNotification(IncomingCallMessage incomingCallMessage, int notificationId)
        {
            string callSid = incomingCallMessage.CallSid;

            if (!incomingCallMessage.Cancelled)
            {
                /*
                 * Create a PendingIntent to specify the action when the notification is
                 * selected in the notification drawer
                 */
                Intent intent = new Intent(this, typeof(VoiceActivity));
                intent.Action = VoiceActivity.ACTION_INCOMING_CALL;
                intent.putExtra(VoiceActivity.INCOMING_CALL_MESSAGE, incomingCallMessage);
                intent.putExtra(VoiceActivity.INCOMING_CALL_NOTIFICATION_ID, notificationId);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);

                /*
                 * Pass the notification id and call sid to use as an identifier to cancel the
                 * notification later
                 */
                Bundle extras = new Bundle();
                extras.putInt(NOTIFICATION_ID_KEY, notificationId);
                extras.putString(CALL_SID_KEY, callSid);

                /*
                 * Create the notification shown in the notification drawer
                 */
                NotificationCompat.Builder notificationBuilder = (new NotificationCompat.Builder(this)).setSmallIcon(R.drawable.ic_call_white_24px).setContentTitle(getString([email protected]_name)).setContentTextuniquetempvar.setAutoCancel(true).setExtras(extras).setContentIntent(pendingIntent).setColor(Color.rgb(214, 10, 37));

                notificationManager.notify(notificationId, notificationBuilder.build());
            }
            else
            {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
                {
                    /*
                     * If the incoming call was cancelled then remove the notification by matching
                     * it with the call sid from the list of notifications in the notification drawer.
                     */
                    StatusBarNotification[] activeNotifications = notificationManager.ActiveNotifications;
                    foreach (StatusBarNotification statusBarNotification in activeNotifications)
                    {
                        Notification notification        = statusBarNotification.Notification;
                        Bundle       extras              = notification.extras;
                        string       notificationCallSid = extras.getString(CALL_SID_KEY);
                        if (callSid.Equals(notificationCallSid))
                        {
                            notificationManager.cancel(extras.getInt(NOTIFICATION_ID_KEY));
                        }
                    }
                }
                else
                {
                    /*
                     * Prior to Android M the notification manager did not provide a list of
                     * active notifications so we lazily clear all the notifications when
                     * receiving a cancelled call.
                     *
                     * In order to properly cancel a notification using
                     * NotificationManager.cancel(notificationId) we should store the call sid &
                     * notification id of any incoming calls using shared preferences or some other form
                     * of persistent storage.
                     */
                    notificationManager.cancelAll();
                }
            }
        }
Example #11
0
 /// <summary>
 /// Fill answer for a given question. Answers are sent when calling <seealso cref="#actionContent(Context)"/>
 /// . </summary>
 /// <param name="questionId"> question id as specified in the Bundle returned by <seealso cref="#getQuestions()"/>. </param>
 /// <param name="choiceId"> choice id as specified in the Bundle returned by <seealso cref="#getQuestions()"/>. </param>
 public virtual void fillAnswer(string questionId, string choiceId)
 {
     mAnswers.putString(questionId, choiceId);
 }