public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) { base.OnCreateView(inflater, container, savedState); _currentView = this.BindingInflate(Resource.Layout.customer_details, container, false); this.ViewModel = new CustomerDetailFragmentViewModel(); _txtSmsSendInfo = _currentView.FindViewById <TextView>(Resource.Id.txtSmsSendInfo); _imgCustomerPhoto = _currentView.FindViewById <CircularImageView>(Resource.Id.imgCustomerPhoto); _txtCustomerName = _currentView.FindViewById <TextView>(Resource.Id.txtCustomerName); _txtCustomerPhone = _currentView.FindViewById <TextView>(Resource.Id.txtCustomerPhone); _currentView.FindViewById <TextView>(Resource.Id.txtLblProduct); _txtCustomerProduct = _currentView.FindViewById <TextView>(Resource.Id.txtCustomerProduct); _btnRaiseIssue = _currentView.FindViewById <Button>(Resource.Id.btnRaiseIssue); _btnRaiseIssue.TransformationMethod = null; _btnCallCustomer = _currentView.FindViewById <Button>(Resource.Id.btnCallCustomer); _btnCallCustomer.TransformationMethod = null; _txtRegistrationProcessSteps = _currentView.FindViewById <TextView>(Resource.Id.txtRegistrationProcessSteps); _txtStepDoneNo = _currentView.FindViewById <TextView>(Resource.Id.txtStepDoneNo); _txtStepDone = _currentView.FindViewById <TextView>(Resource.Id.txtStepDone); _txtStepCurrentNo = _currentView.FindViewById <TextView>(Resource.Id.txtStepCurrentNo); _txtStepCurrent = _currentView.FindViewById <TextView>(Resource.Id.txtStepCurrent); _txtStepFutureNo = _currentView.FindViewById <TextView>(Resource.Id.txtStepFutureNo); _txtStepFuture = _currentView.FindViewById <TextView>(Resource.Id.txtStepFuture); _txtExtraInformation = _currentView.FindViewById <TextView>(Resource.Id.txtExtraInformation); _txtExtraInformation.Visibility = ViewStates.Gone; _linStepDoneNo = _currentView.FindViewById <LinearLayout>(Resource.Id.linStepDoneNo); _lineStepDone = _currentView.FindViewById <View>(Resource.Id.lineStepDoneNo); _linStepCurrentNo = _currentView.FindViewById <LinearLayout>(Resource.Id.linStepCurrentNo); _lineStepCurrent = _currentView.FindViewById <View>(Resource.Id.lineStepCurrent); _linStepFutureNo = _currentView.FindViewById <LinearLayout>(Resource.Id.linStepFutureNo); _lSmsInfoStatus = _currentView.FindViewById <RelativeLayout>(Resource.Id.lSmsInfoStatus); _btnResendRegistration = _currentView.FindViewById <TextView>(Resource.Id.btnResendRegistration); _loadingAnimation = _currentView.FindViewById <ProgressBar>(Resource.Id.loadingAnimation); // App trackking GoogleAnalyticService.Instance.TrackScreen(Activity.GetString(Resource.String.customer_details)); if (savedState != null) { string json = savedState.GetString(SearchResult); if (!string.IsNullOrEmpty(json)) { _customerSearchResult = JsonConvert.DeserializeObject <CustomerSearchResult>(json); } } if (_customerSearchResult == null) { _customerSearchResult = JsonConvert.DeserializeObject <CustomerSearchResult>(Arguments.GetString(SearchResult)); } AsyncHelper.RunSync(async() => await this.InitCustomer()); SetEventHandlers(); return(_currentView); }
private void InitializeComponent() { Orientation = Orientation.Horizontal; Padding = new Padding(14, 7, 7, 7); Spacing = 7; _titleLabel = new Label(); _titleLabel.TextColor = Color.Parse("#42484a"); _titleLabel.Font = SystemFonts.Label(16); _titleLayout = new StackLayout(); _titleLayout.Orientation = Orientation.Vertical; _titleLayout.Padding = new Padding(0, 10); _titleLayout.Items.Add(_titleLabel); _photoBox = new CircularImageView(); _photoBox.Size = new Size(65, 65); _settingsButton = new Button(); _settingsButton.Image = Bitmap.FromResource("preferences"); _settingsButton.Width = 40; _settingsButton.Height = 40; _settingsButton.Click += OnPreferencesButtonClick; _exportButton = new Button(); _exportButton.Image = Bitmap.FromResource("export"); _exportButton.Width = 40; _exportButton.Height = 40; _exportButton.Click += OnExportButtonClick; Items.Add(new StackLayoutItem(_photoBox)); Items.Add(new StackLayoutItem(_titleLayout, HorizontalAlignment.Left, true)); Items.Add(new StackLayoutItem(_exportButton, HorizontalAlignment.Right) { VerticalAlignment = VerticalAlignment.Center }); Items.Add(new StackLayoutItem(_settingsButton, HorizontalAlignment.Right) { VerticalAlignment = VerticalAlignment.Center }); }