Пример #1
0
    private void AndroidBigTextStyle()
    {
        SA_ScreenUtil.TakeScreenshot(256, (screenshot) => {
            var builder = new AN_NotificationCompat.Builder();
            builder.SetContentText("Big Text Style");
            builder.SetContentTitle("Big TextStyle Title");

            var bigTextStyle = new AN_NotificationCompat.BigTextStyle();
            bigTextStyle.BigText("This is test big text style");
            builder.SetStyle(bigTextStyle);
            builder.SetDefaults(AN_Notification.DEFAULT_ALL);

            var trigger = new AN_AlarmNotificationTrigger();
            trigger.SetDate(TimeSpan.FromSeconds(1));

            var id      = SA_IdFactory.NextId;
            var request = new AN_NotificationRequest(id, builder, trigger);
            AN_NotificationManager.Schedule(request);
        });
    }
Пример #2
0
        private void TestNotificationWithVariantId(int variantId)
        {
            var builder = new AN_NotificationCompat.Builder();


            //should be created automatically
            builder.SetChanelId("test_chanel");
            var icon = SA_IconManager.GetIcon(Color.cyan, 32, 32);

            builder.SetLargeIcon(icon);


            var trigger = new AN_AlarmNotificationTrigger();

            trigger.SetDate(TimeSpan.FromSeconds(1));

            int id = SA_IdFactory.NextId;


            switch (variantId)
            {
            case 1:
                builder.SetContentText("Default");
                builder.SetContentTitle("SetDefaults Test");
                builder.SetDefaults(AN_Notification.DEFAULT_LIGHTS | AN_Notification.DEFAULT_SOUND);
                break;

            case 2:

                builder.SetContentText("BigTextStyle");
                builder.SetContentTitle("BigTextStyle Title");

                var bigTextStyle = new AN_NotificationCompat.BigTextStyle();
                bigTextStyle.BigText("This is test big text style");
                builder.SetStyle(bigTextStyle);
                builder.SetDefaults(AN_Notification.DEFAULT_ALL);
                break;

            case 3:

                builder.SetContentText("BigPictureStyle");
                builder.SetContentTitle("BigPictureStyle title");

                var bigPictureStyle = new AN_NotificationCompat.BigPictureStyle();
                bigPictureStyle.BigPicture(SA_IconManager.GetIcon(Color.red, 32, 32));
                bigPictureStyle.BigLargeIcon(SA_IconManager.GetIcon(Color.green, 32, 32));
                builder.SetStyle(bigPictureStyle);
                builder.SetDefaults(AN_Notification.DEFAULT_ALL);
                break;
            }


            if (variantId == 4)
            {
                SetResult(SA_TestResult.OK);
            }
            else
            {
                m_sendedRequest = new AN_NotificationRequest(id, builder, trigger);
                AN_NotificationManager.Schedule(m_sendedRequest);
            }
        }