public void cargarconsolas() { listaelementos.Clear(); for (int i = 0; i < listillaxx.Count; i++) { Models.romsinfos modelito = new Models.romsinfos { Name = miselaneousmethods.consolelistformal[i], InfoLink = miselaneousmethods.consolelist[i], Portrait = "android.resource//" + PackageName + "/" + resourceids[i], Region = romcounts[i].ToString() + " Roms" }; listaelementos.Add(modelito); } ; estado = 2; var adaptadolllll = new adaptadorroms(this, listaelementos, idimagen, resourceids); RunOnUiThread(() => { SupportActionBar.Title = "Todas las consolas"; listin.Adapter = adaptadolllll; dialogoprogreso.Dismiss(); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.hambur); }); GC.Collect(0); }
public void cargaremuladores() { listaelementos.Clear(); for (int i = 0; i < listillaxx.Count; i++) { Models.romsinfos modelito = new Models.romsinfos { Name = miselaneousmethods.consolelistformal[i], InfoLink = miselaneousmethods.consolelist[i], Portrait = "android.resource//" + PackageName + "/" + resourceids[i] }; if (diccionarioemuladores.ContainsKey(miselaneousmethods.consolelist[i])) { modelito.Region = diccionarioemuladores[miselaneousmethods.consolelist[i]].Count + " Emuladores"; } else { modelito.Region = "0 Emuladores"; } listaelementos.Add(modelito); } ; estado = 3; var adaptadolllll = new adaptadorroms(this, listaelementos, idimagen, resourceids); RunOnUiThread(() => { SupportActionBar.Title = "Todos los emuladores"; listin.Adapter = adaptadolllll; dialogoprogreso.Dismiss(); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.hambur); }); GC.Collect(0); }
public void cargaremulador(int console) { RunOnUiThread(() => { searchview.SetQuery("", true); SupportActionBar.Title = miselaneousmethods.consolelistformal[console]; }); try { Glide.Get(this).ClearMemory(); } catch { } listaelementos.Clear(); setdialog("Cargando lista de emuladores", "Por favor espere..."); foreach (var ax in diccionarioemuladores[miselaneousmethods.consolelist[console]]) { Models.romsinfos modelito = new Models.romsinfos { Name = ax.nombre, InfoLink = ax.link, Portrait = ax.imagen, Region = ax.compactible }; /* if (modelito.InfoLink.Contains("https://play.google.com/store/apps/details?id=")) * {*/ try { if (miselaneousmethods.existepaquete(this, modelito.InfoLink.Split('=')[1])) { modelito.Region += " - instalado"; } } catch (Exception) { } // } listaelementos.Add(modelito); modelito = new Models.romsinfos(); } estado = 4; idimagen = resourceids[console]; /// listaelementos = listaelementos.OrderBy(c => c.nombre).ToList(); var adaptadolllll = new adaptadorroms(this, listaelementos, resourceids[console]); RunOnUiThread(() => { listin.Adapter = adaptadolllll; dialogoprogreso.Dismiss(); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.home); }); GC.Collect(0); }
public void cargardescargas() { /// miselaneousmethods.actualizararchivos(this); /// bool noencontro = false; listaelementos.Clear(); setdialog("Cargando roms", "Por favor espere..."); downloadlinks.Clear(); foreach (var klk in miselaneousmethods.getteardatosregistry()) { Models.romsinfos modelito = new Models.romsinfos { Name = klk.nombre, InfoLink = klk.path, Portrait = miselaneousmethods.imgpath + "/" + klk.nombre + ".jpg", Region = klk.consola }; if (File.Exists(modelito.InfoLink)) { downloadlinks.Add(klk.linkdescarga); listaelementos.Add(modelito); } else { noencontro = true; } } downloadlinks.Reverse(); listaelementos.Reverse(); var adaptadolllll = new adaptadorromsdownloaded(this, listaelementos, Resource.Drawable.download, null, downloadlinks); RunOnUiThread(() => { SupportActionBar.Title = "Roms descargados"; listin.Adapter = adaptadolllll; dialogoprogreso.Dismiss(); }); if (noencontro) { RunOnUiThread(() => { new Android.App.AlertDialog.Builder(this).SetTitle("No se pudieron encontrar algunos roms").SetMessage("Al parecer algunos roms fueron movidos o eliminados de sus rutas originales si desea actualizar sus rutas por favor haga toque escanear").SetCancelable(false).SetNegativeButton("Cancelar", cancell).SetPositiveButton("Escanear", scan).Create().Show(); }); } GC.Collect(0); ///////estatuscodes //////0-roms search //////1-rom downloads //////2-romselection estado = 1; }
public void cargarrutas() { try { var rutas = JsonConvert.DeserializeObject <Dictionary <string, string> >(File.ReadAllText(miselaneousmethods.cachepath + "/paths.json")); listaelementos.Clear(); for (int i = 0; i < listillaxx.Count; i++) { Models.romsinfos modelito = new Models.romsinfos { Name = miselaneousmethods.consolelistformal[i], InfoLink = miselaneousmethods.consolelist[i], Portrait = "android.resource//" + PackageName + "/" + resourceids[i], Region = rutas[miselaneousmethods.consolelist[i]] }; listaelementos.Add(modelito); } ; estado = 5; var adaptadolllll = new adaptadorroms(this, listaelementos, idimagen, resourceids); RunOnUiThread(() => { SupportActionBar.Title = "Carpetas de descargas"; listin.Adapter = adaptadolllll; dialogoprogreso.Dismiss(); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.hambur); }); } catch (Exception) { Dictionary <string, string> dic = new Dictionary <string, string>(); string downloadpath = System.IO.Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, Android.OS.Environment.DirectoryDownloads); foreach (var axd in miselaneousmethods.consolelist) { dic.Add(axd, downloadpath); } if (!Directory.Exists(directoriocache)) { Directory.CreateDirectory(directoriocache); } var xdd = File.CreateText(directoriocache + "/paths.json"); xdd.Write(JsonConvert.SerializeObject(dic)); xdd.Close(); cargarrutas(); } GC.Collect(0); }