/// <summary> /// Ons the create. /// </summary> /// <returns>The create.</returns> /// <param name="bundle">Bundle.</param> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.LoginView); progressDialog = new ProgressDialog(this); progressDialog.SetMessage("Loading..."); progressDialog.SetCancelable(false); _loginField = FindViewById <EditText>(Resource.Id.usernameField); _passwordField = FindViewById <EditText>(Resource.Id.passwordField); var registerButton = FindViewById <Button>(Resource.Id.registerButton); registerButton.Touch += (sender, e) => Register(this, new Tuple <string, string>(_loginField.Text, _passwordField.Text)); var loginButton = FindViewById <Button>(Resource.Id.loginButton); loginButton.Touch += (sender, e) => Login(this, new Tuple <string, string>(_loginField.Text, _passwordField.Text)); var app = ChatApplication.GetApplication(this); var state = new ApplicationState(); _presenter = new LoginPresenter(state, new NavigationService(app)); _presenter.SetView(this); app.CurrentActivity = this; }
/// <summary> /// Ons the create. /// </summary> /// <returns>The create.</returns> /// <param name="bundle">Bundle.</param> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ChatView); var metrics = Resources.DisplayMetrics; _width = (int)((metrics.WidthPixels) / Resources.DisplayMetrics.Density); _scrollViewInnerLayout = FindViewById <LinearLayout>(Resource.Id.scrollViewInnerLayout); _editText = FindViewById <EditText>(Resource.Id.chatField); var sendButton = FindViewById <Button>(Resource.Id.sendButton); sendButton.Touch += HandleSendButton; var app = ChatApplication.GetApplication(this); app.CurrentActivity = this; _presenter = app.Presenter as ChatPresenter; _presenter.SetView(this); app.CurrentActivity = this; }
/// <summary> /// Ons the resume. /// </summary> /// <returns>The resume.</returns> protected override void OnResume() { base.OnResume(); var app = ChatApplication.GetApplication(this); app.CurrentActivity = this; if (_presenter != null) { _presenter.SetView(this); } }
/// <summary> /// Ons the create. /// </summary> /// <returns>The create.</returns> /// <param name="bundle">Bundle.</param> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ListView.SetBackgroundColor(Color.White); var app = ChatApplication.GetApplication(this); app.CurrentActivity = this; _presenter = app.Presenter as ClientsListPresenter; _presenter.SetView(this); _adapter = new ClientsListAdapter(this); ListAdapter = _adapter; }