Proyectos de Subversion Android Microlearning - Nuevo Interface

Rev

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

Rev 8 Rev 19
Línea 28... Línea 28...
28
import com.cesams.twogetskills.dao.TopicDao;
28
import com.cesams.twogetskills.dao.TopicDao;
29
import com.cesams.twogetskills.library.Http;
29
import com.cesams.twogetskills.library.Http;
30
import com.cesams.twogetskills.library.MD5;
30
import com.cesams.twogetskills.library.MD5;
31
import com.cesams.twogetskills.entity.Progress;
31
import com.cesams.twogetskills.entity.Progress;
32
import com.cesams.twogetskills.entity.Topic;
32
import com.cesams.twogetskills.entity.Topic;
-
 
33
import com.cesams.twogetskills.preference.Preference;
33
import com.cesams.twogetskills.skeleton.ITwoGetSkills;
34
import com.cesams.twogetskills.skeleton.ITwoGetSkills;
34
import com.cesams.twogetskills.viewmodel.TopicViewModel;
35
import com.cesams.twogetskills.viewmodel.TopicViewModel;
Línea 35... Línea 36...
35
 
36
 
36
import org.json.JSONException;
37
import org.json.JSONException;
Línea 197... Línea 198...
197
        }
198
        }
198
    }
199
    }
Línea 199... Línea 200...
199
 
200
 
200
    private void loadData()
201
    private void loadData()
-
 
202
    {
201
    {
203
        String userUuid = iTwoGetSkills.getPreference().getUserUuid();
Línea 202... Línea 204...
202
        iTwoGetSkills.setTitleActionBar(requireActivity().getString(R.string.menu_topics));
204
        iTwoGetSkills.setTitleActionBar(requireActivity().getString(R.string.menu_topics));
203
 
205
 
Línea 217... Línea 219...
217
            topic.setDescription(dbTopic.getDescription());
219
            topic.setDescription(dbTopic.getDescription());
218
            topic.setImage(dbTopic.getImage());
220
            topic.setImage(dbTopic.getImage());
219
            topic.setPosition(dbTopic.getPosition());
221
            topic.setPosition(dbTopic.getPosition());
Línea 220... Línea 222...
220
 
222
 
221
 
223
 
222
            progress = progressDao.selectByTopicUuid(topic.getUuid());
224
            progress = progressDao.selectByTopicUuidAndUserUuid(topic.getUuid(), userUuid);
223
            if(progress != null) {
225
            if(progress != null) {
224
                topic.setCompleted(progress.getCompleted());
226
                topic.setCompleted(progress.getCompleted());
225
                topic.setViewSlides( progress.getViewSlides());
227
                topic.setViewSlides( progress.getViewSlides());
Línea 239... Línea 241...
239
        Log.d(TAG, "onItemClick");
241
        Log.d(TAG, "onItemClick");
240
        iTwoGetSkills.changeTopicActive(mTopicViewModel.getTopicArrayList().get(position).getUuid());
242
        iTwoGetSkills.changeTopicActive(mTopicViewModel.getTopicArrayList().get(position).getUuid());
241
    }
243
    }
Línea 242... Línea 244...
242
 
244
 
-
 
245
    private void processResponseServer(String dataString) {
Línea 243... Línea 246...
243
    private void processResponseServer(String dataString) {
246
       // Log.e("El device uuid","en topic: "+iTwoGetSkills.getPreference().getDeviceUuid());
Línea 244... Línea 247...
244
 
247
 
Línea 259... Línea 262...
259
                            message = item.toString();
262
                            message = item.toString();
260
                        }
263
                        }
261
                    }
264
                    }
Línea 262... Línea 265...
262
 
265
 
-
 
266
                    if (success) {
-
 
267
                        Preference preference = iTwoGetSkills.getPreference();
-
 
268
 
263
                    if (success) {
269
 
264
                        iTwoGetSkills.getDatabase().getAnswerDao().removeAll();
270
                        iTwoGetSkills.getDatabase().getAnswerDao().removeAll();
265
                        iTwoGetSkills.getDatabase().getQuestionDao().removeAll();
271
                        iTwoGetSkills.getDatabase().getQuestionDao().removeAll();
266
                        iTwoGetSkills.getDatabase().getQuizDao().removeAll();
272
                        iTwoGetSkills.getDatabase().getQuizDao().removeAll();
267
                        iTwoGetSkills.getDatabase().getSlideDao().removeAll();
273
                        iTwoGetSkills.getDatabase().getSlideDao().removeAll();
268
                        iTwoGetSkills.getDatabase().getCapsuleDao().removeAll();
274
                        iTwoGetSkills.getDatabase().getCapsuleDao().removeAll();
-
 
275
                        iTwoGetSkills.getDatabase().getTopicDao().removeAll();
269
                        iTwoGetSkills.getDatabase().getTopicDao().removeAll();
276
			            iTwoGetSkills.getDatabase().getNotificationCenterDao().removeAllnotifications();
270
                        iTwoGetSkills.getDatabase().getUserExtendedDao().removeAll();
-
 
-
 
277
                        iTwoGetSkills.getDatabase().getUserExtendedDao().removeAll();
-
 
278
                        iTwoGetSkills.getDatabase().getUserLogDao().removeAllUserUuidNotEqual(preference.getUserUuid());
Línea 271... Línea 279...
271
 
279
                        iTwoGetSkills.getDatabase().getProgressDao().removeAllUserUuidNotEqual(preference.getUserUuid());
272
 
280
 
Línea 290... Línea 298...
290
            }
298
            }
291
        });
299
        });
Línea 292... Línea 300...
292
 
300
 
293
 
-
 
294
    }
301
 
-
 
302
    }