public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_layouts, container, false);
            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            Button btnLinear = (Button)rootView.FindViewById(Resource.Id.btnLinear);
            btnLinear.Click += (object sender, EventArgs e) => {
                listView.SetLayoutManager(new LinearLayoutManager(this.Activity));
            };

            Button btnStaggered = (Button)rootView.FindViewById(Resource.Id.btnStaggered);
            btnStaggered.Click += (object sender, EventArgs e) => {
                StaggeredGridLayoutManager slm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                listView.SetLayoutManager(slm);
            };

            Button btnGrid = (Button)rootView.FindViewById(Resource.Id.btnGrid);
            btnGrid.Click += (object sender, EventArgs e) => {
                GridLayoutManager glm = new GridLayoutManager(this.Activity, 3, GridLayoutManager.Vertical, false);
                listView.SetLayoutManager(glm);
            };

            ArrayList source = new ArrayList();
            for (int i = 0; i < 50; i++) {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));
            return rootView;
        }
Ejemplo n.º 2
0
 public EndlessRecyclerViewScrollListener(StaggeredGridLayoutManager layoutManager)
 {
     this.mLayoutManager = layoutManager;
     visibleThreshold   *= layoutManager.SpanCount;
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            _photoService = new PhotoService();
            photos = _photoService.GetPhotos();

            #region IsAvialableCamera?

            if (IsThereAnAppToTakePictures())
            {
                CreateDirectoryForPictures();
            }

            #endregion

            #region ResouleViewInitialization

            myRecyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView);
            //Create layout manager
            //myLayoutManager = new LinearLayoutManager(this);
            mygridLayoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
            // Attach the layout manager to the recycler view
            myRecyclerView.SetLayoutManager(mygridLayoutManager);
            myAdapter = new RecyclerAdapter(photos);
            myRecyclerView.SetItemAnimator(new DefaultItemAnimator {MoveDuration = 501, AddDuration = 1000});
            myRecyclerView.SetAdapter(myAdapter);

            #endregion
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                IMethods.IApp.FullScreenApp(this);

                var view = MyContextWrapper.GetContentView(this, Settings.Lang, Resource.Layout.CreateProduct_Layout);
                if (view != null)
                {
                    SetContentView(view);
                }
                else
                {
                    SetContentView(Resource.Layout.CreateProduct_Layout);
                }

                var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (ToolBar != null)
                {
                    ToolBar.Title = GetText(Resource.String.Lbl_CreateNewProduct);

                    SetSupportActionBar(ToolBar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);
                }

                CategoriesRecyclerView = FindViewById <RecyclerView>(Resource.Id.CatRecyler);

                Txt_Add = FindViewById <TextView>(Resource.Id.toolbar_title);

                Image_Item   = FindViewById <ImageViewAsync>(Resource.Id.Image);
                Image_delete = FindViewById <CircleButton>(Resource.Id.ImageCircle);
                Btn_AddPhoto = FindViewById <Button>(Resource.Id.btn_AddPhoto);
                Txt_name     = FindViewById <EditText>(Resource.Id.nameet);
                Txt_price    = FindViewById <EditText>(Resource.Id.priceet);
                Txt_Location = FindViewById <EditText>(Resource.Id.Locationet);
                Txt_about    = FindViewById <EditText>(Resource.Id.aboutet);

                RB_New  = FindViewById <RadioButton>(Resource.Id.rad_New);
                RB_Used = FindViewById <RadioButton>(Resource.Id.rad_Used);


                //Get Data Categories Local
                var cat = new CategoriesController();
                cat.Get_Categories_Communities();
                if (CategoriesController.ListCatigories_Names.Count > 0)
                {
                    mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Horizontal);

                    CategoriesRecyclerView.HasFixedSize = true;
                    CategoriesRecyclerView.SetLayoutManager(mLayoutManager);

                    CategoriesAdapter = new Categories_Adapter(this);
                    CategoriesAdapter.mCategoriesList =
                        new ObservableCollection <Classes.Catigories>(CategoriesController.ListCatigories_Names);
                    CategoriesRecyclerView.SetAdapter(CategoriesAdapter);
                    CategoriesRecyclerView.NestedScrollingEnabled = false;
                    CategoriesAdapter.BindEnd();

                    CategoriesRecyclerView.Visibility = ViewStates.Visible;
                }

                var imageTrancform = ImageService.Instance.LoadCompiledResource("Grey_Offline.jpg");
                imageTrancform.LoadingPlaceholder("Grey_Offline.jpg", ImageSource.CompiledResource);
                imageTrancform.ErrorPlaceholder("Grey_Offline.jpg", ImageSource.CompiledResource);
                imageTrancform.TransformPlaceholders(true);
                imageTrancform.Transform(new RoundedTransformation(30));
                imageTrancform.FadeAnimation(false);
                imageTrancform.Into(Image_Item);

                //Show Ads
                mAdView = FindViewById <AdView>(Resource.Id.adView);
                if (Settings.Show_ADMOB_Banner)
                {
                    mAdView.Visibility = ViewStates.Visible;
                    var adRequest = new AdRequest.Builder().Build();
                    mAdView.LoadAd(adRequest);
                }
                else
                {
                    mAdView.Pause();
                    mAdView.Visibility = ViewStates.Invisible;
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
Ejemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                IMethods.IApp.FullScreenApp(this);

                var view = MyContextWrapper.GetContentView(this, Settings.Lang, Resource.Layout.Albums_Layout);
                if (view != null)
                {
                    SetContentView(view);
                }
                else
                {
                    SetContentView(Resource.Layout.Albums_Layout);
                }

                var data = Intent.GetStringExtra("UserId") ?? "Data not available";
                if (data != "Data not available" && !string.IsNullOrEmpty(data))
                {
                    S_UserId = data;
                }

                var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (ToolBar != null)
                {
                    if (S_UserId == UserDetails.User_id)
                    {
                        ToolBar.Title = GetText(Resource.String.Lbl_MyImages);
                    }
                    else
                    {
                        ToolBar.Title = GetText(Resource.String.Lbl_YourImages);
                    }

                    SetSupportActionBar(ToolBar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);
                }


                ImagesRecylerView = (RecyclerView)FindViewById(Resource.Id.RecylerImages);

                swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                swipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight,
                                                           Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight,
                                                           Android.Resource.Color.HoloRedLight);
                swipeRefreshLayout.Refreshing = true;
                swipeRefreshLayout.Enabled    = true;

                photos_Empty = FindViewById <LinearLayout>(Resource.Id.Albums_LinerEmpty);

                Icon_photos = FindViewById <TextView>(Resource.Id.Albums_icon);
                IMethods.Set_TextViewIcon("2", Icon_photos, "\uf03e");

                ImagesRecylerView.Visibility = ViewStates.Visible;
                photos_Empty.Visibility      = ViewStates.Gone;

                photosAdapter = new PhotosAdapter(this);

                // Check if we're running on Android 5.0 or higher
                if ((int)Build.VERSION.SdkInt < 23)
                {
                    mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical);
                    ImagesRecylerView.SetLayoutManager(mLayoutManager);
                }
                else
                {
                    mLayoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                    ImagesRecylerView.SetLayoutManager(mLayoutManager);
                }

                ImagesRecylerView.AddItemDecoration(new GridSpacingItemDecoration(2, 3, true));
                ImagesRecylerView.SetAdapter(photosAdapter);
                ImagesRecylerView.Visibility = ViewStates.Visible;

                Get_Data_local();
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
Ejemplo n.º 6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_layouts, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            ArrayList source = new ArrayList();

            for (int i = 0; i < 50; i++)
            {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));

            Button btnLinear = (Button)rootView.FindViewById(Resource.Id.btnLinear);

            btnLinear.Click += (object sender, EventArgs e) => {
                listView.SetLayoutManager(new LinearLayoutManager(this.Activity));
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnStaggered = (Button)rootView.FindViewById(Resource.Id.btnStaggered);

            btnStaggered.Click += (object sender, EventArgs e) => {
                StaggeredGridLayoutManager slm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                listView.SetLayoutManager(slm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnGrid = (Button)rootView.FindViewById(Resource.Id.btnGrid);

            btnGrid.Click += (object sender, EventArgs e) => {
                GridLayoutManager glm = new GridLayoutManager(this.Activity, 3, GridLayoutManager.Vertical, false);
                listView.SetLayoutManager(glm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnDeck = (Button)rootView.FindViewById(Resource.Id.btnDeck);

            btnDeck.Click += (object sender, EventArgs e) => {
                DeckOfCardsLayoutManager dclm = new DeckOfCardsLayoutManager(this.Activity);
                listView.SetLayoutManager(dclm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnSlide = (Button)rootView.FindViewById(Resource.Id.btnSlide);

            btnSlide.Click += (object sender, EventArgs e) => {
                SlideLayoutManager slm = new SlideLayoutManager(this.Activity);
                listView.SetLayoutManager(slm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnWrap = (Button)rootView.FindViewById(Resource.Id.btnWrap);

            btnWrap.Click += (object sender, EventArgs e) => {
                WrapLayoutManager wlm = new WrapLayoutManager(this.Activity);
                listView.SetLayoutManager(wlm);
                listView.SetAdapter(new MyWrapAdapter(source));
            };

            return(rootView);
        }