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 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); }
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); }
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); }
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 }
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); }
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; }
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); }
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) { // } }
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); }
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); }
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; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TestSelection); pref = GetSharedPreferences("login", FileCreationMode.Private); edit = pref.Edit(); banned = pref.GetBoolean("banned", false); //if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) //{ // if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.WriteExternalStorage)) // { // } // else // { // ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.WriteExternalStorage }, 101); // } //} //if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != (int)Permission.Granted) //{ // if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.ReadExternalStorage)) // { // } // else // { // ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.ReadExternalStorage }, 102); // } //} Utility.intalizejson(); JsonConvert.DefaultSettings = () => new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), Converters = { new StringEnumConverter() } }; toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); //For showing back button SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); toolbar.SetTitle(Resource.String.MyRequest); mRecycleView = FindViewById <RecyclerView>(Resource.Id.mytestselectionlist); mLayoutManager = new GridLayoutManager(this, 3); mRecycleView.SetLayoutManager(mLayoutManager); cp = new CustomProgressDialog(this); cp.SetCancelable(false); cp.Show(); if (Utility.IsNetworkConnected(this)) { Callapi(); } else { cp.Dismiss(); Toast.MakeText(this, "Check your internet connection", ToastLength.Short).Show(); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) { if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.WriteExternalStorage)) { } else { ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.WriteExternalStorage }, 101); } } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != (int)Permission.Granted) { if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.ReadExternalStorage)) { } else { ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.ReadExternalStorage }, 102); } } // Create your application here }
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); }
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) { } }
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(); }
private bool isTaskTitleChanged = false; //Це поле знадобиться тоді, коли буде йти опрацювання OnSavedInstanceState protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.create_cleaning_task); View view1 = FindViewById <View>(Resource.Id.line_view1); view1.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); View view2 = FindViewById <View>(Resource.Id.line_view2); view2.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); View view3 = FindViewById <View>(Resource.Id.line_view3); view3.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); View view4 = FindViewById <View>(Resource.Id.line_view4); view4.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); View view5 = FindViewById <View>(Resource.Id.line_view5); view5.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); timeTextView = FindViewById <TextView>(Resource.Id.time_textview); dateTextView = FindViewById <TextView>(Resource.Id.date_textview); timeTextView.Click += TimeTextView_Click; dateTextView.Click += DateTextView_Click; taskRecycler = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.task_reсycler); roomSpinner = FindViewById <Spinner>(Resource.Id.room_spinner); periodicityEditText = FindViewById <EditText>(Resource.Id.periodicity_edit_text); periodicityEditText.Text = periodicity.ToString(); timeOfCleaningEditText = FindViewById <EditText>(Resource.Id.time_of_cleaning_edit_text); timeOfCleaningEditText.Text = timeOfCleaning.ToString(); roomId = Intent.GetIntExtra(IntentManagement.IntentManagement.ROOM_ID, -1); taskId = Intent.GetIntExtra(RoomManagement.TASK_ID, -2); //-2 за дефолтом присвоюємо тому, що -1 уже забито під ще не створену задачу. коли вилізе -2 ми відразу побачимо помилку captions = new string[1]; imagesId = new int[1]; descriptions = new string[1]; descriptions[0] = GetString(Resource.String.click_to_edit_text); RoomDatabaseManagement roomDatabaseManagement = new RoomDatabaseManagement(); roomDatabaseManagement.FindRightOrderOfRoomTitles(this); roomIds = roomDatabaseManagement.GetRoomIds(); roomTitles = roomDatabaseManagement.GetRoomTitles(); //roomImageIds = roomDatabaseManagement.GetRoomImageIds(); roomSpinner.ItemSelected += RoomSpinner_ItemSelected; if (taskId == -1) //taskId == -1 означає (якщо це true), що задача ще не створена { if (roomId == -1) //Коли ми створюємо задачу переходячи до створення із головної сторінки (наприклад), а не з активності конкретної кімнати { var spinnerAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, roomTitles); roomSpinner.Adapter = spinnerAdapter; roomId = roomIds[0]; } else { var spinnerAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, roomTitles); roomSpinner.Adapter = spinnerAdapter; int spinnerCounter = 0; for (int i = 0; i < roomTitles.Length; i++) { if (roomId == roomIds[i]) { spinnerCounter = i; break; } } roomSpinner.SetSelection(spinnerCounter); } imagesId[0] = DatabaseManagement.RoomDatabaseManagement.GetRoomImageId(this, roomId); countOfCleaningTask = DatabaseManagement.CleaningTaskDatabaseManagement.CountOfCleaningTask(this, roomId); taskTitle = GetString(Resource.String.task_title) + (countOfCleaningTask + 1).ToString(); captions[0] = taskTitle; } else { var spinnerAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, roomTitles); roomSpinner.Adapter = spinnerAdapter; int spinnerCounter = 0; for (int i = 0; i < roomTitles.Length; i++) { if (roomId == roomIds[i]) { spinnerCounter = i; break; } } roomSpinner.SetSelection(spinnerCounter); SQLiteOpenHelper rationalCleaningDatabaseHelper = new RationalCleaningDatabaseHelper(this); db = rationalCleaningDatabaseHelper.ReadableDatabase; taskCursor = db.Query("CLEANING_TASK_TABLE", new string[] { "TITLE", "YEAR", "MONTH", "DAY_OF_MONTH", "DATE_DEFAULT", "HOUR", "MINUTE", "PERIODICITY", "TIME_OF_CLEANING" }, "_id = ?", new string[] { taskId.ToString() }, null, null, null); if (taskCursor.MoveToFirst()) { taskTitle = taskCursor.GetString(0); year = taskCursor.GetInt(1); month = taskCursor.GetInt(2); dayOfMonth = taskCursor.GetInt(3); dateDefault = taskCursor.GetInt(4); hour = taskCursor.GetInt(5); minute = taskCursor.GetInt(6); periodicity = taskCursor.GetInt(7); timeOfCleaning = taskCursor.GetInt(8); dateDefaultOriginal = dateDefault; } taskCursor.Close(); db.Close(); captions[0] = taskTitle; if (hour != -1) { TimeToFormat(hour, minute); } if (dateDefault == 0) { DateToFormat(year, month, dayOfMonth); } periodicityEditText.Text = periodicity.ToString(); timeOfCleaningEditText.Text = timeOfCleaning.ToString(); imagesId[0] = DatabaseManagement.RoomDatabaseManagement.GetRoomImageId(this, roomId); } #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 UpdateCaptionedImagesAdapter(); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); taskRecycler.SetLayoutManager(linearLayoutManager); taskRecycler.NestedScrollingEnabled = false; saveButton = FindViewById <Button>(Resource.Id.save_button); saveButton.Click += SaveButton_Click; }
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) { // } }
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"); }
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; } }