예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Presenter       = ServiceLocator.GetService <IPresenterFactory <Slug> >().GetPresenterFor(this);
            CustomLayoutId  = Resource.Layout.activity_main;
            CurrentActivity = NavigableScreen.Main;
            CanNavigateTo   = new List <NavigableScreen>
            {
                NavigableScreen.Determination,
                NavigableScreen.SpeciesList,
                NavigableScreen.Info
            };
            base.OnCreate(savedInstanceState);
            ActivityTitle.Text = "Welkom bij Blauwtipje!";

            //Searching buttons in layout
            var buttonDetermination = FindViewById <Button>(Resource.Id.myButtonDeterminatie);
            var buttonInfo          = FindViewById <Button>(Resource.Id.myButtonInfo);
            var buttonListOfSpecies = FindViewById <Button>(Resource.Id.myButtonSoortenlijst);

            //Making events for the buttons
            buttonDetermination.Click += (sender, e) =>
            {
                Presenter.OnDeterminationButtonClicked();
            };
            buttonListOfSpecies.Click += (sender, e) =>
            {
                Presenter.OnSpeciesListButtonClicked();
            };
            buttonInfo.Click += (sender, e) =>
            {
                Presenter.OnInfoButtonClicked();
            };
            DebugMode          = Settings.DebugMode;
            companyLogo        = FindViewById <ResourceImageView>(Resource.Id.companyLogo);
            companyLogo.Click += CompanyLogoOnClick;

            if (DebugMode)
            {
                companyLogo.SetBackgroundColor(Color.Black);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Presenter       = ServiceLocator.GetService <IPresenterFactory <Slug> >().GetPresenterFor(this);
            CustomLayoutId  = IsTablet() ? Resource.Layout.activity_slugresult_tablet : Resource.Layout.activity_slugresult_phone;
            CurrentActivity = NavigableScreen.Other;

            CanNavigateTo = new List <NavigableScreen>
            {
                NavigableScreen.Main,
                NavigableScreen.Determination,
                NavigableScreen.SpeciesList,
                NavigableScreen.Info
            };

            base.OnCreate(savedInstanceState);

            SlugName           = FindViewById <TextView>(Resource.Id.AnimalName);
            SlugScientificName = FindViewById <TextView>(Resource.Id.AnimalScientificName);
            SlugPicture        = FindViewById <ResourceImageView>(Resource.Id.AnimalImage);
            SlugPicture.Click += (sender, e) => Presenter.OnResultPictureClicked();
            SlugDescription    = FindViewById <CustomWebView>(Resource.Id.AnimalPage);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Presenter      = ServiceLocator.GetService <IPresenterFactory <Slug> >().GetPresenterFor(this);
            CustomLayoutId = Resource.Layout.activity_determination;
            CanNavigateTo  = new List <NavigableScreen>
            {
                NavigableScreen.Main,
                NavigableScreen.SpeciesList,
                NavigableScreen.Info
            };
            CurrentActivity = NavigableScreen.Determination;
            base.OnCreate(savedInstanceState);

            ownPictureView            = FindViewById <ResourceImageView>(Resource.Id.ownPicture);
            imageContainer            = FindViewById <FrameLayout>(Resource.Id.imageContainer);
            imageContainer.Click     += OwnPictureOnClick;
            imageContainer.LongClick += OwnPictureOnLongClick;

            recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            choices = new List <Choice>();

            var layoutManager = new LinearLayoutManager(this);

            recyclerView.SetLayoutManager(layoutManager);

            var expandedImageView = FindViewById <ImageView>(Resource.Id.expanded_image);

            expandImageHelper = new ExpandImageHelper(expandedImageView);
            expandImageHelper.SetZoomInAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.zoom_in));
            expandImageHelper.SetZoomOutAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.zoom_out));

            adapter = new RecyclerAdapterDetermination(choices);
            adapter.OnChoiceClicked      += (sender, selectedChoice) => OnChoiceClicked(selectedChoice);
            adapter.OnChoiceImageClicked += (sender, selectedChoice) => OnChoiceImageClicked(selectedChoice);
            recyclerView.SetAdapter(adapter);
        }