public MainActivity() { DashboardController = new EscritorioController(); Usuario_Fotos_Perfil = new Dictionary <KeyValuePair <string, string>, byte[]>(); List <ConfiguracionesModel> config = new ConfigurationsController().GetListConfiguraciones(); usuario_imagen_path = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PERFILES DE USUARIOS").Parametro_Varchar_1; publicaciones_imagen_path = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PUBLICACIONES").Parametro_Varchar_1; localStorage = SimpleStorage.EditGroup("Login"); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CommentLayout); post_id = Intent.GetStringExtra("post_id"); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.Title = Intent.GetStringExtra("Titulo"); ActionBar.SetDisplayHomeAsUpEnabled(true); DashboardController = new EscritorioController(); post = DashboardController.GetSinglePost(post_id); FillPost(); svComentarios = FindViewById <ScrollView>(Resource.Id.svComentarios); tlComentarios = FindViewById <TableLayout>(Resource.Id.comment_table); comentarios = DashboardController.GetComentariosPost(post_id, localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo"), page, sizePage); if (Convert.ToInt32(Intent.GetStringExtra("comments_total")) > 0) { tlComentarios.RemoveAllViews(); FillComments(); } SwipeRefreshLayout refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_container); refresher.SetColorSchemeColors(Color.Gray, Color.LightGray, Color.Gray, Color.DarkGray, Color.Black, Color.DarkGray); refresher.Refresh += (sender, e) => { comentarios = DashboardController.GetComentariosPost(post_id, localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo"), page, sizePage); if (comentarios.Count != 0) { tlComentarios.RemoveAllViews(); FillComments(); } ((SwipeRefreshLayout)sender).Refreshing = false; }; svComentarios.ScrollChange += (sender, e) => { if ((comentarios.Count / (page + 1)) < sizePage - 1) { if ((((ScrollView)sender).ScrollY / (page + 1)) > ((svComentarios.Height) * .4)) { ++page; FillComments(); } } }; }