Beispiel #1
0
        public TimeEditView(Noti noti, NotiManager notiManager)
        {
            this.noti        = noti;
            this.notiManager = notiManager;
            maxHour          = GetMaxHour();

            InitializeComponent();

            InitValue();
        }
Beispiel #2
0
            private void ResetTimer(Intent intent)
            {
                int id = intent.GetIntExtra("NotiId", -1);

                NotiManager.NotificationType type = (NotiManager.NotificationType)intent.GetIntExtra("NotiType", 0);
                NotiManager notiManager           = type switch
                {
                    NotiManager.NotificationType.Expedition => new ExpeditionNotiManager(),
                    NotiManager.NotificationType.GatheringItem => new GatheringItemNotiManager(),
                    NotiManager.NotificationType.Gadget => new GadgetNotiManager(),
                    NotiManager.NotificationType.Furnishing => new FurnishingNotiManager(),
                    NotiManager.NotificationType.Gardening => new GardeningNotiManager(),
                    _ => null
                };

                if ((notiManager is null) ||
                    (id == -1))
                {
                    return;
                }

                Noti noti = notiManager.Notis.Find(x => x.NotiId.Equals(id));

                NotiScheduleAndroid.Cancel(noti);

                noti.UpdateTime();
                notiManager.SaveNotis();

                switch (type)
                {
                case NotiManager.NotificationType.Expedition:
                    NotiScheduleAndroid.Schedule <ExpeditionNoti>(noti);
                    break;

                case NotiManager.NotificationType.GatheringItem:
                    NotiScheduleAndroid.Schedule <GatheringItemNoti>(noti);
                    break;

                case NotiManager.NotificationType.Gadget:
                    NotiScheduleAndroid.Schedule <GadgetNoti>(noti);
                    break;

                case NotiManager.NotificationType.Furnishing:
                    NotiScheduleAndroid.Schedule <FurnishingNoti>(noti);
                    break;

                case NotiManager.NotificationType.Gardening:
                    NotiScheduleAndroid.Schedule <GardeningNoti>(noti);
                    break;

                default:
                    break;
                }
            }
        }
        public EditFurnishingItemPage(NotiManager notiManager, NotiManager.EditType type, FurnishingNoti noti = null)
        {
            editType         = type;
            this.notiManager = notiManager;

            Noti = noti;

            InitializeComponent();

            Title = (editType == NotiManager.EditType.Add) ? AppResources.EditItemPage_Title_New : AppResources.EditItemPage_Title_Edit;

            InitPicker();
        }
Beispiel #4
0
        public EditExpeditionItemPage(NotiManager notiManager, NotiManager.EditType type, ExpeditionNoti noti = null)
        {
            editType         = type;
            this.notiManager = notiManager;

            Noti = noti;

            InitializeComponent();

            Title = (editType == NotiManager.EditType.Add) ? AppResources.EditExpedition_Title_New : AppResources.EditExpedition_Title_Edit;

            InitValues();
        }
        private void UpdateNotis()
        {
            if (Preferences.Get(SettingConstants.NOTI_ENABLED, false))
            {
                NotiManager notiManager = type switch
                {
                    RealmEnv.RealmType.Currency => new RealmCurrencyNotiManager(),
                    RealmEnv.RealmType.Friendship => new RealmFriendshipNotiManager(),
                    _ => null
                };

                notiManager?.UpdateNotisTime();
            }
        }
Beispiel #6
0
        internal override void RemoveItem()
        {
            base.RemoveItem();

            if (ListView.SelectedItem != null)
            {
                NotiManager.EditList(ListView.SelectedItem as Noti, NotiManager.EditType.Remove);

                Utils.RefreshCollectionView(ListView, Notis);
            }
            else
            {
                DependencyService.Get <IToast>().Show(AppResources.NotiSettingPage_NotSelectedToast_Message);
            }
        }
Beispiel #7
0
        private void FurnishingSpeedUpToolbarItem_Clicked(object sender, EventArgs e)
        {
            if (ListView.SelectedItems.Count < 0)
            {
                return;
            }

            FurnishingNoti selectedNoti = (FurnishingNoti)ListView.SelectedItem;

            selectedNoti.NotiTime = selectedNoti.NotiTime.AddHours(-FEnv.SpeedUpHour);

            NotiManager.EditList(selectedNoti, NotiManager.EditType.EditOnlyTime);

            Utils.RefreshCollectionView(ListView, Notis);
        }
        internal override void RefreshTime(object statusInfo)
        {
            if (ExpEnv.IsSyncEnabled)
            {
                SyncHelper.Update(SyncHelper.SyncTarget.Expedition).GetAwaiter().OnCompleted(() =>
                {
                    NotiManager.ReloadNotiList <ExpeditionNoti>();

                    base.RefreshTime(statusInfo);
                });
            }
            else
            {
                base.RefreshTime(statusInfo);
            }
        }
Beispiel #9
0
 public ListTimerHomeItem(NotiManager manager)
 {
     _manager = manager;
 }
Beispiel #10
0
 public NotiScheduleiOS()
 {
     manager = new NotiManager();
 }
Beispiel #11
0
 public NotiScheduleUWP()
 {
     manager = new NotiManager();
 }
Beispiel #12
0
 public NotiScheduleAndroid()
 {
     manager = new();
 }