protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.bus_table); noteTextView = (TextView)FindViewById(Resource.Id.noteTextView); scheduleListView = (ListView)FindViewById(Resource.Id.scheduleListView); daySpinner = (MaterialSpinner)FindViewById(Resource.Id.daySpinner); toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.tableToolbar); busesLayout = (RelativeLayout)FindViewById(Resource.Id.buses_layout); busesButton = (ImageButton)FindViewById(Resource.Id.busesButton); busesButton.Click += Buses_Click; busesLayout.Click += Buses_Click; ParseData(); SortBuses(); SetUpToolbar(); SetUpSpinner(); SetUpListView(withoutTimeBuses, mon_fri_dub_odi, mon_fri_odi_dub); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RequestCard_content); SupportToolbar mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.Title = "Домофон (первичная заявка)"; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_action_arrow_back); ab.SetDisplayHomeAsUpEnabled(true); //Cпиннер listItems.Add("Мастер-Дом, Парамонов О.С."); _spinner = FindViewById <MaterialSpinner>(Resource.Id.contractor_spinner); adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner.Adapter = adapter; _spinner.ItemSelected += _spinner_ItemSelected; //Звонилка подрядчику _CallPhoneContractor = FindViewById <ImageView>(Resource.Id.callPhoneContractor); _CallPhoneContractor.Click += _CallPhoneContractor_Click; }
private void StyleViews(View view) { // Find view IDs _notamMainbackground = view.FindViewById <LinearLayout>(Resource.Id.notam_options_linearlayoutBottom); _configurationText = view.FindViewById <TextView>(Resource.Id.notam_options_configuration_text); _sortByTextView = view.FindViewById <TextView>(Resource.Id.notam_options_sortBy_textView); _sortBySpinner = view.FindViewById <MaterialSpinner>(Resource.Id.notam_options_sortBy_spinner); _sourceTextView = view.FindViewById <TextView>(Resource.Id.notam_options_source_textView); _sourceSpinner = view.FindViewById <MaterialSpinner>(Resource.Id.notam_options_source_spinner); _shareTextView = view.FindViewById <TextView>(Resource.Id.notam_options_share_textView); _shareSpinner = view.FindViewById <MaterialSpinner>(Resource.Id.notam_options_share_spinner); _dismissDialogButton = view.FindViewById <Button>(Resource.Id.notam_option_closeButton); // Coloring _notamMainbackground.SetBackgroundColor(new ApplyTheme().GetColor(DesiredColor.MainBackground)); _configurationText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MagentaText)); _sortByTextView.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _sourceTextView.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _shareTextView.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); // Assign text fields _configurationText.Text = Resources.GetString(Resource.String.NOTAM_configuration); _sortByTextView.Text = Resources.GetString(Resource.String.NOTAM_sortBy); _sourceTextView.Text = Resources.GetString(Resource.String.NOTAM_source); _shareTextView.Text = Resources.GetString(Resource.String.NOTAM_share); }
/// <summary> /// Inits the spinner hint and floating label. /// </summary> public void InitSpinnerHintAndFloatingLabel() { spiProcedenciaProducto = FindViewById <MaterialSpinner>(Resource.Id.spiProcedenciaProducto); spiProcedenciaProducto.Adapter = adapterProcedencia; spiProcedenciaProducto.SetPaddingSafe(0, 0, 0, 0); spiFrigorificoProducto = FindViewById <MaterialSpinner>(Resource.Id.spiFrigorificoProducto); spiFrigorificoProducto.SetPaddingSafe(0, 0, 0, 0); }
public override Dialog OnCreateDialog(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Begin building a new dialog. var builder = new AlertDialog.Builder(Activity); //Get the layout inflater var inflater = Activity.LayoutInflater; //Inflate the layout for this dialog var dialogView = inflater.Inflate(Resource.Layout.DialogAddNewChallenge, null); dataManager = new DataManger(dialogView.Context); frequencies = dataManager.ChallangeData.GetPredefinedFrequencies(); var adapter = new ArrayAdapter <Frequency>(dialogView.Context, Android.Resource.Layout.SimpleSpinnerItem, frequencies); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner = dialogView.FindViewById <MaterialSpinner>(Resource.Id.spinner); manualLayout = dialogView.FindViewById <LinearLayout>(Resource.Id.manualLayout); switchOption = dialogView.FindViewById <Switch>(Resource.Id.switchOption); var yesBtn = dialogView.FindViewById <Button>(Resource.Id.yesBtn); var noBtn = dialogView.FindViewById <Button>(Resource.Id.noBtn); days = dialogView.FindViewById <EditText>(Resource.Id.days); seekBarDuration = dialogView.FindViewById <SeekBar>(Resource.Id.seekBarDuration); durationText = dialogView.FindViewById <TextView>(Resource.Id.durationText); challengeName = dialogView.FindViewById <EditText>(Resource.Id.challengeName); selectDateBtn = dialogView.FindViewById <ImageButton>(Resource.Id.pickDateBtn); dateEditText = dialogView.FindViewById <EditText>(Resource.Id.dateEditText); seekBarDuration.Max = 100 - 1; spinner.Adapter = adapter; switchOption.CheckedChange += SwitchOption_CheckedChange; yesBtn.Click += YesBtn_Click; noBtn.Click += NoBtn_Click; seekBarDuration.ProgressChanged += SeekBarDuration_ProgressChanged; selectDateBtn.Click += _dateSelectButton_Click; manualLayout.Visibility = ViewStates.Gone; builder.SetView(dialogView); var dialog = builder.Create(); return(dialog); }
void ConnectViews(View view) { newUserName = (TextInputLayout)view.FindViewById(Resource.Id.newUserName); newPhoneNumber = (TextInputLayout)view.FindViewById(Resource.Id.newPhoneNumber); newEmail = (TextInputLayout)view.FindViewById(Resource.Id.newEmail); newCity = (TextInputLayout)view.FindViewById(Resource.Id.newCity); newCountry = (TextInputLayout)view.FindViewById(Resource.Id.newCountry); bloodTypeSpinner = (MaterialSpinner)view.FindViewById(Resource.Id.bloodTypeSpinner); addButton = (Button)view.FindViewById(Resource.Id.addButton); addButton.Click += AddButton_Click; }
void ConnectViews(View view) { fullnameText = (TextInputLayout)view.FindViewById(Resource.Id.fullnameText); emailText = (TextInputLayout)view.FindViewById(Resource.Id.emailText); phoneText = (TextInputLayout)view.FindViewById(Resource.Id.phoneText); cityText = (TextInputLayout)view.FindViewById(Resource.Id.cityText); countryText = (TextInputLayout)view.FindViewById(Resource.Id.countryText); materialSpinner = (MaterialSpinner)view.FindViewById(Resource.Id.materialSpinner); saveButton = (Button)view.FindViewById(Resource.Id.saveButton); saveButton.Click += SaveButton_Click; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.calendar, container, false); //TextViews testText = view.FindViewById <TextView>(Resource.Id.txttest); beginnerText = view.FindViewById <TextView>(Resource.Id.txtBeginnerSelector); intermediateText = view.FindViewById <TextView>(Resource.Id.txtIntermediateSelector); //TextBoxes calendarWorkoutTextBox = view.FindViewById <EditText>(Resource.Id.txtWorkoutInput); calendarRepTextBox = view.FindViewById <EditText>(Resource.Id.txtRepInput); //CalendarViews calendarCalendarView = view.FindViewById <CalendarView>(Resource.Id.viewCalendar); //Buttons selfStartButton = view.FindViewById <Button>(Resource.Id.btnSelfCalendarStart); //RadioButton beginnerCheckBox = view.FindViewById <CheckBox>(Resource.Id.cbBeginnerSelector); intermediateCheckBox = view.FindViewById <CheckBox>(Resource.Id.cbIntermediateSelector); //Spinner workoutSpinner = view.FindViewById <MaterialSpinner>(Resource.Id.workoutSpinner); //Layouts FrameLayout workoutLayout = view.FindViewById <FrameLayout>(Resource.Id.layoutWorkout); workoutLayoutBottomSheetBehaviour = BottomSheetBehavior.From(workoutLayout); FrameLayout recyclerViewLayout = view.FindViewById <FrameLayout>(Resource.Id.layoutWorkoutBottomSheet); workoutRecyclerViewBottomSheetBehaviour = BottomSheetBehavior.From(recyclerViewLayout); calendarCoordinatorLayout = view.FindViewById <CoordinatorLayout>(Resource.Id.calendarView); //RecyclerView myRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.myRecyclerView); //Events calendarCalendarView.DateChange += CalendarCalendarView_DateChange; selfStartButton.Click += SelfStartButton_Click; calendarWorkoutTextBox.TextChanged += CalendarWorkoutTextBox_TextChanged; beginnerCheckBox.Click += BeginnerButton_Click; intermediateCheckBox.Click += IntermediateButton_Click; workoutSpinner.ItemSelected += WorkoutSpinner_ItemSelected; SetupWorkoutSpinner(); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment View view = inflater.Inflate(Resource.Layout.newalumini, container, false); fullnameText = (TextInputLayout)view.FindViewById(Resource.Id.fullnameText); departmentText = (TextInputLayout)view.FindViewById(Resource.Id.departmentText); setText = (TextInputLayout)view.FindViewById(Resource.Id.setText); statusSpinner = (MaterialSpinner)view.FindViewById(Resource.Id.statusSpinner); submitButton = (Button)view.FindViewById(Resource.Id.submitButton); submitButton.Click += SubmitButton_Click; SetupStatusPinner(); return(view); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); payloadSpinner = View.FindViewById <MaterialSpinner>(Resource.Id.payloadSpinner); refreshBtn = View.FindViewById <FloatingActionButton>(Resource.Id.refreshBtn); sendBtn = View.FindViewById <Button>(Resource.Id.sendBtn); loadFiles(); SaveSettings settings = new SaveSettings(); settings.Load(); Port = settings.port; IPAdress = settings.IPAdress; sendBtn.Click += SendBtn_Click; refreshBtn.Click += RefreshBtnOnClick; loadFiles(); }
private void StyleViews(View view) { // Find view IDs _wx_mainbackground = view.FindViewById <LinearLayout>(Resource.Id.wx_options_linearlayoutBottom); _metarOrTaforSpinner = view.FindViewById <MaterialSpinner>(Resource.Id.wx_options_metarORtafor_spinner); _configurationText = view.FindViewById <TextView>(Resource.Id.wx_options_configuration_text); _metarOrTaforText = view.FindViewById <TextView>(Resource.Id.wx_options_metarORtafor_text); _metarHoursText = view.FindViewById <TextView>(Resource.Id.wx_options_metarHours); _metarHoursSeekBar = view.FindViewById <SeekBar>(Resource.Id.wx_options_metarHours_seekbar); _metarHoursSeekBarText = view.FindViewById <TextView>(Resource.Id.wx_option_metarHours_seekbarText); _dismissBialogButton = view.FindViewById <Button>(Resource.Id.wx_option_closeButton); _saveDataText = view.FindViewById <TextView>(Resource.Id.wx_options_saveDataText); _saveDataSwitch = view.FindViewById <Switch>(Resource.Id.wx_options_saveDataSwitch); _colorWeatherText = view.FindViewById <TextView>(Resource.Id.wx_options_colorWeatherText); _colorWeatherSwitch = view.FindViewById <Switch>(Resource.Id.wx_options_colorWeatherSwitch); _divideTaforText = view.FindViewById <TextView>(Resource.Id.wx_options_divideTaforText); _divideTaforSwitch = view.FindViewById <Switch>(Resource.Id.wx_options_divideTaforSwitch); // Coloring _wx_mainbackground.SetBackgroundColor(new ApplyTheme().GetColor(DesiredColor.MainBackground)); _configurationText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MagentaText)); _metarOrTaforText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _metarHoursText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _metarHoursSeekBarText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _saveDataText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _colorWeatherText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _divideTaforText.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); _divideTaforSwitch.SetTextColor(new ApplyTheme().GetColor(DesiredColor.MainText)); // Assign text fields _configurationText.Text = Resources.GetString(Resource.String.Option_ConfigurationText); _metarOrTaforText.Text = Resources.GetString(Resource.String.Option_ChooseMetarOrTaforText); _metarHoursText.Text = Resources.GetString(Resource.String.Option_MetarHoursText); _saveDataText.Text = Resources.GetString(Resource.String.Option_SaveDataText); _colorWeatherText.Text = Resources.GetString(Resource.String.Option_ColorWeatherText); _divideTaforText.Text = Resources.GetString(Resource.String.Option_DivideTaforText); }
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); View view = inflater.Inflate(Resource.Layout.NewDrug, container, false); newFullnameText = (TextInputLayout)view.FindViewById(Resource.Id.newFullnameText); newActiveSubstanceText = (TextInputLayout)view.FindViewById(Resource.Id.newActiveSubstanceText); newFormText = (TextInputLayout)view.FindViewById(Resource.Id.newFormText); newGroupSpinner = (MaterialSpinner)view.FindViewById(Resource.Id.newGroupSpinner); addDrugButton = (Button)view.FindViewById(Resource.Id.addDrugButton); SetupFormSpinner(); addDrugButton.Click += AddDrugButton_Click; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); slavyanskiPosition = new LatLng(55.728246, 37.473204); odintsovoPosition = new LatLng(55.672067, 37.279666); dubkiPosition = new LatLng(55.660864, 37.226496); latlngPairs = new Dictionary <string, LatLng>(); latlngPairs.Add("Dubki", dubkiPosition); latlngPairs.Add("Odintsovo", odintsovoPosition); latlngPairs.Add("Slavyanski", slavyanskiPosition); durationTextView = (TextView)FindViewById(Resource.Id.durationTextView); routeSpinner = (MaterialSpinner)FindViewById(Resource.Id.routeSpinner); busesRecyclerView = (RecyclerView)FindViewById(Resource.Id.busesRecyclerView); toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.busesToolbar); scheduleLayout = (RelativeLayout)FindViewById(Resource.Id.schedule_layout); scheduleButton = (ImageButton)FindViewById(Resource.Id.scheduleButton); scheduleButton.Click += Schedule_Click; scheduleLayout.Click += Schedule_Click; ParseData(); SortBusesByDay(); SortBusesByTime(); SetUpToolbars(); SetUpSpinner(); SetUpRecyclerViewAsync(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ArticlesList); //get all groups from database //using (var connection = new SQLiteConnection(System.IO.Path.Combine(GlobalVariables.databasePath, "MobileSell.db"))) //{ // var allGroups = connection.Table<Group>(); // groups.AddRange(allGroups); //} var allGroups = DatabaseRequest.GetAllFromTable <Group>(); groups.AddRange(allGroups); //fill in spinner with items spinner = FindViewById <MaterialSpinner>(Resource.Id.spinner); adapter = new ArrayAdapter <Group>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, groups); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; spinner.Background = Drawable.CreateFromXml(Resources, Resources.GetXml(Resource.Drawable.material_spinner_border)); //on activity start get all articles allArticles = DatabaseRequest.GetAllFromTable <Article>().Select(x => new ArticleViewModel { Id = x.Id, Group = x.Group, Name = x.Name, SellPrice = x.SellPrice, Quantity = x.Quantity }).ToList(); //create line between recyclerview items DividerItemDecoration itemDecoration = new DividerItemDecoration(this, DividerItemDecoration.Vertical); //pass all articles to the RecyclerView articlesRecyclerView = FindViewById <RecyclerView>(Resource.Id.articlesRecyclerView); articlesRecyclerView.AddItemDecoration(itemDecoration); articlesLayoutManager = new LinearLayoutManager(this); articlesRecyclerView.SetLayoutManager(articlesLayoutManager); articlesAdapter = new ArticlesAdapter(allArticles); articlesAdapter.ItemClick += OnItemClick; articlesRecyclerView.SetAdapter(articlesAdapter); //get all articles from selected group spinner.ItemSelected += (s, e) => { if (e.Position != -1) { var groupId = groups.ElementAt(e.Position).Id; //get all articles from group which is currently selected List <ArticleViewModel> articlesFromGroup = allArticles.Where(x => x.Group == groupId).ToList(); //fill in the RecyclerView with articlesFromGroup; articlesAdapter = new ArticlesAdapter(articlesFromGroup); articlesAdapter.ItemClick += OnItemClick; articlesRecyclerView.SetAdapter(articlesAdapter); } else { //if no group is selected display all articles on screen articlesLayoutManager = new LinearLayoutManager(this); articlesRecyclerView.SetLayoutManager(articlesLayoutManager); articlesAdapter = new ArticlesAdapter(allArticles); articlesAdapter.ItemClick += OnItemClick; articlesRecyclerView.SetAdapter(articlesAdapter); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Inventory); //get all groups from database using (var connection = new SQLiteConnection(System.IO.Path.Combine(GlobalVariables.databasePath, "MobileSell.db"))) { var allGroups = connection.Table <Group>(); groups.AddRange(allGroups); } //fill in spinner with items spinner = FindViewById <MaterialSpinner>(Resource.Id.spinner); adapter = new ArrayAdapter <Group>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, groups); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; spinner.Background = Drawable.CreateFromXml(Resources, Resources.GetXml(Resource.Drawable.material_spinner_border)); //on activity start get all articles allArticles = DatabaseRequest.GetAllFromTable <Article>().Select(x => new ArticleViewModel { Id = x.Id, Group = x.Group, Name = x.Name, SellPrice = x.SellPrice, Quantity = x.Quantity }).ToList(); //pass all articles to the RecyclerView articlesRecyclerView = FindViewById <RecyclerView>(Resource.Id.articlesRecyclerView); articlesLayoutManager = new LinearLayoutManager(this); articlesRecyclerView.SetLayoutManager(articlesLayoutManager); articlesAdapter = new ArticlesAdapter(allArticles); articlesRecyclerView.SetAdapter(articlesAdapter); TextView totalValue = FindViewById <TextView>(Resource.Id.totalValue); //calculate total sum of all articles in RecyclerView and set it to totalValue TextView decimal totalSumAllArticles = articlesAdapter.listOfArticles.Sum(x => x.Sum); totalValue.Text = String.Format("{0:0.00}", totalSumAllArticles); //get all articles from selected group spinner.ItemSelected += (s, e) => { if (e.Position != -1) { var groupId = groups.ElementAt(e.Position).Id; //get all articles from group which is currently selected List <ArticleViewModel> articlesFromGroup = allArticles.Where(x => x.Group == groupId).ToList(); //fill in the RecyclerView with articlesFromGroup //articlesLayoutManager = new LinearLayoutManager(this); //articlesRecyclerView.SetLayoutManager(articlesLayoutManager); articlesAdapter = new ArticlesAdapter(articlesFromGroup); articlesRecyclerView.SetAdapter(articlesAdapter); //calculate total value of articles //decimal totalSum = 0; //foreach(ArticleViewModel article in articlesFromGroup) //{ // totalSum += article.Sum; //} //calculate total sum of all articles in RecyclerView and set it to totalValue TextView totalSumAllArticles = articlesAdapter.listOfArticles.Sum(x => x.Sum); totalValue.Text = String.Format("{0:0.00}", totalSumAllArticles); } else { //if no group is selected display all articles on screen //articlesLayoutManager = new LinearLayoutManager(this); //articlesRecyclerView.SetLayoutManager(articlesLayoutManager); articlesAdapter = new ArticlesAdapter(allArticles); articlesRecyclerView.SetAdapter(articlesAdapter); //calculate total sum of all articles in RecyclerView and set it to totalValue TextView totalSumAllArticles = articlesAdapter.listOfArticles.Sum(x => x.Sum); totalValue.Text = String.Format("{0:0.00}", totalSumAllArticles); } }; Button btnPrint = FindViewById <Button>(Resource.Id.btnPrint); btnPrint.Click += delegate { StartActivity(typeof(PrintingActivity)); }; }
private void InitSpinnerHintAndFloatingLabel() { spinner1 = FindViewById<MaterialSpinner>(Resource.Id.spinner1); spinner1.Adapter = adapter; spinner1.SetPaddingSafe(0,0,0,0); }
private void InitSpinnerScrolling() { spinner5 = FindViewById<MaterialSpinner>(Resource.Id.spinner5); spinner5.Adapter = adapter; spinner5.Hint = "Select an item"; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.Add_Edit_Expense, container, false); headertext = view.FindViewById <TextView>(Resource.Id.headertext); desciptiontext = view.FindViewById <TextInputLayout>(Resource.Id.desciptiontext); amounttext = view.FindViewById <TextInputLayout>(Resource.Id.amounttext); datefield = view.FindViewById <EditText>(Resource.Id.datefield); itemspinner = view.FindViewById <MaterialSpinner>(Resource.Id.itemspinner); saveexpensebutton = view.FindViewById <Button>(Resource.Id.saveexpensebutton); closebutton = view.FindViewById <ImageView>(Resource.Id.closebutton); closebutton.SetColorFilter(Color.ParseColor("#04040C")); closebutton.Click += Closebutton_Click; ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Activity); amounttext.Hint = "Amount" + "(" + prefs.GetString("CurrencySymbolSelected", "") + ")"; database = AppDataHelper.GetDatabase(); FragTagName = Tag; FetchExpenseItemsTable(); if (FragTagName == "Add Expense") { headertext.Text = FragTagName; int day = DateTime.Now.Day; int month = DateTime.Now.Month - 1; int year = DateTime.Now.Year; picker = new DatePickerDialog(Activity); picker.UpdateDate(year, month, day); CurrentUserUid = Arguments.GetString("CurrentUserUid"); } else { headertext.Text = FragTagName; expenseID = Arguments.GetString("expenseID"); ExpenseItemDescription = Arguments.GetString("ExpenseItemDescription"); ExpenseItemDate = Arguments.GetString("ExpenseItemDate"); ExpenseItemAmount = Arguments.GetString("ExpenseItemAmount"); ExpenseItemName = Arguments.GetString("ExpenseItemName"); desciptiontext.EditText.Text = ExpenseItemDescription; amounttext.EditText.Text = ExpenseItemAmount; datefield.Text = ExpenseItemDate; string[] val = ExpenseItemDate.Split(','); int day = Convert.ToInt32(val[0].Trim()); int month = Array.IndexOf(MONTHS, val[1].Trim()); int year = Convert.ToInt32(val[2].Trim()); picker = new DatePickerDialog(Activity); picker.UpdateDate(year, month, day); MonthSelected = val[1].Trim(); YearSelected = val[2].Trim(); DaySelected = val[0].Trim(); } datefield.Click += Datefield_Click; saveexpensebutton.Click += Saveexpensebutton_Click; return(view); }
private void InitSpinnerScrolling() { spinner5 = FindViewById <MaterialSpinner>(Resource.Id.spinner5); spinner5.Adapter = adapter; spinner5.Hint = "Select an item"; }
private void InitSpinnerNoHintNoFloatingLabel() { spinner3 = FindViewById<MaterialSpinner>(Resource.Id.spinner3); spinner3.Adapter = adapter; }
private void InitSpinnerOnlyHint() { spinner2 = FindViewById <MaterialSpinner>(Resource.Id.spinner2); spinner2.Adapter = adapter; }
private void InitSpinnerHintAndFloatingLabel() { spinner1 = FindViewById <MaterialSpinner>(Resource.Id.spinner1); spinner1.Adapter = adapter; spinner1.SetPaddingSafe(0, 0, 0, 0); }
protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.raceSchedule); circuitImage = FindViewById <ImageView>(Resource.Id.cktImage); circuitImage2 = FindViewById <ImageView>(Resource.Id.raceScheduleBanner); //circuitImage2.Visibility = ViewStates.Gone; cktName = FindViewById <TextView>(Resource.Id.textViewCktName); raceRound = FindViewById <TextView>(Resource.Id.textViewRound); raceDay = FindViewById <TextView>(Resource.Id.textViewDay); raceDate = FindViewById <TextView>(Resource.Id.textViewDate); eRace = FindViewById <TextView>(Resource.Id.textViewErace); raceQualifying = FindViewById <TextView>(Resource.Id.textViewQualifying); racePractice1 = FindViewById <TextView>(Resource.Id.textViewPractice1); racePractice2 = FindViewById <TextView>(Resource.Id.textViewPractice2); Android.Graphics.Typeface tf1 = Android.Graphics.Typeface.CreateFromAsset(Assets, "Khula-Regular.ttf"); Android.Graphics.Typeface tf3 = Android.Graphics.Typeface.CreateFromAsset(Assets, "Khula-SemiBold.ttf"); Android.Graphics.Typeface tf = Android.Graphics.Typeface.CreateFromAsset(Assets, "PoppinsMedium.ttf"); Android.Graphics.Typeface tf2 = Android.Graphics.Typeface.CreateFromAsset(Assets, "Khula-Light.ttf"); cktName.SetTypeface(tf, Android.Graphics.TypefaceStyle.Bold); raceRound.SetTypeface(tf, Android.Graphics.TypefaceStyle.Bold); raceDay.SetTypeface(tf1, Android.Graphics.TypefaceStyle.Bold); raceDate.SetTypeface(tf2, Android.Graphics.TypefaceStyle.Normal); eRace.SetTypeface(tf3, Android.Graphics.TypefaceStyle.Normal); raceQualifying.SetTypeface(tf3, Android.Graphics.TypefaceStyle.Normal); racePractice1.SetTypeface(tf3, Android.Graphics.TypefaceStyle.Normal); racePractice2.SetTypeface(tf3, Android.Graphics.TypefaceStyle.Normal); await Task.Run(() => CountryListFetcher()); //cktImage = FindViewById<ImageView>(Resource.Id.cktImage1); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.Title = "Race Schedule"; SetSupportActionBar(toolbar); if (SupportActionBar != null) { SupportActionBar.SetDisplayHomeAsUpEnabled(true); } InitItemsAsync(); spinner = FindViewById <MaterialSpinner>(Resource.Id.spinnerCountrySelect); adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line); spinner.Adapter = adapter; spinner.ItemSelected += async(s, e) => { if (e.Position != -1) { long selected = spinner.GetItemIdAtPosition(e.Position); Console.WriteLine("Selected : " + selected); await getRaceSchedule(selected); //switch (selected) //{ // case 0: // Console.WriteLine("Cases {0}", selected); // await getRaceSchedule(selected); // break; // case 1: // Console.WriteLine("Cases {0}", selected); // await getRaceSchedule(selected); // break; // case 2: // Console.WriteLine("Cases {0}", selected); // await getRaceSchedule(selected); // break; // case 3: // Console.WriteLine("Cases {0}", selected); // await getRaceSchedule(selected); // break; //} } }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Creation); //Инициализация кастомного тулбара SupportToolbar mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.Title = "Новая заявка"; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white_24dp); ab.SetDisplayHomeAsUpEnabled(true); //Выпадающее меню слева _mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); NavigationView mLeftDrawer = FindViewById <NavigationView>(Resource.Id.left_drawer); if (mLeftDrawer != null) { SetUpDrawerContent(mLeftDrawer); } //Выбор даты _dateSelectButton = FindViewById <Button>(Resource.Id.InputDate); _dateSelectButton.Click += DateSelect_OnClick; //Выбор времени _timeSelectButton = FindViewById <Button>(Resource.Id.InputTime); _timeSelectButton.Click += TimeSelect_OnClick; _timeSelectButton.Text = DateTime.Now.ToString("HH:mm"); //Начальное время (текущее) //Select инициализация и выбор спинеров //Инициализация обектов спиннера listItems1.Add("Неисправность - 1"); listItems1.Add("Неисправность - 2"); listItems2.Add("Подрядчик - 1"); listItems2.Add("Подрядчик - 2"); //Первый спиннер _spinner1 = FindViewById <MaterialSpinner>(Resource.Id.defect_spinner); adapter1 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems1); adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner1.Adapter = adapter1; _spinner1.ItemSelected += _spinner_ItemSelected; //Второй спиннер _spinner2 = FindViewById <MaterialSpinner>(Resource.Id.contractor_spinner); adapter2 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems2); adapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner2.Adapter = adapter2; _spinner2.ItemSelected += _spinner_ItemSelected; //Парящая кнопка FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += (o, e) => { View anchor = o as View; Snackbar.Make(anchor, "Ваша заявка созданна", Snackbar.LengthLong) .SetAction("К списку звявок", v => { Intent intent = new Intent(fab.Context, typeof(MainActivity)); StartActivity(intent); Finish(); OverridePendingTransition(Android.Resource.Animation.SlideOutRight, Android.Resource.Animation.SlideInLeft); }) .Show(); }; //Автокомплит AutoCompleteTextView textView = FindViewById <AutoCompleteTextView>(Resource.Id.autocomplete_txtInputHouse); var adapter = new ArrayAdapter <String>(this, Resource.Layout.autocomplete, COUNTRIES); textView.Adapter = adapter; }
private void InitSpinnerMultiline() { spinner4 = FindViewById<MaterialSpinner>(Resource.Id.spinner4); spinner4.Adapter = adapter; spinner4.Hint = "Select an item"; }
void FindViews() { mdSpinner = FindViewById <MaterialSpinner>(Resource.Id.spinner); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Filter_content); SupportToolbar mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.Title = "Фильтр"; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_action_arrow_back); ab.SetDisplayHomeAsUpEnabled(true); //Select инициализация и выбор спинеров //Инициализация обектов спиннера listItems1.Add("Неисправность - 1"); listItems1.Add("Неисправность - 2"); listItems2.Add("Заявка выполненна"); listItems2.Add("Проверенна"); listItems3.Add("Подрядчик - 1"); listItems3.Add("Подрядчик - 2"); listItems4.Add("Ответственный - 1"); listItems4.Add("Ответственный - 2"); listItems5.Add("Исполнитель - 1"); listItems5.Add("Исполнитель - 2"); //Парящая кнопка FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += (o, e) => { View anchor = o as View; Intent intent = new Intent(fab.Context, typeof(MainActivity)); StartActivity(intent); OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight); }; //Первый спиннер _spinner1 = FindViewById <MaterialSpinner>(Resource.Id.defect_spinner); adapter1 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems1); adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner1.Adapter = adapter1; _spinner1.ItemSelected += _spinner_ItemSelected; //Второй спиннер _spinner2 = FindViewById <MaterialSpinner>(Resource.Id.request_status); adapter2 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems2); adapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner2.Adapter = adapter2; _spinner2.ItemSelected += _spinner_ItemSelected; //Третий спиннер _spinner3 = FindViewById <MaterialSpinner>(Resource.Id.contractor_spinner); adapter3 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems3); adapter3.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner3.Adapter = adapter3; _spinner3.ItemSelected += _spinner_ItemSelected; //4 спиннер _spinner4 = FindViewById <MaterialSpinner>(Resource.Id.responsible); adapter4 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems4); adapter4.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner4.Adapter = adapter4; _spinner4.ItemSelected += _spinner_ItemSelected; //5 спиннер _spinner5 = FindViewById <MaterialSpinner>(Resource.Id.executor); adapter5 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, listItems5); adapter5.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); _spinner5.Adapter = adapter5; _spinner5.ItemSelected += _spinner_ItemSelected; //Выбор даты _dateSelectButtonFrom = FindViewById <Button>(Resource.Id.InputDateFrom); _dateSelectButtonFrom.Click += DateSelect_OnClick_From; _dateSelectButtonTo = FindViewById <Button>(Resource.Id.InputDateTo); _dateSelectButtonTo.Click += DateSelect_OnClick_To; }
private void InitSpinnerNoHintNoFloatingLabel() { spinner3 = FindViewById <MaterialSpinner>(Resource.Id.spinner3); spinner3.Adapter = adapter; }
private void InitSpinnerOnlyHint() { spinner2 = FindViewById<MaterialSpinner>(Resource.Id.spinner2); spinner2.Adapter = adapter; }
private void InitSpinnerMultiline() { spinner4 = FindViewById <MaterialSpinner>(Resource.Id.spinner4); spinner4.Adapter = adapter; spinner4.Hint = "Select an item"; }
/// <summary> /// Inits the spinner hint and floating label. /// </summary> public void InitSpinnerHintAndFloatingLabelProducto() { spiItemsProductos = FindViewById <MaterialSpinner>(Resource.Id.spiItemsProductos); spiItemsProductos.Adapter = adapterProductos; spiItemsProductos.SetPaddingSafe(0, 0, 0, 0); }