Exemplo n.º 1
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                LoadingLinear            = (LinearLayout)view.FindViewById(Resource.Id.Loading_LinearLayout);
                LoadingLinear.Visibility = ViewStates.Visible;

                ViewPagerView = view.FindViewById <ViewPager>(Resource.Id.viewpager2);

                MainAppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.mainAppBarLayout);
                MainAppBarLayout.SetExpanded(false);

                CollapsingToolbarLayout = (CollapsingToolbarLayout)view.FindViewById(Resource.Id.collapsingToolbar);
                ToolbarLogo             = view.FindViewById <ImageView>(Resource.Id.ToolbarLogo);
                ToolbarLogoLinearLayout = view.FindViewById <LinearLayout>(Resource.Id.ToolbarLogoLinearLayout);

                if (AppSettings.ShowAppLogoInToolbar)
                {
                    CollapsingToolbarLayout.SetTitle(" ");
                    MainAppBarLayout.AddOnOffsetChangedListener(this);

                    ToolbarLogoLinearLayout.BringToFront();
                    ViewCompat.SetTranslationZ(ToolbarLogoLinearLayout, 100);
                    ((View)ToolbarLogoLinearLayout.Parent).RequestLayout();
                }
                else
                {
                    CollapsingToolbarLayout.Title = AppSettings.ApplicationName;
                }

                SwipeRefreshLayout = (SpringView)view.FindViewById(Resource.Id.material_style_ptr_frame);
                SwipeRefreshLayout.SetType(SpringView.Type.Overlap);
                SwipeRefreshLayout.Header = new Helpers.PullSwipeStyles.DefaultHeader(Activity);
                SwipeRefreshLayout.Footer = new Helpers.PullSwipeStyles.DefaultFooter(Activity);
                SwipeRefreshLayout.Enable = true;
                SwipeRefreshLayout.SetListener(this);

                MainAlert            = (RelativeLayout)view.FindViewById(Resource.Id.mainAlert);
                MainAlert.Visibility = !UserDetails.IsLogin ? ViewStates.Visible : ViewStates.Gone;
                MainAlert.Click     += MainAlertOnClick;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
            // Because FastRenderer of Label or Image can't be set ClickListener,
            // insert FrameLayout with same position and same size on the view.
            public void OnLayoutChange(Android.Views.View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)
            {
                _overlay.Layout(v.Left, v.Top, v.Right, v.Bottom);

                if (_alreadyGotParent)
                {
                    return;
                }

                _parent           = _view.Parent as Android.Views.ViewGroup;
                _alreadyGotParent = true;

                _parent.AddView(_overlay);

                _overlay.BringToFront();
            }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.CadastroRR_Images_View);

            Loading = FindViewById <ViewGroup>(Resource.Id.loadingImage);
            Loading.BringToFront();

            registroDeReforma = JsonConvert.DeserializeObject <RegistroDeReforma>(Intent.GetStringExtra("RegistroDeReforma"));
            quantidadeImagens = PegaQuantidadeImagensServidor(registroDeReforma);

            if (quantidadeImagens > 0)
            {
                if (bitmap == null)
                {
                    bitmap = new List <Bitmap>();
                }

                bitmap.Add(PegarImagensServidor(registroDeReforma, 0));

                imageView = FindViewById <EnchantedViewPagerExtended>(Resource.Id.cadastroRRImagesView);

                adapter           = new ImagesViewAdapter(this, bitmap);
                imageView.Adapter = adapter;
            }
            else
            {
                Program.Main.ShowMessage("O diretório não possui imagens");
            }

            nextImage    = FindViewById <FloatingActionButton>(Resource.Id.nextImage);
            previusImage = FindViewById <FloatingActionButton>(Resource.Id.previousImage);

            nextImage.Click     += NextImage_Click;
            previusImage.Click  += PreviusImage_Click;
            previusImage.Enabled = false;
        }