public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            View v = inflater.Inflate(Resource.Layout.DoOnlineTestFragment, container, false);

            //var AllTestlistserlizeRecord = Arguments.GetString("AllTestList");

            AllTestList = JsonConvert.DeserializeObject <List <AllTestModelData> >(MyTest.myFinalTestlistserilize);
            if (AllTestList.Count > 0)
            {
                mRecycleView   = v.FindViewById <RecyclerView>(Resource.Id.onlinetestlist);
                mLayoutManager = new LinearLayoutManager(this.Activity);
                mRecycleView.SetLayoutManager(mLayoutManager);
                DoOnlineTestAapter mAdapter = new DoOnlineTestAapter(this.Activity, mRecycleView, AllTestList);
                mAdapter.ItemClick += MAdapter_ItemClick;
                mRecycleView.SetAdapter(mAdapter);
            }
            else
            {
                Toast.MakeText(Activity, "No Test available in this package", ToastLength.Long).Show();
            }


            return(v);
        }
Exemple #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            View         v       = inflater.Inflate(Resource.Layout.MockTestFragment, container, false);
            MockTestBean objbean = new MockTestBean
            {
                Id         = "1",
                Coursename = "ST-544 SSCHSL(PRE) 2019",
                Date       = "2019-04-10",
                Attempted  = "7",
                Correct    = "3",
                Obtaind    = "4",
                Result     = "N/A",
                Totalmarks = "100",
                Course     = "testttttt"
            };

            for (int i = 0; i < 10; i++)
            {
                myList.Add(objbean);
            }

            mRecycleView   = v.FindViewById <RecyclerView>(Resource.Id.mocktestlist);
            mLayoutManager = new LinearLayoutManager(this.Activity);
            mRecycleView.SetLayoutManager(mLayoutManager);
            MockTestAdapter mAdapter = new MockTestAdapter(myList, this.Activity, mRecycleView);

            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
            return(v);
        }
Exemple #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Downloads, container, false);

            ax_downloads = this;
            Button btt = view.FindViewById <Button>(Resource.Id.newLink);

            btt.Click += (o, e) =>
            {
                Context context = view.Context;
                Intent  intent  = new Intent(context, typeof(LinkdownloadActivity));

                StartActivity(intent);
            };

            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_links);
            _re = re;

            re.SetItemClickListener((rv, position, _view) =>
            {
                // try {

                DoLink(0, position);

                // }
                // catch (System.Exception) {

                //     print("Error getting:" + position);
                // }
            });

            SetUpRecyclerView(_re);

            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            base.OnCreateView(inflater, container, savedInstanceState);
            View v = inflater.Inflate(Resource.Layout.NextClassSchedule, container, false);

            mRecycleView   = v.FindViewById <RecyclerView>(Resource.Id.nextclassschedulelist);
            mLayoutManager = new LinearLayoutManager(this.Activity);
            mRecycleView.SetLayoutManager(mLayoutManager);
            MyClassScheduleAdapter mAdapter = new MyClassScheduleAdapter(myList, this.Activity, mRecycleView);

            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);

            Spinner spinner = v.FindViewById <Spinner>(Resource.Id.nextclassscheduleSpinner);

            spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelected);
            //var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.car_array, Android.Resource.Layout.SimpleSpinnerItem);
            var items = new List <string>()
            {
                "one", "two", "three"
            };
            var adapter = new ArrayAdapter <string>(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, items);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;

            return(v);
        }
Exemple #5
0
        void SelectMovie(_w.RecyclerView rv, int position, View _view)
        {
            var check = __view.FindViewById <CheckBox>(Resource.Id.checkBox1);

            if (!check.Checked)
            {
                //An item has been clicked
                try {
                    SearchResultsActivity.done = false;
                }
                catch (System.Exception) {
                }

                movieSelectedID = wlink[position];
                Context context = _view.Context;
                Intent  intent  = new Intent(context, typeof(SearchResultsActivity));
                // intent.PutExtra(CheeseDetailActivity.EXTRA_NAME, values[position]);

                context.StartActivity(intent);
            }
            else
            {
                HistoryPressTitle(movieTitles[position], true);
                UpdateList();
                _re.ScrollToPosition(position);
            }
        }
