Exemplo n.º 1
0
        private void Adapter_Action1_Click(object sender, EventArgs e)
        {
            roomImageCounter++;

            imagesId[0] = RoomImage.RoomImageClass.GetRoomImageResource(roomImageCounter);

            CaptionedImagesWithTwoActionsAdapter adapter = new CaptionedImagesWithTwoActionsAdapter(this, captions, imagesId, actionText);

            adapter.ItemClick += OnItemClick;

            adapter.Action1_Click += Adapter_Action1_Click;
            adapter.Action2_Click += Adapter_Action2_Click;

            createRoomRecycler.SetAdapter(adapter);
        }
        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 ();
            //			};
        }
Exemplo n.º 3
0
        private void SetAdapterForTaskRecycler()
        {
            TaskInListAdapter adapter = new TaskInListAdapter(taskTitles, tasksTimeOfCleaningString);

            adapter.ItemClick += OnItemClick;
            listOfTasksRecycler.SetAdapter(adapter);
        }
        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);
        }
Exemplo n.º 5
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) {


            //  }
        }
        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);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        private void Spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Spinner spinner         = (Spinner)sender;
            string  selectedspinner = spinner.GetItemAtPosition(e.Position) + "";

            selectedspinnerPosition = e.Position;
            RightdrawerAdapter mAdapter = new RightdrawerAdapter(this, AlQuestionList, myitems, startingquestionposition, mRecycleView, selectedspinnerPosition);

            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
        }
Exemplo n.º 9
0
        private void SetAdapterForRoomRecycler()
        {
            CaptionedImagesWithSpinner roomAdapter = new CaptionedImagesWithSpinner(this, spinnerPosition, roomTitles, roomImageIds,
                                                                                    actionText, isSecondActionButtonIsVisible, timeOfRoomCleaning, roomCleanness);

            roomAdapter.ItemClick += RoomAdapter_ItemClick;
            roomAdapter.SpinnerItemSelectionChanged += RoomAdapter_SpinnerItemSelectionChanged;
            roomAdapter.Action1_Click += RoomAdapter_Action1_Click;
            roomAdapter.Action2_Click += RoomAdapter_Action2_Click;
            roomRecycler.SetAdapter(roomAdapter);
        }
Exemplo n.º 10
0
        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
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 15
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.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);
        }
Exemplo n.º 16
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) {


            //  }
        }
Exemplo n.º 17
0
        bool SupportSearchView.IOnQueryTextListener.OnQueryTextChange(string newText)
        {
            String text = newText.ToLower();
            List <UserListItem> newList = new List <UserListItem>();

            foreach (UserListItem user in SearchUsersList)
            {
                String name  = user.name.ToLower();
                String email = user.email.ToLower();
                if (name.Contains(text) || email.Contains(text))
                {
                    newList.Add(user);
                }
            }
            RecyclerViewAdapter = new UsersAdapter(newList, this);
            SearchUserView.SetAdapter(RecyclerViewAdapter);

            return(true);
        }
Exemplo n.º 18
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);
        }
Exemplo n.º 19
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;
        }
Exemplo n.º 20
0
        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();
        }
Exemplo n.º 21
0
        async void Callapi()
        {
            try
            {
                var apiresponse             = RestService.For <ApiConnection>(Utility.mibsapiBaseUrl);
                UserStPackageModel response = await apiresponse.GetOnlineSTCoursesr();

                listresponse = JsonConvert.DeserializeObject <List <UserPackageModel> >(response.Data);

                var apiresponseforuser             = RestService.For <ApiConnection>(Utility.mibsapiBaseUrl);
                UserStPackageModel responseforuser = await apiresponse.GetUserSTPackages(MainActivity1.userid + "");

                listresponseforuser = JsonConvert.DeserializeObject <List <UserPackageModel> >(responseforuser.Data);
                List <UserTestPostObject> mylist = new List <UserTestPostObject>();
                for (int i = 0; i < listresponseforuser.Count; i++)
                {
                    UserPackageModel   userpackagemodel = listresponseforuser[i];
                    string             iDate            = userpackagemodel.StartsFrom;
                    DateTime           oDate            = Convert.ToDateTime(iDate);
                    UserTestPostObject obj = new UserTestPostObject
                    {
                        UserId     = MainActivity1.userid,
                        PackageID  = userpackagemodel.PackageID,
                        StartsFrom = oDate,
                    };
                    mylist.Add(obj);
                }
                string mytem = JsonConvert.SerializeObject(mylist);
                var    apiresponseforgiventestpackagewise = RestService.For <ApiConnectionForTestPackage>(Utility.stapibaseUrl);
                var    responseforgiventestpackagewise    = await apiresponseforgiventestpackagewise.Getusertestgivenpackagewise(mylist);

                var listforgiventestpackagewise = JsonConvert.DeserializeObject <List <UserTestGivenPackageWiseRecord> >(responseforgiventestpackagewise.Data);
                //if (listforgiventestpackagewise.Count > 0)
                //{
                //    var l1 = listforgiventestpackagewise.Count;
                //    var l2 = listresponseforuser.Count;
                //    if (l1 > l2)
                //        l1 = l2;
                //    for (int i = 0; i < listresponseforuser.Count; i++)
                //    {

                //        listresponseforuser[i].ExamGiven = listforgiventestpackagewise[i].ExamGiven;
                //        try
                //        {
                //            listresponseforuser[i].PracticalGiven = listforgiventestpackagewise[i].PracticalGiven;
                //        }
                //        catch (Exception)
                //        {
                //            listresponseforuser[i].ExamGiven = listforgiventestpackagewise[i].ExamGiven;
                //        }
                //    }
                //}


                TestSelectionAdapter mAdapter = new TestSelectionAdapter(listresponse, listresponseforuser, colorcode, imagename, this, mRecycleView);
                mAdapter.ItemClick += MAdapter_ItemClick;
                mRecycleView.SetAdapter(mAdapter);
                cp.DismissDialog();
                try
                {
                    listresponseforuser.Add(TestSelectionAdapter.finallist[listresponseforuser.Count]);
                }
                catch (Exception e)
                {
                    // Toast.MakeText(this, "mahendras-->"+e.Message, ToastLength.Short).Show();
                }
            }
            catch (Exception e)
            {
                cp.DismissDialog();
                Toast.MakeText(this, e.Message, ToastLength.Short).Show();
            }
        }
