Beispiel #1
0
 public static void SetDefaultStyle(this SwipeRefreshLayout 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;
     swipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
 }
Beispiel #2
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                ActionButton            = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonView);
                ActionButton.Visibility = ViewStates.Visible;
                ActionButton.SetImageResource(Resource.Drawable.ic_add);

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                ProgressBarLoader            = (ProgressBar)view.FindViewById(Resource.Id.sectionProgress);
                ProgressBarLoader.Visibility = ViewStates.Gone;

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));


                MAdView = view.FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.swipeRefreshLayout);
                if (SwipeRefreshLayout != null)
                {
                    SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                    SwipeRefreshLayout.Refreshing = true;
                    SwipeRefreshLayout.Enabled    = true;
                    SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                    SwipeRefreshLayout.SetBackgroundColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#282828") : Color.White);
                }

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
 public static void Customize(SwipeRefreshLayout _refreshLayout)
 {
     if (_refreshLayout != null)
     {
         _refreshLayout.SetColorSchemeResources(Resource.Color.color_refresh_loader);
         _refreshLayout.SetProgressBackgroundColor(Resource.Color.color_transparent);
         _refreshLayout.SetSize(0);
         try
         {
             var field = _refreshLayout.Class.GetDeclaredField("mCircleView");
             AccessibleObject[] array = new AccessibleObject[1];
             array[0] = field;
             AccessibleObject.SetAccessible(array, true);
             var _refreshImageView = (ImageView)field.Get(_refreshLayout);
             _refreshImageView.Elevation = 0;
         }
         catch (NoSuchFieldException e)
         {
             e.PrintStackTrace();
         }
         catch (IllegalAccessException e)
         {
             e.PrintStackTrace();
         }
     }
 }
Beispiel #6
0
        private void InitComponent()
        {
            try
            {
                var mainLayout = FindViewById <CoordinatorLayout>(Resource.Id.mainLayout);
                mainLayout.SetPadding(0, 0, 0, 0);

                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                Methods.SetMargin(MAdView, 0, 0, 0, 0);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #7
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));


                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);

                BtnAction            = FindViewById <TextView>(Resource.Id.toolbar_title);
                BtnAction.Visibility = ViewStates.Visible;
                BtnAction.Text       = GetText(Resource.String.Lbl_CreateJob);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Beispiel #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            id               = Intent.GetStringExtra("id");
            handler          = new Handler();
            commentPresenter = new DailyCommentPresenter(this);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            adapter = new DailyCommentsAdapter();
            adapter.OnLoadMoreListener = this;

            recyclerView.SetAdapter(adapter);
            recyclerView.Post(() =>
            {
                swipeRefreshLayout.Refreshing = true;
                OnRefresh();
            });
        }
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                PostFeedAdapter = new NativePostAdapter(this, IdSearch, MainRecyclerView, NativeFeedType.SearchForPosts);

                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 = false;
                SwipeRefreshLayout.Enabled    = true;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(PostFeedAdapter, SwipeRefreshLayout);

                if (Inflated == null)
                {
                    Inflated = EmptyStateLayout.Inflate();
                }

                EmptyStateInflater x1 = new EmptyStateInflater();
                x1.InflateLayout(Inflated, EmptyStateInflater.Type.NoSearchResult);
                x1.EmptyStateButton.Visibility = ViewStates.Gone;

                EmptyStateLayout.Visibility = ViewStates.Visible;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Beispiel #10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mContainer = container;
            View view = inflater.Inflate(Resource.Layout.StudentQsPresent, container, false);

            progressBar = view.FindViewById <ProgressBar>(Resource.Id.circularProgress);
            mListView   = view.FindViewById <ListView>(Resource.Id.myQsListView);
            ImageView backButton = view.FindViewById <ImageView>(Resource.Id.backButton);

            swipeContainer    = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout);
            backButton.Click += (sender, e) =>
            {
                Android.Support.V4.App.FragmentTransaction trans = FragmentManager.BeginTransaction();
                trans.Replace(Resource.Id.qs_root_frame, new Fragments.CurrentPastQs());
                trans.Commit();
            };

            string           dbPath_attributes = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "attributes.db3");
            SQLiteConnection db_attributes     = new SQLiteConnection(dbPath_attributes);

            myAttributes = db_attributes.Get <MyAttributes>(1);

            PopulateList();

            swipeContainer.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight,
                                                   Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            swipeContainer.Refresh += RefreshOnSwipe;

            return(view);
        }