Exemple #6
0
        void SetUpRecyclerView(_w.RecyclerView recyclerView)
        {
            ax_Bookmarks.ax_bookmarks.UpdateList();
            //var values = GetRandomSubList(Cheeses.CheeseStrings, 30);
            var values = new List <string>();

            wlink = new List <int>();
            for (int i = 0; i < movieTitles.Count; i++)
            {
                if (!movieTitles[i].Contains("B___"))
                {
                    values.Add(MainActivity.movieTitles[i]);
                    wlink.Add(i);
                }
            }
            //.Replace("B___", "")
            recyclerView.SetLayoutManager(new _w.LinearLayoutManager(recyclerView.Context));
            var adapter = new SimpleStringRecyclerViewAdapter(recyclerView.Context, values, Activity.Resources);

            adapter.ItemClick += MAdapter_ItemLongClick;
            recyclerView.SetAdapter(adapter);
            // System.Diagnostics.Debug.WriteLine("QQQ:" + movieTitles.Count.ToString());

            // if(   !recyclerView.itemc) {


            //  }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            //RECYCLER VIEW
            mObject = new SideBySideObject ();
            mAdapter = new SideBySideAdapter (mObject, this, false);
            SetContentView (Resource.Layout.BrowseNationalities);
            mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            mRecyclerView.SetAdapter (mAdapter);
            mLayoutManager = new v7Widget.LinearLayoutManager (this);
            mRecyclerView.SetLayoutManager (mLayoutManager);

            //MENU VIEW
            Button menu_button = FindViewById<Button> (Resource.Id.menu_button);
            MenuButtonSetupSuperClass (menu_button);
            //			menu_button.Click += (s, arg) => {
            //				menu_button.SetBackgroundResource(Resource.Drawable.pressed_lines);
            //				PopupMenu menu = new PopupMenu (this, menu_button);
            //				menu.Inflate (Resource.Menu.Main_Menu);
            //				menu.MenuItemClick += this.MenuButtonClick;
            //				menu.DismissEvent += (s2, arg2) => {
            //					menu_button.SetBackgroundResource(Resource.Drawable.menu_lines);
            //					Console.WriteLine ("menu dismissed");
            //				};
            //				menu.Show ();
            //			};
        }
        public void deployRecyclerView(PlannedMealAdapter mAdapter, v7Widget.RecyclerView.LayoutManager mLayoutManager,
			v7Widget.RecyclerView mRecyclerView)
        {
            this.mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            this.mRecyclerView.SetAdapter (mAdapter);
            this.mRecyclerView.SetLayoutManager (mLayoutManager);
        }
Exemple #9
0
        public override void SmoothScrollToPosition(Android.Support.V7.Widget.RecyclerView recyclerView, Android.Support.V7.Widget.RecyclerView.State state, int position)
        {
            CustomLinearSmoothScroller linearSmoothScroller = new CustomLinearSmoothScroller(recyclerView.Context);

            linearSmoothScroller.SetManager(this);
            linearSmoothScroller.TargetPosition = position;
            StartSmoothScroll(linearSmoothScroller);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.leftdrawer);
            // var myquestionlist = Intent.GetStringExtra("QuestionList");
            var myquestionlist = DosTestFragment.myquestionlist;

            position = Intent.GetIntExtra("position", 0);
            drawerselelectedspinner  = Intent.GetIntExtra("drawerselelectedspinner", 0);
            startingquestionposition = JsonConvert.DeserializeObject <List <int> >(Intent.GetStringExtra("startingquestionposition"));
            items = JsonConvert.DeserializeObject <List <string> >(Intent.GetStringExtra("items"));
            myitems.Add("All");
            for (int i = 0; i < items.Count; i++)
            {
                myitems.Add(items[i]);
            }



            AlQuestionList = JsonConvert.DeserializeObject <List <List <questionmodel> > >(myquestionlist);
            Spinner spinner = FindViewById <Spinner>(Resource.Id.mytesttestSpinner);

            var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, myitems);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;


            if (TestInstruction.testInfoList[0].Duration > 0)
            {
                spinner.Enabled = false;
            }
            else
            {
                spinner.Enabled = true;
            }

            spinner.SetSelection(drawerselelectedspinner);
            spinner.ItemSelected += Spinner_ItemSelected;
            ivclose = FindViewById <LinearLayout>(Resource.Id.closeleftdrawer);
            ivclose.SetOnClickListener(this);


            mRecycleView   = FindViewById <RecyclerView>(Resource.Id.leftdrawerlist);
            mLayoutManager = new GridLayoutManager(this, 6);
            mRecycleView.SetLayoutManager(mLayoutManager);

            RightdrawerAdapter mAdapter = new RightdrawerAdapter(this, AlQuestionList, myitems, startingquestionposition, mRecycleView, 0);

            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
            // Create your application here
        }
Exemple #11
0
 public static void SendVideoCardListToFeedRecycler(List <VideoCard> vcl, Android.Support.V7.Widget.RecyclerView recyclerView, int id = -1)
 {
     if (GetFeedRecyclerViewAdapter == null)
     {
         GetFeedRecyclerViewAdapter            = new FeedRecyclerViewAdapter(vcl);
         GetFeedRecyclerViewAdapter.ItemClick += CommonFrag.GetFragmentById(id).RootVideoAdapter_ItemClick;
         recyclerView.SetAdapter(GetFeedRecyclerViewAdapter);
     }
     else
     {
         GetFeedRecyclerViewAdapter.UpdateDataSet(vcl, true);
     }
 }