Exemplo n.º 22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.list_of_rooms);

            #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.BackgroundTintList = ColorStateList.ValueOf(Android.Graphics.Color.LightCyan);

            fab.Click += Fab_Click;

            try
            {
                RoomDatabaseManagement roomDatabaseManagement = new RoomDatabaseManagement();
                roomDatabaseManagement.FindRightOrderOfRoomTitles(this);
                roomIds    = roomDatabaseManagement.GetRoomIds();
                roomTitles = roomDatabaseManagement.GetRoomTitles();

                timeOfRoomCleaning = new string[roomTitles.Length];
                roomCleanness      = new string[roomTitles.Length];

                RoomDatabaseManagement roomDatabaseManagement2 = new RoomDatabaseManagement();
                roomDatabaseManagement2.CalculateRoomCleannessAndTimeOfRoomCleaning(this);
                timeOfRoomCleaningInteger = roomDatabaseManagement2.GetTimeOfRoomCleaning();
                roomCleannessInteger      = roomDatabaseManagement2.GetRoomCleanness();

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


                listOfRoomsRecycler = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.list_of_rooms_recycler);

                RoomInListAdapter adapter = new RoomInListAdapter(roomTitles, timeOfRoomCleaning, roomCleanness);
                adapter.ItemClick += OnItemClick;
                listOfRoomsRecycler.SetAdapter(adapter);
                LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
                listOfRoomsRecycler.SetLayoutManager(linearLayoutManager);
                listOfRoomsRecycler.NestedScrollingEnabled = false;
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 23
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) {


            //  }
        }
Exemplo n.º 24
0
        void SetUpRecyclerView(_w.RecyclerView recyclerView)
        {
            //var values = GetRandomSubList(Cheeses.CheeseStrings, 30);
            currentActiveLinksNames = new List <string>();
            currentActiveLinks      = new List <string>();
            flink = new List <int>();
            for (int i = 0; i < activeLinksNames.Count; i++)
            {
                try {
                    if (movieProvider[movieSelectedID] == 0)
                    {
                        if ((activeLinksNames[i].Contains("(Dub)") && currentMain) || (activeLinksNames[i].Contains("(Sub)") && !currentMain))
                        {
                            currentActiveLinksNames.Add(activeLinksNames[i]);
                            currentActiveLinks.Add(activeLinks[i]);
                            flink.Add(i);
                        }
                    }
                    else if (movieProvider[movieSelectedID] == 3 && __selSeason != 0)
                    {
                        if (activeLinksNames[i].Contains("Season " + __selSeason + " "))
                        {
                            currentActiveLinksNames.Add(activeLinksNames[i]);
                            flink.Add(i);
                            currentActiveLinks.Add(activeLinks[i]);
                        }
                    }
                    else if (movieProvider[movieSelectedID] == 4)
                    {
                        if ((currentMain && activeLinksNames[i].StartsWith("Episode")) || (!currentMain && !activeLinksNames[i].StartsWith("Episode")))
                        {
                            currentActiveLinksNames.Add(activeLinksNames[i]);
                            flink.Add(i);
                            currentActiveLinks.Add(activeLinks[i]);

                            // print(activeLinksNames[i] + " |||| >> " + i);
                        }
                    }
                    else
                    {
                        currentActiveLinksNames.Add(activeLinksNames[i]);
                        currentActiveLinks.Add(activeLinks[i]);

                        flink.Add(i);
                    }
                }
                catch (System.Exception) {
                }
            }



            recyclerView.SetLayoutManager(new _w.LinearLayoutManager(recyclerView.Context));
            try {
                var adapter = new SimpleStringRecyclerViewAdapter(recyclerView.Context, currentActiveLinksNames, Activity.Resources, this);
                adapter.ItemClick += MAdapter_ItemLongClick;
                recyclerView.SetAdapter(adapter);
            }
            catch (System.Exception) {
            }
            void MAdapter_ItemLongClick(object sender, int e)
            {
                // HistoryPressTitle(movieTitles[movieSelectedID] + "|" + activeLinksNames[flink[e]], true);
                //UpdateList();
            }

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

            // if(   !recyclerView.itemc) {


            //  }
        }
Exemplo n.º 25
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;
            }
        }
Exemplo n.º 26
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");
        }
Exemplo n.º 27
0
 private void UpdateCaptionedImagesAdapter()
 {
     adapter            = new CaptionedImagesAdapterFull(captions, imagesId, descriptions);
     adapter.ItemClick += OnItemClick;
     taskRecycler.SetAdapter(adapter);
 }