Beispiel #11
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MessageButton = (ImageView)view.FindViewById(Resource.Id.Message_icon);

                if (!UserDetails.IsLogin)
                {
                    MessageButton.Visibility = ViewStates.Invisible;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #12
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;

                LayoutPageRequest            = (RelativeLayout)view.FindViewById(Resource.Id.layout_friend_Request);
                LayoutPageRequest.Visibility = ViewStates.Gone;

                LinearLayout adContainer = view.FindViewById <LinearLayout>(Resource.Id.bannerContainer);
                BannerAd = AdsFacebook.InitAdView(Activity, adContainer);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        protected override void OnElementChanged(ElementChangedEventArgs <PullToRefreshContentView> e)
        {
            base.OnElementChanged(e);

            if (refresher != null)
            {
                return;
            }

            refresher = new SwipeRefreshLayout(Xamarin.Forms.Forms.Context);
            refresher.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
            refresher.SetColorSchemeResources(Resource.Color.xam_purple);

            refresher.SetOnRefreshListener(this);
            //This gets called when we pull down to refresh to trigger command
            refresher.Refresh += (object sender2, EventArgs e2) => {
                var command = this.Element.RefreshCommand;
                if (command == null)
                {
                    return;
                }

                command.Execute(null);
            };

            //HACK as I need to add the sub group to the content group...
            //var text = new Android.Widget.ListView (Xamarin.Forms.Forms.Context);
            //text.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
            //text.Text = "Hello world";

            //refresher.AddView (text);

            refresher.SetBackgroundColor(Android.Graphics.Color.Red);
            SetNativeControl(refresher);
        }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            answerId   = Intent.GetIntExtra("answerId", 0);
            questionId = Intent.GetIntExtra("questionId", 0);
            SetToolBarNavBack();
            StatusBarUtil.SetColorStatusBars(this);
            SetToolBarTitle("»Ø´ðÆÀÂÛ");
            //ÏÔʾͼƬÅäÖÃ
            options = new DisplayImageOptions.Builder()
                      .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnFail(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnLoading(Resource.Drawable.icon_user)
                      .CacheInMemory(true)
                      .BitmapConfig(Bitmap.Config.Rgb565)
                      .CacheOnDisk(true)
                      // .Displayer(new DisplayerImageCircle(20))
                      .Build();
            edit_content = FindViewById <EditText>(Resource.Id.edit_content);
            btn_submit   = FindViewById <Button>(Resource.Id.btn_submit);
            userToken    = UserTokenUtil.GetToken(this);
            //btn_submit.enabvle
            btn_submit.Click += (s, e) =>
            {
                Add();
            };
            edit_content.TextChanged += (s, e) =>
            {
                string temp = edit_content.Text.TrimStart().TrimEnd();
                if (!string.IsNullOrEmpty(temp))
                {
                    btn_submit.Enabled = true;
                    if (atUserName != null && atUserName.Length > 0 && temp.Contains(atUserName))
                    {
                        isAt = true;
                    }
                    else
                    {
                        isAt = false;
                    }
                }
                else
                {
                    btn_submit.Enabled = false;
                }
            };

            _swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            _swipeRefreshLayout.SetOnRefreshListener(this);
            _swipeRefreshLayout.Post(() =>
            {
                _swipeRefreshLayout.Refreshing = true;
            });
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this));
            _recyclerView.AddItemDecoration(new RecyclerViewDecoration(this, (int)Orientation.Vertical));
            initRecyclerView();
            userInfo = UserInfoShared.GetUserInfo(this);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            RootView     = inflater.Inflate(Resource.Layout.generic_list, container, false);
            RecyclerView = RootView.FindViewById <RecyclerView>(Resource.Id.gridView_items);
            RecyclerView.SetLayoutManager(new LinearLayoutManager(Context));
            SwipeRefreshLayout = RootView.FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout);
            LoadingProgressBar = RootView.FindViewById <ContentLoadingProgressBar>(Resource.Id.load_progress_bar);
            var BtnFloatingAction = RootView.FindViewById <ImageButton>(Resource.Id.btn_floating_action);

            SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            SwipeRefreshLayout.Enabled   = AllowRefresh;
            BtnFloatingAction.Visibility = ShowFloatingActionButton ? ViewStates.Visible : ViewStates.Gone;
            BtnFloatingAction.Click     += (o, e) => FloatingActionButtonClick?.Invoke(o, e);
            if (FloatingActionButtonResID > 0)
            {
                BtnFloatingAction.SetImageResource(FloatingActionButtonResID.Value);
            }
            SwipeRefreshLayout.Refresh += (o, e) => OnRefreshed(e);
            ViewCreated?.Invoke(this, new EventArgs());
            if (HeaderLayoutResID.HasValue)
            {
                var headerView = inflater.Inflate(HeaderLayoutResID.Value, RootView.FindViewById <ViewGroup>(Resource.Id.view_list_header));
            }
            return(RootView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.FragmentMessages, null);

            mContext = (Activity)container.Context;

            RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(mContext);
            mRecyclerView = root.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            mSwipeRefreshLayout = root.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout);
            mSwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight);
            mSwipeRefreshLayout.Refresh += (s, e) => UpdateList();

            FloatingActionButton mFloatingActionButton = root.FindViewById <FloatingActionButton>(Resource.Id.Fab);

            mFloatingActionButton.Click += MFloatingActionButton_Click;

            mEemptyList = root.FindViewById <TextView>(Resource.Id.ViewEmpty);

            mListDataSet = new List <string>();
            mListDataSet.Add("ќтветить");
            mListDataSet.Add("ѕереслать");
            mListDataSet.Add("”далить");
            ArrayAdapter <string> mListAdapter = new ArrayAdapter <string>(mContext, Android.Resource.Layout.SimpleListItem1, mListDataSet);

            AlertDialog.Builder mAlertDialog = new AlertDialog.Builder(mContext)
                                               .SetTitle("¬ыберите действие:")
                                               .SetAdapter(mListAdapter, OnSelectAction);
            mDialog = mAlertDialog.Create();

            return(root);
        }
        private void InitComponent(View view)
        {
            try
            {
                EmptyStateLayout  = (ViewStub)view.FindViewById(Resource.Id.viewStub);
                TopSongsViewStub  = (ViewStub)view.FindViewById(Resource.Id.viewStubTopSongs);
                TopAlbumsViewStub = (ViewStub)view.FindViewById(Resource.Id.viewStubTopAlbums);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;

                SearchBox = view.FindViewById <AutoCompleteTextView>(Resource.Id.searchViewBox);
                SearchBox.SetHintTextColor(AppSettings.SetTabDarkTheme ?  Color.White : Color.Gray);
                SearchBox.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray);
                SearchBox.Click += SearchBoxOnClick;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            //Button button = FindViewById<Button>(Resource.Id.MyButton);

            //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
            Button okButton = FindViewById <Button>(Resource.Id.okButton);

            okButton.Click += onOkButtonClick;

            _OrderDateList = FindViewById <ListView>(Resource.Id.orderDateList);

            _OrderDateList.ItemClick += OnOrderDateClick;

            var layoutInflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);

            _ListHeader = (LinearLayout)layoutInflater.Inflate(Resource.Layout.ListHeader, null);

            _SwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout);

            _SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloGreenDark);
            _SwipeRefreshLayout.Refresh += _SwipeRefreshLayout_Refresh;

            //ActionBar.SetDisplayShowHomeEnabled(true);
            //ActionBar.SetDisplayHomeAsUpEnabled(true);

            AuthenticateUser();
        }
        protected override void InitView()
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            ToastUtil.ToastShort(Activity, position.ToString());
            srlBlog = FindViewById <SwipeRefreshLayout>(Resource.Id.srl_blog);
            //srlBlog = view.FindViewById<SwipeRefreshLayout>(Resource.Id.srl_blog);
            recyclerview_blog = FindViewById <RecyclerView>(Resource.Id.recyclerview_blog);
            srlBlog.SetColorSchemeResources(Resource.Color.colorPrimary);
            recyclerview_blog.SetLayoutManager(new  LinearLayoutManager(this.Activity));

            blogPresenter   = new BlogPresenter(this);
            adapter         = new BlogAdapter();
            loadMoreWrapper = new LoadMoreWrapper(adapter);
            recyclerview_blog.SetAdapter(loadMoreWrapper);

            emptyView = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty, (ViewGroup)recyclerview_blog.Parent, false);
            failView  = this.Activity.LayoutInflater.Inflate(Resource.Layout.fail, (ViewGroup)recyclerview_blog.Parent, false);

            srlBlog.SetOnRefreshListener(this);
            failView.SetOnClickListener(this);
            emptyView.SetOnClickListener(this);
            loadMoreWrapper.SetOnLoadMoreListener(this);

            recyclerview_blog.Post(async() =>
            {
                await blogPresenter.GetLocalBlog(pageSize, position);
            });
        }