Exemple #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetContentView(Resource.Layout.RecyclerView);
            base.OnCreate(savedInstanceState);
            //recycler view
            mRoomlist      = new RoomList();
            recyclerView   = FindViewById <RecyclerView>(Resource.Id.recycler1);
            mLayoutManager = new LinearLayoutManager(this);
            recyclerView.SetLayoutManager(mLayoutManager);
            mAdapter            = new RoomPhotoAdapter(mRoomlist);
            mAdapter.ItemClick += MAdapter_ItemClick;

            recyclerView.SetAdapter(mAdapter);
        }
Exemple #13
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SearchPerson);
            ToolBar        = FindViewById <SupportToolBar>(Resource.Id.toolbar);
            SearchUserView = FindViewById <SupportRecyclerView>(Resource.Id.searchUserList);

            SetSupportActionBar(ToolBar);
            SupportActionBar.Title = "Select Person";

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            UsersDatabase db = new UsersDatabase();

            ISharedPreferences info = Application.Context.GetSharedPreferences(Application.Context.GetString(Resource.String.ApplicationInfo), FileCreationMode.Private);
            String             Date = info.GetString(Application.Context.GetString(Resource.String.ModifyDate), String.Empty);

            ProgressDialog progressDialog = ProgressDialog.Show(this, "", "Loading, please wait...", true);

            List <UserListItem> tmp = await MeritMoneyBrain.GetListOfUsers(modifyAfter : Date);

            if (db.IsExist())
            {
                db.Merge(tmp);
            }
            else
            {
                db.CreateDatabase();
                db.Insert(tmp);
            }

            SearchUsersList = db.GetUsers();

            progressDialog.Dismiss();

            RecyclerViewManager = new LinearLayoutManager(this);
            SearchUserView.SetLayoutManager(RecyclerViewManager);
            RecyclerViewAdapter = new UsersAdapter(SearchUsersList, this);
            SearchUserView.SetAdapter(RecyclerViewAdapter);

            for (int i = 0; i < SearchUsersList.Count; i++)
            {
                new CacheListItemImage(RecyclerViewAdapter, i, Application.Context).Execute(SearchUsersList[i]);
            }

            //ToolBar.MenuItemClick += ToolBar_MenuItemClick;
        }
Exemple #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            string databasePath = Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), Database.SimpleGpsDatabase.DatabaseName);

            this.databaseConnection = new SQLiteConnection(databasePath);

            this.databaseConnection.CreateTable <Database.SimpleGpsLocation>();
            this.databaseConnection.CreateTable <Database.SimpleGpsRoute>();

            this.adapter = new Adapters.RoutesAdapter(new List <Database.SimpleGpsRoute>());

            V7.RecyclerView routesList = FindViewById <V7.RecyclerView>(Resource.Id.routesListView);

            adapter.ItemClick += Adapter_ItemClick;
            routesList.SetLayoutManager(new V7.LinearLayoutManager(this));
            routesList.SetAdapter(adapter);

            // How to access the service here ?
            // I need to know this information in order to show some info on the screen and disable buttons.

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

            Button trackButton = FindViewById <Button>(Resource.Id.trackButton);

            trackButton.Click += TrackButton_Click;

            Button stopButton = FindViewById <Button>(Resource.Id.stopTrackButton);

            stopButton.Enabled = false;
            stopButton.Click  += StopButton_Click;

            Button routesButton = FindViewById <Button>(Resource.Id.routesButton);

            routesButton.Click += ShowRoutes_Click;

            // It's still null if application is closed from the system, but the service is running
            // Maybe I need to destroy the service in Ondestroy.
            if (this.connection == null)
            {
                this.connection = new Connections.GpsTrackerServiceConnection(this);
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView(inflater, container, savedInstanceState);
            View v = inflater.Inflate(Resource.Layout.OnlineTestFragment, container, false);

            MyResultandSelectionBean objbean = new MyResultandSelectionBean
            {
                Id         = "1",
                Coursename = "ST-544 SSCHSL(PRE) 2019",
                Date       = "2019-04-10",
                Attempted  = "7",
                Correct    = "3",
                Obtaind    = "4",
                Mode       = "Online",
                Rank       = "5244"
            };

            for (int i = 0; i < 10; i++)
            {
                myList.Add(objbean);
            }

            mRecycleView   = v.FindViewById <RecyclerView>(Resource.Id.onlinetestlist);
            mLayoutManager = new LinearLayoutManager(this.Activity);
            mRecycleView.SetLayoutManager(mLayoutManager);
            OnlineTestAapter mAdapter = new OnlineTestAapter(myList, this.Activity, mRecycleView);

            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);

            Spinner spinner = v.FindViewById <Spinner>(Resource.Id.onlinetestSpinner);

            spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelected);
            //var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.car_array, Android.Resource.Layout.SimpleSpinnerItem);
            var items = new List <string>()
            {
                "one", "two", "three"
            };
            var adapter = new ArrayAdapter <string>(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, items);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;

            return(v);
        }
