• R/O
  • SSH
  • HTTPS

androidstudying: Commit


Commit MetaInfo

Revision65 (tree)
Time2020-03-05 13:31:04
Authorpbtdanh

Log Message

* update

Change Summary

Incremental Difference

--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/AppDatabase.java (nonexistent)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/AppDatabase.java (revision 65)
@@ -0,0 +1,14 @@
1+package com.xynotec.dictdroid.data.local.db;
2+
3+import androidx.room.Database;
4+import androidx.room.RoomDatabase;
5+
6+//@Database(entities = {User.class, Question.class, Option.class}, version = 2)
7+public abstract class AppDatabase{
8+
9+// public abstract OptionDao optionDao();
10+//
11+// public abstract QuestionDao questionDao();
12+//
13+// public abstract UserDao userDao();
14+}
\ No newline at end of file
--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/AppDbHelper.java (nonexistent)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/AppDbHelper.java (revision 65)
@@ -0,0 +1,37 @@
1+package com.xynotec.dictdroid.data.local.db;
2+
3+import com.xynotec.dictdroid.data.model.Favorite;
4+import com.xynotec.dictdroid.data.model.History;
5+
6+import java.util.List;
7+
8+import javax.inject.Inject;
9+
10+public class AppDbHelper implements DbHelper {
11+ private final AppDatabase mAppDatabase;
12+
13+ @Inject
14+ public AppDbHelper(AppDatabase appDatabase) {
15+ this.mAppDatabase = appDatabase;
16+ }
17+
18+ @Override
19+ public List<History> getHistory() {
20+ return null;
21+ }
22+
23+ @Override
24+ public List<Favorite> getFavorite() {
25+ return null;
26+ }
27+
28+ @Override
29+ public void insertHistory(History history) {
30+
31+ }
32+
33+ @Override
34+ public void insertFavorite(Favorite favorite) {
35+
36+ }
37+}
--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/DbHelper.java (nonexistent)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/local/db/DbHelper.java (revision 65)
@@ -0,0 +1,16 @@
1+package com.xynotec.dictdroid.data.local.db;
2+
3+import com.xynotec.dictdroid.data.model.Favorite;
4+import com.xynotec.dictdroid.data.model.History;
5+
6+import java.util.List;
7+
8+public interface DbHelper {
9+
10+ List<History> getHistory();
11+ List<Favorite> getFavorite();
12+ void insertHistory(History history);
13+ void insertFavorite(Favorite favorite);
14+
15+
16+}
--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/AppDataManager.java (revision 64)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/AppDataManager.java (revision 65)
@@ -3,7 +3,7 @@
33 import android.content.Context;
44
55 import com.google.gson.Gson;
6-import com.xynotec.dictdroid.data.local.dao.DbHelper;
6+import com.xynotec.dictdroid.data.local.db.DbHelper;
77 import com.xynotec.dictdroid.data.local.prefs.PreferencesHelper;
88 import com.xynotec.dictdroid.data.model.Favorite;
99 import com.xynotec.dictdroid.data.model.History;
--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/DataManager.java (revision 64)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/data/DataManager.java (revision 65)
@@ -1,6 +1,6 @@
11 package com.xynotec.dictdroid.data;
22
3-import com.xynotec.dictdroid.data.local.dao.DbHelper;
3+import com.xynotec.dictdroid.data.local.db.DbHelper;
44 import com.xynotec.dictdroid.data.local.prefs.PreferencesHelper;
55 import com.xynotec.dictdroid.data.remote.ApiHelper;
66
--- trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/di/AppModule.java (revision 64)
+++ trunk/dictdroid2020/single/app/src/main/java/com/xynotec/dictdroid/di/AppModule.java (revision 65)
@@ -7,9 +7,9 @@
77
88 import com.google.gson.Gson;
99 import com.google.gson.GsonBuilder;
10-import com.xynotec.dictdroid.data.local.dao.AppDatabase;
11-import com.xynotec.dictdroid.data.local.dao.AppDbHelper;
12-import com.xynotec.dictdroid.data.local.dao.DbHelper;
10+import com.xynotec.dictdroid.data.local.db.AppDatabase;
11+import com.xynotec.dictdroid.data.local.db.AppDbHelper;
12+import com.xynotec.dictdroid.data.local.db.DbHelper;
1313 import com.xynotec.dictdroid.data.local.prefs.AppPreferencesHelper;
1414 import com.xynotec.dictdroid.data.local.prefs.PreferencesHelper;
1515 import com.xynotec.dictdroid.ende.BuildConfig;
Show on old repository browser