Beispiel #20
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);

                SaveTextView = FindViewById <TextView>(Resource.Id.toolbar_title);
                if (Caller == "register")
                {
                    SaveTextView.Visibility = ViewStates.Visible;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar));

            // Create list with demo content
            var list = new List<string> { "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", 
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr",
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr"
            };
                    
            FindViewById<ListView>(Resource.Id.listView).Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, list);

            // Set colors for swipe container and attach a refresh listener
            swipeContainer = FindViewById<SwipeRefreshLayout>(Resource.Id.slSwipeContainer);
            swipeContainer.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            swipeContainer.Refresh += SwipeContainer_Refresh;

            // Uncomment to following line if you want to show the loading indicator from the beginning
            // It has to be delayed until the swipeContainer has been completely loaded to take effect
            // swipeContainer.Post(() => { swipeContainer.Refreshing = true; });

            // Manually show refreshing indicator on button press
            FindViewById<Button>(Resource.Id.button).Click += async delegate(object sender, EventArgs e)
            {
                swipeContainer.Refreshing = true;
                await Task.Delay(5000);
                swipeContainer.Refreshing = false;
            };
        }
		protected override void OnElementChanged (ElementChangedEventArgs<PullToRefreshContentView> e)
		{
			base.OnElementChanged (e);

			if (refresher != null)
				return;

			refresher = new SwipeRefreshLayout (Xamarin.Forms.Forms.Context);
			refresher.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			refresher.SetColorSchemeResources (Resource.Color.xam_purple);

			refresher.SetOnRefreshListener (this);
			//This gets called when we pull down to refresh to trigger command
			refresher.Refresh += (object sender2, EventArgs e2) => {
				var command = this.Element.RefreshCommand;
				if (command == null)
					return;

				command.Execute (null);
			};

			//HACK as I need to add the sub group to the content group...
			//var text = new Android.Widget.ListView (Xamarin.Forms.Forms.Context);
			//text.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			//text.Text = "Hello world";

			//refresher.AddView (text);

			refresher.SetBackgroundColor (Android.Graphics.Color.Red);
			SetNativeControl (refresher);
		}
