Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set up our view
            SetContentView(Resource.Layout.Main);
            var recyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            var layoutManager = new LinearLayoutManager(this);

            recyclerView.SetLayoutManager(layoutManager);
            recyclerView.SetAdapter(new VerseAdapter(LayoutInflater));

            // Wire up Android-side events
            var chapterHeading = FindViewById <Button>(Resource.Id.headingText);

            chapterHeading.Click += (_, __) => StartActivity(typeof(ChooseBookActivity));

            // Initialize the app
            _chapterHeadingAdapter  = new TextViewChapterHeadingAdapter(chapterHeading);
            _verseViewAdapter       = new RecyclerViewVerseViewAdapter(this, recyclerView, layoutManager, ChapterHeadingHeight());
            _simpleStorageAdapter   = new SharedPreferencesSimpleStorageAdapter(ApplicationContext.GetSharedPreferences("global", FileCreationMode.Private));
            _backButton             = FindViewById <ImageButton>(Resource.Id.backButton);
            _forwardButton          = FindViewById <ImageButton>(Resource.Id.forwardButton);
            _historyControlsAdapter = new ViewHistoryControlsAdapter(_backButton, _forwardButton);

            CreateApp();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set up our view
            SetContentView(Resource.Layout.Main);
            var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            recyclerView.SetAdapter(new VerseAdapter(LayoutInflater));

            // Initialize the app
            _verseViewAdapter = new RecyclerViewVerseViewAdapter(this, recyclerView);
            _verseViewAdapter.SwipeTouchListener.OnSwipeLeft += SwipeLeft;
        }