Exemple #16
0
        public override void OnScrolled(Android.Support.V7.Widget.RecyclerView recyclerView, int dx, int dy)
        {
            LinearLayoutManager layoutManager = (LinearLayoutManager)recyclerView.GetLayoutManager();

            int firstVisible = layoutManager.FindFirstVisibleItemPosition();
            int visibleCount = Math.Abs(firstVisible - layoutManager.FindLastCompletelyVisibleItemPosition());
            int itemCount    = recyclerView.GetAdapter().ItemCount;

            if (firstVisible != _lastFirstVisible || visibleCount != _lastVisibleCount || itemCount != _lastItemCount)
            {
                _scrollListener.OnScroll(null, firstVisible, visibleCount, itemCount);
                _lastVisibleCount = firstVisible;
                _lastVisibleCount = visibleCount;
                _lastItemCount    = itemCount;
            }
        }
Exemple #17
0
        void SetUpRecyclerView(_w.RecyclerView recyclerView)
        {
            //var values = GetRandomSubList(Cheeses.CheeseStrings, 30);


            List <string> values = new List <string>();
            var           localC = Application.Context.GetSharedPreferences("Downloads", FileCreationMode.Private);
            IDictionary <string, object> allData   = localC.All;
            ICollection <string>         allTitles = allData.Keys;

            string[] tempVal = new string[allData.Count];
            allTitles.CopyTo(tempVal, 0);

            values = new List <string>();

            for (int i = 0; i < tempVal.Length; i++)
            {
                if (!tempVal[i].Contains("P___"))
                {
                    values.Add(tempVal[i]);
                }
            }

            allValues = values;

            recyclerView.SetLayoutManager(new _w.LinearLayoutManager(recyclerView.Context));
            try {
                var adapter = new SimpleStringRecyclerViewAdapter(recyclerView.Context, values, Activity.Resources);
                adapter.ItemClick += MAdapter_ItemLongClick;
                recyclerView.SetAdapter(adapter);
            }
            catch (System.Exception) {
            }

            void MAdapter_ItemLongClick(object sender, int e)
            {
                HistoryPressTitle(movieTitles[movieSelectedID] + "|" + activeLinksNames[e], true);
                //UpdateList();
            }

            // System.Diagnostics.Debug.WriteLine("QQQ:" + movieTitles.Count.ToString());

            // if(   !recyclerView.itemc) {


            //  }
        }
Exemple #18
0
        public override void OnScrollStateChanged(AWidget.RecyclerView recyclerView, int newState)
        {
            base.OnScrollStateChanged(recyclerView, newState);

            switch (newState)
            {
            case AWidget.RecyclerView.ScrollStateDragging:
                // all image loading requests will be silently canceled
                ImageService.Instance.SetPauseWork(true);
                break;

            case AWidget.RecyclerView.ScrollStateIdle:
                // loading requests are allowed again
                ImageService.Instance.SetPauseWork(false);
                break;
            }
        }
Exemple #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.create_room);

            roomTitle  = GetString(Resource.String.room_title);
            roomTitle += (DatabaseManagement.RoomDatabaseManagement.CountOfRooms(this) + 1).ToString();

            #region Висувний список та Action Bar

            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);
            SetSupportActionBar(mToolBar);

            mActionBar = SupportActionBar;
            mActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            mActionBar.SetHomeButtonEnabled(true);
            mActionBar.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mNavigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            if (mNavigationView != null)
            {
                SetUpDrawerContent(mNavigationView);
            }

            #endregion


            createRoomRecycler = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.create_room_recycler);


            captions      = new string[1];
            captions[0]   = roomTitle;
            imagesId      = new int[1];
            imagesId[0]   = Resource.Drawable.roomImage1;
            actionText    = new string[2];
            actionText[0] = GetString(Resource.String.next_image_text);
            actionText[1] = GetString(Resource.String.save_text);

            SetAdapterForRoomRecycler();
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
            createRoomRecycler.SetLayoutManager(linearLayoutManager);
        }
Exemple #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            mPhotoAlbum = new Album();


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


            mLayoutManager = new LinearLayoutManager(this);

            mAdapter            = new PhotoAdapter(mPhotoAlbum);
            mAdapter.ItemClick += MAdapter_ItemClick;

            mRecyclerview = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.RvList);
            mRecyclerview.SetLayoutManager(mLayoutManager);;
            mRecyclerview.SetAdapter(mAdapter);
        }
Exemple #21
0
        public override void OnScrollStateChanged(Android.Support.V7.Widget.RecyclerView recyclerView, int newState)
        {
            ScrollState listViewState = ScrollState.Idle;

            switch (newState)
            {
            case ScrollStateDragging:
                listViewState = ScrollState.TouchScroll;
                break;

            case ScrollStateIdle:
                listViewState = ScrollState.Idle;
                break;

            case ScrollStateSettling:
                listViewState = ScrollState.Fling;
                break;
            }

            _scrollListener.OnScrollStateChanged(null, listViewState);
        }