Beispiel #23
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                InviteFriendsButton = (TextView)FindViewById(Resource.Id.toolbar_title);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, InviteFriendsButton, IonIconsFonts.PersonAdd);
                InviteFriendsButton.SetTextColor(Color.White);
                InviteFriendsButton.SetTextSize(ComplexUnitType.Sp, 20f);
                InviteFriendsButton.Visibility = ViewStates.Visible;

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Beispiel #24
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            var manager = new LinearLayoutManager(this.Activity);

            recyclerView.SetLayoutManager(manager);

            adapter = new NewsAdapter();
            adapter.SetOnLoadMoreListener(this);
            recyclerView.SetAdapter(adapter);
            notDataView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty_view, (ViewGroup)recyclerView.Parent, false);
            notDataView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            errorView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.error_view, (ViewGroup)recyclerView.Parent, false);
            errorView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            recyclerView.Post(async() =>
            {
                await newsPresenter.GetClientNews(position);
            });
        }
Beispiel #25
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                FilterButton = view.FindViewById <TextView>(Resource.Id.toolbar_title);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, FilterButton, IonIconsFonts.AndroidOptions);
                FilterButton.SetTextColor(Color.White);
                FilterButton.SetTextSize(ComplexUnitType.Sp, 20f);
                FilterButton.Visibility = ViewStates.Visible;
                FilterButton.Click     += FilterButtonOnClick;

                ShowGoogleAds(view, MRecycler);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void InitializeViews()
        {
            Contract.Requires(() => _viewModel != null);

            Log.Info("InitializeViews");

            SetContentView(Resource.Layout.activity_main);

            _toolbar       = FindViewById <Toolbar>(Resource.Id.toolbar);
            _toolbar.Title = _viewModel.Title;
            SetSupportActionBar(_toolbar);

            _loader = FindViewById <ProgressBar>(Resource.Id.progress_loading);

            _errorViewSwitcher = new ErrorViewSwitcher(
                this,
                FindViewById <LinearLayout>(Resource.Id.view_error));

            _adapter      = new SillyRecyclerAdapter(this);
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.list_silly);
            _recyclerView.SetItemAnimator(new ScaleInAnimator());
            _recyclerView.SetAdapter(_adapter);
            _recyclerView.SetLayoutManager(new LinearLayoutManager(this));

            _refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresh_container);
            _refreshLayout.SetColorSchemeResources(Resource.Color.accent, Resource.Color.primary);
        }
