Proyectos de Subversion Android Microlearning - Nuevo Interface

Rev

Rev 19 | Rev 25 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 19 Rev 21
Línea 364... Línea 364...
364
                iTwoGetSkills.getDatabase().getQuizDao().removeAll();
364
                iTwoGetSkills.getDatabase().getQuizDao().removeAll();
365
                iTwoGetSkills.getDatabase().getSlideDao().removeAll();
365
                iTwoGetSkills.getDatabase().getSlideDao().removeAll();
366
                iTwoGetSkills.getDatabase().getCapsuleDao().removeAll();
366
                iTwoGetSkills.getDatabase().getCapsuleDao().removeAll();
367
                iTwoGetSkills.getDatabase().getTopicDao().removeAll();
367
                iTwoGetSkills.getDatabase().getTopicDao().removeAll();
368
                iTwoGetSkills.getDatabase().getUserExtendedDao().removeAll();
368
                iTwoGetSkills.getDatabase().getUserExtendedDao().removeAll();
-
 
369
                iTwoGetSkills.getDatabase().getNotificationCenterDao().removeAllnotifications();
369
                iTwoGetSkills.getDatabase().getProgressDao().removeAllUserUuidNotEqual(userUuid);
370
                iTwoGetSkills.getDatabase().getProgressDao().removeAllUserUuidNotEqual(userUuid);
370
                iTwoGetSkills.getDatabase().getUserLogDao().removeAllUserUuidNotEqual(userUuid);
371
                iTwoGetSkills.getDatabase().getUserLogDao().removeAllUserUuidNotEqual(userUuid);
371
                iTwoGetSkills.syncFromServer(data);
372
                iTwoGetSkills.syncFromServer(data);
Línea 382... Línea 383...
382
                JSONObject objDevice = data.getJSONObject("device");
383
                JSONObject objDevice = data.getJSONObject("device");
383
                preference.setAes(objDevice.getString("aes"));
384
                preference.setAes(objDevice.getString("aes"));
384
                preference.setPassword(objDevice.getString("password"));
385
                preference.setPassword(objDevice.getString("password"));
385
                preference.save();
386
                preference.save();
Línea -... Línea 387...
-
 
387
 
Línea -... Línea 388...
-
 
388
                getActivity().runOnUiThread(() -> {
-
 
389
 
-
 
390
                    iTwoGetSkills.invokeFragment(Constants.IDX_FRAGMENT_WELCOME);
Línea 386... Línea 391...
386
 
391
                    iTwoGetSkills.showNavigationAndToolbar();
387
 
392
                });
388
 
393
 
Línea 398... Línea 403...
398
 
403
 
399
                SyncDao syncDao = iTwoGetSkills.getDatabase().getSyncDao();
404
                SyncDao syncDao = iTwoGetSkills.getDatabase().getSyncDao();
Línea 400... Línea -...
400
                syncDao.insert(sync);
-
 
401
 
-
 
402
 
-
 
403
                getActivity().runOnUiThread(new Runnable() {
-
 
404
 
-
 
405
                    @Override
-
 
406
                    public void run() {
-
 
407
 
-
 
408
                        ResultCount resultCount = iTwoGetSkills.getDatabase().getCapsuleDao().getCount();
-
 
409
                        String message = resultCount.getCount() == 1
-
 
410
                                ? "Hay 1 cápsula nueva disponible"
-
 
411
                                : "Hay " + resultCount.getCount() + " cápsulas disponible";
-
 
412
 
-
 
413
                        iTwoGetSkills.showMessageSnackBarWithClose(message);
-
 
414
 
-
 
415
 
-
 
416
                      //  iTwoGetSkills.reloadNavHeader();
-
 
417
                        iTwoGetSkills.invokeFragment(Constants.IDX_FRAGMENT_WELCOME);
-
 
418
                        iTwoGetSkills.showNavigationAndToolbar();
-
 
419
                    }
-
 
420
                });
-
 
421
 
-
 
422
 
405
                syncDao.insert(sync);
423
 
406
 
424
 
407
 
425
            } else {
408
            } else {
426
                if(!TextUtils.isEmpty(message)) {
409
                if(!TextUtils.isEmpty(message)) {