Exemple #22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.full_list_of_tasks);

            #region Висувний список та Action Bar

            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);
            SetSupportActionBar(mToolBar);

            mActionBar = SupportActionBar;
            mActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            mActionBar.SetHomeButtonEnabled(true);
            mActionBar.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mNavigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            if (mNavigationView != null)
            {
                SetUpDrawerContent(mNavigationView);
            }

            #endregion

            fullListOfTasksRecyclerView = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.full_list_of_tasks_recycler_view);

            taskCardSimple = new TaskCardSimple();
            taskCardSimple.InitializeFullListOfTasks(this);

            adapter                      = new TaskAdapterExtended(taskCardSimple.TaskCardSimpleList);
            adapter.ItemClick           += OnItemClick;
            adapter.ActionTextViewClick += Adapter_ActionTextViewClick;
            fullListOfTasksRecyclerView.SetAdapter(adapter);
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
            fullListOfTasksRecyclerView.SetLayoutManager(linearLayoutManager);
            fullListOfTasksRecyclerView.NestedScrollingEnabled = false;
        }
Exemple #23
0
        public override void OnScrolled(AWidget.RecyclerView recyclerView, int dx, int dy)
        {
            base.OnScrolled(recyclerView, dx, dy);

            if (scrolledDistance > HIDE_THRESHOLD && controlsVisible)
            {
                _view.LastScrollDirection = Shared.RecyclerView.ScrollToStart;

                controlsVisible  = false;
                scrolledDistance = 0;
            }
            else if (scrolledDistance < -HIDE_THRESHOLD && !controlsVisible)
            {
                _view.LastScrollDirection = Shared.RecyclerView.ScrollToEnd;

                controlsVisible  = true;
                scrolledDistance = 0;
            }

            if ((controlsVisible && dy > 0) || (!controlsVisible && dy < 0))
            {
                scrolledDistance += dy;
            }
        }
Exemple #24
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            this.mostRecentKeywords = "";
            this.asc = "Asc";
            this.ordertype = "Diff";

            //RECYCLER VIEW
            mObject = new RecipeObject ();
            mAdapter = new RecipeAdapter (mObject, this);
            mAdapter.itemClick += this.OnItemClick;
            SetContentView (Resource.Layout.Search);
            mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            mRecyclerView.SetAdapter (mAdapter);
            mLayoutManager = new v7Widget.LinearLayoutManager (this);
            mRecyclerView.SetLayoutManager (mLayoutManager);

            //SEARCH VIEW
            SearchView searchView = FindViewById<SearchView> (Resource.Id.main_search);
            searchView.SetBackgroundColor (Android.Graphics.Color.DarkOrange);
            searchView.SetOnQueryTextListener ((SearchView.IOnQueryTextListener)this);
            int id = Resources.GetIdentifier ("android:id/search_src_text", null, null);
            TextView textView = (TextView)searchView.FindViewById (id);
            textView.SetTextColor (Android.Graphics.Color.White);
            textView.SetHintTextColor (Android.Graphics.Color.White);
            searchView.SetQueryHint ("Search Recipes...");
            LinearLayout search_container = FindViewById<LinearLayout> (Resource.Id.search_container);
            search_container.Click += (sender, e) => {
                if (searchView.Iconified != false) {
                    searchView.Iconified = false;
                }
            };

            //MENU VIEW
            Button menu_button = FindViewById<Button> (Resource.Id.menu_button);
            menu_button.Click += (s, arg) => {
                menu_button.SetBackgroundResource (Resource.Drawable.pressed_lines);
                PopupMenu menu = new PopupMenu (this, menu_button);
                menu.Inflate (Resource.Menu.Main_Menu);
                menu.MenuItemClick += this.MenuButtonClick;
                menu.DismissEvent += (s2, arg2) => {
                    menu_button.SetBackgroundResource (Resource.Drawable.menu_lines);
                    Console.WriteLine ("menu dismissed");
                };
                menu.Show ();
            };

            this.filter_button = FindViewById<Button> (Resource.Id.filter_button);
            RegisterForContextMenu (filter_button);
            filter_button.Click += (s, arg) => {
                ((Button) s).ShowContextMenu();
            };

            if(CachedData.Instance.PreviousActivity.GetType() == typeof(SubtypeBrowseActivity)){
                string selectionInput = CachedData.Instance.SelectedSubgenre.Replace(' ', ',');
                string url = "http://speedychef.azurewebsites.net/search/searchbyunion?inputKeywords=" + this.mostRecentKeywords + "&ordertype=" + this.ordertype + "&ascending=" + this.asc + "&subgenre=" + selectionInput;
                this.ProcessSingleSearchQuery (url, "SearchByUnion");
            }

            if(CachedData.Instance.SubmissionFromMain){
                string url = "http://speedychef.azurewebsites.net/search/search?inputKeywords=" + CachedData.Instance.LastSubmissionFromMain + "&ordertype=" + this.ordertype + "&ascending=" + this.asc;
                this.ProcessSingleSearchQuery (url, "Search");
                CachedData.Instance.SubmissionFromMain = false;
            }
        }
        async void CallApi()
        {
            var testInfoApi      = RestService.For <ApiConnectionForTestPackage>(Utility.stapibaseUrl);
            var testInfoResponse = await testInfoApi.GetSTInfo(Testid + "");

            testDataRecord = JsonConvert.DeserializeObject <TestDataRecord>(testInfoResponse.Data);
            string language = testDataRecord.Languages;

            string[] languacodearray = language.Split(",");
            for (int i = 0; i < languacodearray.Count(); i++)
            {
                languagecodelist.Add(languacodearray[i]);
                languagelist.Add(languacodearray[i].ToUpper());
            }
            var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, languagelist);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            Spnlanguage.Adapter       = adapter;
            Spnlanguage.ItemSelected += Spnlanguage_ItemSelected;
            try
            {
                testInfoList = testDataRecord.SubPattern;
            }
            catch (Exception)
            {
                Intent resultIntent = new Intent();
                resultIntent.PutExtra("serilizeObj", MyTest.SerilizeString);
                resultIntent.PutExtra("testtype", testtype);
                SetResult(Result.Ok, resultIntent);

                Finish();
                //MyTest.activity.Finish();
                //var intent1 = new Intent(this, typeof(MyTest));
                //intent1.PutExtra("serilizeObj", MyTest.SerilizeString);
                //StartActivity(intent1);
                OverridePendingTransition(Resource.Animation.hold, Resource.Animation.slide_right);
                return;
            }


            startingquestionposition.Add(mycounter);
            testInfoList.Sort((x, y) => x.SeqNo.CompareTo(y.SeqNo));
            for (int i = 0; i < testInfoList.Count; i++)
            {
                testInfoList[i].Duration = testInfoList[i].Duration * 60 * 1000;
                //testInfoList[i].Duration = 20 * 1000;

                if (i != 0)
                {
                    mycounter = mycounter + testInfoList[i - 1].TotalQuestion;
                    startingquestionposition.Add(mycounter);
                }
                items.Add(testInfoList[i].SubjectTitle);
                subjectid.Add(testInfoList[i].SubjectID);
                subjecttotalquestion.Add(testInfoList[i].TotalQuestion);
            }
            //  txtlanguage.Text = testDataRecord.Languages;
            txtnoofquestion.Text = testDataRecord.TotalQuestions + "";
            txttime.Text         = testDataRecord.Duration + "";
            txttotalmarks.Text   = testDataRecord.TotalMarks + "";
            mRecycleView         = FindViewById <RecyclerView>(Resource.Id.sectionalpatternlist);
            mLayoutManager       = new LinearLayoutManager(this);
            mRecycleView.SetLayoutManager(mLayoutManager);
            TestInstructionAdapter mAdapter = new TestInstructionAdapter(this, mRecycleView, testInfoList);

            mRecycleView.SetAdapter(mAdapter);
            cp.Dismiss();
        }