Beispiel #27
0
        private void InitComponent()
        {
            try
            {
                MRecycler        = (RecyclerView)FindViewById(Resource.Id.recyler);
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(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;

                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                SwipeRefreshLayout.SetBackgroundColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#282828") : Color.White);
                MRecycler.SetBackgroundColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#282828") : Color.White);

                TxtSuggestedGroups            = FindViewById <TextView>(Resource.Id.toolbar_title);
                TxtSuggestedGroups.Text       = GetString(Resource.String.Lbl_SuggestedGroups);
                TxtSuggestedGroups.Visibility = ViewStates.Visible;

                CreateButton            = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonView);
                CreateButton.Visibility = ViewStates.Visible;
                CreateButton.SetImageResource(Resource.Drawable.ic_add);

                MAdView = FindViewById <AdView>(Resource.Id.adView);
                AdsGoogle.InitAdView(MAdView, MRecycler);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void InitComponent()
        {
            try
            {
                RootView = FindViewById <RelativeLayout>(Resource.Id.rootChatWindowView);

                ChatEmojiImage       = FindViewById <AppCompatImageView>(Resource.Id.emojiicon);
                EmojiconEditTextView = FindViewById <EmojiconEditText>(Resource.Id.EmojiconEditText5);
                ChatSendButton       = FindViewById <CircleButton>(Resource.Id.sendButton);
                ChatBoxRecylerView   = FindViewById <RecyclerView>(Resource.Id.recyler);
                SwipeRefreshLayout   = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
                SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);

                ChatSendButton.Tag = "Text";
                ChatSendButton.SetImageResource(Resource.Drawable.SendLetter);

                ModeCallback = new ActionModeCallback(this);

                var emojisIcon = new EmojIconActions(this, RootView, EmojiconEditTextView, ChatEmojiImage);
                emojisIcon.ShowEmojIcon();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #29
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                EmptyStateLayout = FindViewById <ViewStub>(Resource.Id.viewStub);
                MainRecyclerView = FindViewById <WRecyclerView>(Resource.Id.Recyler);
                MAdapter         = new NativePostAdapter(this, "", MainRecyclerView, NativeFeedType.Global, SupportFragmentManager);

                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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                MainRecyclerView.SetXAdapter(MAdapter, SwipeRefreshLayout);

                CommentsRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view);
                CommentsRecyclerView.NestedScrollingEnabled = false;
                CommentAdapter = new CommentAdapter(this)
                {
                    CommentList = new ObservableCollection <CommentObjectExtra>()
                };
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #30
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(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;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;

                RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager);
                MainScrollEvent = xamarinRecyclerViewOnScrollListener;
                MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent;
                MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener);
                MainScrollEvent.IsLoading = false;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar));

            // Create list with demo content
            var list = new List <string> {
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr",
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr",
                "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr", "Lorem ipsum dolor", "Sit amet, consetetur", "Sadipscing elitr"
            };

            FindViewById <ListView>(Resource.Id.listView).Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, list);

            // Set colors for swipe container and attach a refresh listener
            swipeContainer = FindViewById <SwipeRefreshLayout>(Resource.Id.slSwipeContainer);
            swipeContainer.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
            swipeContainer.Refresh += SwipeContainer_Refresh;

            // Uncomment to following line if you want to show the loading indicator from the beginning
            // It has to be delayed until the swipeContainer has been completely loaded to take effect
            // swipeContainer.Post(() => { swipeContainer.Refreshing = true; });

            // Manually show refreshing indicator on button press
            FindViewById <Button>(Resource.Id.button).Click += async delegate(object sender, EventArgs e)
            {
                swipeContainer.Refreshing = true;
                await Task.Delay(5000);

                swipeContainer.Refreshing = false;
            };
        }
        private void InitComponent()
        {
            try
            {
                RootView             = MainView.FindViewById <RelativeLayout>(Resource.Id.root);
                Emojiicon            = MainView.FindViewById <AppCompatImageView>(Resource.Id.emojiicon);
                EmojiconEditTextView = MainView.FindViewById <EmojiconEditText>(Resource.Id.EmojiconEditText5);
                SendButton           = MainView.FindViewById <CircleButton>(Resource.Id.sendButton);
                CommentRecyclerView  = MainView.FindViewById <RecyclerView>(Resource.Id.recyler);
                XSwipeRefreshLayout  = MainView.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                ProgressBarLoader    = MainView.FindViewById <ProgressBar>(Resource.Id.sectionProgress);
                EmptyStateLayout     = MainView.FindViewById <ViewStub>(Resource.Id.viewStub);
                ViewboxText          = MainView.FindViewById <TextView>(Resource.Id.viewbox);
                ViewboxText.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                XSwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight);
                XSwipeRefreshLayout.Refreshing = false;
                XSwipeRefreshLayout.Enabled    = true;
                XSwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                ProgressBarLoader.Visibility = ViewStates.Visible;

                EmojiconEditTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray);
                EmojiconEditTextView.SetHintTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Gray);

                EmojIconActions emojis = new EmojIconActions(Activity, RootView, EmojiconEditTextView, Emojiicon);
                emojis.ShowEmojIcon();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #33
