Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            System.Console.WriteLine("AnnotationActivity >> OnCreate");

            app = this;

            try
            {
                if (FindViewById(Resource.Id.lines) != null)
                {
                    AnnTask.UpdateVars(this);
                    CheckIsShared();

                    return;
                }

                curFilePath           = "";
                isFirstAnnotation     = true;
                isFirstFileAnnotation = true;

                PreferenceManager.SetDefaultValues(this, Resource.Xml.preferences, false);
                sharedPrefs = PreferenceManager.GetDefaultSharedPreferences(this);

                SetContentView(Resource.Layout.MainActivity);
                mToolbar = (Toolbar)FindViewById(Resource.Id.toolbar); // Attaching the layout to the toolbar object
                SetSupportActionBar(mToolbar);
                SupportActionBar.SetDisplayShowHomeEnabled(true);
                SupportActionBar.SetIcon(Resource.Drawable.logo_toolbar);

                wPopup   = new WordPopup(this);
                testView = new LineView(this);
                testView.UpdateVars();

                lines             = new List <List <object> >();
                linesRecyclerView = (CustomRecyclerView)FindViewById(Resource.Id.lines);
                linesRecyclerView.mMainActivity = this;
                linesLayoutManager = new LinearLayoutManager(this);
                linesRecyclerView.SetLayoutManager(linesLayoutManager);
                linesAdapter = new AnnListAdapter(this, this.lines, linesRecyclerView, wPopup);
                linesRecyclerView.SetAdapter(linesAdapter);
                defaultItemAnimator = linesRecyclerView.GetItemAnimator();

                linesRecyclerView.AddOnScrollListener(new RecyclerViewOnScrollListener(this));

                mBookmarks      = new List <Bookmark>();
                mFoundBookmarks = new List <Bookmark>();
            }
            catch (Exception e)
            {
                Toast.MakeText(this, "Error: " + e.Message, ToastLength.Long).Show();
            }
        }
Example #2
0
 public ProgressViewHolder(AnnListAdapter adapter, View v) : base(v)
 {
     this.adapter = adapter;
     progressBar  = (ProgressBar)v.FindViewById(Resource.Id.progressBar);
     v.SetOnClickListener(this);
 }
Example #3
0
 public LineViewHolder(AnnListAdapter adapter, View v) : base(v)
 {
     this.adapter = adapter;
     mLineView    = (LineView)v;
     mLineView.SetOnClickListener(this);
 }