public AssessProspectView(ViewGroup root, Context context) : base(context) { _log.Initialize(this.GetType().FullName); if (context != null) { coordinator = (IRegistrationCoordinator)context; } if (root != null) { toggleNeed = root.FindViewById <ToggleButton>(Resource.Id.toggleNeed); toggleAuthority = root.FindViewById <ToggleButton>(Resource.Id.toggleAuthority); toggleMoney = root.FindViewById <ToggleButton>(Resource.Id.toggleMoney); textScore = root.FindViewById <TextView>(Resource.Id.textScore); } if (toggleNeed != null) { toggleNeed.Click += OnAssessmentChanged; toggleAuthority.Click += OnAssessmentChanged; toggleMoney.Click += OnAssessmentChanged; } if (coordinator != null && coordinator.btnNext != null) { coordinator.btnNext.Enabled = false; coordinator.btnNext.Click += OnNextTouched; coordinator.btnCancel.Click += OnCancel; } }
private void showEventDocuments() { if (mEvent.Archivos != null) { LinearLayout documentsContainer = FindViewById <LinearLayout>(Resource.Id.eventsDocumentList); documentsContainer.RemoveAllViews(); foreach (AttachmentFile obs in mEvent.Archivos) { string privatePublicc; if (obs.Private) { privatePublicc = "Privado"; } else { privatePublicc = "Publico"; } LayoutInflater inflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService); ViewGroup view = (ViewGroup)inflater.Inflate(Resource.Layout.EventDocumentRow, documentsContainer, false); view.FindViewById <TextView>(Resource.Id.txtDocumentName).Text = obs.FileName + " " + privatePublicc; view.FindViewById <TextView>(Resource.Id.txtDocumentName).PaintFlags = Android.Graphics.PaintFlags.UnderlineText; documentsContainer.AddView(view); view.Click += (sender, e) => OnDocumentClick(this, obs); } eventsDocumentList.Parent.RequestLayout(); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment v = (ViewGroup)inflater.Inflate(Resource.Layout.cuenta_bancaria_fragment, container, false); et_cuenta = (EditText)v.FindViewById(Resource.Id.et_n_cuenta); banco = (Spinner)v.FindViewById(Resource.Id.sp_banco); tipocuenta = (Spinner)v.FindViewById(Resource.Id.sp_tipo_cuenta); button = (Button)v.FindViewById(Resource.Id.btn_update_bancaria); check = (CheckBox)v.FindViewById(Resource.Id.checkBox); button.Enabled = false; //435250781 numero atencion area baja /* * banco.Click += delegate { * * et_cuenta.Enabled = true; * //et_cuenta.SetRawInputType(Android.Text.InputTypes.ClassNumber); * //et_cuenta.Focusable = true; * Toast.MakeText(Activity, "entro al ontouch", ToastLength.Short).Show(); * * }; */ button.Click += delegate { Toast.MakeText(Activity, "Datos guardados", ToastLength.Short).Show(); }; check.CheckedChange += delegate { et_cuenta.Enabled = true; button.Enabled = true; }; return(v); //return base.OnCreateView(inflater, container, savedInstanceState); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_webview_with_spinner, null); // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity. root.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent); loadingSpinner = root.FindViewById(Resource.Id.loading_spinner); webView = root.FindViewById <WebView> (Resource.Id.webview); webView.SetWebChromeClient(webChromeClient); webView.SetWebViewClient(webViewClient); webView.Post(() => { if (CLEAR_CACHE_ON_LOAD) { webView.ClearCache(true); } webView.Settings.JavaScriptEnabled = true; webView.Settings.JavaScriptCanOpenWindowsAutomatically = false; webView.LoadUrl(MAP_URL); webView.AddJavascriptInterface(new MyMapJsi(Activity, savedInstanceState), MAP_JSI_NAME); }); return(root); }
public override Object InstantiateItem(ViewGroup container, int position) { LayoutInflater inflater = LayoutInflater.From(context); ViewGroup layout = (ViewGroup)inflater.Inflate(Resource.Layout.layout_single_image, container, false); var imageView = layout.FindViewById <ImageViewAsync>(Resource.Id.imageView); var progressBar = layout.FindViewById <ProgressBar>(Resource.Id.progressBar); imageView.SetScaleType(scaleType); ImageService.Instance.LoadUrl(imageItems[position]).Finish((obj) => { SupportSlideViewSetup.Activity.RunOnUiThread(delegate { progressBar.Visibility = ViewStates.Gone; }); }).Success(() => { }).Error((obj) => { SupportSlideViewSetup.Activity.RunOnUiThread(delegate { imageView.SetImageResource(Resource.Drawable.image_notfound); }); }).Into(imageView); container.AddView(layout); return(layout); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null); CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly); readOnly.SetOnCheckedChangeListener(this); dataForm = Android.Runtime.Extensions.JavaCast <RadDataForm>(layoutRoot.FindViewById(Resource.Id.dataForm)); person = new Person(); person.AddPropertyChangedListener(this); dataForm.SetEntity(person); RangeValidator validator = (RangeValidator)dataForm.GetExistingEditorForProperty("Age").Property().Validator; validator.Max = 30; validator.Min = 18; Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner); commitModes.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, CommitMode.Values()); commitModes.OnItemSelectedListener = this; personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText); commitButton = (Button)layoutRoot.FindViewById(Resource.Id.manualCommit); commitButton.SetOnClickListener(this); return(layoutRoot); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null); CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly); readOnly.SetOnCheckedChangeListener(this); dataForm = new RadDataForm(Activity); layoutRoot.AddView(dataForm, 0); person = new Person(); person.AddPropertyChangedListener(this); dataForm.Entity = person; //RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator; //validator.Max = new Java.Lang.Integer(30); //validator.Min = new Java.Lang.Integer(18); Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner); commitModes.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, CommitMode.Values()); commitModes.OnItemSelectedListener = this; personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText); commitButton = (Button)layoutRoot.FindViewById(Resource.Id.manualCommit); commitButton.Click += (object sender, EventArgs e) => dataForm.CommitChanges(); return(layoutRoot); }
private void ShowDialog(int id) { DatePickerDialog dialog; var packageName = Application.Context.PackageName.ToString(); int position = VacationTabsFragment._viewPager.CurrentItem; int viewId = _container.Context.Resources.GetIdentifier("view_" + position, "id", packageName); View currentView = _container.FindViewById(viewId); if (id == 0) { Button ItemStartDateBtn = currentView.FindViewById <Button>(Resource.Id.ItemStartDateBtn); DateTime time = DateTime.Parse(ItemStartDateBtn.Text); dialog = new DatePickerDialog(_container.Context, HandleStartDateSet, time.Year, time.Month - 1, time.Day); } else { Button ItemEndDateBtn = currentView.FindViewById <Button>(Resource.Id.ItemEndDateBtn); DateTime time = DateTime.Parse(ItemEndDateBtn.Text); dialog = new DatePickerDialog(_container.Context, HandleEndDateSet, time.Year, time.Month - 1, time.Day); } try { dialog.DatePicker.MinDate = (long)(DateTime.Now - new DateTime(1970, 1, 1)).TotalMilliseconds; } catch (Exception ex) { var error = ex.Message; } dialog.Show(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.parsefragment, null); db = new DataBase(); lstSource = db.selectTableEntry(); TextView txtList = (TextView)root.FindViewById(Resource.Id.EmptyList); string withoutInternet = GetString(Resource.String.withoutInternet); //if (lstSource.Count>0) //{ // lstData = (ListView)root.FindViewById(Resource.Id.listView); // var adapter = new ListViewAdapter(this.Activity, lstSource); // lstData.Adapter = adapter; //} //else //{ // txtList.Gravity = GravityFlags.Center; // txtList.Text = withoutInternet; //} lstData = (ListView)root.FindViewById(Resource.Id.listView); var adapter = new ListViewAdapter(this.Activity, lstSource); lstData.Adapter = adapter; return(root); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment ViewGroup v = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_mi_cuenta, container, false); //LoginCargaFragment lf = new LoginCargaFragment(); //b = (Button)v.FindViewById(Resource.Id.boton_mapa); mViewPager = (ViewPager)v.FindViewById(Resource.Id.pager_mi_cuenta); mTabLayout = (TabLayout)v.FindViewById(Resource.Id.tabs_mi_cuenta); //linear= (LinearLayout)v.FindViewById(Resource.Id.container_in_mapfrag); //id = linear.Id; //id = Resource.Id.container_in_mapfrag; setViewPager(); //b.Click += delegate //{ //reemplazarFragment(lf, id); //}; return(v); //return base.OnCreateView(inflater, container, savedInstanceState); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.aboutMeFragment, null); myPhoto = (ImageView)root.FindViewById(Resource.Id.imageView1); Button button = (Button)root.FindViewById(Resource.Id.myButton); //createDirectory(); _file = null; _file = new Java.IO.File(Environment.GetExternalStoragePublicDirectory(Environment.DirectoryPictures), "avatar.png"); if (_file.Exists()) { myPhoto.SetImageURI(Uri.FromFile(_file)); } button.Click += delegate { //SelectImage(); ShowCamera(); }; return(root); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.activity_myrestaurant, null); myList = (RecyclerView)root.FindViewById <RecyclerView>(Resource.Id.hlistview); myList_ = (RecyclerView)root.FindViewById <RecyclerView>(Resource.Id.mlistview); TextView tv = (TextView)root.FindViewById <TextView>(Resource.Id.editarhorarios); TextView tv_ = (TextView)root.FindViewById <TextView>(Resource.Id.editarmesas); tv.Click += Tv_Click; tv_.Click += Tv__Click; mLayoutManager = new LinearLayoutManager(Activity); mmLayoutManager = new LinearLayoutManager(Activity); myList.SetLayoutManager(mLayoutManager); myList_.SetLayoutManager(mmLayoutManager); mAdapter = new MyHoraListAdapter(new HoraData()._HoraData_()); mmAdapter = new MyMesListAdapter(new MesData()._MesData_()); myList.SetAdapter(mAdapter); myList_.SetAdapter(mmAdapter); //myList.SetAdapter( new MyHoraListAdapter(HoraData.horas)); //myList.ItemClick += MyList_ItemClick; //Button LoginBtn = (Button)root.FindViewById(Resource.Id.dummybutton_); //LoginBtn.Click += LoginBtn_Click; return(root); }
public Holder(ViewGroup viewGroup) { UserNameTextView = viewGroup.FindViewById <TextView>(Resource.Id.postHeader_userFirstName_textView); DateTextView = viewGroup.FindViewById <TextView>(Resource.Id.postHeader_postDate_textView); AvatarImageView = viewGroup.FindViewById <ImageView>(Resource.Id.postHeader_userAvatar_imageView); OptionsImageButton = viewGroup.FindViewById <ImageButton>(Resource.Id.postHeader_options_button); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.FragmentMessages, null); mContext = (Activity)container.Context; RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(mContext); mRecyclerView = root.FindViewById <RecyclerView>(Resource.Id.recyclerView); mRecyclerView.SetLayoutManager(mLayoutManager); mSwipeRefreshLayout = root.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout); mSwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSwipeRefreshLayout.Refresh += (s, e) => UpdateList(); FloatingActionButton mFloatingActionButton = root.FindViewById <FloatingActionButton>(Resource.Id.Fab); mFloatingActionButton.Click += MFloatingActionButton_Click; mEemptyList = root.FindViewById <TextView>(Resource.Id.ViewEmpty); mListDataSet = new List <string>(); mListDataSet.Add("ќтветить"); mListDataSet.Add("ѕереслать"); mListDataSet.Add("”далить"); ArrayAdapter <string> mListAdapter = new ArrayAdapter <string>(mContext, Android.Resource.Layout.SimpleListItem1, mListDataSet); AlertDialog.Builder mAlertDialog = new AlertDialog.Builder(mContext) .SetTitle("¬ыберите действие:") .SetAdapter(mListAdapter, OnSelectAction); mDialog = mAlertDialog.Create(); return(root); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_calendar_events_read, container, false); settingsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.go_settings_layout); readEventsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.read_events_layout); RadCalendarView calendarView = new RadCalendarView(Activity); adapter = new EventReadAdapter(calendarView); calendarView.EventAdapter = adapter; Button settingsButton = (Button)rootView.FindViewById(Resource.Id.go_settings_button); settingsButton.Click += (object sender, EventArgs e) => { GoToSettings(); }; Button readEventsButton = (Button)rootView.FindViewById(Resource.Id.read_events_button); readEventsButton.Click += (object sender, EventArgs e) => { TryReadEvents(); }; InitLayoutVisibility(); rootView.AddView(calendarView); return(rootView); }
private void ShowVideoLevelPopup(View anchor) { LayoutInflater layoutInflater = (LayoutInflater)GetSystemService(LayoutInflaterService); ViewGroup layoutView = (ViewGroup)layoutInflater.Inflate(Resource.Layout.real_play_quality_items, null, true); int height = 105; height = Utils.Dip2px(this, height); PopupWindow windowQuality = new PopupWindow(layoutView, ViewGroup.LayoutParams.WrapContent, height, true); Button btnQualityHigh = layoutView.FindViewById <Button>(Resource.Id.btnQualityHigh); btnQualityHigh.Enabled = camera.VideoLevel != EZConstants.EZVideoLevel.VideoLevelHd; btnQualityHigh.Click += (sender, args) => SetQuality(windowQuality, EZConstants.EZVideoLevel.VideoLevelHd); Button btnQualityBanlance = layoutView.FindViewById <Button>(Resource.Id.btnBalance); btnQualityBanlance.Enabled = camera.VideoLevel != EZConstants.EZVideoLevel.VideoLevelBalanced; btnQualityBanlance.Click += (sender, args) => SetQuality(windowQuality, EZConstants.EZVideoLevel.VideoLevelBalanced); Button btnQualityFlunet = layoutView.FindViewById <Button>(Resource.Id.btnQualityFlunet); btnQualityFlunet.Enabled = camera.VideoLevel != EZConstants.EZVideoLevel.VideoLevelFlunet; btnQualityFlunet.Click += (sender, args) => SetQuality(windowQuality, EZConstants.EZVideoLevel.VideoLevelFlunet); windowQuality.ShowAsDropDown(anchor, -Utils.Dip2px(this, 5), -(height + anchor.Height + Utils.Dip2px(this, 8))); }
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); // Inflate the layout containing a title and body text. ViewGroup rootView = (ViewGroup)inflater .Inflate(Resource.Layout.fragment_screen_slide_page, container, false); // Set the title view to show the page number. var text = rootView.FindViewById <TextView>(Android.Resource.Id.Text1); text.Text = @"СТРАНИЦА " + (mPageNumber + 1); //if (mPageNumber % 2 == 0) if (!mIsAttendanceStart && mPageNumber > 1) { var lock_message = rootView.FindViewById <TextView>(Resource.Id.lock_message); lock_message.Text = @"БЛОКИРОВКА " + (mPageNumber + 1); } else { var locker = rootView.FindViewById <RelativeLayout>(Resource.Id.locker); locker.Visibility = ViewStates.Invisible; } return(rootView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootLayout = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_validation_mode, null); Spinner validationModeSpinner = (Spinner)rootLayout.FindViewById(Resource.Id.data_form_validation_mode_spinner); validationModeSpinner.OnItemSelectedListener = this; validationModeSpinner.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, new ValidationMode[] { ValidationMode.Immediate, ValidationMode.OnLostFocus, ValidationMode.Manual }); dataForm = new RadDataForm(this.Activity); dataForm.LayoutManager = new DataFormLinearLayoutManager(this.Activity); dataForm.CommitMode = CommitMode.Manual; dataForm.ValidationMode = ValidationMode.Immediate; Person joe = new Person(); joe.Name = "Joe"; joe.Mail = "*****@*****.**"; dataForm.SetEntity(joe); validateButton = (Button)rootLayout.FindViewById(Resource.Id.data_form_validate_button); validateButton.SetOnClickListener(this); rootLayout.AddView(dataForm, 0); return(rootLayout); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mainLayout = (ViewGroup)inflater.Inflate(Resource.Layout.RecentTimeEntriesListFragment, container, false); mainLayout.FindViewById <TextView> (Resource.Id.EmptyTitleTextView).SetFont(Font.Roboto); mainLayout.FindViewById <TextView> (Resource.Id.EmptyTextTextView).SetFont(Font.RobotoLight); return(mainLayout); }
/// <summary> /// Handle a response from Zebra Savanna APIs /// </summary> /// <param name="apiData">An object representing a json string, <see cref="byte[]"/>, or <see cref="Error{T}"/>.</param> private void OnPostExecute(object apiData, bool showHeader = true) { ViewGroup root = (ViewGroup)View; if (root == null) { return; } _showResultsLabel = showHeader; TextView barcodeLabel = root.FindViewById <TextView>(Resource.Id.resultLabel); barcodeLabel.Visibility = showHeader ? ViewStates.Visible : ViewStates.Gone; ImageView barcode = root.FindViewById <ImageView>(Resource.Id.barcode); TextView results = root.FindViewById <TextView>(Resource.Id.resultData); if (apiData is byte[] data) { _barcodeImage = BitmapFactory.DecodeByteArray(data, 0, data.Length); barcode.SetImageBitmap(_barcodeImage); barcode.Visibility = ViewStates.Visible; results.Visibility = ViewStates.Gone; } else if (apiData is Error e) { OnPostExecute(e.MessageFormatted, false); } else if (apiData is Exception ex) { OnPostExecute(ex.Message, false); } else { var noResults = Resources.GetString(Resource.String.noResults); string json = (string)apiData; if (json == "{}") { json = string.Empty; } results.Visibility = ViewStates.Visible; if (_details.Length == 0 || _details == noResults) { _details = json; } else if (_details != json && !string.IsNullOrWhiteSpace(json)) { _details += "\n" + json; } if (_details.Length == 0) { _details = noResults; } results.Text = _details; if (barcode != null) { barcode.Visibility = ViewStates.Gone; } } }
void SetupSettingsButton(int containerId, int labelId, int imageViewId, View.IOnClickListener onClickListener) { ViewGroup container = (ViewGroup)FindViewById(containerId); var buttonLabel = ((TextView)container.FindViewById(labelId)).Text; ImageView imageView = (ImageView)container.FindViewById(imageViewId); imageView.ContentDescription = buttonLabel; container.SetOnClickListener(onClickListener); }
//@Override //@NonNull public override View GetView(int position, View convertView, ViewGroup parent) { ViewGroup view = (ViewGroup)convertView; ViewHolder viewHolder; if (view == null) { view = createView(parent); viewHolder = new ViewHolder(); viewHolder.titleParent = (ViewGroup)view.FindViewById(mTitleParentResId); viewHolder.contentParent = (ViewGroup)view.FindViewById(mContentParentResId); view.Tag = viewHolder; } else { viewHolder = (ViewHolder)view.Tag; } View titleView = getTitleView(position, viewHolder.titleView, viewHolder.titleParent); if (!titleView.Equals(viewHolder.titleView)) { viewHolder.titleParent.RemoveAllViews(); viewHolder.titleParent.AddView(titleView); if (mActionViewResId == 0) { view.SetOnClickListener(new TitleViewOnClickListener(viewHolder.contentParent, this)); } else { view.FindViewById(mActionViewResId).SetOnClickListener(new TitleViewOnClickListener(viewHolder.contentParent, this)); } } viewHolder.titleView = titleView; View contentView = getContentView(position, viewHolder.contentView, viewHolder.contentParent); if (!contentView.Equals(viewHolder.contentView)) { viewHolder.contentParent.RemoveAllViews(); viewHolder.contentParent.AddView(contentView); } viewHolder.contentView = contentView; viewHolder.contentParent.Visibility = mExpandedIds.Contains(GetItemId(position)) ? ViewStates.Visible : ViewStates.Gone; viewHolder.contentParent.Tag = GetItemId(position); ViewGroup.LayoutParams layoutParams = viewHolder.contentParent.LayoutParameters; layoutParams.Height = ViewGroup.LayoutParams.WrapContent; viewHolder.contentParent.LayoutParameters = layoutParams; return(view); }
public static ImageComponent Create(LayoutInflater inflater) { ViewGroup viewRoot = (ViewGroup)inflater.Inflate(Resource.Layout.comp_image, null); var comp = new ImageComponent(viewRoot); comp.Image = viewRoot.FindViewById <ImageView>(Resource.Id.img_view); comp.Caption = viewRoot.FindViewById <TextView>(Resource.Id.img_caption); comp.Byline = viewRoot.FindViewById <TextView>(Resource.Id.img_byline); return(comp); }
private void addAttachedFile(string filename) { LayoutInflater inflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService); ViewGroup view = (ViewGroup)inflater.Inflate(Resource.Layout.AddEventDocumentRow, filesContainer, false); view.FindViewById <TextView>(Resource.Id.txtDocumentName).Text = filename; view.FindViewById <TextView>(Resource.Id.txtDocumentName).PaintFlags = Android.Graphics.PaintFlags.UnderlineText; view.FindViewById <ImageView>(Resource.Id.btnRemoveEventDocument).Click += ClickRemoveFile; filesContainer.AddView(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_content_appinfo, null); txt_welcome_note_0 = root.FindViewById <TextView>(Resource.Id.txt_welcome_note_0); txt_welcome_note_0.SetText(Resource.String.welcome_points1); //txt_welcome_note_0.Text = Html.FromHtml(GetString(Resource.String.welcome_points0)).ToString(); btn_backtodashboard = root.FindViewById <Button>(Resource.Id.btn_backtodashboard); btn_backtodashboard.Click += (sndr, argus) => btn_backtodashboard_Click(sndr, argus, this.Activity); return(root); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_content_contact, null); input_contact_subject = root.FindViewById <EditText>(Resource.Id.input_contact_subject); input_contact_notes = root.FindViewById <EditText>(Resource.Id.input_contact_notes); btn_contact_cancel = root.FindViewById <Button>(Resource.Id.btn_contact_cancel); btn_sendmsg = root.FindViewById <Button>(Resource.Id.btn_sendmsg); btn_contact_cancel.Click += (sndr, argus) => Cancel_Contact(sndr, argus, this.Activity); btn_sendmsg.Click += (sndr, argus) => Send_Message(sndr, argus, this.Activity); return(root); }
public Holder(ViewGroup viewGroup) { LongPercentTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_longPercent_textView); ShortPercentTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_shortPercent_textView); LongTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_long_textView); ShortTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_short_textView); DealsTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_deals_textView); DealsValueTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_dealsValue_textView); PnLTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_pl_textView); PnLValueTextView = viewGroup.FindViewById <TextView>(Resource.Id.postStatictics_plValue_textView); GreenLineRelativeLayout = viewGroup.FindViewById <RelativeLayout>(Resource.Id.post_green_relativeLayout); RedLineTextView = viewGroup.FindViewById <TextView>(Resource.Id.post_red_textView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout._fragment_content_selectfarm, null); try { var client = new RestClient(Common.UrlBase); var request = new RestRequest("Farm/GetAllFarmsDetails", Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("IsRegister", "true"); IRestResponse response = client.Execute(request); var content = response.Content; arrFields = Newtonsoft.Json.JsonConvert.DeserializeObject <List <FarmDetailResponse> >(content); spinnerx0 = root.FindViewById <Spinner>(Resource.Id.spinnerx0); spinnerx0.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinnerx0_ItemSelected); var x = arrFields.Where(a => a.Status == ResponseStatus.Successful).ToList(); if (x != null && x.Count() > default(int)) { spinnerx0.Adapter = new ArrayAdapter <string>(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, x.Select(a => a.FarmName).ToList()); } else { throw new Exception("No farm data found"); } btn_map_farm = root.FindViewById <Button>(Resource.Id.btn_map_farm); btn_map_farm.Click += (sndr, argus) => AddFarm_Clicked(sndr, argus, this.Activity); } catch (Exception ex) { this.Activity.RunOnUiThread(() => { Android.App.AlertDialog.Builder alertDiag = new Android.App.AlertDialog.Builder(this.Activity); alertDiag.SetTitle(Resource.String.DialogHeaderError); alertDiag.SetMessage(ex.Message); alertDiag.SetIcon(Resource.Drawable.alert); alertDiag.SetPositiveButton(Resource.String.DialogButtonOk, (senderAlert, args) => { MyFarmDashboardFragment obj = new MyFarmDashboardFragment(); Android.Support.V4.App.FragmentTransaction tx = FragmentManager.BeginTransaction(); tx.Replace(Resource.Id.m_main, obj, Constants.myfarmdash); tx.Commit(); }); Dialog diag = alertDiag.Create(); diag.Show(); diag.SetCanceledOnTouchOutside(false); }); } return(root); }
/// <summary> /// Ons the create view. /// </summary> /// <returns>The create view.</returns> /// <param name="inflater">Inflater.</param> /// <param name="container">Container.</param> /// <param name="savedInstanceState">Saved instance state.</param> public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { scale = Context.Resources.DisplayMetrics.Density; int pixels = 0; if (v == null) { v = (ViewGroup)inflater.Inflate(Resource.Layout.sucursales_fragment, container, false); } cordinatorSucursales = v.FindViewById <CoordinatorLayout>(Resource.Id.cordinatorSucursales); btnLogout = v.FindViewById <ImageButton>(Resource.Id.btnLogout); btnVolver = v.FindViewById <ImageView>(Resource.Id.btnVolver); linearLayoutBtnIrAMapasDeTienda = v.FindViewById <LinearLayout>(Resource.Id.linearLayoutBtnIrAMapasDeTienda); lblNombreActivity = v.FindViewById <TextView>(Resource.Id.lblNombreActivity); btnVolver.Visibility = ViewStates.Invisible; btnLogout.Visibility = ViewStates.Invisible; linearLayoutBtnIrAMapasDeTienda.Visibility = ViewStates.Invisible; lblNombreActivity.Text = "¿En qué tienda estás?"; sheet_suc = v.FindViewById <LinearLayout>(Resource.Id.linear_sheet_sucursales); linear_mapa = v.FindViewById <LinearLayout>(Resource.Id.linear_mapa); listaVacia = v.FindViewById <LinearLayout>(Resource.Id.sucursal_lista_vacia); CoordinatorLayout.LayoutParams linearLayoutParams = new CoordinatorLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); if (isVertical) { pixels = (int)(360 * scale + 0.5f); bottomSheetBehavior_suc = BottomSheetBehavior.From(sheet_suc); bottomSheetBehavior_suc.PeekHeight = pixels; } else { ViewGroup.LayoutParams parameters = (ViewGroup.LayoutParams)sheet_suc.LayoutParameters; parameters.Width = 500; parameters.Height = 660; if (parameters is ViewGroup.MarginLayoutParams) { ((ViewGroup.MarginLayoutParams)parameters).LeftMargin = 780; } sheet_suc.LayoutParameters = parameters; pixels = (int)(0 * scale + 0.5f); } linearLayoutParams.SetMargins(0, 0, 0, pixels); linear_mapa.LayoutParameters = linearLayoutParams; recycler = v.FindViewById <RecyclerView>(Resource.Id.mi_recycler_view_sucursales); adapter = new AdapterSucursal(DataManager.Sucursales, this); adapter.itemClick += OnItemClick; recycler.SetAdapter(adapter); layoutManager = new LinearLayoutManager(Activity); recycler.SetLayoutManager(layoutManager); mf = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map_sucursales); mf.GetMapAsync(this); ThreadPool.QueueUserWorkItem(o => cargaServicios()); RetainInstance = true; return(v); }
void SetupSettingsSwitch(int containerId, int labelId, int switchId, bool IsChecked, CompoundButton.IOnCheckedChangeListener checkedChangeListener) { ViewGroup container = (ViewGroup)FindViewById(containerId); var switchLabel = ((TextView)container.FindViewById(labelId)).Text; Switch switchView = (Switch)container.FindViewById(switchId); switchView.ContentDescription = switchLabel; switchView.Checked = IsChecked; container.Click += (sender, e) => { switchView.PerformClick(); }; switchView.SetOnCheckedChangeListener(checkedChangeListener); }