0
 public void FindAndBindViews()
 {
     mRecycler = FindViewById<RecyclerView>(Resource.Id.rvList);
     mRecycler.SetLayoutManager(new LinearLayoutManager(this));
     refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
     refresher.Refresh += (sender, e) => OnRefresh(sAccount);
     refresher.SetColorSchemeResources(Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloGreenLight);
     mAdapter = new BaseRecyclerViewAdapter<UserModel, UserViewHolder>(BaseContext, new List<UserModel>(), Resource.Layout.Item_UserView);
     mRecycler.SetAdapter(mAdapter);
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            var rootView = inflater.Inflate(Resource.Layout.list_fragment, container, false);

            pbNews = rootView.FindViewById<RelativeLayout>(Resource.Id.pbNews);
            listViewNews = rootView.FindViewById<RecyclerView>(Resource.Id.list_news);
            emptyView = rootView.FindViewById<TextView>(Resource.Id.empty_view);

            PreCachingLayoutManager mLayoutManager = new PreCachingLayoutManager(Application.Context);
            mLayoutManager.Orientation = LinearLayoutManager.Vertical;
            mLayoutManager.SetExtraLayoutSpace(GetScreenHeight(Activity));
            listViewNews.SetLayoutManager(mLayoutManager);
            listViewNews.SetLayoutManager(mLayoutManager);
            listViewNews.AddOnScrollListener(new mOnScrollListener(this));

            refresher = rootView.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorSchemeResources(Resource.Color.orange, Resource.Color.green, Resource.Color.blue);

            refresher.Refresh+= (sender, e) => {
                pbNews.Visibility = ViewStates.Visible;
                load(site + "feed", true);
                page = 1;
                detecting = true;
            };

            load (site+"feed",false);

            return rootView;
        }
