コード例 #1
0
 private void LogFontSizeUI_Updated(object sender, Ao3TrackDatabase.VariableUpdatedEventArgs e)
 {
     if (!int.TryParse(e.NewValue, out int LogFontSizeUI))
     {
         LogFontSizeUI = 0;
     }
     UpdateFontsize(LogFontSizeUI);
 }
コード例 #2
0
 private void LogFontSizeUI_Updated(object sender, Ao3TrackDatabase.VariableUpdatedEventArgs e)
 {
     wvp.DoOnMainThreadAsync(() =>
     {
         ListView.ItemsSource = null;
         ListView.ItemsSource = helpBacking;
     }).ConfigureAwait(false);
 }
コード例 #3
0
 private void DatabaseVariable_Updated(object sender, Ao3TrackDatabase.VariableUpdatedEventArgs e)
 {
     Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
     {
         bool.TryParse(e.NewValue, out useBlur);
         if (Element != null)
         {
             UpdateBackgroundColor();
         }
     });
 }
コード例 #4
0
        private void DatabaseVariable_Updated(object sender, Ao3TrackDatabase.VariableUpdatedEventArgs e)
        {
            Xamarin.Forms.Device.BeginInvokeOnMainThread(() => {
                bool.TryParse(e.NewValue, out useBlur);

                if (useBlur)
                {
                    if (IsAttachedToWindow)
                    {
                        if (rs == null)
                        {
                            rs = RenderScript.Create(Context);
                        }

                        if (rs != null)
                        {
                            script = ScriptIntrinsicBlur.Create(rs, Android.Renderscripts.Element.U8_4(rs));
                        }
                    }
                }
                else
                {
                    script?.Dispose();
                    script = null;
                    sourceCanvas?.Dispose();
                    sourceCanvas = null;
                    source?.Dispose();
                    source = null;
                    blurred?.Dispose();
                    blurred = null;
                    rs?.Dispose();
                    rs = null;
                }

                if (Element != null)
                {
                    UpdateBackgroundColor();
                }
            });
        }
コード例 #5
0
        private void TagVisibilities_Updated(object sender, Ao3TrackDatabase.VariableUpdatedEventArgs e)
        {
            Ao3TagType type;

            switch (e.VarName)
            {
            case "TagOptions.showCatTags":
                type = Ao3TagType.Category;
                break;

            case "TagOptions.showWIPTags":
                type = Ao3TagType.Complete;
                break;

            case "TagOptions.showRatingTags":
                type = Ao3TagType.Rating;
                break;

            default:
                return;
            }

            if (!bool.TryParse(e.NewValue, out var b))
            {
                return;
            }

            wvp.DoOnMainThreadAsync(() =>
            {
                tagTypeVisible[type] = b;
                readingListBacking.ForEachInAll((item) =>
                {
                    if (item?.BaseData?.Type == Ao3PageType.Work)
                    {
                        item.SetTagVisibilities(type, b);
                    }
                });
            });
        }