private void visibilidadeTela(int ESTADO_TELA) { listaReciclavelProdutos.Visibility = ViewStates.Gone; ic_confirmar_pedido.Visibility = ViewStates.Gone; ll_resumo_itens_selecionados.Visibility = ViewStates.Gone; if (ESTADO_TELA == SOLICITANDO_PEDIDO) { listaReciclavelProdutos.Visibility = ViewStates.Visible; toolbar.SetTitle(Resource.String.titulo_toolbar); ESTADO_TELA_ATIVO = ESTADO_TELA; SupportActionBar.SetDisplayHomeAsUpEnabled(false); atualizarTextoBotaoConfirmar(); } else if (ESTADO_TELA == CONFIRMAAR_PEDIDO) { ic_confirmar_pedido.Visibility = ViewStates.Visible; ll_resumo_itens_selecionados.Visibility = ViewStates.Visible; toolbar.SetTitle(Resource.String.titulo_toolbar_confirmar); ESTADO_TELA_ATIVO = ESTADO_TELA; SupportActionBar.SetDisplayHomeAsUpEnabled(true); botaoConfirmarPedido.Text = "FINALIZAR A COMPRA"; tv_quantidade_itens_selecionados.Text = quantidadeTotalProdutos + " UN"; tv_valor_total_itens_selecionados.Text = "R$" + valorTotalPedidos; } ; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.SetTitle(Resource.String.titulo_toolbar); SetSupportActionBar(toolbar); listaReciclavelProdutos = FindViewById <RecyclerView>(Resource.Id.listaReciclavelProdutos); progressBar = FindViewById <Android.Widget.ProgressBar>(Resource.Id.progressBar); botaoConfirmarPedido = FindViewById <Button>(Resource.Id.bt_confirmar_pedido); ll_confirmar_pedido = FindViewById <LinearLayout>(Resource.Id.ll_confirmar_pedido); ic_confirmar_pedido = FindViewById <ScrollView>(Resource.Id.ic_confirmar_pedido); ll_recebe_produtos = FindViewById <LinearLayout>(Resource.Id.ll_recebe_produtos); tv_quantidade_itens_selecionados = FindViewById <TextView>(Resource.Id.tv_quantidade_itens_selecionados); tv_valor_total_itens_selecionados = FindViewById <TextView>(Resource.Id.tv_valor_total_itens_selecionados); ll_resumo_itens_selecionados = FindViewById <LinearLayout>(Resource.Id.ll_resumo_itens_selecionados); inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService); consumirDadosListarPromocoes(); botaoConfirmarPedido.Click += delegate { acaoBotaoConformeTela(); }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.booking_new, null); miCounts = new Dictionary <MenuItem, int>(); newBooking = new Booking(); newPayment = new Payment(); newBooking.CustomerId = GenericFacade.UserId; newPayment.CustomerId = GenericFacade.UserId; Android.Support.V7.Widget.Toolbar toolbar = view.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_new_booking); toolbar.SetTitle(Resource.String.bookingNewDialogTitle); ((AppCompatActivity)Activity).SetSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionBar = ((AppCompatActivity)Activity).SupportActionBar; if (actionBar != null) { actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeButtonEnabled(true); actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_clear_white); } Setup(); return(view); }
private void InitToolbar() { toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); toolbar.SetTitle(Resource.String.app_name); //toolbar.InflateMenu(Resource.Menu.menu); InitActionBarSpinner(); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); progress = view.FindViewById <ProgressBar>(Resource.Id.progressbar); recycler = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); toolbar = view.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); shoppingCart = view.FindViewById <Button>(Resource.Id.shopping_cart); drawerLayout = view.FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawerRecycler = view.FindViewById <RecyclerView>(Resource.Id.drawer_list); shoppingCart.Click += delegate { FragmentManager .BeginTransaction() .Replace(Resource.Id.fragment_container, new ShoppingCartFragment(), "cart") .AddToBackStack(null) .Commit(); }; recycler.HasFixedSize = true; recycler.SetLayoutManager( new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false) ); drawerRecycler.HasFixedSize = true; drawerRecycler.SetLayoutManager(new LinearLayoutManager(Activity)); // var activity = Activity as AppCompatActivity; toolbar.SetLogo(Resource.Mipmap.icon); toolbar.SetTitle(Resource.String.app_name); toolbar.SetSubtitle(Resource.String.app_short_desc); activity.SetSupportActionBar(toolbar); activity.SupportActionBar.SetDisplayHomeAsUpEnabled(true); activity.SupportActionBar.SetHomeButtonEnabled(true); // if (!alreadyStarted) { presenter.InitShoppingAction(); } else { presenter.ResetListAction(); } }
private void My_sensors_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { selected = my_sensors.GetItemAtPosition(e.Position).ToString(); Toast.MakeText(this, "Длинное нажатие", ToastLength.Short).Show(); LinearLayout.LayoutParams toolBarParams = new LinearLayout.LayoutParams(V7ToolBar.LayoutParams.MatchParent, 150); LinearLayout.LayoutParams appBarParams = new LinearLayout.LayoutParams(BarLayout.LayoutParams.MatchParent, Resource.Attribute.actionBarSize); toolBar = new V7ToolBar(this); toolBar.LayoutParameters = toolBarParams; toolBar.SetBackgroundColor(Color.Black); toolBar.SetTitle(Resource.String.my_sensors_toolbar_title); toolBar.SetTitleTextColor(Color.White); toolBar.Visibility = ViewStates.Visible; toolBar.PopupTheme = Resource.Style.AppTheme_PopupOverlay; barLayout.AddView(toolBar, 0); SetSupportActionBar(toolBar); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.invoicesedit_activity); // Setup toolbar Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.SetTitle(Resource.String.applicationname); // Set toolbar title here if (toolbar != null) { SetSupportActionBar(toolbar); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); } var repository = new Repository(); int invoiceId = this.Intent.Extras.GetInt("InvoiceId"); Invoice invoice = repository.GetInvoices().Where(x => x.Id == invoiceId).FirstOrDefault(); // To handle animations. If we don't do this, the animation will stutter upon page load. TextInputLayout textInputLayoutInvoiceReferenceNumber = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceReferenceNumber); TextInputLayout textInputLayoutInvoiceBillTo = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceBillTo); TextInputLayout textInputLayoutInvoiceAmount = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceAmount); textInputLayoutInvoiceReferenceNumber.HintAnimationEnabled = false; textInputLayoutInvoiceBillTo.HintAnimationEnabled = false; textInputLayoutInvoiceAmount.HintAnimationEnabled = false; TextView referenceNumberTextView = FindViewById <TextView>(Resource.Id.invoiceReferenceNumber); TextView billToTextView = FindViewById <TextView>(Resource.Id.invoiceBillTo); TextView amountTextView = FindViewById <TextView>(Resource.Id.invoiceAmount); referenceNumberTextView.Text = invoice.ReferenceNumber; billToTextView.Text = invoice.BillTo; amountTextView.Text = invoice.Amount.ToString(); // re-enable animations again textInputLayoutInvoiceReferenceNumber.HintAnimationEnabled = true; textInputLayoutInvoiceBillTo.HintAnimationEnabled = true; textInputLayoutInvoiceAmount.HintAnimationEnabled = true; }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); progress = view.FindViewById <ProgressBar>(Resource.Id.progressbar); recycler = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); toolbar = view.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); finalizeShopping = view.FindViewById <Button>(Resource.Id.finalize); quantity = view.FindViewById <TextView>(Resource.Id.quantity); total = view.FindViewById <TextView>(Resource.Id.total); recycler.HasFixedSize = true; recycler.SetLayoutManager( new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false) ); finalizeShopping.Click += delegate { presenter.FinalizeShoppingAction(); }; // var activity = Activity as AppCompatActivity; toolbar.SetLogo(Resource.Mipmap.icon); toolbar.SetTitle(Resource.String.app_name); toolbar.SetSubtitle(Resource.String.app_short_desc); activity.SetSupportActionBar(toolbar); activity.SupportActionBar.SetDisplayHomeAsUpEnabled(true); activity.SupportActionBar.SetHomeButtonEnabled(true); if (!alreadyStarted) { presenter.LoadCartAction(); } else { presenter.ReloadCartAction(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TestInstruction); activity = this; Spnlanguage = FindViewById <Spinner>(Resource.Id.testlanguage); txtnoofquestion = FindViewById <TextView>(Resource.Id.noofquestion); txttime = FindViewById <TextView>(Resource.Id.questiontime); txttotalmarks = FindViewById <TextView>(Resource.Id.totalmarks); txtTestname = FindViewById <TextView>(Resource.Id.testname); Testid = Intent.GetIntExtra("TestID", 0); testduration = Intent.GetIntExtra("TestDuration", 0); testtype = Intent.GetStringExtra("testtype"); string testname = Intent.GetStringExtra("TestName"); txtTestname.Text = testname; StartTest = FindViewById <Button>(Resource.Id.startest); StartTest.StartAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.shake)); StartTest.SetOnClickListener(this); 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); cp = new CustomProgressDialog(this); cp.Show(); if (Utility.IsNetworkConnected(this)) { CallApi(); } else { cp.Dismiss(); Toast.MakeText(this, "Check your internet connection", ToastLength.Short).Show(); } }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); string parameterValue = this.Intent.GetStringExtra ("message"); if (!string.IsNullOrEmpty (parameterValue)) { } #region Re-defining Variables _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _supporttoolbar.SetTitle(Resource.String.boletin); SetSupportActionBar(_supporttoolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); _supporttoolbar.Visibility = ViewStates.Gone; // _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); // // _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); // Button btnBoletin = FindViewById<Button>(Resource.Id.btnBoletin); // Button btnAsesoria = FindViewById<Button>(Resource.Id.btnAsesoria); // Button btnSeguimiento = FindViewById<Button>(Resource.Id.btnSeguimiento); news = new NewsFragment(); tips = new TipsFragment(); ticket = new TicketFragment(); ticketJuridico = new TicketJuridicoFragment(); seguimiento = new SeguimientoFragment(); mStackFragments = new Stack<SupportFragment>(); #endregion Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction(); tx.Add(Resource.Id.layout_content, news); tx.Add(Resource.Id.layout_content, tips); tx.Add (Resource.Id.layout_content, ticket); tx.Add (Resource.Id.layout_content, ticketJuridico); tx.Add (Resource.Id.layout_content, seguimiento); tx.Hide(news); tx.Hide (ticket); tx.Hide (ticketJuridico); tx.Hide (seguimiento); mCurrentFragment = tips; tx.Commit(); _supporttoolbar.Click += (object sender, EventArgs e) => { StartActivity (typeof(MainActivity)); }; #region CommentCode // btnBoletin.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnAsesoria.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnSeguimiento.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // _navigationview.NavigationItemSelected += (sender, e) => { // Android.Support.V4.App.Fragment fragment = null; // switch (e.MenuItem.ItemId) { // case Resource.Id.nav_news: // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // break; // case Resource.Id.nav_monedero: // _supporttoolbar.SetTitle(Resource.String.monedero); // fragment = new TipsFragment (); // break; // case Resource.Id.nav_ticket: // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // break; // case Resource.Id.nav_ticket_juridico: // _supporttoolbar.SetTitle(Resource.String.Apoyo_Juridico); // fragment = new TicketJuridicoFragment (); // break; // case Resource.Id.nav_seguimiento: // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // break; // } // // // // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_content, fragment).Commit (); // _drawer.CloseDrawers (); // // }; #endregion }
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 }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); string parameterValue = this.Intent.GetStringExtra("message"); if (!string.IsNullOrEmpty(parameterValue)) { } #region Re-defining Variables _supporttoolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _supporttoolbar.SetTitle(Resource.String.boletin); SetSupportActionBar(_supporttoolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); _supporttoolbar.Visibility = ViewStates.Gone; // _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); // // _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); // Button btnBoletin = FindViewById<Button>(Resource.Id.btnBoletin); // Button btnAsesoria = FindViewById<Button>(Resource.Id.btnAsesoria); // Button btnSeguimiento = FindViewById<Button>(Resource.Id.btnSeguimiento); news = new NewsFragment(); tips = new TipsFragment(); ticket = new TicketFragment(); ticketJuridico = new TicketJuridicoFragment(); seguimiento = new SeguimientoFragment(); mStackFragments = new Stack <SupportFragment>(); #endregion Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction(); tx.Add(Resource.Id.layout_content, news); tx.Add(Resource.Id.layout_content, tips); tx.Add(Resource.Id.layout_content, ticket); tx.Add(Resource.Id.layout_content, ticketJuridico); tx.Add(Resource.Id.layout_content, seguimiento); tx.Hide(news); tx.Hide(ticket); tx.Hide(ticketJuridico); tx.Hide(seguimiento); mCurrentFragment = tips; tx.Commit(); _supporttoolbar.Click += (object sender, EventArgs e) => { StartActivity(typeof(MainActivity)); }; #region CommentCode // btnBoletin.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnAsesoria.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnSeguimiento.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // _navigationview.NavigationItemSelected += (sender, e) => { // Android.Support.V4.App.Fragment fragment = null; // switch (e.MenuItem.ItemId) { // case Resource.Id.nav_news: // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // break; // case Resource.Id.nav_monedero: // _supporttoolbar.SetTitle(Resource.String.monedero); // fragment = new TipsFragment (); // break; // case Resource.Id.nav_ticket: // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // break; // case Resource.Id.nav_ticket_juridico: // _supporttoolbar.SetTitle(Resource.String.Apoyo_Juridico); // fragment = new TicketJuridicoFragment (); // break; // case Resource.Id.nav_seguimiento: // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // break; // } // // // // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_content, fragment).Commit (); // _drawer.CloseDrawers (); // // }; #endregion }