Skip to content

Commit e9348f7

Browse files
committed
Refactor of the widget & its configuration. Now, we no longer only select from HSK1-7, but from any list, whether they are user lists, or systemlists (yes, incl. HSK ones). Introduced system lists HSK1-7+. Took the opportunity to remove extra activity that was only for configuring the widget, now that the full fledged activity can handle everything through fragments.
1 parent 4024224 commit e9348f7

28 files changed

Lines changed: 945 additions & 390 deletions
Lines changed: 388 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,388 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 10,
5+
"identityHash": "23cebc4b3e4781934a155eb9bf16efd0",
6+
"entities": [
7+
{
8+
"tableName": "ChineseWordAnnotation",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`a_simplified` TEXT NOT NULL, `a_pinyins` TEXT, `notes` TEXT, `class_type` TEXT, `class_level` TEXT, `themes` TEXT, `first_seen` INTEGER, `is_exam` INTEGER, `a_searchable_text` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`a_simplified`))",
10+
"fields": [
11+
{
12+
"fieldPath": "simplified",
13+
"columnName": "a_simplified",
14+
"affinity": "TEXT",
15+
"notNull": true
16+
},
17+
{
18+
"fieldPath": "pinyins",
19+
"columnName": "a_pinyins",
20+
"affinity": "TEXT"
21+
},
22+
{
23+
"fieldPath": "notes",
24+
"columnName": "notes",
25+
"affinity": "TEXT"
26+
},
27+
{
28+
"fieldPath": "classType",
29+
"columnName": "class_type",
30+
"affinity": "TEXT"
31+
},
32+
{
33+
"fieldPath": "level",
34+
"columnName": "class_level",
35+
"affinity": "TEXT"
36+
},
37+
{
38+
"fieldPath": "themes",
39+
"columnName": "themes",
40+
"affinity": "TEXT"
41+
},
42+
{
43+
"fieldPath": "firstSeen",
44+
"columnName": "first_seen",
45+
"affinity": "INTEGER"
46+
},
47+
{
48+
"fieldPath": "isExam",
49+
"columnName": "is_exam",
50+
"affinity": "INTEGER"
51+
},
52+
{
53+
"fieldPath": "a_searchable_text",
54+
"columnName": "a_searchable_text",
55+
"affinity": "TEXT",
56+
"notNull": true,
57+
"defaultValue": "''"
58+
}
59+
],
60+
"primaryKey": {
61+
"autoGenerate": false,
62+
"columnNames": [
63+
"a_simplified"
64+
]
65+
},
66+
"indices": [
67+
{
68+
"name": "index_ChineseWordAnnotation_a_searchable_text",
69+
"unique": false,
70+
"columnNames": [
71+
"a_searchable_text"
72+
],
73+
"orders": [],
74+
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChineseWordAnnotation_a_searchable_text` ON `${TABLE_NAME}` (`a_searchable_text`)"
75+
}
76+
]
77+
},
78+
{
79+
"tableName": "ChineseWord",
80+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`simplified` TEXT NOT NULL, `traditional` TEXT, `definition` TEXT NOT NULL, `hsk_level` TEXT, `pinyins` TEXT, `popularity` INTEGER, `examples` TEXT DEFAULT '', `modality` TEXT DEFAULT 'N/A', `type` TEXT DEFAULT 'N/A', `synonyms` TEXT DEFAULT '', `antonym` TEXT DEFAULT '', `searchable_text` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`simplified`))",
81+
"fields": [
82+
{
83+
"fieldPath": "simplified",
84+
"columnName": "simplified",
85+
"affinity": "TEXT",
86+
"notNull": true
87+
},
88+
{
89+
"fieldPath": "traditional",
90+
"columnName": "traditional",
91+
"affinity": "TEXT"
92+
},
93+
{
94+
"fieldPath": "definition",
95+
"columnName": "definition",
96+
"affinity": "TEXT",
97+
"notNull": true
98+
},
99+
{
100+
"fieldPath": "hskLevel",
101+
"columnName": "hsk_level",
102+
"affinity": "TEXT"
103+
},
104+
{
105+
"fieldPath": "pinyins",
106+
"columnName": "pinyins",
107+
"affinity": "TEXT"
108+
},
109+
{
110+
"fieldPath": "popularity",
111+
"columnName": "popularity",
112+
"affinity": "INTEGER"
113+
},
114+
{
115+
"fieldPath": "examples",
116+
"columnName": "examples",
117+
"affinity": "TEXT",
118+
"defaultValue": "''"
119+
},
120+
{
121+
"fieldPath": "modality",
122+
"columnName": "modality",
123+
"affinity": "TEXT",
124+
"defaultValue": "'N/A'"
125+
},
126+
{
127+
"fieldPath": "type",
128+
"columnName": "type",
129+
"affinity": "TEXT",
130+
"defaultValue": "'N/A'"
131+
},
132+
{
133+
"fieldPath": "synonyms",
134+
"columnName": "synonyms",
135+
"affinity": "TEXT",
136+
"defaultValue": "''"
137+
},
138+
{
139+
"fieldPath": "antonym",
140+
"columnName": "antonym",
141+
"affinity": "TEXT",
142+
"defaultValue": "''"
143+
},
144+
{
145+
"fieldPath": "searchable_text",
146+
"columnName": "searchable_text",
147+
"affinity": "TEXT",
148+
"notNull": true,
149+
"defaultValue": "''"
150+
}
151+
],
152+
"primaryKey": {
153+
"autoGenerate": false,
154+
"columnNames": [
155+
"simplified"
156+
]
157+
},
158+
"indices": [
159+
{
160+
"name": "index_ChineseWord_searchable_text",
161+
"unique": false,
162+
"columnNames": [
163+
"searchable_text"
164+
],
165+
"orders": [],
166+
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChineseWord_searchable_text` ON `${TABLE_NAME}` (`searchable_text`)"
167+
}
168+
]
169+
},
170+
{
171+
"tableName": "ChineseWordFrequency",
172+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`simplified` TEXT NOT NULL, `appearance_count` INTEGER NOT NULL, `consulted_count` INTEGER NOT NULL, PRIMARY KEY(`simplified`))",
173+
"fields": [
174+
{
175+
"fieldPath": "simplified",
176+
"columnName": "simplified",
177+
"affinity": "TEXT",
178+
"notNull": true
179+
},
180+
{
181+
"fieldPath": "appearanceCnt",
182+
"columnName": "appearance_count",
183+
"affinity": "INTEGER",
184+
"notNull": true
185+
},
186+
{
187+
"fieldPath": "consultedCnt",
188+
"columnName": "consulted_count",
189+
"affinity": "INTEGER",
190+
"notNull": true
191+
}
192+
],
193+
"primaryKey": {
194+
"autoGenerate": false,
195+
"columnNames": [
196+
"simplified"
197+
]
198+
},
199+
"indices": [
200+
{
201+
"name": "index_ChineseWordFrequency_simplified",
202+
"unique": false,
203+
"columnNames": [
204+
"simplified"
205+
],
206+
"orders": [],
207+
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChineseWordFrequency_simplified` ON `${TABLE_NAME}` (`simplified`)"
208+
}
209+
]
210+
},
211+
{
212+
"tableName": "word_lists",
213+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `creationDate` INTEGER NOT NULL, `lastModified` INTEGER NOT NULL, `ankiDeckId` INTEGER NOT NULL, `listType` TEXT NOT NULL)",
214+
"fields": [
215+
{
216+
"fieldPath": "name",
217+
"columnName": "name",
218+
"affinity": "TEXT",
219+
"notNull": true
220+
},
221+
{
222+
"fieldPath": "id",
223+
"columnName": "id",
224+
"affinity": "INTEGER",
225+
"notNull": true
226+
},
227+
{
228+
"fieldPath": "creationDate",
229+
"columnName": "creationDate",
230+
"affinity": "INTEGER",
231+
"notNull": true
232+
},
233+
{
234+
"fieldPath": "lastModified",
235+
"columnName": "lastModified",
236+
"affinity": "INTEGER",
237+
"notNull": true
238+
},
239+
{
240+
"fieldPath": "ankiDeckId",
241+
"columnName": "ankiDeckId",
242+
"affinity": "INTEGER",
243+
"notNull": true
244+
},
245+
{
246+
"fieldPath": "listType",
247+
"columnName": "listType",
248+
"affinity": "TEXT",
249+
"notNull": true
250+
}
251+
],
252+
"primaryKey": {
253+
"autoGenerate": true,
254+
"columnNames": [
255+
"id"
256+
]
257+
}
258+
},
259+
{
260+
"tableName": "word_list_entries",
261+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`listId` INTEGER NOT NULL, `simplified` TEXT NOT NULL, `ankiNoteId` INTEGER NOT NULL, PRIMARY KEY(`listId`, `simplified`, `ankiNoteId`), FOREIGN KEY(`listId`) REFERENCES `word_lists`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
262+
"fields": [
263+
{
264+
"fieldPath": "listId",
265+
"columnName": "listId",
266+
"affinity": "INTEGER",
267+
"notNull": true
268+
},
269+
{
270+
"fieldPath": "simplified",
271+
"columnName": "simplified",
272+
"affinity": "TEXT",
273+
"notNull": true
274+
},
275+
{
276+
"fieldPath": "ankiNoteId",
277+
"columnName": "ankiNoteId",
278+
"affinity": "INTEGER",
279+
"notNull": true
280+
}
281+
],
282+
"primaryKey": {
283+
"autoGenerate": false,
284+
"columnNames": [
285+
"listId",
286+
"simplified",
287+
"ankiNoteId"
288+
]
289+
},
290+
"indices": [
291+
{
292+
"name": "index_word_list_entries_listId",
293+
"unique": false,
294+
"columnNames": [
295+
"listId"
296+
],
297+
"orders": [],
298+
"createSql": "CREATE INDEX IF NOT EXISTS `index_word_list_entries_listId` ON `${TABLE_NAME}` (`listId`)"
299+
},
300+
{
301+
"name": "index_word_list_entries_simplified",
302+
"unique": false,
303+
"columnNames": [
304+
"simplified"
305+
],
306+
"orders": [],
307+
"createSql": "CREATE INDEX IF NOT EXISTS `index_word_list_entries_simplified` ON `${TABLE_NAME}` (`simplified`)"
308+
}
309+
],
310+
"foreignKeys": [
311+
{
312+
"table": "word_lists",
313+
"onDelete": "CASCADE",
314+
"onUpdate": "NO ACTION",
315+
"columns": [
316+
"listId"
317+
],
318+
"referencedColumns": [
319+
"id"
320+
]
321+
}
322+
]
323+
},
324+
{
325+
"tableName": "widget_list_entries",
326+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`widgetId` INTEGER NOT NULL, `listId` INTEGER NOT NULL, PRIMARY KEY(`widgetId`, `listId`), FOREIGN KEY(`listId`) REFERENCES `word_lists`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
327+
"fields": [
328+
{
329+
"fieldPath": "widgetId",
330+
"columnName": "widgetId",
331+
"affinity": "INTEGER",
332+
"notNull": true
333+
},
334+
{
335+
"fieldPath": "listId",
336+
"columnName": "listId",
337+
"affinity": "INTEGER",
338+
"notNull": true
339+
}
340+
],
341+
"primaryKey": {
342+
"autoGenerate": false,
343+
"columnNames": [
344+
"widgetId",
345+
"listId"
346+
]
347+
},
348+
"indices": [
349+
{
350+
"name": "index_widget_list_entries_widgetId",
351+
"unique": false,
352+
"columnNames": [
353+
"widgetId"
354+
],
355+
"orders": [],
356+
"createSql": "CREATE INDEX IF NOT EXISTS `index_widget_list_entries_widgetId` ON `${TABLE_NAME}` (`widgetId`)"
357+
},
358+
{
359+
"name": "index_widget_list_entries_listId",
360+
"unique": false,
361+
"columnNames": [
362+
"listId"
363+
],
364+
"orders": [],
365+
"createSql": "CREATE INDEX IF NOT EXISTS `index_widget_list_entries_listId` ON `${TABLE_NAME}` (`listId`)"
366+
}
367+
],
368+
"foreignKeys": [
369+
{
370+
"table": "word_lists",
371+
"onDelete": "CASCADE",
372+
"onUpdate": "NO ACTION",
373+
"columns": [
374+
"listId"
375+
],
376+
"referencedColumns": [
377+
"id"
378+
]
379+
}
380+
]
381+
}
382+
],
383+
"setupQueries": [
384+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
385+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '23cebc4b3e4781934a155eb9bf16efd0')"
386+
]
387+
}
388+
}

0 commit comments

Comments
 (0)