Exemple #26
0
 public override void OnDetachedFromRecyclerView(Android.Support.V7.Widget.RecyclerView recyclerView)
 {
     --_attachedRecyclerViews;
     base.OnDetachedFromRecyclerView(recyclerView);
 }
Exemple #27
0
 public override void OnAttachedToRecyclerView(Android.Support.V7.Widget.RecyclerView recyclerView)
 {
     ++_attachedRecyclerViews;
     base.OnAttachedToRecyclerView(recyclerView);
 }
#pragma warning disable CS0672 // Member overrides obsolete member
        public override void GetItemOffsets(Android.Graphics.Rect outRect, int itemPosition, Android.Support.V7.Widget.RecyclerView parent)
#pragma warning restore CS0672 // Member overrides obsolete member
        {
            if (SkipFirstRow && itemPosition == 0)
            {
                outRect.Top  = 0;
                outRect.Left = 0;
            }
            else if (itemPosition % 2 == 0)
            {
                outRect.Top = space;
                // outRect.Left = space;
                outRect.Bottom = space;
            }
            else
            {
                outRect.Top = space;
                // outRect.Left = space;
                outRect.Bottom = space;
            }
        }
Exemple #29
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            //RECYCLER VIEW
            mObject = new PlannedMealObject ();
            mAdapter = new PlannedMealAdapter (mObject);
            SetContentView (Resource.Layout.Main);
            mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            mRecyclerView.SetAdapter (mAdapter);
            mLayoutManager = new v7Widget.LinearLayoutManager (this);
            mRecyclerView.SetLayoutManager (mLayoutManager);

            //SEARCH VIEW
            SearchView searchView = FindViewById<SearchView> (Resource.Id.main_search);
            searchView.SetBackgroundColor (Android.Graphics.Color.DarkOrange);
            searchView.SetOnQueryTextListener ((SearchView.IOnQueryTextListener) this);
            int id = Resources.GetIdentifier("android:id/search_src_text", null, null);
            TextView textView = (TextView) searchView.FindViewById(id);
            textView.SetTextColor(Android.Graphics.Color.White);
            textView.SetHintTextColor (Android.Graphics.Color.White);
            searchView.SetQueryHint ("Search Recipes...");
            LinearLayout search_container = FindViewById<LinearLayout> (Resource.Id.search_container);
            search_container.Click += (sender, e) => {
                if (searchView.Iconified != false){
                    searchView.Iconified = false;
                }
            };

            //MENU VIEW
            Button menu_button = FindViewById<Button> (Resource.Id.menu_button);
            menu_button.Click += (s, arg) => {
                menu_button.SetBackgroundResource(Resource.Drawable.pressed_lines);
                PopupMenu menu = new PopupMenu (this, menu_button);
                menu.Inflate (Resource.Menu.Main_Menu);
                menu.MenuItemClick += this.MenuButtonClick;
                menu.DismissEvent += (s2, arg2) => {
                    menu_button.SetBackgroundResource(Resource.Drawable.menu_lines);
                    Console.WriteLine ("menu dismissed");
                };
                menu.Show ();
            };

            this.GenerateUpcomingMeals ("http://speedychef.azurewebsites.net/search/GenerateUpcomingMeals?user=tester&date1=" + DateTime.Now + "&date2=" + DateTime.Now.AddDays (7.0), "GenerateUpcomingMeals");
        }
        /* public FirebaseFirestore GetDatabase()
         * {
         *  var app = FirebaseApp.InitializeApp(this.context);
         *  FirebaseFirestore database;
         *  if (app == null)
         *  {
         *      var options = new FirebaseOptions.Builder()
         *      .SetProjectId("fir-project-16446")
         *      .SetApplicationId("fir-project-16446")
         *      .SetApiKey("AIzaSyB4tFXBV6P6AiHCZmsjNNEWlF_9eXncoQg")
         *      .SetDatabaseUrl("https://fir-project-16446.firebaseio.com")
         *      .SetStorageBucket("fir-project-16446.appspot.com")
         *      .Build();
         *
         *      app = FirebaseApp.InitializeApp(this.context, options);
         *      database = FirebaseFirestore.GetInstance(app);
         *  }
         *  else
         *  {
         *      database = FirebaseFirestore.GetInstance(app);
         *  }
         *  return database;
         * } */



        public ExamAdapter(Context context, Android.Support.V7.Widget.RecyclerView recyclerView, List <ExamModel> Exams)
        {
            this.context      = context;
            this.recyclerView = recyclerView;
            Items             = Exams;
        }