Beispiel #35
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (Arguments != null)
            {
                site = Arguments.GetString("baseUrl", "http://smartreporter.altervista.org/");
            }

            searching = false;
            loadedSite = "http://smartreporter.altervista.org/";

            var rootView = inflater.Inflate(Resource.Layout.list_fragment, container, false);

            if (savedInstanceState != null)
            {
                IParcelable savedRecyclerLayoutState = (IParcelable)savedInstanceState.GetParcelable("recycler_layout");
                listViewNews.GetLayoutManager().OnRestoreInstanceState(savedRecyclerLayoutState);
            }

            pbNews = rootView.FindViewById<RelativeLayout>(Resource.Id.pbNews);
            listViewNews = rootView.FindViewById<RecyclerView>(Resource.Id.list_news);
            emptyView = rootView.FindViewById<TextView>(Resource.Id.empty_view);

            //Setup layout manager
            PreCachingLayoutManager mLayoutManager = new PreCachingLayoutManager(Application.Context);
            mLayoutManager.Orientation = LinearLayoutManager.Vertical;
            mLayoutManager.SetExtraLayoutSpace(GetScreenHeight(Activity));
            listViewNews.SetLayoutManager(mLayoutManager);

            listViewNews.AddOnScrollListener(new mOnScrollListener(this));

            refresher = rootView.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorSchemeResources(Resource.Color.orange, Resource.Color.green, Resource.Color.blue);

            refresher.Refresh += (sender, e) =>
            {
                pbNews.Visibility = ViewStates.Visible;
                load(site + "feed", true);
                page = 1;
                detecting = true;
            };

            load(site + "feed", false);

            return rootView;
        }
Beispiel #36
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Groepscherm);

            _persoon = Gegevens.GetPerson();
            _groep = Gegevens.CurrentGroup();

            _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);

            TextView title = _toolbar.FindViewById<TextView>(Resource.Id.Title);
            title.Text = _groep.groepsnaam;

            SetSupportActionBar(_toolbar);
            SupportActionBar.Title = "";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            _participantsRecyclerView = FindViewById<RecyclerView>(Resource.Id.participantsrecyclerview);
            _participantsRecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            _participantsRecyclerView.SetScrollContainer(false);
            _participantsRecyclerView.NestedScrollingEnabled = false;

            _swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.mainColor);
            _swipeRefreshLayout.SetOnRefreshListener(this);

            CardView historyCardView = FindViewById<CardView>(Resource.Id.history_card_view);
            Button cameraButton = FindViewById<Button>(Resource.Id.buttonCamera);
            Button textButton = FindViewById<Button>(Resource.Id.buttonText);
            Button leaveButton = FindViewById<Button>(Resource.Id.buttonLeave);

            leaveButton.Click += (sender, e) =>
            {
                DatabaseInterface.RemoveFromGroup(_persoon.Id, _groep.groepsnaam, _persoon.Id, _persoon.Password);
                Finish();
            };
            historyCardView.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(Historyscherm));
                StartActivity(activity);
            };
            cameraButton.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(CameraActivity));
                StartActivityForResult(activity, 1);
            };
            textButton.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(Nieuwschuld));
                StartActivity(activity);
            };

            CreateParticipantsEnvironment();
        }