Esempio n. 1
0
        /// Metodo que instancia la vista y recursos de la vista y la devuelve
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            notificacionesUtil = new NotificacionesUtil(this.Activity);
            View     view = inflater.Inflate(Resource.Layout.Notificaciones, container, false);
            TextView lblNotificacionesTitulo = view.FindViewById <TextView>(Resource.Id.lblNotificacionesTitulo);

            lblMarcarComoLeida                          = view.FindViewById <TextView>(Resource.Id.lblMarcarComoLeida);
            btnCamapanaNotificaciones                   = Activity.FindViewById <ImageView>(Resource.Id.btnCamapanaNotificaciones);
            btnCamapanaNotificacionesNoLeida            = Activity.FindViewById <ImageView>(Resource.Id.btnCamapanaNotificacionesNoLeida);
            lblContadorNotificacionesNoLeidas           = Activity.FindViewById <TextView>(Resource.Id.lblContadorNotificacionesNoLeidas);
            relativeLayoutCampanaNotificacionesContador = Activity.FindViewById <RelativeLayout>(Resource.Id.relativeLayoutCampanaNotificacionesContador);
            NotificacionesListView                      = view.FindViewById <ListView>(Resource.Id.notificacionesListView);
            var font = Typeface.CreateFromAsset(Activity.Assets, ConstantesSecurity.fuente);

            lblNotificacionesTitulo.Typeface  = font;
            lblMarcarComoLeida.Typeface       = font;
            dialogoLoadingBcoSecurityActivity = new DialogoLoadingBcoSecurityActivity(Activity);
            return(view);
        }
Esempio n. 2
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Home);
            nombreConocido          = MainActivity.returnNombreConsultaEnrolado();
            nombreDesdeConfirmacion = ConfirmacionEnroladoActivity.returnNombreConsultaEnroladoConocido();
            // NotificacionesFragment NotificacionesFragment = new NotificacionesFragment();
            nombreTitulo = nombreConocido;
            if (string.IsNullOrEmpty(nombreTitulo))
            {
                nombreTitulo = nombreDesdeConfirmacion;
            }
            string nombreLogin = nombreTitulo;

            nombreUsuario        = nombreLogin.Split(' ');
            primerNombreUsuario  = nombreUsuario[0].ToLower();
            segundoNombreUsuario = nombreUsuario[1].ToLower();
            string primeraLetraPrimerNombre    = primerNombreUsuario.Substring(0, 1).ToUpper();
            string restoPrimernombreFormateado = primerNombreUsuario.Substring(1, primerNombreUsuario.Length - 1);

            primerNombreFormateado = primeraLetraPrimerNombre + restoPrimernombreFormateado;
            if (!string.IsNullOrEmpty(segundoNombreUsuario))
            {
                string primeraLetraSegundoNombre    = segundoNombreUsuario.Substring(0, 1).ToUpper();
                string restoSegundonombreFormateado = segundoNombreUsuario.Substring(1, segundoNombreUsuario.Length - 1);
                segundoNombreFormateado = primeraLetraSegundoNombre + restoSegundonombreFormateado;
            }
            string nombreUserFormateado = primerNombreFormateado + " " + segundoNombreFormateado;

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            btnBurger    = FindViewById <ImageView>(Resource.Id.btnBurger);
            btnCamapanaNotificaciones                   = FindViewById <ImageView>(Resource.Id.btnCamapanaNotificaciones);
            btnCamapanaNotificacionesNoLeida            = FindViewById <ImageView>(Resource.Id.btnCamapanaNotificacionesNoLeida);
            lblContadorNotificacionesNoLeidas           = FindViewById <TextView>(Resource.Id.lblContadorNotificacionesNoLeidas);
            relativeLayoutCampanaNotificacionesContador = FindViewById <RelativeLayout>(Resource.Id.relativeLayoutCampanaNotificacionesContador);
            notificacionesUtil = new NotificacionesUtil(this);
            preferenciasNotificacionesLeidas = new PreferenciasNotificacionesLeidas();
            listadoFinal = await notificacionesUtil.Llamarservicio(this, UtilAndroid.getRut());

            int contadorNotificaciones = preferenciasNotificacionesLeidas.getContadorNotificacionesNoLeidas(this, listadoFinal);

            if (contadorNotificaciones == 0)
            {
                relativeLayoutCampanaNotificacionesContador.Visibility = ViewStates.Gone;
                btnCamapanaNotificaciones.Visibility = ViewStates.Visible;
                btnCamapanaNotificaciones.Click     += BtnCamapanaNotificaciones_Click;
            }
            else
            {
                lblContadorNotificacionesNoLeidas.Text = contadorNotificaciones + string.Empty;
                relativeLayoutCampanaNotificacionesContador.Visibility = ViewStates.Visible;
                btnCamapanaNotificaciones.Visibility    = ViewStates.Gone;
                btnCamapanaNotificacionesNoLeida.Click += BtnCamapanaNotificacionesNoLeida_Click;
            }
            btnBurger.Click += BtnBurger_Click;
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            View hView = navigationView.GetHeaderView(cero);

            lblUsuarioMenu      = hView.FindViewById <TextView>(Resource.Id.lblUsuarioMenu);
            lblUsuarioMenu.Text = nombreUserFormateado;
            var fontRegular = Typeface.CreateFromAsset(Assets, rutaFuenteTitilium);
            var fontBold    = Typeface.CreateFromAsset(Assets, rutaFuenteTitiliumBold);

            lblUsuarioMenu.Typeface = fontRegular;
            cambiarFuenteMenu();
            var fragmentOnOff = FragmentManager.BeginTransaction();

            fragmentOnOff.AddToBackStack(null);
            fragmentOnOff.Add(Resource.Id.HomeLayout, new OnOffFragment());
            fragmentOnOff.Commit();
            dialogoLoadingBcoSecurityActivity = new DialogoLoadingBcoSecurityActivity(this);
        }