Exemple #31
0
        void SetUpRecyclerView(_w.RecyclerView recyclerView)
        {
            //  refreshBar.Visibility = ViewStates.Gone;

            /*
             * List<string> _movieTitles = new List<string>();
             * List<string> _fwordLink = new List<string>();
             * List<Movie> _moviesActive = new List<Movie>();
             * List<bool> _movieIsAnime = new List<bool>();
             * List<int> _movieProvider = new List<int>();
             * for (int i = 0; i < movieTitles.Count; i++) {
             *  if (!movieTitles[i].Contains("B___")) {
             *      _movieTitles.Add(movieTitles[i]);
             *      _moviesActive.Add(moviesActive[i]);
             *      _movieIsAnime.Add(movieIsAnime[i]);
             *      _movieProvider.Add(movieProvider[i]);
             *      _fwordLink.Add(fwordLink[i]);
             *  }
             * }
             * movieTitles = _movieTitles;
             * fwordLink = _fwordLink;
             * moviesActive = _moviesActive;
             * movieIsAnime = _movieIsAnime;
             * movieProvider = _movieProvider;
             */
            GetBookMarks();


            //var values = GetRandomSubList(Cheeses.CheeseStrings, 30);
            wlink = new List <int>();

            List <string> values = new List <string>();

            for (int i = 0; i < movieTitles.Count; i++)
            {
                if (movieTitles[i].Contains("B___"))
                {
                    print("--" + movieTitles[i]);
                    string addTo = "";
                    for (int q = 0; q < addWatched.Count; q++)
                    {
                        if (addWatched[q].StartsWith(movieTitles[i] + ";"))
                        {
                            addTo = addWatched[q].Substring(addWatched[q].IndexOf(";") + 1, addWatched[q].Length - addWatched[q].IndexOf(";") - 1);
                        }
                    }
                    values.Add(movieTitles[i].Replace("B___", "").Replace(" (Bookmark)", "") + addTo);
                    wlink.Add(i);
                }
            }


            //.Replace("B___", "")
            recyclerView.SetLayoutManager(new _w.LinearLayoutManager(recyclerView.Context));

            recyclerView.SetAdapter(new SimpleStringRecyclerViewAdapter(recyclerView.Context, values, Activity.Resources));
            // System.Diagnostics.Debug.WriteLine("QQQ:" + movieTitles.Count.ToString());

            // if(   !recyclerView.itemc) {


            //  }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.room_management);

            actionText    = new string[2];
            actionText[0] = GetString(Resource.String.next_image_text);
            actionText[1] = GetString(Resource.String.save_text);

            roomId = Intent.GetIntExtra(IntentManagement.IntentManagement.ROOM_ID, -1);

            RoomDatabaseManagement roomDatabaseManagement = new RoomDatabaseManagement();

            roomDatabaseManagement.CalculateRoomCleannessAndTimeOfRoomCleaning(this);
            roomIds    = roomDatabaseManagement.GetRoomIds();
            roomTitles = roomDatabaseManagement.GetRoomTitles();
            timeOfRoomCleaningInteger = roomDatabaseManagement.GetTimeOfRoomCleaning();
            roomCleannessInteger      = roomDatabaseManagement.GetRoomCleanness();
            roomImageIds = roomDatabaseManagement.GetRoomImageIds();
            isRoom       = roomDatabaseManagement.GetIsRoom();

            timeOfRoomCleaning = new string[timeOfRoomCleaningInteger.Length];
            roomCleanness      = new string[roomCleannessInteger.Length];

            spinnerPosition    = new int[1];
            spinnerPosition[0] = 0;

            isSecondActionButtonIsVisible    = new bool[1];
            isSecondActionButtonIsVisible[0] = false;

            if (roomId == -1)
            {
                roomId = roomIds[0];
            }

            for (int i = 0; i < roomIds.Length; i++)
            {
                if (roomId == roomIds[i])
                {
                    break;
                }
                else
                {
                    spinnerPosition[0]++;
                }
            }

            for (int i = 0; i < roomIds.Length; i++)
            {
                timeOfRoomCleaning[i] = timeOfRoomCleaningInteger[i].ToString() + " " + GetString(Resource.String.minute_text);
                roomCleanness[i]      = roomCleannessInteger[i].ToString() + "%";
            }

            roomRecycler = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.room_recycler);

            SetAdapterForRoomRecycler();
            LinearLayoutManager roomLinearLayoutManager = new LinearLayoutManager(this);

            roomRecycler.SetLayoutManager(roomLinearLayoutManager);

            #region Висувний список та Action Bar
            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);
            SetSupportActionBar(mToolBar);

            mActionBar = SupportActionBar;
            mActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            mActionBar.SetHomeButtonEnabled(true);
            mActionBar.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mNavigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            if (mNavigationView != null)
            {
                SetUpDrawerContent(mNavigationView);
            }
            #endregion

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);
            fab.Click += Fab_Click;

            UpdateTasks();

            listOfTasksRecycler = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.list_of_tasks_recycler);

            SetAdapterForTaskRecycler();
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
            listOfTasksRecycler.SetLayoutManager(linearLayoutManager);
        }
