Beispiel #1
0
        public static BasicAskQuestionFragment NewInstance()
        {
            var fragment = new BasicAskQuestionFragment {
                Arguments = new Bundle()
            };

            return(fragment);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            View view = inflater.Inflate(Resource.Layout.basic_fragment_QA, null);

            Activity.Title = "Opportunities";

            browse = view.FindViewById <Button>(Resource.Id.browse);
            ask    = view.FindViewById <Button>(Resource.Id.ask);

            browse.Click += (sender, e) =>
            {
                FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicBrowseQuestionsFragment.NewInstance())
                .AddToBackStack(null).Commit();
            };

            ask.Click += (sender, e) =>
            {
                FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicAskQuestionFragment.NewInstance())
                .AddToBackStack(null).Commit();
            };


            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            View view = inflater.Inflate(Resource.Layout.basic_fragment_get_help, null);

            addRequest = view.FindViewById <Button>(Resource.Id.btnAdd);

            Activity.Title = "Get Help";

            ViewModel = new BrowseQuestionsViewModel();

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

            recyclerView.HasFixedSize = false;
            recyclerView.AddItemDecoration(new DividerItemDecoration(recyclerView.Context, DividerItemDecoration.Vertical));
            recyclerView.SetAdapter(adapter = new MyCurrentRequestAdapter(Activity, this, ViewModel));

            refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);
            refresher.SetColorSchemeColors(Resource.Color.accent);

            addRequest.Click += (sender, e) =>
            {
                FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicAskQuestionFragment.NewInstance())
                .AddToBackStack(null).Commit();
            };

            return(view);
        }