<commit_before>﻿using System;
using System.ComponentModel;
using System.Linq;
using Android.Views;
using Android.Views.Animations;
using Android.Widget;
using Toggl.Phoebe.Data;
using Toggl.Phoebe.Data.Views;

namespace Toggl.Joey.UI.Adapters
{
    public abstract class BaseDataViewAdapter<T> : BaseAdapter
    {
        private static readonly int LoadMoreOffset = 3;
        protected static readonly int ViewTypeLoaderPlaceholder = 0;
        protected static readonly int ViewTypeContent = 1;
        private IDataView<T> dataView;

        public BaseDataViewAdapter (IDataView<T> dataView)
        {
            this.dataView = dataView;
            dataView.Updated += OnDataViewUpdated;
        }
<commit_msg>Dispose of data views in base adapter.<commit_after>﻿using System;
using System.ComponentModel;
using System.Linq;
using Android.Views;
using Android.Views.Animations;
using Android.Widget;
using Toggl.Phoebe.Data;
using Toggl.Phoebe.Data.Views;

namespace Toggl.Joey.UI.Adapters
{
    public abstract class BaseDataViewAdapter<T> : BaseAdapter
    {
        private static readonly int LoadMoreOffset = 3;
        protected static readonly int ViewTypeLoaderPlaceholder = 0;
        protected static readonly int ViewTypeContent = 1;
        private IDataView<T> dataView;

        public BaseDataViewAdapter (IDataView<T> dataView)
        {
            this.dataView = dataView;
            dataView.Updated += OnDataViewUpdated;
        }

        protected override void Dispose (bool disposing)
        {
            if (disposing) {
                var dispoableDataView = dataView as IDisposable;
                if (dispoableDataView != null) {
                    dispoableDataView.Dispose ();
                    dataView = null;
                }
            }
            base.Dispose (disposing);
        }

{'fraction_non_alphanumeric': 0.07232191408374117, 'fraction_numerical': 0.0032626427406199023, 'mean_word_length': 2.4980988593155895, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7376952', 'n_tokens_mistral': 520, 'n_tokens_neox': 502, 'n_words': 131}