Exemple #33
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ax_Bookmarks, container, false);

            // _w.RecyclerView rez = view as _w.RecyclerView;

            __view       = view;
            ___view      = view;
            ax_bookmarks = this;

            // _w.RecyclerView rez = view as _w.RecyclerView; //inflater.Inflate(Resource.Layout.ax_Search, container, false) as _w.RecyclerView;
            _w.RecyclerView re = view.FindViewById <_w.RecyclerView>(Resource.Id.recyclerView_movies);
            _re = re;

            refreshButton = view.FindViewById <ImageButton>(Resource.Id.reloadbtt);
            refreshBar    = view.FindViewById <ProgressBar>(Resource.Id.refreshBar);
            // refreshBar.Visibility = ViewStates.Gone;

            refreshButton.Click += (o, e) =>
            {
                //  refreshBar.Visibility = ViewStates.Visible;
                // if(!refreshing) {
                thredNum++;
                thredNumber++;
                print("RefreshBtt clicked");

                if (!refreshing)
                {
                    ShowSnackBar("Loading the amount of links");


                    MethodInvoker simpleDelegate;
                    simpleDelegate = new MethodInvoker(GetAllEps);
                    simpleDelegate.BeginInvoke(null, null);
                }
                else
                {
                    ShowSnackBar("Loading Progress Aborted");

                    refreshBar.Progress    = 0;
                    refreshButton.Rotation = 0;
                    refreshRot             = 0;
                    ax_Bookmarks.ax_bookmarks.UpdateList();
                }

                refreshing = !refreshing;
            };


            re.SetItemClickListener((rv, position, _view) =>
            {
                //An item has been clicked
                print(wlink.Count.ToString());
                print(position.ToString());

                movieSelectedID = wlink[position];
                Context context = _view.Context;
                Intent intent   = new Intent(context, typeof(SearchResultsActivity));
                // intent.PutExtra(CheeseDetailActivity.EXTRA_NAME, values[position]);

                context.StartActivity(intent);
            });
            GetBookMarks();
            SetUpRecyclerView(_re);



            /*
             * refresher = view.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher);
             *
             * refresher.Refresh += (o,e) =>
             * {
             *  print("DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaLLLLLLLLLLLLLLLLLLLLLLLL");
             *  MethodInvoker simpleDelegate;
             *      simpleDelegate = new MethodInvoker(GetAllEps);
             *      simpleDelegate.BeginInvoke(null, null);
             *
             *
             *
             * };
             */


            return(view);
        }
Exemple #34
0
 public override void OnScrolled(Android.Support.V7.Widget.RecyclerView recyclerView, int dx, int dy)
 {
     _recyclerScrollListener.OnScrolled(recyclerView, dx, dy);
 }