Compare commits
556 Commits
Author | SHA1 | Date | |
---|---|---|---|
f6a224b49d | |||
957fe8115e | |||
13b172e37b | |||
83bda397d0 | |||
14fe38324a | |||
753592db49 | |||
7194f27adc | |||
714dadf709 | |||
b2af0dedb4 | |||
a3beeeebef | |||
caad081edb | |||
18b254da46 | |||
f45c57b456 | |||
8fd41782ad | |||
|
f18a03c6cb | ||
|
4d29dc6376 | ||
|
ae6e4afb3d | ||
|
1594b9bfa1 | ||
|
6c1321ecb0 | ||
|
a2d129ca80 | ||
|
4429991822 | ||
|
dcd264adb4 | ||
|
41abd55f43 | ||
|
0f9fa51219 | ||
|
e5f5037fc7 | ||
|
8e0d3c2513 | ||
|
ea5af3c9d8 | ||
284992a9f1 | |||
|
813ebf945a | ||
|
84be4dd642 | ||
|
dbcdb38961 | ||
|
01655b20f8 | ||
|
254ad9ef7e | ||
|
38eed2b322 | ||
|
d53a836aff | ||
|
0a3afeb959 | ||
|
36536f02f0 | ||
|
72c33f1d3c | ||
90fb3640ed | |||
|
6a64bfa9fd | ||
|
2bbce7dc93 | ||
|
33bc6efe2a | ||
|
095387b5d5 | ||
|
fc66a216d4 | ||
|
adae8f875a | ||
|
dc630840d2 | ||
|
4a579950a1 | ||
|
2e8dbf7804 | ||
|
c3f9c9a502 | ||
|
88be3ea745 | ||
|
686c7f5d75 | ||
|
437656b635 | ||
|
013931ff72 | ||
|
d86d239fdc | ||
|
c229c42c83 | ||
|
91634dbbfc | ||
|
886e589136 | ||
|
48edaf243d | ||
|
11fd49e393 | ||
|
4ab2a44cf5 | ||
|
166407ea5d | ||
|
737bfcefaa | ||
|
d67fa0d733 | ||
|
eb533db847 | ||
|
ce7e2c4b33 | ||
|
87db8183c1 | ||
|
8137268a06 | ||
|
a40f6dd7b6 | ||
|
ed9739e029 | ||
|
a5f56b84f5 | ||
|
f75c33bb46 | ||
|
0125e4c9ed | ||
|
4fd13b6189 | ||
|
b3376d6928 | ||
|
397a11f135 | ||
|
86cf2aa050 | ||
|
e809e6a630 | ||
a3431b400a | |||
1a367ae2d0 | |||
|
f950cf07d7 | ||
|
6be734c453 | ||
|
da85af62d0 | ||
668202faaf | |||
|
30c28e826f | ||
33429880a2 | |||
21e520f83a | |||
|
b4989ac740 | ||
|
44757a93a6 | ||
|
85e91b54a0 | ||
|
c8129b55fd | ||
|
3d2704235c | ||
|
8886602547 | ||
|
66f7547e0d | ||
|
bd903de0ab | ||
|
76821e16c2 | ||
|
d319150ca7 | ||
a88fc9704c | |||
|
0ed72582f5 | ||
|
028953cbb7 | ||
|
34e0b6ba13 | ||
|
5f815e6afe | ||
|
622f771ffb | ||
|
14c094e369 | ||
|
1ebefbeea7 | ||
|
9746154da4 | ||
|
3aaca43a6e | ||
2977a7511b | |||
8745daae4f | |||
0f4db7e2cc | |||
|
fcdd116b20 | ||
|
8f8cfea110 | ||
|
0c6419577b | ||
|
afc3d2c390 | ||
|
3dee123b8d | ||
|
016784a47b | ||
09f4bd924e | |||
aa371a26fb | |||
458e12ca17 | |||
eed9ab9ad6 | |||
6a7b84196a | |||
97b2b3673d | |||
d356ed757d | |||
a53b5634d0 | |||
71bf74c890 | |||
d745608232 | |||
078e3d9f60 | |||
5cb073552f | |||
4971133501 | |||
e34ccee121 | |||
555a8daae2 | |||
e101021374 | |||
29e2738660 | |||
6d8bd8aee6 | |||
|
663b947f98 | ||
c988f0b3af | |||
598923db7a | |||
b03c0ac1ad | |||
c2eae55f09 | |||
d7c6eb3937 | |||
59b3213f2f | |||
c04ca8ddea | |||
34d91f1e0c | |||
55d2f6bb25 | |||
c38a6883c6 | |||
1ba6588148 | |||
57bde5c7fe | |||
db267632d2 | |||
c0e3bc4c63 | |||
bdf4a656d0 | |||
41e81b6bc2 | |||
39160cb2c8 | |||
90abf17501 | |||
c556f23903 | |||
|
3fbcae3c33 | ||
|
6c63f1492c | ||
|
cda35f9995 | ||
|
d9d74d6dfd | ||
|
4ab58545d1 | ||
e545548862 | |||
3df5d9224d | |||
b3a9dc5ad4 | |||
bd985c9cf3 | |||
|
ab0898c571 | ||
|
df40491a2f | ||
|
0618081fda | ||
|
a71911cf69 | ||
|
9546faeb9e | ||
|
7a7de175ff | ||
58240541f7 | |||
|
086a70421f | ||
8da102888c | |||
95472cd80e | |||
|
785a255648 | ||
|
99bfc45b79 | ||
84f25e646c | |||
|
acb8d33992 | ||
|
eeac30121a | ||
9e5d0b281e | |||
|
797a098c58 | ||
c27366211e | |||
|
7785300490 | ||
|
d83b13ed38 | ||
|
5acec1cc2b | ||
b9e146bc0e | |||
|
abe6bcea29 | ||
76aee54566 | |||
a1ccf4cc81 | |||
|
f770a2edb2 | ||
9a4aff77ea | |||
|
ffdc94eac2 | ||
|
7f76620dd6 | ||
bf9cb29d65 | |||
87a094c845 | |||
|
6524137cea | ||
|
780bbc8c06 | ||
|
c94c913b2b | ||
33bc0a5160 | |||
|
9c0b2dcf1a | ||
123920777c | |||
913fa1fa1a | |||
dd9e7ab430 | |||
5a68269480 | |||
f045974e6e | |||
91e2043058 | |||
9fe9322c80 | |||
f184c7ccff | |||
f7d1776f96 | |||
|
197db5b5e4 | ||
|
fb1f295541 | ||
a64e613d7e | |||
6819890a92 | |||
|
1ac62d7351 | ||
e417595006 | |||
5402ad1e60 | |||
153b50c391 | |||
3ed98be1df | |||
65495a2ea1 | |||
dd58d7a98f | |||
6444197b8b | |||
0b5b8a8017 | |||
ef81ab02d6 | |||
52230f8f73 | |||
3a9ced6c9f | |||
6e6a2da771 | |||
ea1ff1f2a9 | |||
68c7958812 | |||
76ded375ff | |||
fbbd27efcf | |||
45d747a294 | |||
fda404aaac | |||
3381e18458 | |||
222e9a1c15 | |||
16d1fec3af | |||
5641398ed0 | |||
5f1a87b7b8 | |||
589ae7564c | |||
388c593a3c | |||
f45f6412f1 | |||
0713cedfde | |||
b540008fb3 | |||
5d86ae58c4 | |||
511eeceaf2 | |||
6c8f705011 | |||
299f8d9c8a | |||
41186df469 | |||
|
6f3f2ca020 | ||
|
3e7ced68a6 | ||
2639ad5f48 | |||
06e32b1486 | |||
ac6fee32f8 | |||
6a847330de | |||
52b98dcbd6 | |||
beb77e1b5b | |||
845a43ffcb | |||
4d68dfe96c | |||
6266201acb | |||
168ad51b3c | |||
0bb53d81ab | |||
5da5795994 | |||
1bd42a532d | |||
1159e29216 | |||
5a97ab3e56 | |||
a2c4511a99 | |||
8293bc1d06 | |||
c11eb9687e | |||
f69d86cacb | |||
7fe6bfa1a3 | |||
7c65d17e40 | |||
91ca339185 | |||
51941fc255 | |||
965f2fcbf5 | |||
415d15209c | |||
7e24c5714d | |||
9b3516d927 | |||
bc5e6418a3 | |||
590394f84c | |||
c231ecd204 | |||
b25a7729db | |||
a2b73e0fa2 | |||
05ee69c06f | |||
cc43cea80c | |||
9074214e33 | |||
badb0933c1 | |||
2eea419f22 | |||
63e38074a2 | |||
9433c64ed5 | |||
5ac786cc90 | |||
fe2be20ed9 | |||
86c9558384 | |||
1279d3fbb0 | |||
6f370dbbe1 | |||
903a6dee42 | |||
48b2976fbb | |||
ace6180301 | |||
26a00b5140 | |||
1f1162c164 | |||
43a792fa6c | |||
272b404ef8 | |||
6d79cd45c0 | |||
d54513373e | |||
3d2be659a5 | |||
8c35204fba | |||
1e8d2ec084 | |||
3e4b2e2ce2 | |||
ac5da65e8a | |||
6293dd2ebe | |||
b44c346193 | |||
799a30172c | |||
2e33e16365 | |||
7ebf58a58c | |||
2c4a6e45ef | |||
8f57858587 | |||
b1711b862b | |||
976ef1c9ba | |||
cc06926ffa | |||
92fb1f2386 | |||
52dd79d3a9 | |||
e7b7e56ae7 | |||
6249a348f2 | |||
17dfe871ea | |||
2d7b4cf4b3 | |||
abc0997f0c | |||
390c562a40 | |||
28cdaf7424 | |||
e57e0bce26 | |||
70a14ce4ce | |||
9d3addda9d | |||
ae16570491 | |||
9591295f32 | |||
284c3aa280 | |||
8c4782ab73 | |||
938597b845 | |||
044e9a5563 | |||
c98242e6e7 | |||
425e5dbde5 | |||
73f62b675b | |||
c29b55bb9e | |||
b70ca95660 | |||
ee5ae23821 | |||
7d7ce178dc | |||
7b282fa220 | |||
9bbeb0f8aa | |||
f4a87469b7 | |||
43d70abb6c | |||
999d717daf | |||
7c5efc0a1c | |||
|
43e92e181a | ||
e7dfbb70ea | |||
b29e6efe63 | |||
96b3aa58b2 | |||
0e7b0ef2de | |||
c8d689615d | |||
582ce51307 | |||
99eaabc838 | |||
016ac1286e | |||
|
1b9ad36c90 | ||
e085497f7d | |||
|
ed6d8e4df1 | ||
|
f9c26cc196 | ||
|
d7b5fd3edf | ||
dd45acb04d | |||
|
b8c3ad989a | ||
|
0c87120a4d | ||
|
aa89726d2c | ||
|
caf09722bf | ||
|
a7ba54cd42 | ||
|
b04dec9460 | ||
|
0456b8461a | ||
|
e00e1a9a89 | ||
7f618d11be | |||
|
a0a52c877b | ||
|
d93215a21f | ||
|
a4f77bb489 | ||
|
f73036bf6b | ||
78887f693e | |||
|
3d847ded04 | ||
|
93157ed02b | ||
43707241ee | |||
75958914eb | |||
|
2a1f56f5f5 | ||
|
eba6e8ebac | ||
|
903431b8e5 | ||
|
439dd9966b | ||
|
309cf298d6 | ||
|
e60e3fe883 | ||
|
1d2f52b1d2 | ||
3a99adf716 | |||
|
aa41c98402 | ||
|
e4b6aee5c9 | ||
|
b966b422dc | ||
|
000bf7274c | ||
|
73d96a9791 | ||
3eb5280279 | |||
|
a5c7b5897b | ||
|
a508e68057 | ||
|
6535225c2c | ||
|
1fff959fe2 | ||
|
7beea00c8b | ||
1feeb88e37 | |||
|
aea9fece30 | ||
|
30fb32194b | ||
|
850a8503c9 | ||
|
4b4218b2fc | ||
|
837b5407e7 | ||
|
98c77f09e1 | ||
d0cec13065 | |||
4afbca3c75 | |||
1246359b34 | |||
|
22f5aa8c1b | ||
|
4459c9071e | ||
|
9b17da661d | ||
|
e24b8e26b1 | ||
|
a1d44d139a | ||
|
4153716507 | ||
|
f3f8436198 | ||
|
cebf543a8b | ||
|
e7ff0493f6 | ||
|
aa442fa857 | ||
|
6297b36b38 | ||
|
3c017d9e2b | ||
|
5d83653b07 | ||
|
b44eaff64b | ||
|
5dc6a844e7 | ||
|
dd5f65567c | ||
|
142708d65a | ||
|
8453c2d7de | ||
|
f178cd2440 | ||
|
a7912f9d1c | ||
|
cfb36bf685 | ||
29dd0c5936 | |||
|
11372f8aef | ||
|
acc1528b38 | ||
|
496394108d | ||
|
62c6ac2518 | ||
ed0a2951af | |||
78a471f10d | |||
|
7a0ea81a7c | ||
|
6235c3dad9 | ||
|
e474bfeda1 | ||
|
c236a4de6f | ||
|
b932ac6c9e | ||
|
8ecb7eacbd | ||
|
5819a03a09 | ||
|
2b225c434f | ||
40a5c7eefb | |||
259d1bf7dc | |||
10ded0f9aa | |||
9be689b238 | |||
6a3660579c | |||
931cdd1a77 | |||
|
7606885fe6 | ||
8a593d47bd | |||
|
d77ba65296 | ||
|
8602a07479 | ||
|
43d1f2f5a4 | ||
|
4f78be754c | ||
|
dc61607157 | ||
|
2fe9d832d0 | ||
|
ab61d683d5 | ||
|
318d4fe7b7 | ||
|
27e4a0b9fa | ||
|
c68071d446 | ||
08895d0762 | |||
|
9d083c0c2a | ||
3f7d8cc978 | |||
|
28559eb04d | ||
|
f609702657 | ||
|
5e792d6f44 | ||
|
7e902d2224 | ||
|
aef2bdb95a | ||
7040e50c32 | |||
249d0b78ce | |||
e1631c8a1f | |||
|
2bd794b08f | ||
|
94af12bba9 | ||
17eb93d389 | |||
|
f96e60b969 | ||
|
c9d9015196 | ||
5d11005d70 | |||
39789c18fc | |||
|
8e259ec030 | ||
605c4b8e68 | |||
e80e401282 | |||
59d5b1e655 | |||
|
d3318bac1a | ||
d4b74b5b1d | |||
f045927f1f | |||
d98148c06d | |||
16c6a1cc25 | |||
8105c638f1 | |||
f8ad546f64 | |||
001ef17e87 | |||
289d8baf49 | |||
ce027a4d12 | |||
735577e345 | |||
267b322f23 | |||
53284447ca | |||
72e2793f0b | |||
25f106a1e9 | |||
76696ff044 | |||
3bf0dea2b7 | |||
060d014494 | |||
88a5852a91 | |||
4ba0f05a2d | |||
4211759a82 | |||
1d644f8516 | |||
21e640dbdc | |||
4d52aba32e | |||
c8dc1c09dd | |||
a6047aa4a0 | |||
6aea5d3382 | |||
746c793cf0 | |||
2423ff1778 | |||
f92e86141b | |||
37c8bc39c2 | |||
99b2de174d | |||
63d4d3b8f5 | |||
f7e1370320 | |||
54538a34cb | |||
1af2d45433 | |||
c414f3650b | |||
0a9dd2752b | |||
ce03428e63 | |||
052c585b0c | |||
e805608f23 | |||
d62cb24b7f | |||
531a653655 | |||
79430508f2 | |||
3ae480229c | |||
eba5397bb1 | |||
cdee826dd6 | |||
0370a27a2c | |||
beae0e8f0f | |||
00d222eecd | |||
fae1a876d0 | |||
c65db2897f | |||
8f63f84139 | |||
052812ec0a | |||
b61a1ccbe7 | |||
d2e9d35193 | |||
6744de428f | |||
d08728a6a3 | |||
9427e1cd75 | |||
f6fa2ac985 | |||
93b44957ab | |||
875b14bfa4 | |||
9f097577a1 | |||
020935811d | |||
4b3ac868f5 | |||
8a1b7bc259 | |||
5f5c338a8b | |||
19b3324f3d | |||
638f8a8230 | |||
63ba91817d | |||
942281238c | |||
4b87cb9bd4 |
167
.drone.yml
Normal file
167
.drone.yml
Normal file
|
@ -0,0 +1,167 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: debug
|
||||
|
||||
steps:
|
||||
- name: restore-cache
|
||||
image: drillster/drone-volume-cache
|
||||
settings:
|
||||
restore: true
|
||||
mount:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
|
||||
- name: fetch-tags
|
||||
image: drone/git:latest
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
- name: build
|
||||
image: git.cuernodehipnos.es/marown/android-sdk-docker:latest
|
||||
environment:
|
||||
GRADLE_USER_HOME: /drone/src/.gradle
|
||||
commands:
|
||||
# Build
|
||||
- ./gradlew buildDebug
|
||||
|
||||
- name: test
|
||||
image: git.cuernodehipnos.es/marown/android-sdk-docker:latest
|
||||
privileged: true
|
||||
environment:
|
||||
GRADLE_USER_HOME: /drone/src/.gradle
|
||||
commands:
|
||||
# Create and run emulator
|
||||
- echo "no" | avdmanager --verbose create avd --force --name "generic_34" --package "system-images;android-34;google_apis;x86_64" --tag "google_apis" --abi "x86_64"
|
||||
- emulator -avd "generic_34" -no-window -no-audio -no-boot-anim -netdelay none -no-snapshot -wipe-data -partition-size 1024 &
|
||||
# Wait for emulator to be ready
|
||||
- android-wait-for-emulator.sh
|
||||
# Run tests
|
||||
- ./gradlew connectedCheck -i
|
||||
|
||||
- name: assemble
|
||||
image: git.cuernodehipnos.es/marown/android-sdk-docker:latest
|
||||
environment:
|
||||
GRADLE_USER_HOME: /drone/src/.gradle
|
||||
commands:
|
||||
# Assemble APK
|
||||
- ./gradlew assembleDebug
|
||||
|
||||
#- name: code-analysis
|
||||
# image: drone-plugins/sonarqube-scanner:latest
|
||||
# settings:
|
||||
# sonar_host:
|
||||
# from_secret: sonar_host
|
||||
# sonar_token:
|
||||
# from_secret: sonar_token
|
||||
|
||||
- name: rebuild-cache
|
||||
image: drillster/drone-volume-cache
|
||||
settings:
|
||||
rebuild: true
|
||||
mount:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /share/CACHEDEV1_DATA/homes/admin/drone/cache
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: release
|
||||
|
||||
steps:
|
||||
- name: restore-cache
|
||||
image: drillster/drone-volume-cache
|
||||
settings:
|
||||
restore: true
|
||||
mount:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
|
||||
- name: fetch-tags
|
||||
image: drone/git:latest
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
- name: build
|
||||
image: git.cuernodehipnos.es/marown/android-sdk-docker:latest
|
||||
environment:
|
||||
GRADLE_USER_HOME: /drone/src/.gradle
|
||||
commands:
|
||||
# Build
|
||||
- ./gradlew buildRelease
|
||||
|
||||
- name: assemble
|
||||
image: git.cuernodehipnos.es/marown/android-sdk-docker:latest
|
||||
environment:
|
||||
GRADLE_USER_HOME: /drone/src/.gradle
|
||||
RELEASE_KEY_ALIAS:
|
||||
from_secret: release_key_alias
|
||||
RELEASE_KEY_PASSWORD:
|
||||
from_secret: release_key_password
|
||||
RELEASE_KEYSTORE_BASE64:
|
||||
from_secret: release_keystore_base64
|
||||
RELEASE_STORE_FILE:
|
||||
from_secret: release_store_file
|
||||
RELEASE_STORE_PASSWORD:
|
||||
from_secret: release_store_password
|
||||
commands:
|
||||
# Encrypt keystore & set $RELEASE_KEYSTORE_BASE64 environment variable in Drone CI
|
||||
# - openssl base64 -A -in keystore.jks
|
||||
# Decrypt keystore
|
||||
- echo $RELEASE_KEYSTORE_BASE64 | base64 -d > SWADroid/keystore.jks
|
||||
# Assemble APK
|
||||
- ./gradlew assembleRelease
|
||||
|
||||
- name: gitea-release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: gitea_api_key
|
||||
base_url: https://git.cuernodehipnos.es
|
||||
files:
|
||||
- SWADroid/build/outputs/apk/release/SWADroid-release.apk
|
||||
- SWADroid/build/outputs/apk/release/SWADroid-release.apk.idsig
|
||||
checksum:
|
||||
- md5
|
||||
- sha1
|
||||
- sha256
|
||||
- sha512
|
||||
- adler32
|
||||
- crc32
|
||||
|
||||
- name: rebuild-cache
|
||||
image: drillster/drone-volume-cache
|
||||
settings:
|
||||
rebuild: true
|
||||
mount:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /share/CACHEDEV1_DATA/homes/admin/drone/cache
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
46
.gitea/CODE_OF_CONDUCT.md
Normal file
46
.gitea/CODE_OF_CONDUCT.md
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at swadroid@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
13
.gitea/CONTRIBUTING.md
Normal file
13
.gitea/CONTRIBUTING.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
## Contributing to SWADroid
|
||||
|
||||
*Before opening a pull request*, consider:
|
||||
|
||||
- Is the change important and ready enough to ask the community to spend time reviewing?
|
||||
- Have you searched for existing, related Gitea issues and pull requests?
|
||||
- Is the change being proposed clearly explained and motivated?
|
||||
|
||||
When you contribute code, you affirm that the contribution is your original work and that you
|
||||
license the work to the project under the project's open source license. Whether or not you
|
||||
state this explicitly, by submitting any copyrighted material via pull request, email, or
|
||||
other means you agree to license the material under the project's open source license and
|
||||
warrant that you have the legal authority to do so.
|
29
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
29
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. Google Pixel 2 XL]
|
||||
- OS: [e.g. Android 12 (S)]
|
||||
- Version: [e.g. 1.5.8]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
17
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
17
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
10
.gitea/PULL_REQUEST_TEMPLATE.md
Normal file
10
.gitea/PULL_REQUEST_TEMPLATE.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
## What changes were proposed in this pull request?
|
||||
|
||||
(Please fill in changes proposed in this fix)
|
||||
|
||||
## How was this patch tested?
|
||||
|
||||
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
|
||||
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
|
||||
|
||||
Please review https://git.cuernodehipnos.es/Marown/SWADroid/src/branch/main/.gitea/CONTRIBUTING.md before opening a pull request.
|
8
.gitea/dependabot.yml
Normal file
8
.gitea/dependabot.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 10
|
66
.gitignore
vendored
66
.gitignore
vendored
|
@ -1,9 +1,59 @@
|
|||
.idea
|
||||
.gradle
|
||||
gradle
|
||||
build
|
||||
gradlew
|
||||
gradlew.bat
|
||||
import-summary.txt
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
app/lint.xml
|
||||
keystore.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
# google-services.json
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
# lint/reports/
|
||||
/SWADroid/src/debug/
|
||||
/SWADroid/release/
|
||||
|
|
100
README.md
100
README.md
|
@ -1,84 +1,58 @@
|
|||
# SWADroid
|
||||
SWADroid
|
||||
========
|
||||
|
||||
Android client for e-learning platform [![SWADroid](https://openswad.org/logo/swad84x24.png "OpenSWAD")][swad]
|
||||
Android client for e-learning platform [![SWADroid](https://openswad.org/logo/swad84x24.png)](http://openswad.org/)
|
||||
|
||||
[![SWADroid](http://developer.android.com/images/brand/en_generic_rgb_wo_45.png "Install from Google Play")][apk]
|
||||
[![SWADroid](http://developer.android.com/images/brand/en_generic_rgb_wo_45.png)](https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid)
|
||||
|
||||
* Code: `git clone https://github.com/Amab/SWADroid.git`
|
||||
* Issue tracker: <https://github.com/Amab/SWADroid/issues>
|
||||
[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/c/c8/Farm-Fresh_twitter_1.png)](http://twitter.com/SWADroid)[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/4/4d/Farm-Fresh_facebook.png)](https://www.facebook.com/SWADroid)[![SWADroid](https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Telegram_Messenger.png/35px-Telegram_Messenger.png?uselang=es)](https://telegram.me/swadroid)[![SWADroid](https://s.w.org/about/images/logos/wordpress-logo-32-blue.png)](http://swadroid.wordpress.com)
|
||||
|
||||
[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/c/c8/Farm-Fresh_twitter_1.png "SWADroid on Twitter")][Twitter]
|
||||
[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/4/4d/Farm-Fresh_facebook.png "SWADroid on Facebook")][Facebook]
|
||||
[![SWADroid](http://upload.wikimedia.org/wikipedia/commons/b/ba/Google_plus_32.png "SWADroid on Google+")][Google+]
|
||||
[![SWADroid](https://s.w.org/about/images/logos/wordpress-logo-32-blue.png "SWADroid on Wordpress")][Wordpress]
|
||||
|
||||
|
||||
## Copyright and License
|
||||
Copyright and License
|
||||
---------------------
|
||||
|
||||
Copyright (C) 2010, Juan Miguel Boyero Corral
|
||||
|
||||
[![Copyright and License](http://www.gnu.org/graphics/gplv3-88x31.png)][gplv3]
|
||||
SWADroid client is free software; you can redistribute it and/or modify
|
||||
it under the same terms as [GPLv3][gplv3] license.
|
||||
[![Copyright and License](https://img.shields.io/badge/license-GPLv3-green.svg?style=flat)](http://www.gnu.org/licenses/gpl.html) SWADroid client is free software; you can redistribute it and/or modify it under the same terms as [GPLv3](http://www.gnu.org/licenses/gpl.html) license.
|
||||
|
||||
[![Copyright and License](http://www.gnu.org/graphics/lgplv3-88x31.png)][lgplv3]
|
||||
SWADroid uses [Android DataFrameWork][androiddataframework-library] library developed by [Javier Pérez Pacheco][androiddataframework-author] and licensed under [LGPLv3][lgplv3].
|
||||
[![Copyright and License](https://img.shields.io/badge/license-LGPLv3-green.svg?style=flat)](http://www.gnu.org/licenses/lgpl.html) SWADroid uses [Android DataFrameWork](http://code.google.com/p/androiddataframework/) library developed by Javier Pérez Pacheco and licensed under [LGPLv3](http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
[![Copyright and License](http://upload.wikimedia.org/wikipedia/commons/8/83/License_icon-mit.png)][mit]
|
||||
SWADroid uses [ksoap2-android][ksoap2-library] library developed by [Manfred Moser][ksoap2-author] and licensed under [MIT][mit].
|
||||
[![Copyright and License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](http://www.opensource.org/licenses/mit-license.php) SWADroid uses [ksoap2-android](https://github.com/simpligility/ksoap2-android) library developed by [Manfred Moser](https://github.com/mosabua) and licensed under [MIT](http://www.opensource.org/licenses/mit-license.php).
|
||||
|
||||
[![Copyright and License](http://www.apache.org/images/asf_logo_simple.png)][apache2]
|
||||
SWADroid uses [ZXing][zxing-library] library developed by [Sean Owen][zxing-author] and licensed under [Apache License 2.0][apache2].
|
||||
[![Copyright and License](https://img.shields.io/badge/license-Apache%202-green.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) SWADroid uses [ZXing Android Embedded](https://github.com/journeyapps/zxing-android-embedded) library developed by [journeyapps](https://github.com/journeyapps) and licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
[![Copyright and License](http://www.apache.org/images/asf_logo_simple.png)][apache2]
|
||||
SWADroid uses [Universal Image Loader][universal-image-loader-library] library developed by [Sergey Tarasevich][universal-image-loader-author] and licensed under [Apache License 2.0][apache2].
|
||||
[![Copyright and License](https://img.shields.io/badge/license-Apache%202-green.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) SWADroid uses [Universal Image Loader](https://github.com/nostra13/Android-Universal-Image-Loader) library developed by [Sergey Tarasevich](https://github.com/nostra13) and licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
[![Copyright and License](http://www.apache.org/images/asf_logo_simple.png)][apache2]
|
||||
SWADroid uses [MathJax][mathjax] library developed by The MathJax Team and licensed under [Apache License 2.0][apache2].
|
||||
[![Copyright and License](https://img.shields.io/badge/license-Apache%202-green.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) SWADroid uses [MathJax](https://www.mathjax.org/) library developed by The MathJax Team and licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
## Author
|
||||
[![Copyright and License](https://img.shields.io/badge/license-Apache%202-green.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) SWADroid uses [GSon](https://github.com/google/gson) library developed by Google and licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
* [Juan Miguel Boyero Corral][urlJuanMiguel]
|
||||
Author
|
||||
------
|
||||
|
||||
## Contributors
|
||||
- [Juan Miguel Boyero Corral](http://www.linkedin.com/pub/juan-miguel-boyero-corral/27/362/163)
|
||||
|
||||
* [Antonio Cañas Vargas][urlAntonioCanas]
|
||||
* [Helena Rodríguez Gijón][urlHelena]
|
||||
* [Antonio Aguilera Malagón][urlAntonioAguilera]
|
||||
* [José Antonio Guerrero Avilés][urlJose]
|
||||
* [Alejandro Alcalde][urlAlex]
|
||||
Contributors
|
||||
------------
|
||||
|
||||
## Contributing
|
||||
- [Antonio Cañas Vargas](http://www.ugr.es/~acanas/)
|
||||
- [Helena Rodríguez Gijón](http://prezi.com/user/7ofwrjzwrfsq/)
|
||||
- [Antonio Aguilera Malagón](http://www.slideshare.net/antonioaguileramalagon)
|
||||
- [José Antonio Guerrero Avilés](http://www.linkedin.com/in/antonioguerreroaviles)
|
||||
- [Alejandro Alcalde](http://elbauldelprogramador.com/)
|
||||
- [Rubén Martín Hidalgo](https://github.com/romilgildo)
|
||||
- [Javier Bueno López](https://github.com/JaviBL8)
|
||||
|
||||
SWADroid is an open source project. I encourage contributions.
|
||||
Contributing
|
||||
------------
|
||||
|
||||
The Github team has also been kind enough to write up some great [documentation][doc_contrib] on working with pull requests. Contributions should be performed on [topic branches][topic_br] in your personal forks - just issue your pull requests from there.
|
||||
SWADroid is an open source project. I encourage contributions.
|
||||
|
||||
### Notice
|
||||
|
||||
[swad]: http://openswad.org/
|
||||
[gplv3]: http://www.gnu.org/licenses/gpl.html
|
||||
[lgplv3]: http://www.gnu.org/licenses/lgpl.html
|
||||
[mit]: http://www.opensource.org/licenses/mit-license.php
|
||||
[doc_contrib]: http://help.github.com/pull-requests/
|
||||
[topic_br]: http://progit.org/book/ch3-4.html
|
||||
[ksoap2-library]: http://code.google.com/p/ksoap2-android
|
||||
[ksoap2-author]: https://github.com/mosabua
|
||||
[androiddataframework-library]: http://code.google.com/p/androiddataframework/
|
||||
[androiddataframework-author]: http://www.javielinux.com/quiensoy.php
|
||||
[zxing-library]: http://code.google.com/p/zxing/
|
||||
[zxing-author]: https://github.com/srowen
|
||||
[universal-image-loader-library]: https://github.com/nostra13/Android-Universal-Image-Loader
|
||||
[universal-image-loader-author]: https://github.com/nostra13
|
||||
[mathjax]: https://www.mathjax.org/
|
||||
[apache2]: http://www.apache.org/licenses/LICENSE-2.0
|
||||
[apk]: https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid
|
||||
[urlJuanMiguel]: http://www.linkedin.com/pub/juan-miguel-boyero-corral/27/362/163 "LinkedIn profile"
|
||||
[urlAntonioCanas]: http://www.ugr.es/~acanas/ "Personal web"
|
||||
[urlHelena]: http://prezi.com/user/7ofwrjzwrfsq/ "Prezi profile"
|
||||
[urlAntonioAguilera]: http://www.slideshare.net/antonioaguileramalagon "Slideshare profile"
|
||||
[urlJose]: http://www.linkedin.com/in/antonioguerreroaviles "LinkedIn profile"
|
||||
[urlAlex]: http://elbauldelprogramador.com/ "Personal blog"
|
||||
[Twitter]: http://twitter.com/SWADroid
|
||||
[Facebook]: https://www.facebook.com/SWADroid
|
||||
[Google+]: https://plus.google.com/115615684349730524355/posts
|
||||
[Wordpress]: http://swadroid.wordpress.com
|
||||
Requests to the SWAD web service require an API key. This API key has not been uploaded to the repository for security reasons.
|
||||
|
||||
The `keystore.properties` file must be created in the root of the project, at the same level as this `README.md` file, with the following format:
|
||||
|
||||
`SWAD_APP_KEY=ExampleAPIKey`
|
||||
|
||||
If you want to collaborate with the SWADroid project you can request the API key by sending a request to [Contact Support](mailto:swadroid.gmail.com).
|
||||
|
|
19
SWADroid.iml
19
SWADroid.iml
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="SWADroid" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="java-gradle" name="Java-Gradle">
|
||||
<configuration>
|
||||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
|
||||
<option name="BUILDABLE" value="false" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
103
SWADroid/build.gradle
Normal file
103
SWADroid/build.gradle
Normal file
|
@ -0,0 +1,103 @@
|
|||
import io.github.reactivecircus.appversioning.SemVer
|
||||
|
||||
plugins {
|
||||
id("io.github.reactivecircus.app-versioning") version "1.3.1"
|
||||
}
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
//return a BuildConfigField from a properties file.
|
||||
def static getBuildConfigField(String property){
|
||||
def propFile = new File("keystore.properties")
|
||||
def value
|
||||
|
||||
if(propFile.exists()) {
|
||||
Properties properties = new Properties()
|
||||
properties.load(new FileInputStream(propFile))
|
||||
value = "\"" + properties.getProperty(property) + "\""
|
||||
} else {
|
||||
value = "\"" + System.getenv(property) + "\""
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
appVersioning {
|
||||
overrideVersionCode { gitTag, providers, variantInfo ->
|
||||
//SemVer-based version code
|
||||
def semVer = SemVer.fromGitTag(gitTag)
|
||||
semVer.major * 1000000 + semVer.minor * 1000 + semVer.patch
|
||||
|
||||
//Timestamp-based version code
|
||||
//Instant.now().epochSecond.toInt()
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'es.ugr.swad.swadroid'
|
||||
compileSdk 34
|
||||
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "es.ugr.swad.swadroid"
|
||||
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 34
|
||||
|
||||
testApplicationId "es.ugr.swad.swadroid.test"
|
||||
testInstrumentationRunner "android.test.InstrumentationTestRunner"
|
||||
|
||||
buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
|
||||
}
|
||||
|
||||
def RELEASE_STORE_FILE = System.getenv("RELEASE_STORE_FILE")
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
|
||||
if (RELEASE_STORE_FILE) {
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file(RELEASE_STORE_FILE)
|
||||
storePassword System.getenv("RELEASE_STORE_PASSWORD")
|
||||
keyAlias System.getenv("RELEASE_KEY_ALIAS")
|
||||
keyPassword System.getenv("RELEASE_KEY_PASSWORD")
|
||||
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
|
||||
enableV3Signing = true
|
||||
enableV4Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RELEASE_STORE_FILE) {
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
} else {
|
||||
project.logger.warn("RELEASE_STORE_FILE is not defined. Skipping signing step")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
|
||||
implementation 'commons-io:commons-io:2.11.0'
|
||||
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
||||
implementation 'com.google.zxing:core:3.5.2'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
}
|
17
SWADroid/lint.xml
Normal file
17
SWADroid/lint.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<lint>
|
||||
<issue id="BackButton" severity="warning" />
|
||||
<issue id="EasterEgg" severity="warning" />
|
||||
<issue id="FieldGetter" severity="warning" />
|
||||
<issue id="GradleDynamicVersion" severity="warning" />
|
||||
<issue id="IconExpectedSize" severity="warning" />
|
||||
<issue id="NewerVersionAvailable" severity="warning" />
|
||||
<issue id="RtlCompat" severity="error" />
|
||||
<issue id="RtlEnabled" severity="warning" />
|
||||
<issue id="RtlHardcoded" severity="warning" />
|
||||
<issue id="RtlSymmetry" severity="error" />
|
||||
<issue id="SelectableText" severity="warning" />
|
||||
<issue id="StopShip" severity="warning" />
|
||||
<issue id="TypographyQuotes" severity="warning" />
|
||||
<issue id="UnusedIds" severity="warning" />
|
||||
</lint>
|
|
@ -1,21 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="es.ugr.swad.swadroid"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="70"
|
||||
android:versionName="1.3" >
|
||||
android:installLocation="auto" >
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" android:maxSdkVersion="22"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" android:maxSdkVersion="22"/>
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" android:maxSdkVersion="22"/>
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" android:maxSdkVersion="22" />
|
||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.touchscreen"
|
||||
|
@ -38,16 +43,15 @@
|
|||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:fullBackupOnly="true"
|
||||
android:icon="@drawable/ic_launcher_swadroid"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:hardwareAccelerated="true">
|
||||
<meta-data android:name="com.google.android.gms.version"
|
||||
android:value="@integer/google_play_services_version" />
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.SWADMain"
|
||||
android:icon="@drawable/ic_launcher_swadroid"
|
||||
android:label="@string/app_name" >
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -55,15 +59,15 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.PreferencesActivity"
|
||||
android:name=".preferences.PreferencesActivity"
|
||||
android:label="@string/set_preferences" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.RecoverPassword"
|
||||
android:name=".modules.password.RecoverPassword"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.Login"
|
||||
android:name=".modules.login.Login"
|
||||
android:label="@string/loginModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
|
@ -103,30 +107,25 @@
|
|||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.Groups"
|
||||
android:name=".modules.rollcall.ContinuousCaptureActivity"
|
||||
android:label="@string/rollcallModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.groups.Groups"
|
||||
android:label="@string/myGroupsModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.google.zxing.client.android.CaptureActivity"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" >
|
||||
<intent-filter>
|
||||
<action android:name="es.ugr.swad.swadroid.android.SCAN" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.Courses"
|
||||
android:name=".modules.courses.Courses"
|
||||
android:label="@string/coursesModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.notifications.Notifications"
|
||||
android:label="@string/notificationsModuleLabel"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain"
|
||||
android:exported="true">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
|
@ -171,7 +170,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.messages.Messages"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:label="@string/messagesModuleLabel"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
|
@ -180,19 +179,16 @@
|
|||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.messages.FilterUsersList"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:name="es.ugr.swad.swadroid.modules.messages.SearchUsers"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:label="@string/filterUsersListModuleLabel">
|
||||
android:parentActivityName="es.ugr.swad.swadroid.modules.messages.Messages" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.modules.messages.Messages" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.messages.UsersList"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:label="@string/messagesModuleLabel">
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.Notices"
|
||||
android:name=".modules.notices.Notices"
|
||||
android:label="@string/noticesModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
|
@ -232,7 +228,7 @@
|
|||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.GroupTypes"
|
||||
android:name=".modules.groups.GroupTypes"
|
||||
android:label="@string/groupTypesModuleLabel"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
|
@ -242,13 +238,53 @@
|
|||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.GenerateQR"
|
||||
android:name=".modules.qr.GenerateQR"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.indoorlocation.IndoorLocation"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.indoorlocation.GetLocation"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.indoorlocation.GetLastLocation"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.indoorlocation.SendCurrentLocation"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".modules.indoorlocation.GetAvailableRoles"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.modules.information.Information"
|
||||
android:configChanges="orientation|screenSize"
|
||||
|
@ -279,7 +315,7 @@
|
|||
android:configChanges="orientation|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:label="@string/createAccountModuleLabel"
|
||||
android:parentActivityName="es.ugr.swad.swadroid.LoginActivity" >
|
||||
android:parentActivityName=".modules.login.LoginActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="es.ugr.swad.swadroid.SWADMain" />
|
||||
|
@ -295,7 +331,7 @@
|
|||
android:theme="@style/Theme.AppCompat.Translucent" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="es.ugr.swad.swadroid.LoginActivity"
|
||||
android:name=".modules.login.LoginActivity"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
android:label="@string/title_activity_login"
|
||||
android:windowSoftInputMode="adjustResize|stateVisible" >
|
||||
|
@ -305,11 +341,12 @@
|
|||
android:name="es.ugr.swad.swadroid.sync.DummyProvider"
|
||||
android:authorities="es.ugr.swad.swadroid.content"
|
||||
android:label="SWADroid"
|
||||
android:syncable="true" />
|
||||
android:syncable="true"
|
||||
android:exported="false" />
|
||||
|
||||
<service
|
||||
android:name="es.ugr.swad.swadroid.sync.AccountAuthenticatorService"
|
||||
android:exported="true" >
|
||||
android:exported="false" >
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
|
@ -320,7 +357,8 @@
|
|||
</service>
|
||||
<service
|
||||
android:name="es.ugr.swad.swadroid.modules.notifications.NotificationsSyncAdapterService"
|
||||
android:exported="true" >
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" >
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter" />
|
||||
</intent-filter>
|
||||
|
@ -329,6 +367,36 @@
|
|||
android:name="android.content.SyncAdapter"
|
||||
android:resource="@xml/sync_notifications" />
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name="es.ugr.swad.swadroid.modules.notifications.RestarterNotificationsReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.REBOOT" />
|
||||
<action android:name="android.intent.action.SCREEN_ON" />
|
||||
<action android:name="android.intent.action.SCREEN_OFF" />
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
<action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
|
||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||
<action android:name="android.intent.action.PACKAGE_RESTARTED" />
|
||||
<action android:name="android.intent.action.MY_PACKAGE_SUSPENDED" />
|
||||
<action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
|
||||
<action android:name="android.intent.action.PACKAGE_REMOVED" />
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="es.ugr.swad.swadroid.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
SWADroid/src/main/assets/fonts/fontawesome-webfont.ttf
Normal file
BIN
SWADroid/src/main/assets/fonts/fontawesome-webfont.ttf
Normal file
Binary file not shown.
15
SWADroid/src/main/assets/mathjax/conf.js
Normal file
15
SWADroid/src/main/assets/mathjax/conf.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
window.MathJax = {
|
||||
options: {
|
||||
enableMenu: false,
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
tex: {
|
||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
||||
processEscapes: true,
|
||||
packages: ['base', 'ams', 'noerrors', 'noundefined']
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/noerrors']
|
||||
}
|
||||
};
|
1
SWADroid/src/main/assets/mathjax/core.js
Normal file
1
SWADroid/src/main/assets/mathjax/core.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,o={669:function(t,a,o){Object.defineProperty(a,"__esModule",{value:!0}),a.ActionConfiguration=a.ActionMethods=void 0;var e=o(251),n=o(193),i=o(871),r=o(360);a.ActionMethods={},a.ActionMethods.Macro=r.default.Macro,a.ActionMethods.Toggle=function(t,a){for(var o,e=[];"\\endtoggle"!==(o=t.GetArgument(a));)e.push(new n.default(o,t.stack.env,t.configuration).mml());t.Push(t.create("node","maction",e,{actiontype:"toggle"}))},a.ActionMethods.Mathtip=function(t,a){var o=t.ParseArg(a),e=t.ParseArg(a);t.Push(t.create("node","maction",[o,e],{actiontype:"tooltip"}))},new i.CommandMap("action-macros",{toggle:"Toggle",mathtip:"Mathtip",texttip:["Macro","\\mathtip{#1}{\\text{#2}}",2]},a.ActionMethods),a.ActionConfiguration=e.Configuration.create("action",{handler:{macro:["action-macros"]}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},193:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.TexParser.default},360:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.base.BaseMethods.default}},e={};function n(t){var a=e[t];if(void 0!==a)return a.exports;var i=e[t]={exports:{}};return o[t](i,i.exports,n),i.exports}t=n(955),a=n(669),(0,t.r8)({_:{input:{tex:{action:{ActionConfiguration:a}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,e={133:function(t,a,e){Object.defineProperty(a,"__esModule",{value:!0}),a.BboxConfiguration=a.BboxMethods=void 0;var o=e(251),n=e(871),i=e(402);a.BboxMethods={},a.BboxMethods.BBox=function(t,a){for(var e,o,n,u=t.GetBrackets(a,""),l=t.ParseArg(a),x=u.split(/,/),M=0,c=x.length;M<c;M++){var s=x[M].trim(),f=s.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);if(f){if(e)throw new i.default("MultipleBBoxProperty","%1 specified twice in %2","Padding",a);var d=p(f[1]+f[3]);d&&(e={height:"+"+d,depth:"+"+d,lspace:d,width:"+"+2*parseInt(f[1],10)+f[3]})}else if(s.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)){if(o)throw new i.default("MultipleBBoxProperty","%1 specified twice in %2","Background",a);o=s}else if(s.match(/^[-a-z]+:/i)){if(n)throw new i.default("MultipleBBoxProperty","%1 specified twice in %2","Style",a);n=r(s)}else if(""!==s)throw new i.default("InvalidBBoxProperty",'"%1" doesn\'t look like a color, a padding dimension, or a style',s)}e&&(l=t.create("node","mpadded",[l],e)),(o||n)&&(e={},o&&Object.assign(e,{mathbackground:o}),n&&Object.assign(e,{style:n}),l=t.create("node","mstyle",[l],e)),t.Push(l)};var r=function(t){return t},p=function(t){return t};new n.CommandMap("bbox",{bbox:"BBox"},a.BboxMethods),a.BboxConfiguration=o.Configuration.create("bbox",{handler:{macro:["bbox"]}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.TexError.default}},o={};function n(t){var a=o[t];if(void 0!==a)return a.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}t=n(955),a=n(133),(0,t.r8)({_:{input:{tex:{bbox:{BboxConfiguration:a}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,o={986:function(t,a,o){var e=this&&this.__values||function(t){var a="function"==typeof Symbol&&Symbol.iterator,o=a&&t[a],e=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(a,"__esModule",{value:!0}),a.BoldsymbolConfiguration=a.rewriteBoldTokens=a.createBoldToken=a.BoldsymbolMethods=void 0;var n=o(251),r=o(748),i=o(108),l=o(871),s=o(348),u={};function d(t,a,o,e){var n=s.NodeFactory.createToken(t,a,o,e);return"mtext"!==a&&t.configuration.parser.stack.env.boldsymbol&&(r.default.setProperty(n,"fixBold",!0),t.configuration.addNode("fixBold",n)),n}function x(t){var a,o;try{for(var n=e(t.data.getList("fixBold")),l=n.next();!l.done;l=n.next()){var s=l.value;if(r.default.getProperty(s,"fixBold")){var d=r.default.getAttribute(s,"mathvariant");null==d?r.default.setAttribute(s,"mathvariant",i.TexConstant.Variant.BOLD):r.default.setAttribute(s,"mathvariant",u[d]||d),r.default.removeProperties(s,"fixBold")}}}catch(t){a={error:t}}finally{try{l&&!l.done&&(o=n.return)&&o.call(n)}finally{if(a)throw a.error}}}u[i.TexConstant.Variant.NORMAL]=i.TexConstant.Variant.BOLD,u[i.TexConstant.Variant.ITALIC]=i.TexConstant.Variant.BOLDITALIC,u[i.TexConstant.Variant.FRAKTUR]=i.TexConstant.Variant.BOLDFRAKTUR,u[i.TexConstant.Variant.SCRIPT]=i.TexConstant.Variant.BOLDSCRIPT,u[i.TexConstant.Variant.SANSSERIF]=i.TexConstant.Variant.BOLDSANSSERIF,u["-tex-calligraphic"]="-tex-bold-calligraphic",u["-tex-oldstyle"]="-tex-bold-oldstyle",u["-tex-mathit"]=i.TexConstant.Variant.BOLDITALIC,a.BoldsymbolMethods={},a.BoldsymbolMethods.Boldsymbol=function(t,a){var o=t.stack.env.boldsymbol;t.stack.env.boldsymbol=!0;var e=t.ParseArg(a);t.stack.env.boldsymbol=o,t.Push(e)},new l.CommandMap("boldsymbol",{boldsymbol:"Boldsymbol"},a.BoldsymbolMethods),a.createBoldToken=d,a.rewriteBoldTokens=x,a.BoldsymbolConfiguration=n.Configuration.create("boldsymbol",{handler:{macro:["boldsymbol"]},nodes:{token:d},postprocessors:[x]})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},348:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.NodeFactory=MathJax._.input.tex.NodeFactory.NodeFactory},748:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.NodeUtil.default},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.TexConstant=MathJax._.input.tex.TexConstants.TexConstant}},e={};function n(t){var a=e[t];if(void 0!==a)return a.exports;var r=e[t]={exports:{}};return o[t].call(r.exports,r,r.exports,n),r.exports}t=n(955),a=n(986),(0,t.r8)({_:{input:{tex:{boldsymbol:{BoldsymbolConfiguration:a}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,e={774:function(t,a,e){Object.defineProperty(a,"__esModule",{value:!0}),a.CancelConfiguration=a.CancelMethods=void 0;var n=e(251),o=e(108),i=e(871),c=e(398),r=e(975);a.CancelMethods={},a.CancelMethods.Cancel=function(t,a,e){var n=t.GetBrackets(a,""),o=t.ParseArg(a),i=c.default.keyvalOptions(n,r.ENCLOSE_OPTIONS);i.notation=e,t.Push(t.create("node","menclose",[o],i))},a.CancelMethods.CancelTo=function(t,a){var e=t.GetBrackets(a,""),n=t.ParseArg(a),i=t.ParseArg(a),l=c.default.keyvalOptions(e,r.ENCLOSE_OPTIONS);l.notation=[o.TexConstant.Notation.UPDIAGONALSTRIKE,o.TexConstant.Notation.UPDIAGONALARROW,o.TexConstant.Notation.NORTHEASTARROW].join(" "),n=t.create("node","mpadded",[n],{depth:"-.1em",height:"+.1em",voffset:".1em"}),t.Push(t.create("node","msup",[t.create("node","menclose",[i],l),n]))},new i.CommandMap("cancel",{cancel:["Cancel",o.TexConstant.Notation.UPDIAGONALSTRIKE],bcancel:["Cancel",o.TexConstant.Notation.DOWNDIAGONALSTRIKE],xcancel:["Cancel",o.TexConstant.Notation.UPDIAGONALSTRIKE+" "+o.TexConstant.Notation.DOWNDIAGONALSTRIKE],cancelto:"CancelTo"},a.CancelMethods),a.CancelConfiguration=n.Configuration.create("cancel",{handler:{macro:["cancel"]}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.ParseUtil.default},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.TexConstant=MathJax._.input.tex.TexConstants.TexConstant},975:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.ENCLOSE_OPTIONS=MathJax._.input.tex.enclose.EncloseConfiguration.ENCLOSE_OPTIONS,a.EncloseMethods=MathJax._.input.tex.enclose.EncloseConfiguration.EncloseMethods,a.EncloseConfiguration=MathJax._.input.tex.enclose.EncloseConfiguration.EncloseConfiguration}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}t=o(955),a=o(774),(0,t.r8)({_:{input:{tex:{cancel:{CancelConfiguration:a}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var e,t,a={286:function(e,t,a){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],n=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CenternotConfiguration=t.filterCenterOver=void 0;var r=a(251),o=a(193),i=a(748),u=a(871),l=a(360);function p(e){var t,a,r=e.data;try{for(var o=n(r.getList("centerOver")),u=o.next();!u.done;u=o.next()){var l=u.value,p=i.default.getTexClass(l.childNodes[0].childNodes[0]);null!==p&&i.default.setProperties(l.parent.parent.parent.parent.parent.parent,{texClass:p})}}catch(e){t={error:e}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(t)throw t.error}}}new u.CommandMap("centernot",{centerOver:"CenterOver",centernot:["Macro","\\centerOver{#1}{{\u29f8}}",1]},{CenterOver:function(e,t){var a="{"+e.GetArgument(t)+"}",n=e.ParseArg(t),r=new o.default(a,e.stack.env,e.configuration).mml(),i=e.create("node","TeXAtom",[new o.default(a,e.stack.env,e.configuration).mml(),e.create("node","mpadded",[e.create("node","mpadded",[n],{width:0,lspace:"-.5width"}),e.create("node","mphantom",[r])],{width:0,lspace:"-.5width"})]);e.configuration.addNode("centerOver",r),e.Push(i)},Macro:l.default.Macro}),t.filterCenterOver=p,t.CenternotConfiguration=r.Configuration.create("centernot",{handler:{macro:["centernot"]},postprocessors:[p]})},955:function(e,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.NodeUtil.default},871:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},193:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.TexParser.default},360:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.base.BaseMethods.default}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return a[e].call(o.exports,o,o.exports,r),o.exports}e=r(955),t=r(286),(0,e.r8)({_:{input:{tex:{centernot:{CenternotConfiguration:t}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var o,a,t={888:function(o,a,t){Object.defineProperty(a,"__esModule",{value:!0}),a.ColorConfiguration=a.ColorV2Methods=void 0;var n=t(871),e=t(251);a.ColorV2Methods={Color:function(o,a){var t=o.GetArgument(a),n=o.stack.env.color;o.stack.env.color=t;var e=o.ParseArg(a);n?o.stack.env.color=n:delete o.stack.env.color;var r=o.create("node","mstyle",[e],{mathcolor:t});o.Push(r)}},new n.CommandMap("colorv2",{color:"Color"},a.ColorV2Methods),a.ColorConfiguration=e.Configuration.create("colorv2",{handler:{macro:["colorv2"]}})},955:function(o,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap}},n={};function e(o){var a=n[o];if(void 0!==a)return a.exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}o=e(955),a=e(888),(0,o.r8)({_:{input:{tex:{colorv2:{ColorV2Configuration:a}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,e={359:function(t,a,e){var n,o=this&&this.__values||function(t){var a="function"==typeof Symbol&&Symbol.iterator,e=a&&t[a],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(a,"__esModule",{value:!0}),a.ConfigMacrosConfiguration=void 0;var i=e(251),r=e(74),p=e(871),l=e(945),s=e(924),u=e(432),c=e(975),M="configmacros-map",f="configmacros-env-map";a.ConfigMacrosConfiguration=i.Configuration.create("configmacros",{init:function(t){new p.CommandMap(M,{},{}),new p.EnvironmentMap(f,l.default.environment,{},{}),t.append(i.Configuration.local({handler:{macro:[M],environment:[f]},priority:3}))},config:function(t,a){!function(t){var a,e,n=t.parseOptions.handlers.retrieve(M),i=t.parseOptions.options.macros;try{for(var r=o(Object.keys(i)),p=r.next();!p.done;p=r.next()){var l=p.value,c="string"==typeof i[l]?[i[l]]:i[l],f=Array.isArray(c[2])?new s.Macro(l,u.default.MacroWithTemplate,c.slice(0,2).concat(c[2])):new s.Macro(l,u.default.Macro,c);n.add(l,f)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(e=r.return)&&e.call(r)}finally{if(a)throw a.error}}}(a),function(t){var a,e,n=t.parseOptions.handlers.retrieve(f),i=t.parseOptions.options.environments;try{for(var r=o(Object.keys(i)),p=r.next();!p.done;p=r.next()){var l=p.value;n.add(l,new s.Macro(l,u.default.BeginEnv,[!0].concat(i[l])))}}catch(t){a={error:t}}finally{try{p&&!p.done&&(e=r.return)&&e.call(r)}finally{if(a)throw a.error}}}(a)},items:(n={},n[c.BeginEnvItem.prototype.kind]=c.BeginEnvItem,n),options:{macros:r.expandable({}),environments:r.expandable({})}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},74:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.isObject=MathJax._.util.Options.isObject,a.APPEND=MathJax._.util.Options.APPEND,a.REMOVE=MathJax._.util.Options.REMOVE,a.OPTIONS=MathJax._.util.Options.OPTIONS,a.Expandable=MathJax._.util.Options.Expandable,a.expandable=MathJax._.util.Options.expandable,a.makeArray=MathJax._.util.Options.makeArray,a.keys=MathJax._.util.Options.keys,a.copy=MathJax._.util.Options.copy,a.insert=MathJax._.util.Options.insert,a.defaultOptions=MathJax._.util.Options.defaultOptions,a.userOptions=MathJax._.util.Options.userOptions,a.selectOptions=MathJax._.util.Options.selectOptions,a.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,a.separateOptions=MathJax._.util.Options.separateOptions,a.lookup=MathJax._.util.Options.lookup},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},945:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.ParseMethods.default},924:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Symbol=MathJax._.input.tex.Symbol.Symbol,a.Macro=MathJax._.input.tex.Symbol.Macro},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},975:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.BeginEnvItem=MathJax._.input.tex.newcommand.NewcommandItems.BeginEnvItem},432:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.newcommand.NewcommandMethods.default}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var i=n[t]={exports:{}};return e[t].call(i.exports,i,i.exports,o),i.exports}t=o(955),a=o(359),(0,t.r8)({_:{input:{tex:{configmacros:{ConfigMacrosConfiguration:a}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var a,t,e={272:function(a,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.EncloseConfiguration=t.EncloseMethods=t.ENCLOSE_OPTIONS=void 0;var o=e(251),n=e(871),r=e(398);t.ENCLOSE_OPTIONS={"data-arrowhead":1,color:1,mathcolor:1,background:1,mathbackground:1,"data-padding":1,"data-thickness":1},t.EncloseMethods={},t.EncloseMethods.Enclose=function(a,e){var o=a.GetArgument(e).replace(/,/g," "),n=a.GetBrackets(e,""),i=a.ParseArg(e),l=r.default.keyvalOptions(n,t.ENCLOSE_OPTIONS);l.notation=o,a.Push(a.create("node","menclose",[i],l))},new n.CommandMap("enclose",{enclose:"Enclose"},t.EncloseMethods),t.EncloseConfiguration=o.Configuration.create("enclose",{handler:{macro:["enclose"]}})},955:function(a,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},398:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=MathJax._.input.tex.ParseUtil.default},871:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap}},o={};function n(a){var t=o[a];if(void 0!==t)return t.exports;var r=o[a]={exports:{}};return e[a](r,r.exports,n),r.exports}a=n(955),t=n(272),(0,a.r8)({_:{input:{tex:{enclose:{EncloseConfiguration:t}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,e,a={646:function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0}),e.ExtpfeilConfiguration=e.ExtpfeilMethods=void 0;var o=a(251),n=a(871),r=a(939),i=a(892),u=a(417),x=a(402);e.ExtpfeilMethods={},e.ExtpfeilMethods.xArrow=r.AmsMethods.xArrow,e.ExtpfeilMethods.NewExtArrow=function(t,a){var o=t.GetArgument(a),n=t.GetArgument(a),r=t.GetArgument(a);if(!o.match(/^\\([a-z]+|.)$/i))throw new x.default("NewextarrowArg1","First argument to %1 must be a control sequence name",a);if(!n.match(/^(\d+),(\d+)$/))throw new x.default("NewextarrowArg2","Second argument to %1 must be two integers separated by a comma",a);if(!r.match(/^(\d+|0x[0-9A-F]+)$/i))throw new x.default("NewextarrowArg3","Third argument to %1 must be a unicode character number",a);o=o.substr(1);var u=n.split(",");i.default.addMacro(t,o,e.ExtpfeilMethods.xArrow,[parseInt(r),parseInt(u[0]),parseInt(u[1])])},new n.CommandMap("extpfeil",{xtwoheadrightarrow:["xArrow",8608,12,16],xtwoheadleftarrow:["xArrow",8606,17,13],xmapsto:["xArrow",8614,6,7],xlongequal:["xArrow",61,7,7],xtofrom:["xArrow",8644,12,12],Newextarrow:"NewExtArrow"},e.ExtpfeilMethods);e.ExtpfeilConfiguration=o.Configuration.create("extpfeil",{handler:{macro:["extpfeil"]},init:function(t){u.NewcommandConfiguration.init(t)}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default},939:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AmsMethods=MathJax._.input.tex.ams.AmsMethods.AmsMethods,e.NEW_OPS=MathJax._.input.tex.ams.AmsMethods.NEW_OPS},417:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NewcommandConfiguration=MathJax._.input.tex.newcommand.NewcommandConfiguration.NewcommandConfiguration},892:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.newcommand.NewcommandUtil.default}},o={};function n(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return a[t](r,r.exports,n),r.exports}t=n(955),e=n(646),(0,t.r8)({_:{input:{tex:{extpfeil:{ExtpfeilConfiguration:e}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var a,t,n={82:function(a,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.GensymbConfiguration=void 0;var e=n(251),o=n(108);new(n(871).CharacterMap)("gensymb-symbols",(function(a,t){var n=t.attributes||{};n.mathvariant=o.TexConstant.Variant.NORMAL,n.class="MathML-Unit";var e=a.create("token","mi",n,t.char);a.Push(e)}),{ohm:"\u2126",degree:"\xb0",celsius:"\u2103",perthousand:"\u2030",micro:"\xb5"}),t.GensymbConfiguration=e.Configuration.create("gensymb",{handler:{macro:["gensymb-symbols"]}})},955:function(a,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TexConstant=MathJax._.input.tex.TexConstants.TexConstant}},e={};function o(a){var t=e[a];if(void 0!==t)return t.exports;var i=e[a]={exports:{}};return n[a](i,i.exports,o),i.exports}a=o(955),t=o(82),(0,a.r8)({_:{input:{tex:{gensymb:{GensymbConfiguration:t}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,e,n={738:function(t,a,e){Object.defineProperty(a,"__esModule",{value:!0}),a.HtmlConfiguration=void 0;var n=e(251),r=e(871),o=e(248);new r.CommandMap("html_macros",{href:"Href",class:"Class",style:"Style",cssId:"Id"},o.default),a.HtmlConfiguration=n.Configuration.create("html",{handler:{macro:["html_macros"]}})},248:function(t,a,e){Object.defineProperty(a,"__esModule",{value:!0});var n=e(748),r={Href:function(t,a){var e=t.GetArgument(a),r=o(t,a);n.default.setAttribute(r,"href",e),t.Push(r)},Class:function(t,a){var e=t.GetArgument(a),r=o(t,a),i=n.default.getAttribute(r,"class");i&&(e=i+" "+e),n.default.setAttribute(r,"class",e),t.Push(r)},Style:function(t,a){var e=t.GetArgument(a),r=o(t,a),i=n.default.getAttribute(r,"style");i&&(";"!==e.charAt(e.length-1)&&(e+=";"),e=i+" "+e),n.default.setAttribute(r,"style",e),t.Push(r)},Id:function(t,a){var e=t.GetArgument(a),r=o(t,a);n.default.setAttribute(r,"id",e),t.Push(r)}},o=function(t,a){var e=t.ParseArg(a);if(!n.default.isInferred(e))return e;var r=n.default.getChildren(e);if(1===r.length)return r[0];var o=t.create("node","mrow");return n.default.copyChildren(e,o),n.default.copyAttributes(e,o),o};a.default=r},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.NodeUtil.default},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap}},r={};function o(t){var a=r[t];if(void 0!==a)return a.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}t=o(955),a=o(738),e=o(248),(0,t.r8)({_:{input:{tex:{html:{HtmlConfiguration:a,HtmlMethods:e}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var o,n,r={634:function(o,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.NoErrorsConfiguration=void 0;var t=r(251);n.NoErrorsConfiguration=t.Configuration.create("noerrors",{nodes:{error:function(o,n,r,t){var e=o.create("token","mtext",{},t.replace(/\n/g," "));return o.create("node","merror",[e],{"data-mjx-error":n,title:n})}}})},955:function(o,n){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,n.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(o,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Configuration=MathJax._.input.tex.Configuration.Configuration,n.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,n.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration}},t={};function e(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return r[o](a,a.exports,e),a.exports}o=e(955),n=e(634),(0,o.r8)({_:{input:{tex:{noerrors:{NoErrorsConfiguration:n}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var n,o,t={999:function(n,o,t){var e=this&&this.__values||function(n){var o="function"==typeof Symbol&&Symbol.iterator,t=o&&n[o],e=0;if(t)return t.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&e>=n.length&&(n=void 0),{value:n&&n[e++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(o,"__esModule",{value:!0}),o.NoUndefinedConfiguration=void 0;var r=t(251);o.NoUndefinedConfiguration=r.Configuration.create("noundefined",{fallback:{macro:function(n,o){var t,r,i=n.create("text","\\"+o),a=n.options.noundefined||{},u={};try{for(var f=e(["color","background","size"]),l=f.next();!l.done;l=f.next()){var c=l.value;a[c]&&(u["math"+c]=a[c])}}catch(n){t={error:n}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}n.Push(n.create("node","mtext",[],u,i))}},options:{noundefined:{color:"red",background:"",size:""}},priority:3})},955:function(n,o){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,o.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(n,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Configuration=MathJax._.input.tex.Configuration.Configuration,o.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,o.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}n=r(955),o=r(999),(0,n.r8)({_:{input:{tex:{noundefined:{NoUndefinedConfiguration:o}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,o,n={941:function(t,o,n){var a,r=this&&this.__extends||(a=function(t,o){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}a(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)});Object.defineProperty(o,"__esModule",{value:!0}),o.TagFormatConfiguration=o.tagformatConfig=void 0;var e=n(251),i=n(680),s=0;function u(t,o){var n=o.parseOptions.options.tags;"base"!==n&&t.tags.hasOwnProperty(n)&&i.TagsFactory.add(n,t.tags[n]);var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.formatNumber=function(t){return o.parseOptions.options.tagformat.number(t)},n.prototype.formatTag=function(t){return o.parseOptions.options.tagformat.tag(t)},n.prototype.formatId=function(t){return o.parseOptions.options.tagformat.id(t)},n.prototype.formatUrl=function(t,n){return o.parseOptions.options.tagformat.url(t,n)},n}(i.TagsFactory.create(o.parseOptions.options.tags).constructor),e="configTags-"+ ++s;i.TagsFactory.add(e,a),o.parseOptions.options.tags=e}o.tagformatConfig=u,o.TagFormatConfiguration=e.Configuration.create("tagformat",{config:[u,10],options:{tagformat:{number:function(t){return t.toString()},tag:function(t){return"("+t+")"},id:function(t){return"mjx-eqn:"+t.replace(/\s/g,"_")},url:function(t,o){return o+"#"+encodeURIComponent(t)}}}})},955:function(t,o){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,o.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Configuration=MathJax._.input.tex.Configuration.Configuration,o.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,o.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},680:function(t,o){Object.defineProperty(o,"__esModule",{value:!0}),o.Label=MathJax._.input.tex.Tags.Label,o.TagInfo=MathJax._.input.tex.Tags.TagInfo,o.AbstractTags=MathJax._.input.tex.Tags.AbstractTags,o.NoTags=MathJax._.input.tex.Tags.NoTags,o.AllTags=MathJax._.input.tex.Tags.AllTags,o.TagsFactory=MathJax._.input.tex.Tags.TagsFactory}},a={};function r(t){var o=a[t];if(void 0!==o)return o.exports;var e=a[t]={exports:{}};return n[t].call(e.exports,e,e.exports,r),e.exports}t=r(955),o=r(941),(0,t.r8)({_:{input:{tex:{tagformat:{TagFormatConfiguration:o}}}}})}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,e,a={376:function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeConfiguration=e.UnicodeMethods=void 0;var n=a(251),o=a(402),i=a(871),r=a(398),u=a(748),l=a(992);e.UnicodeMethods={};var c={};e.UnicodeMethods.Unicode=function(t,e){var a=t.GetBrackets(e),n=null,i=null;a&&(a.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(n=a.replace(/ /g,"").split(/,/),i=t.GetBrackets(e)):i=a);var p=r.default.trimSpaces(t.GetArgument(e)).replace(/^0x/,"x");if(!p.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))throw new o.default("BadUnicode","Argument to \\unicode must be a number");var M=parseInt(p.match(/^x/)?"0"+p:p);c[M]?i||(i=c[M][2]):c[M]=[800,200,i,M],n&&(c[M][0]=Math.floor(1e3*parseFloat(n[0])),c[M][1]=Math.floor(1e3*parseFloat(n[1])));var d=t.stack.env.font,s={};i?(c[M][2]=s.fontfamily=i.replace(/'/g,"'"),d&&(d.match(/bold/)&&(s.fontweight="bold"),d.match(/italic|-mathit/)&&(s.fontstyle="italic"))):d&&(s.mathvariant=d);var x=t.create("token","mtext",s,l.numeric(p));u.default.setProperty(x,"unicode",!0),t.Push(x)},new i.CommandMap("unicode",{unicode:"Unicode"},e.UnicodeMethods),e.UnicodeConfiguration=n.Configuration.create("unicode",{handler:{macro:["unicode"]}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},992:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.options=MathJax._.util.Entities.options,e.entities=MathJax._.util.Entities.entities,e.add=MathJax._.util.Entities.add,e.remove=MathJax._.util.Entities.remove,e.translate=MathJax._.util.Entities.translate,e.numeric=MathJax._.util.Entities.numeric},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},748:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.NodeUtil.default},398:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.ParseUtil.default},871:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,e.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,e.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,e.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,e.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,e.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,e.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,e.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},402:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=MathJax._.input.tex.TexError.default}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return a[t](i,i.exports,o),i.exports}t=o(955),e=o(376),(0,t.r8)({_:{input:{tex:{unicode:{UnicodeConfiguration:e}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var a,t,p={927:function(a,t,p){Object.defineProperty(t,"__esModule",{value:!0}),t.UpgreekConfiguration=void 0;var e=p(251),n=p(871),o=p(108);new n.CharacterMap("upgreek",(function(a,t){var p=t.attributes||{};p.mathvariant=o.TexConstant.Variant.NORMAL;var e=a.create("token","mi",p,t.char);a.Push(e)}),{upalpha:"\u03b1",upbeta:"\u03b2",upgamma:"\u03b3",updelta:"\u03b4",upepsilon:"\u03f5",upzeta:"\u03b6",upeta:"\u03b7",uptheta:"\u03b8",upiota:"\u03b9",upkappa:"\u03ba",uplambda:"\u03bb",upmu:"\u03bc",upnu:"\u03bd",upxi:"\u03be",upomicron:"\u03bf",uppi:"\u03c0",uprho:"\u03c1",upsigma:"\u03c3",uptau:"\u03c4",upupsilon:"\u03c5",upphi:"\u03d5",upchi:"\u03c7",uppsi:"\u03c8",upomega:"\u03c9",upvarepsilon:"\u03b5",upvartheta:"\u03d1",upvarpi:"\u03d6",upvarrho:"\u03f1",upvarsigma:"\u03c2",upvarphi:"\u03c6",Upgamma:"\u0393",Updelta:"\u0394",Uptheta:"\u0398",Uplambda:"\u039b",Upxi:"\u039e",Uppi:"\u03a0",Upsigma:"\u03a3",Upupsilon:"\u03a5",Upphi:"\u03a6",Uppsi:"\u03a8",Upomega:"\u03a9"}),t.UpgreekConfiguration=e.Configuration.create("upgreek",{handler:{macro:["upgreek"]}})},955:function(a,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=MathJax._.input.tex.Configuration.Configuration,t.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,t.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,t.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,t.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,t.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,t.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,t.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,t.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,t.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(a,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TexConstant=MathJax._.input.tex.TexConstants.TexConstant}},e={};function n(a){var t=e[a];if(void 0!==t)return t.exports;var o=e[a]={exports:{}};return p[a](o,o.exports,n),o.exports}a=n(955),t=n(927),(0,a.r8)({_:{input:{tex:{upgreek:{UpgreekConfiguration:t}}}}})}();
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,a,e={768:function(t,a,e){Object.defineProperty(a,"__esModule",{value:!0}),a.VerbConfiguration=a.VerbMethods=void 0;var n=e(251),o=e(108),r=e(871),i=e(402);a.VerbMethods={},a.VerbMethods.Verb=function(t,a){var e=t.GetNext(),n=++t.i;if(""===e)throw new i.default("MissingArgFor","Missing argument for %1",a);for(;t.i<t.string.length&&t.string.charAt(t.i)!==e;)t.i++;if(t.i===t.string.length)throw new i.default("NoClosingDelim","Can't find closing delimiter for %1",t.currentCS);var r=t.string.slice(n,t.i).replace(/ /g,"\xa0");t.i++,t.Push(t.create("token","mtext",{mathvariant:o.TexConstant.Variant.MONOSPACE},r))},new r.CommandMap("verb",{verb:"Verb"},a.VerbMethods),a.VerbConfiguration=n.Configuration.create("verb",{handler:{macro:["verb"]}})},955:function(t,a){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,a.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.Configuration=MathJax._.input.tex.Configuration.Configuration,a.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,a.ParserConfiguration=MathJax._.input.tex.Configuration.ParserConfiguration},871:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractSymbolMap=MathJax._.input.tex.SymbolMap.AbstractSymbolMap,a.RegExpMap=MathJax._.input.tex.SymbolMap.RegExpMap,a.AbstractParseMap=MathJax._.input.tex.SymbolMap.AbstractParseMap,a.CharacterMap=MathJax._.input.tex.SymbolMap.CharacterMap,a.DelimiterMap=MathJax._.input.tex.SymbolMap.DelimiterMap,a.MacroMap=MathJax._.input.tex.SymbolMap.MacroMap,a.CommandMap=MathJax._.input.tex.SymbolMap.CommandMap,a.EnvironmentMap=MathJax._.input.tex.SymbolMap.EnvironmentMap},108:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.TexConstant=MathJax._.input.tex.TexConstants.TexConstant},402:function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=MathJax._.input.tex.TexError.default}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,o),r.exports}t=o(955),a=o(768),(0,t.r8)({_:{input:{tex:{verb:{VerbConfiguration:a}}}}})}();
|
1
SWADroid/src/main/assets/mathjax/latest.js
Normal file
1
SWADroid/src/main/assets/mathjax/latest.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/loader.js
Normal file
1
SWADroid/src/main/assets/mathjax/loader.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/node-main.js
Normal file
1
SWADroid/src/main/assets/mathjax/node-main.js
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
SWADroid/src/main/assets/mathjax/startup.js
Normal file
1
SWADroid/src/main/assets/mathjax/startup.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/tex-chtml.js
Normal file
1
SWADroid/src/main/assets/mathjax/tex-chtml.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/ui/lazy.js
Normal file
1
SWADroid/src/main/assets/mathjax/ui/lazy.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/ui/menu.js
Normal file
1
SWADroid/src/main/assets/mathjax/ui/menu.js
Normal file
File diff suppressed because one or more lines are too long
1
SWADroid/src/main/assets/mathjax/ui/safe.js
Normal file
1
SWADroid/src/main/assets/mathjax/ui/safe.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -47,7 +47,7 @@ public class DataFramework {
|
|||
|
||||
private int mOpenInstances = 0;
|
||||
|
||||
private ArrayList<Table> mTables = new ArrayList<Table>();
|
||||
private ArrayList<Table> mTables = new ArrayList<>();
|
||||
|
||||
private DataFrameworkCore mCore;
|
||||
|
||||
|
@ -210,7 +210,7 @@ public class DataFramework {
|
|||
String[] fields = getTable(table).getFieldsToArray();
|
||||
Cursor c = getCursor(table, fields, where, null, null, null, orderby, limit);
|
||||
|
||||
ArrayList<Entity> aux = new ArrayList<Entity>();
|
||||
ArrayList<Entity> aux = new ArrayList<>();
|
||||
|
||||
c.moveToFirst();
|
||||
while (!c.isAfterLast()) {
|
|
@ -46,7 +46,6 @@ import org.xmlpull.v1.XmlPullParserFactory;
|
|||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class Entity {
|
||||
|
@ -54,8 +53,8 @@ public class Entity {
|
|||
private String mTable;
|
||||
private long mId = -1;
|
||||
private long mForceId = -1;
|
||||
protected HashMap<String, Object> mAttributes = new HashMap<String, Object>();
|
||||
protected HashMap<String, Object> mMultilanguagesAttributes = new HashMap<String, Object>();
|
||||
protected HashMap<String, Object> mAttributes = new HashMap<>();
|
||||
protected HashMap<String, Object> mMultilanguagesAttributes = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Devuelve el siguiente _id
|
||||
|
@ -104,7 +103,7 @@ public class Entity {
|
|||
* @return true si es una actualizacion
|
||||
*/
|
||||
public boolean isUpdate() {
|
||||
return (mId < 0)?false:true;
|
||||
return mId >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +112,7 @@ public class Entity {
|
|||
* @return true si es una nuevo registro
|
||||
*/
|
||||
public boolean isInsert() {
|
||||
return (mId < 0)?true:false;
|
||||
return (mId < 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,8 +161,7 @@ public class Entity {
|
|||
*/
|
||||
public int getDrawableIdentifier(String name)
|
||||
{
|
||||
int id = DataFramework.getInstance().getContext().getResources().getIdentifier(DataFramework.getInstance().getPackage() + ":drawable/"+getValue(name).toString(), null, null);
|
||||
return id;
|
||||
return DataFramework.getInstance().getContext().getResources().getIdentifier(DataFramework.getInstance().getPackage() + ":drawable/"+getValue(name).toString(), null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -190,8 +188,7 @@ public class Entity {
|
|||
{
|
||||
int id = DataFramework.getInstance().getContext().getResources().getIdentifier(DataFramework.getInstance().getPackage() + ":drawable/"+getValue(name).toString(), null, null);
|
||||
java.io.InputStream is = DataFramework.getInstance().getContext().getResources().openRawResource(id);
|
||||
BitmapDrawable bmd = new BitmapDrawable(BitmapFactory.decodeStream(is));
|
||||
return bmd;
|
||||
return new BitmapDrawable(BitmapFactory.decodeStream(is));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -276,19 +273,18 @@ public class Entity {
|
|||
{
|
||||
String[] arString = DataFramework.getInstance().getTable(mTable).getToString().split("%");
|
||||
String out = "";
|
||||
for (int i=0; i<arString.length; i++) {
|
||||
if (isAttribute(arString[i]))
|
||||
{
|
||||
Field f = getTableObject().getField(arString[i]);
|
||||
if (f.getType().equals("foreign-key")){
|
||||
out += getEntity(arString[i]).toString();
|
||||
}else{
|
||||
out += getString(arString[i]);
|
||||
for (String anArString : arString) {
|
||||
if (isAttribute(anArString)) {
|
||||
Field f = getTableObject().getField(anArString);
|
||||
if (f.getType().equals("foreign-key")) {
|
||||
out += getEntity(anArString).toString();
|
||||
} else {
|
||||
out += getString(anArString);
|
||||
}
|
||||
} else if (arString[i].equals(DataFramework.KEY_ID)) {
|
||||
} else if (anArString.equals(DataFramework.KEY_ID)) {
|
||||
out += mId;
|
||||
} else {
|
||||
out += arString[i];
|
||||
out += anArString;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
|
@ -384,30 +380,38 @@ public class Entity {
|
|||
HashMap<String, Object> attribs = mAttributes; // Para reducir el acceso al heap.
|
||||
Object[] attributeNames = attribs.keySet().toArray();
|
||||
int attributeCount = attributeNames.length;
|
||||
|
||||
for (int i = 0; i < attributeCount; i++)
|
||||
{
|
||||
String attributeName = attributeNames[i].toString();
|
||||
|
||||
for (Object attributeName1 : attributeNames) {
|
||||
String attributeName = attributeName1.toString();
|
||||
|
||||
Field f = getTableObject().getField(attributeName);
|
||||
|
||||
int indexField;
|
||||
if (f.getType().equals("multilanguage")) {
|
||||
indexField = c.getColumnIndexOrThrow(attributeName + "_" + DataFramework.getInstance().getCurrentLanguage());
|
||||
} else {
|
||||
indexField = c.getColumnIndexOrThrow(attributeName);
|
||||
}
|
||||
|
||||
if (f.getType().equals("text") || f.getType().equals("multilanguage") || f.getType().equals("string-identifier") || f.getType().equals("drawable-identifier")){
|
||||
attribs.put(attributeName, c.getString(indexField));
|
||||
}else if (f.getType().equals("int")){
|
||||
attribs.put(attributeName, c.getLong(indexField));
|
||||
}else if (f.getType().equals("foreign-key")){
|
||||
attribs.put(attributeName, c.getLong(indexField));
|
||||
}else if (f.getType().equals("real")){
|
||||
attribs.put(attributeName, c.getDouble(indexField));
|
||||
}else{
|
||||
attribs.put(attributeName, c.getString(indexField));
|
||||
|
||||
int indexField;
|
||||
if (f.getType().equals("multilanguage")) {
|
||||
indexField = c.getColumnIndexOrThrow(attributeName + "_" + DataFramework.getInstance().getCurrentLanguage());
|
||||
} else {
|
||||
indexField = c.getColumnIndexOrThrow(attributeName);
|
||||
}
|
||||
|
||||
switch (f.getType()) {
|
||||
case "text":
|
||||
case "multilanguage":
|
||||
case "string-identifier":
|
||||
case "drawable-identifier":
|
||||
attribs.put(attributeName, c.getString(indexField));
|
||||
break;
|
||||
case "int":
|
||||
attribs.put(attributeName, c.getLong(indexField));
|
||||
break;
|
||||
case "foreign-key":
|
||||
attribs.put(attributeName, c.getLong(indexField));
|
||||
break;
|
||||
case "real":
|
||||
attribs.put(attributeName, c.getDouble(indexField));
|
||||
break;
|
||||
default:
|
||||
attribs.put(attributeName, c.getString(indexField));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -585,11 +589,9 @@ public class Entity {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<Entry<String, Object>> it = mMultilanguagesAttributes.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Entry<String, Object> e = (Entry<String, Object>)it.next();
|
||||
args.put(e.getKey().toString(), e.getValue().toString());
|
||||
|
||||
for (Entry<String, Object> e : mMultilanguagesAttributes.entrySet()) {
|
||||
args.put(e.getKey(), e.getValue().toString());
|
||||
}
|
||||
|
||||
if (isInsert()) {
|
||||
|
@ -636,15 +638,13 @@ public class Entity {
|
|||
|
||||
String result = "<entity>\n";
|
||||
result += "<attribute name=\"_id\" value=\"" + mId + "\"/>\n";
|
||||
|
||||
for (int i = 0; i < attributeCount; i++)
|
||||
{
|
||||
if (!isNull(attributeNames[i].toString()))
|
||||
{
|
||||
result += "<attribute name=\"" + attributeNames[i].toString() + "\"" +
|
||||
" value=\"" + getValue(attributeNames[i].toString()).toString() + "\"/>\n";
|
||||
}
|
||||
}
|
||||
|
||||
for (Object attributeName : attributeNames) {
|
||||
if (!isNull(attributeName.toString())) {
|
||||
result += "<attribute name=\"" + attributeName.toString() + "\"" +
|
||||
" value=\"" + getValue(attributeName.toString()).toString() + "\"/>\n";
|
||||
}
|
||||
}
|
||||
|
||||
result += "</entity>\n";
|
||||
return result;
|
||||
|
@ -659,7 +659,7 @@ public class Entity {
|
|||
try {
|
||||
|
||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||
XmlPullParser x = (XmlPullParser)factory.newPullParser();
|
||||
XmlPullParser x = factory.newPullParser();
|
||||
x.setInput(new StringReader(xml));
|
||||
|
||||
int eventType = x.getEventType();
|
||||
|
@ -682,14 +682,11 @@ public class Entity {
|
|||
|
||||
eventType = x.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
} catch (XmlPullParserException | IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -456,11 +456,7 @@ public class EntityCursor implements Cursor, Iterable<Entity> {
|
|||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
if (mCursor.isLast() || mCursor.isAfterLast()){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
return !(mCursor.isLast() || mCursor.isAfterLast());
|
||||
}
|
||||
|
||||
@Override
|
|
@ -122,7 +122,7 @@ public abstract class EntityEditActivity extends Activity
|
|||
|
||||
protected Map<String, View> getAttributeViews()
|
||||
{
|
||||
Map<String, View> views = new HashMap<String, View>();
|
||||
Map<String, View> views = new HashMap<>();
|
||||
View mainView = findViewById(getMainViewId());
|
||||
Table table = new Table(getTableName());
|
||||
|
|
@ -59,7 +59,7 @@ public class DataFrameworkCore {
|
|||
|
||||
private String mPackage = "";
|
||||
|
||||
private ArrayList<String> mLanguages = new ArrayList<String>();
|
||||
private ArrayList<String> mLanguages = new ArrayList<>();
|
||||
private String mCurrentLanguage;
|
||||
|
||||
private SQLiteDatabase mDb;
|
||||
|
@ -139,10 +139,7 @@ public class DataFrameworkCore {
|
|||
}
|
||||
|
||||
private boolean add(int version, int oldVersion, int newVersion) {
|
||||
if (version>oldVersion && version<=newVersion)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return version > oldVersion && version <= newVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -325,13 +322,13 @@ public class DataFrameworkCore {
|
|||
int fieldCount = fields.size();
|
||||
|
||||
while (!c.isAfterLast()) {
|
||||
osw.append("<row table=\"" + tableName + "\" id=\"" + c.getString(c.getColumnIndex(DataFramework.KEY_ID)) + "\">\n");
|
||||
osw.append("<row table=\"").append(tableName).append("\" id=\"").append(c.getString(c.getColumnIndex(DataFramework.KEY_ID))).append("\">\n");
|
||||
|
||||
for (int j = 0; j < fieldCount; j++)
|
||||
{
|
||||
Field field = fields.get(j);
|
||||
if (c.getString(c.getColumnIndex(field.getName()))!=null)
|
||||
osw.append("<field name=\"" + field.getName() + "\" value=\"" + c.getString(c.getColumnIndex(field.getName())).replace("\"", """) + "\" />\n");
|
||||
osw.append("<field name=\"").append(field.getName()).append("\" value=\"").append(c.getString(c.getColumnIndex(field.getName())).replace("\"", """)).append("\" />\n");
|
||||
}
|
||||
|
||||
osw.append("</row>\n");
|
||||
|
@ -361,7 +358,7 @@ public class DataFrameworkCore {
|
|||
public void restore(String file) throws XmlPullParserException, IOException {
|
||||
try {
|
||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||
XmlPullParser x = (XmlPullParser)factory.newPullParser();
|
||||
XmlPullParser x = factory.newPullParser();
|
||||
x.setInput(new FileReader(file));
|
||||
insertXML(x);
|
||||
} catch (IOException e) {
|
|
@ -36,7 +36,7 @@ public class Table {
|
|||
|
||||
private String mName;
|
||||
private String mToString;
|
||||
private ArrayList<Field> mFields = new ArrayList<Field>();
|
||||
private ArrayList<Field> mFields = new ArrayList<>();
|
||||
private int mNewInVersion;
|
||||
private boolean mBackup;
|
||||
|
||||
|
@ -128,8 +128,7 @@ public class Table {
|
|||
|
||||
|
||||
public String getSQLDeleteTable () {
|
||||
String out = "DROP TABLE IF EXISTS " + mName;
|
||||
return out;
|
||||
return "DROP TABLE IF EXISTS " + mName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,7 +153,7 @@ public class Table {
|
|||
ArrayList<Field> fields = mFields;
|
||||
int fieldCount = fields.size();
|
||||
|
||||
ArrayList<String> aux = new ArrayList<String>();
|
||||
ArrayList<String> aux = new ArrayList<>();
|
||||
|
||||
aux.add(DataFramework.KEY_ID);
|
||||
for (int i = 0; i < fieldCount; i++) {
|
31
SWADroid/src/main/java/es/ugr/swad/swadroid/Config.java
Normal file
31
SWADroid/src/main/java/es/ugr/swad/swadroid/Config.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* This file is part of SWADroid.
|
||||
*
|
||||
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*
|
||||
* SWADroid is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SWADroid is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package es.ugr.swad.swadroid;
|
||||
|
||||
/**
|
||||
* Application settings.
|
||||
*
|
||||
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*/
|
||||
public class Config {
|
||||
/**
|
||||
* SWAD application key
|
||||
*/
|
||||
public static final String SWAD_APP_KEY = BuildConfig.SWAD_APP_KEY;
|
||||
}
|
|
@ -32,15 +32,18 @@ import java.io.File;
|
|||
* @author Jose Antonio Guerrero Aviles <cany20@gmail.com>
|
||||
*/
|
||||
public class Constants {
|
||||
/**
|
||||
* SWAD application key
|
||||
* @deprecated Use {@link Config#SWAD_APP_KEY} instead
|
||||
*/
|
||||
public static final String SWAD_APP_KEY = Config.SWAD_APP_KEY;
|
||||
/**
|
||||
* URL of SWAD UGR Server
|
||||
*/
|
||||
public static final String SWAD_UGR_SERVER = "swad.ugr.es";
|
||||
/**
|
||||
* URL of OpenSWAD Server
|
||||
*/
|
||||
public static final String OPENSWAD_SERVER = "openswad.org";
|
||||
/**
|
||||
* Server URL
|
||||
*/
|
||||
public static final String DEFAULT_SERVER = "swad.ugr.es";
|
||||
public static final String DEFAULT_SERVER = SWAD_UGR_SERVER;
|
||||
/**
|
||||
* Account type
|
||||
*/
|
||||
|
@ -57,6 +60,10 @@ public class Constants {
|
|||
* Connection timeout (in milliseconds)
|
||||
*/
|
||||
public static final int CONNECTION_TIMEOUT = 60000;
|
||||
/**
|
||||
* Threshold for clean old notifications (in seconds)
|
||||
*/
|
||||
public static final int CLEAN_NOTIFICATIONS_THRESHOLD = 2592000; // 30 days
|
||||
/**
|
||||
* Null value returned by webservices when a field is empty
|
||||
*/
|
||||
|
@ -220,6 +227,50 @@ public class Constants {
|
|||
* Request code for create a new account
|
||||
*/
|
||||
public static final int CREATE_ACCOUNT_REQUEST_CODE = 39;
|
||||
/**
|
||||
* Request code for search users
|
||||
*/
|
||||
public static final int SEARCH_USERS_REQUEST_CODE = 40;
|
||||
/**
|
||||
* Request code for Manage Location
|
||||
*/
|
||||
public static final int MANAGE_LOCATION = 41;
|
||||
/**
|
||||
* Request code for Find User
|
||||
*/
|
||||
public static final int FIND_USER = 42;
|
||||
/**
|
||||
* Request code for Get Location
|
||||
*/
|
||||
public static final int GET_LOCATION = 43;
|
||||
/**
|
||||
* Request code for Get Last Location
|
||||
*/
|
||||
public static final int GET_LAST_LOCATION = 44;
|
||||
/**
|
||||
* Request code for Send Current Location
|
||||
*/
|
||||
public static final int SEND_CURRENT_LOCATION = 45;
|
||||
/**
|
||||
* Request code for Get Available Roles
|
||||
*/
|
||||
public static final int GET_AVAILABLE_ROLES = 46;
|
||||
/**
|
||||
* Request code for CAMERA permission
|
||||
*/
|
||||
public static final int PERMISSIONS_REQUEST_CAMERA = 100;
|
||||
/**
|
||||
* Request code for WRITE_EXTERNAL_STORAGE permission
|
||||
*/
|
||||
public static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 101;
|
||||
/**
|
||||
* Request code for PERMISSION_MULTIPLE permissions
|
||||
*/
|
||||
public static final int PERMISSION_MULTIPLE = 102;
|
||||
/**
|
||||
* Request code for POST_NOTIFICATIONS permission
|
||||
*/
|
||||
public static final int PERMISSIONS_REQUEST_POST_NOTIFICATIONS = 103;
|
||||
/**
|
||||
* Prefix tag name for Logcat
|
||||
*/
|
||||
|
@ -305,7 +356,7 @@ public class Constants {
|
|||
*/
|
||||
public static final String DIRECTORY_SWADROID = "SWADroid";
|
||||
public static final String DOWNLOADS_PATH =
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + DIRECTORY_SWADROID;
|
||||
Environment.DIRECTORY_DOWNLOADS + File.separator + DIRECTORY_SWADROID;
|
||||
|
||||
/**
|
||||
* Username template for messages
|
845
SWADroid/src/main/java/es/ugr/swad/swadroid/SWADMain.java
Normal file
845
SWADroid/src/main/java/es/ugr/swad/swadroid/SWADMain.java
Normal file
|
@ -0,0 +1,845 @@
|
|||
/*
|
||||
* This file is part of SWADroid.
|
||||
*
|
||||
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*
|
||||
* SWADroid is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SWADroid is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package es.ugr.swad.swadroid;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemSelectedListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ExpandableListView.OnChildClickListener;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import es.ugr.swad.swadroid.database.DataBaseHelper;
|
||||
import es.ugr.swad.swadroid.gui.AlertNotificationFactory;
|
||||
import es.ugr.swad.swadroid.gui.DialogFactory;
|
||||
import es.ugr.swad.swadroid.gui.MenuExpandableListActivity;
|
||||
import es.ugr.swad.swadroid.gui.ProgressScreen;
|
||||
import es.ugr.swad.swadroid.gui.TextExpandableListAdapter;
|
||||
import es.ugr.swad.swadroid.model.Course;
|
||||
import es.ugr.swad.swadroid.model.Model;
|
||||
import es.ugr.swad.swadroid.modules.courses.Courses;
|
||||
import es.ugr.swad.swadroid.modules.downloads.DownloadsManager;
|
||||
import es.ugr.swad.swadroid.modules.groups.MyGroupsManager;
|
||||
import es.ugr.swad.swadroid.modules.indoorlocation.IndoorLocation;
|
||||
import es.ugr.swad.swadroid.modules.information.Information;
|
||||
import es.ugr.swad.swadroid.modules.login.Login;
|
||||
import es.ugr.swad.swadroid.modules.login.LoginActivity;
|
||||
import es.ugr.swad.swadroid.modules.messages.Messages;
|
||||
import es.ugr.swad.swadroid.modules.notices.Notices;
|
||||
import es.ugr.swad.swadroid.modules.notifications.Notifications;
|
||||
import es.ugr.swad.swadroid.modules.qr.GenerateQR;
|
||||
import es.ugr.swad.swadroid.modules.rollcall.Rollcall;
|
||||
import es.ugr.swad.swadroid.modules.tests.Tests;
|
||||
import es.ugr.swad.swadroid.preferences.Preferences;
|
||||
import es.ugr.swad.swadroid.sync.AccountAuthenticator;
|
||||
import es.ugr.swad.swadroid.sync.SyncUtils;
|
||||
import es.ugr.swad.swadroid.utils.DateTimeUtils;
|
||||
import es.ugr.swad.swadroid.utils.Utils;
|
||||
|
||||
/**
|
||||
* Main class of the application.
|
||||
*
|
||||
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
* @author Antonio Aguilera Malagon <aguilerin@gmail.com>
|
||||
* @author Helena Rodriguez Gijon <hrgijon@gmail.com>
|
||||
* @author Jose Antonio Guerrero Aviles <cany20@gmail.com>
|
||||
*/
|
||||
public class SWADMain extends MenuExpandableListActivity {
|
||||
/**
|
||||
* Function name field
|
||||
*/
|
||||
private final String NAME = "listText";
|
||||
/**
|
||||
* Function text field
|
||||
*/
|
||||
private final String IMAGE = "listIcon";
|
||||
/**
|
||||
* Code of selected course
|
||||
*/
|
||||
private long courseCode;
|
||||
/**
|
||||
* User courses list
|
||||
*/
|
||||
private List<Model> listCourses;
|
||||
/**
|
||||
* SWADMain tag name for Logcat
|
||||
*/
|
||||
private static final String TAG = Constants.APP_TAG;
|
||||
|
||||
/**
|
||||
* Indicates if it is the first run
|
||||
*/
|
||||
private boolean firstRun = false;
|
||||
|
||||
|
||||
/**
|
||||
* Current role 2 - student 3 - teacher -1 - none role was chosen
|
||||
*/
|
||||
private int currentRole = -1;
|
||||
|
||||
private LinearLayout mNotifyLayout;
|
||||
private TextView mNotifyTextView;
|
||||
private ImageView mNotifyImageView;
|
||||
private ExpandableListView mExpandableListView;
|
||||
private TextExpandableListAdapter mExpandableListAdapter;
|
||||
private Spinner mCoursesSpinner;
|
||||
|
||||
private final ArrayList<HashMap<String, Object>> mHeaderData = new ArrayList<>();
|
||||
private final ArrayList<ArrayList<HashMap<String, Object>>> mChildData = new ArrayList<>();
|
||||
private final ArrayList<HashMap<String, Object>> mMessagesData = new ArrayList<>();
|
||||
private final ArrayList<HashMap<String, Object>> mUsersData = new ArrayList<>();
|
||||
|
||||
private ProgressScreen mProgressScreen;
|
||||
|
||||
/**
|
||||
* Gets the database helper
|
||||
*
|
||||
* @return the database helper
|
||||
*/
|
||||
public static DataBaseHelper getDbHelper() {
|
||||
return dbHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows initial dialog after application upgrade.
|
||||
*
|
||||
* @param context Application context
|
||||
*/
|
||||
private void showUpgradeDialog(Context context) {
|
||||
AlertDialog alertDialog = DialogFactory.createWebViewDialog(context,
|
||||
R.string.changelogTitle,
|
||||
R.raw.changes);
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see android.app.Activity#onCreate()
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
int lastVersion, currentVersion;
|
||||
|
||||
//Initialize screen
|
||||
super.onCreate(icicle);
|
||||
|
||||
setContentView(R.layout.main);
|
||||
initializeMainViews();
|
||||
|
||||
try {
|
||||
// Create Notifications channel
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
AlertNotificationFactory.createNotificationChanel(this);
|
||||
}
|
||||
|
||||
//Check if this is the first run after an install or upgrade
|
||||
lastVersion = Preferences.getLastVersion();
|
||||
currentVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
dbHelper.initializeDB();
|
||||
//lastVersion = 67;
|
||||
//currentVersion = 68;
|
||||
|
||||
//If this is the first run, show configuration dialog
|
||||
if (lastVersion == 0) {
|
||||
firstRun(currentVersion);
|
||||
|
||||
//If this is an upgrade, show upgrade dialog
|
||||
} else if (lastVersion < currentVersion) {
|
||||
//showUpgradeDialog(this);
|
||||
upgradeApp(lastVersion, currentVersion);
|
||||
}
|
||||
|
||||
loadCourses();
|
||||
|
||||
currentRole = -1;
|
||||
} catch (Exception ex) {
|
||||
error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
||||
// Check Android 13 permission
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[]{Manifest.permission.POST_NOTIFICATIONS},
|
||||
Constants.PERMISSIONS_REQUEST_POST_NOTIFICATIONS);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see android.app.Activity#onResume()
|
||||
*/
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (isUserOrPasswordEmpty() && listCourses.isEmpty()) {
|
||||
startActivityForResult(new Intent(this, LoginActivity.class), Constants.LOGIN_REQUEST_CODE);
|
||||
} else {
|
||||
if(Preferences.isPreferencesChanged() || DataBaseHelper.isDbCleaned()) {
|
||||
DataBaseHelper.setDbCleaned(false);
|
||||
|
||||
Preferences.setPreferencesChanged(false);
|
||||
Preferences.initializeSelectedCourse();
|
||||
|
||||
listCourses.clear();
|
||||
courseCode = -1;
|
||||
} else if(!firstRun) {
|
||||
courseCode = Courses.getSelectedCourseCode();
|
||||
}
|
||||
|
||||
//If today is the user birthday, show birthday message
|
||||
if((Login.getLoggedUser() != null) && (Login.getLoggedUser().getUserBirthday() != null)
|
||||
&& DateTimeUtils.isBirthday(Login.getLoggedUser().getUserBirthday())) {
|
||||
|
||||
showBirthdayMessage();
|
||||
} else {
|
||||
mNotifyLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
createSpinnerAdapter();
|
||||
createMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private void showBirthdayMessage() {
|
||||
mNotifyImageView.setImageResource(R.drawable.fabirthdaycake);
|
||||
mNotifyImageView.setVisibility(View.VISIBLE);
|
||||
mNotifyTextView.setText(getString(R.string.birthdayMsg).replace(
|
||||
Constants.USERNAME_TEMPLATE, Login.getLoggedUser().getUserFirstname()));
|
||||
mNotifyLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes application on first run
|
||||
* @param currentVersion Current version of application
|
||||
*/
|
||||
private void firstRun(int currentVersion) {
|
||||
Log.i(TAG, "Running application for first time. Setting current version to " + currentVersion);
|
||||
|
||||
Intent activity = new Intent(this, AccountAuthenticator.class);
|
||||
|
||||
//Configure automatic synchronization
|
||||
Preferences.setSyncTime(String.valueOf(Constants.DEFAULT_SYNC_TIME));
|
||||
startActivity(activity);
|
||||
|
||||
Preferences.setLastVersion(currentVersion);
|
||||
firstRun = true;
|
||||
|
||||
Preferences.initializeSelectedCourse();
|
||||
|
||||
Log.i(TAG, "First initialization completed successfully");
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes appropriate changes on application upgrade
|
||||
* @param lastVersion Version from which the application is updated
|
||||
* @param currentVersion Version to which the application is updated
|
||||
*/
|
||||
private void upgradeApp(int lastVersion, int currentVersion) throws NoSuchAlgorithmException {
|
||||
Log.i(TAG, "Upgrading application from version " + lastVersion + " to version " + currentVersion);
|
||||
|
||||
dbHelper.upgradeDB();
|
||||
|
||||
if(lastVersion < 52) {
|
||||
//Encrypts users table
|
||||
dbHelper.encryptUsers();
|
||||
|
||||
//If the app is updating from an unencrypted user password version, encrypt user password
|
||||
Preferences.upgradeCredentials();
|
||||
|
||||
Preferences.setSyncTime(String.valueOf(Constants.DEFAULT_SYNC_TIME));
|
||||
}
|
||||
|
||||
if(lastVersion < 57) {
|
||||
//Reconfigure automatic synchronization
|
||||
SyncUtils.removePeriodicSync(Constants.AUTHORITY, Bundle.EMPTY, this);
|
||||
if(!Preferences.getSyncTime().equals("0") && Preferences.isSyncEnabled()) {
|
||||
SyncUtils.addPeriodicSync(Constants.AUTHORITY, Bundle.EMPTY,
|
||||
Long.parseLong(Preferences.getSyncTime()), this);
|
||||
}
|
||||
}
|
||||
|
||||
Preferences.setLastVersion(currentVersion);
|
||||
|
||||
Log.i(TAG, "Application upgraded from version " + lastVersion + " to version " + currentVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
//After get the list of courses, a spinner is showed to choice the course
|
||||
case Constants.COURSES_REQUEST_CODE:
|
||||
loadCourses();
|
||||
|
||||
//User credentials are correct. Set periodic synchronization if enabled
|
||||
if (!"0".equals(Preferences.getSyncTime())
|
||||
&& Preferences.isSyncEnabled() && SyncUtils.isPeriodicSynced(this)) {
|
||||
SyncUtils.addPeriodicSync(Constants.AUTHORITY, Bundle.EMPTY,
|
||||
Long.parseLong(Preferences.getSyncTime()), this);
|
||||
}
|
||||
|
||||
mProgressScreen.hide();
|
||||
|
||||
createSpinnerAdapter();
|
||||
createMenu();
|
||||
|
||||
break;
|
||||
case Constants.LOGIN_REQUEST_CODE:
|
||||
getCurrentCourses();
|
||||
break;
|
||||
}
|
||||
} else if (resultCode == Activity.RESULT_CANCELED) {
|
||||
switch (requestCode) {
|
||||
//After get the list of courses, a dialog is launched to choice the course
|
||||
case Constants.COURSES_REQUEST_CODE:
|
||||
//User credentials are wrong. Remove periodic synchronization
|
||||
SyncUtils.removePeriodicSync(Constants.AUTHORITY, Bundle.EMPTY, this);
|
||||
mProgressScreen.hide();
|
||||
break;
|
||||
case Constants.LOGIN_REQUEST_CODE:
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void createSpinnerAdapter() {
|
||||
listCourses = dbHelper.getAllRows(DataBaseHelper.DB_TABLE_COURSES, null, "shortName");
|
||||
/*
|
||||
Cursor for database access
|
||||
*/
|
||||
Cursor dbCursor = dbHelper.getDb().getCursor(DataBaseHelper.DB_TABLE_COURSES, null, "shortName");
|
||||
startManagingCursor(dbCursor);
|
||||
if (!listCourses.isEmpty()) {
|
||||
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
|
||||
android.R.layout.simple_spinner_item,
|
||||
dbCursor,
|
||||
new String[]{"shortName"},
|
||||
new int[]{android.R.id.text1});
|
||||
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
mCoursesSpinner.setAdapter(adapter);
|
||||
mCoursesSpinner.setOnItemSelectedListener(new onItemSelectedListener());
|
||||
|
||||
if (Preferences.getLastCourseSelected() < listCourses.size())
|
||||
mCoursesSpinner.setSelection(Preferences.getLastCourseSelected());
|
||||
else
|
||||
mCoursesSpinner.setSelection(0);
|
||||
|
||||
mCoursesSpinner.setOnTouchListener(Spinner_OnTouch);
|
||||
mCoursesSpinner.setVisibility(View.VISIBLE);
|
||||
|
||||
Log.i(TAG, "Created Spinner adapter");
|
||||
} else {
|
||||
cleanSpinner();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an empty spinner. It is called when the database is cleaned.
|
||||
*/
|
||||
private void cleanSpinner() {
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, new String[]{getString(R.string.clickToGetCourses)});
|
||||
mCoursesSpinner.setAdapter(adapter);
|
||||
mCoursesSpinner.setOnTouchListener(Spinner_OnTouch);
|
||||
|
||||
Log.i(TAG, "Cleaned Spinner adapter");
|
||||
}
|
||||
|
||||
private class onItemSelectedListener implements OnItemSelectedListener {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position,
|
||||
long id) {
|
||||
if (!listCourses.isEmpty()) {
|
||||
Preferences.setLastCourseSelected(position);
|
||||
|
||||
Course courseSelected = (Course) listCourses.get(position);
|
||||
|
||||
courseCode = courseSelected.getId();
|
||||
|
||||
Courses.setSelectedCourseCode(courseCode);
|
||||
Courses.setSelectedCourseShortName(courseSelected.getShortName());
|
||||
Courses.setSelectedCourseFullName(courseSelected.getFullName());
|
||||
|
||||
Login.setCurrentUserRole(courseSelected.getUserRole());
|
||||
|
||||
createMenu();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> arg0) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private final View.OnTouchListener Spinner_OnTouch = new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
|
||||
if (dbHelper.getAllRows(DataBaseHelper.DB_TABLE_COURSES).isEmpty()) {
|
||||
if (Utils.connectionAvailable(getApplicationContext()))
|
||||
getCurrentCourses();
|
||||
} else {
|
||||
v.performClick();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private void getCurrentCourses() {
|
||||
Log.i(TAG, "Downloading courses...");
|
||||
|
||||
mProgressScreen.show();
|
||||
|
||||
Intent activity = new Intent(this, Courses.class);
|
||||
startActivityForResult(activity, Constants.COURSES_REQUEST_CODE);
|
||||
}
|
||||
|
||||
private void createMenu() {
|
||||
if (!listCourses.isEmpty()) {
|
||||
Course courseSelected;
|
||||
|
||||
if (Courses.getSelectedCourseCode() != -1) {
|
||||
courseSelected = dbHelper.getRow(DataBaseHelper.DB_TABLE_COURSES, "id", String.valueOf(Courses.getSelectedCourseCode()));
|
||||
|
||||
Log.i(TAG + " createMenu", "Recovered selected course " + courseSelected + " from database");
|
||||
} else {
|
||||
Log.w(TAG + " createMenu", "There is no selected course");
|
||||
|
||||
int lastSelected = Preferences.getLastCourseSelected();
|
||||
|
||||
if (lastSelected != -1 && lastSelected < listCourses.size()) {
|
||||
courseSelected = (Course) listCourses.get(lastSelected);
|
||||
Preferences.setLastCourseSelected(lastSelected);
|
||||
|
||||
Log.i(TAG + " createMenu", "Setted last course selected to " + courseSelected);
|
||||
} else {
|
||||
courseSelected = (Course) listCourses.get(0);
|
||||
Preferences.setLastCourseSelected(0);
|
||||
|
||||
Log.w(TAG + " createMenu", "No last course selected. Initialized last course selected to " + courseSelected);
|
||||
}
|
||||
|
||||
Courses.setSelectedCourseCode(courseSelected.getId());
|
||||
Courses.setSelectedCourseShortName(courseSelected.getShortName());
|
||||
Courses.setSelectedCourseFullName(courseSelected.getFullName());
|
||||
}
|
||||
|
||||
createBaseMenu();
|
||||
|
||||
int userRole = courseSelected.getUserRole();
|
||||
|
||||
switch(userRole) {
|
||||
case Constants.STUDENT_TYPE_CODE:
|
||||
changeToStudentMenu();
|
||||
break;
|
||||
case Constants.TEACHER_TYPE_CODE:
|
||||
changeToTeacherMenu();
|
||||
break;
|
||||
}
|
||||
|
||||
Login.setCurrentUserRole(userRole);
|
||||
} else {
|
||||
Preferences.initializeSelectedCourse();
|
||||
|
||||
Log.w(TAG + " createMenu", "No courses available. Resetted selected course and current role to -1");
|
||||
|
||||
createNoCourseMenu();
|
||||
}
|
||||
|
||||
refreshMainMenu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates menu when there are no courses available. This menu is common for students and teachers.
|
||||
*/
|
||||
private void createNoCourseMenu() {
|
||||
if ((listCourses == null) || listCourses.isEmpty()) {
|
||||
clearMenu();
|
||||
|
||||
//Order:
|
||||
// 1- Messages
|
||||
// 2- Users
|
||||
mHeaderData.add(getMenuItem(R.string.users, R.string.fa_users));
|
||||
mHeaderData.add(getMenuItem(R.string.messages, R.string.fa_envelope));
|
||||
|
||||
mChildData.add(mUsersData);
|
||||
mChildData.add(mMessagesData);
|
||||
|
||||
//Users category
|
||||
//Generate QR code
|
||||
mUsersData.add(getMenuItem(R.string.generateQRModuleLabel, R.string.fa_qrcode));
|
||||
|
||||
//Messages category
|
||||
//Notifications
|
||||
mMessagesData.add(getMenuItem(R.string.notificationsModuleLabel, R.string.fa_bell));
|
||||
//Messages
|
||||
mMessagesData.add(getMenuItem(R.string.messagesModuleLabel, R.string.fa_pencil_square_o));
|
||||
|
||||
Log.i(TAG, "Created No Course Menu");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates base menu. The menu base is common for students and teachers.
|
||||
* Sets currentRole to student role
|
||||
*/
|
||||
private void createBaseMenu() {
|
||||
clearMenu();
|
||||
|
||||
//the menu base is equal to students menu.
|
||||
currentRole = Constants.STUDENT_TYPE_CODE;
|
||||
|
||||
//Order:
|
||||
// 1- Course
|
||||
// 2- Evaluation
|
||||
// 3- Files
|
||||
// 4- Users
|
||||
// 5- Messages
|
||||
mHeaderData.add(getMenuItem(R.string.course, R.string.fa_list_ol));
|
||||
mHeaderData.add(getMenuItem(R.string.evaluation, R.string.fa_check_square_o));
|
||||
mHeaderData.add(getMenuItem(R.string.files, R.string.fa_folder_open));
|
||||
mHeaderData.add(getMenuItem(R.string.users, R.string.fa_users));
|
||||
mHeaderData.add(getMenuItem(R.string.messages, R.string.fa_envelope));
|
||||
|
||||
final ArrayList<HashMap<String, Object>> courseData = new ArrayList<>();
|
||||
mChildData.add(courseData);
|
||||
|
||||
final ArrayList<HashMap<String, Object>> evaluationData = new ArrayList<>();
|
||||
mChildData.add(evaluationData);
|
||||
|
||||
final ArrayList<HashMap<String, Object>> filesData = new ArrayList<>();
|
||||
mChildData.add(filesData);
|
||||
|
||||
mChildData.add(mUsersData);
|
||||
mChildData.add(mMessagesData);
|
||||
|
||||
//Course category
|
||||
//Introduction
|
||||
courseData.add(getMenuItem(R.string.introductionModuleLabel, R.string.fa_info));
|
||||
//Teaching Guide
|
||||
courseData.add(getMenuItem(R.string.teachingguideModuleLabel, R.string.fa_file_text));
|
||||
//Syllabus (lectures)
|
||||
courseData.add(getMenuItem(R.string.syllabusLecturesModuleLabel, R.string.fa_list_ol));
|
||||
//Syllabus (practicals)
|
||||
courseData.add(getMenuItem(R.string.syllabusPracticalsModuleLabel, R.string.fa_flask));
|
||||
//Bibliography
|
||||
courseData.add(getMenuItem(R.string.bibliographyModuleLabel, R.string.fa_book));
|
||||
//FAQs
|
||||
courseData.add(getMenuItem(R.string.faqsModuleLabel, R.string.fa_question));
|
||||
//Links
|
||||
courseData.add(getMenuItem(R.string.linksModuleLabel, R.string.fa_link));
|
||||
|
||||
//Evaluation category
|
||||
//Assessment system
|
||||
evaluationData.add(getMenuItem(R.string.assessmentModuleLabel, R.string.fa_info));
|
||||
//Test
|
||||
evaluationData.add(getMenuItem(R.string.testsModuleLabel, R.string.fa_check_square_o));
|
||||
|
||||
//Files category
|
||||
//Documents
|
||||
filesData.add(getMenuItem(R.string.documentsDownloadModuleLabel, R.string.fa_folder_open));
|
||||
//Shared area
|
||||
filesData.add(getMenuItem(R.string.sharedsDownloadModuleLabel, R.string.fa_folder_open));
|
||||
//Marks
|
||||
filesData.add(getMenuItem(R.string.marksModuleLabel, R.string.fa_list_alt));
|
||||
|
||||
//Users category
|
||||
//Groups
|
||||
mUsersData.add(getMenuItem(R.string.myGroupsModuleLabel, R.string.fa_sitemap));
|
||||
//Generate QR code
|
||||
mUsersData.add(getMenuItem(R.string.generateQRModuleLabel, R.string.fa_qrcode));
|
||||
//Manage location
|
||||
//mUsersData.add(getMenuItem(R.string.manageLocation, R.string.fa_map_marker));
|
||||
|
||||
//Messages category
|
||||
//Notifications
|
||||
mMessagesData.add(getMenuItem(R.string.notificationsModuleLabel, R.string.fa_bell));
|
||||
//Messages
|
||||
mMessagesData.add(getMenuItem(R.string.messagesModuleLabel, R.string.fa_pencil_square_o));
|
||||
|
||||
Log.i(TAG, "Created Base Menu");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapts the current menu to students view. Removes options unique to teachers and adds options unique to students
|
||||
*/
|
||||
private void changeToStudentMenu() {
|
||||
if (currentRole != Constants.STUDENT_TYPE_CODE) {
|
||||
//Removes Publish Note from messages menu
|
||||
mExpandableListAdapter.removeChild(Constants.MESSAGES_GROUP, Constants.PUBLISH_NOTE_CHILD);
|
||||
//Removes Rollcall from users menu
|
||||
mExpandableListAdapter.removeChild(Constants.USERS_GROUP, Constants.ROLLCALL_CHILD);
|
||||
|
||||
currentRole = Constants.STUDENT_TYPE_CODE;
|
||||
|
||||
Log.i(TAG, "Changed to Student Menu");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapts the current menu to teachers view. Removes options unique to students and adds options unique to teachers
|
||||
*/
|
||||
private void changeToTeacherMenu() {
|
||||
if (currentRole != Constants.TEACHER_TYPE_CODE) {
|
||||
//Adds Publish Note to messages menu
|
||||
mMessagesData.add(getMenuItem(R.string.noticesModuleLabel, R.string.fa_bullhorn));
|
||||
//Adds Rollcall to users menu
|
||||
mUsersData.add(getMenuItem(R.string.rollcallModuleLabel, R.string.fa_check_square_o));
|
||||
|
||||
currentRole = Constants.TEACHER_TYPE_CODE;
|
||||
|
||||
Log.i(TAG, "Changed to Teacher Menu");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Launches an action when refresh button is pushed
|
||||
*
|
||||
* @param v Actual view
|
||||
*/
|
||||
public void onRefreshClick(View v) {
|
||||
getCurrentCourses();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if user or password preference is empty
|
||||
*/
|
||||
private boolean isUserOrPasswordEmpty() {
|
||||
return TextUtils.isEmpty(Preferences.getUserID())
|
||||
|| TextUtils.isEmpty(Preferences.getUserPassword());
|
||||
}
|
||||
|
||||
private void initializeMainViews() {
|
||||
mExpandableListView = (ExpandableListView) findViewById(R.id.expandableList);
|
||||
mNotifyLayout = (LinearLayout) findViewById(R.id.notify_layout);
|
||||
mNotifyTextView = (TextView) findViewById(R.id.notifyTextView);
|
||||
mNotifyImageView = (ImageView) findViewById(R.id.notifyImageView);
|
||||
View mProgressScreenView = findViewById(R.id.progress_screen);
|
||||
View mCoursesListView = findViewById(R.id.courses_list_view);
|
||||
mCoursesSpinner = (Spinner) this.findViewById(R.id.spinner);
|
||||
mProgressScreen = new ProgressScreen(mProgressScreenView, mCoursesListView,
|
||||
getString(R.string.coursesProgressDescription), this);
|
||||
|
||||
OnChildClickListener mExpandableClickListener = (parent, v, groupPosition, childPosition, id) -> {
|
||||
// Get the item that was clicked
|
||||
Object o = parent.getExpandableListAdapter().getChild(groupPosition, childPosition);
|
||||
@SuppressWarnings("unchecked")
|
||||
String keyword = (String) ((Map<String, Object>) o).get(NAME);
|
||||
Intent activity;
|
||||
Context ctx = getApplicationContext();
|
||||
|
||||
if (keyword.equals(getString(R.string.notificationsModuleLabel))) {
|
||||
activity = new Intent(ctx, Notifications.class);
|
||||
startActivityForResult(activity, Constants.NOTIFICATIONS_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.testsModuleLabel))) {
|
||||
activity = new Intent(ctx, Tests.class);
|
||||
startActivityForResult(activity, Constants.TESTS_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.messagesModuleLabel))) {
|
||||
activity = new Intent(ctx, Messages.class);
|
||||
activity.putExtra("eventCode", Long.valueOf(0));
|
||||
startActivityForResult(activity, Constants.MESSAGES_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.noticesModuleLabel))) {
|
||||
activity = new Intent(ctx, Notices.class);
|
||||
startActivityForResult(activity, Constants.NOTICES_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.rollcallModuleLabel))) {
|
||||
if (Utils.connectionAvailable(ctx)) {
|
||||
activity = new Intent(ctx, Rollcall.class);
|
||||
startActivityForResult(activity, Constants.ROLLCALL_REQUEST_CODE);
|
||||
} else {
|
||||
Toast.makeText(ctx, R.string.noConnectionMsg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else if (keyword.equals(getString(R.string.generateQRModuleLabel))) {
|
||||
activity = new Intent(ctx, GenerateQR.class);
|
||||
startActivityForResult(activity, Constants.GENERATE_QR_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.manageLocation))) {
|
||||
activity = new Intent(ctx, IndoorLocation.class);
|
||||
startActivityForResult(activity, Constants.MANAGE_LOCATION);
|
||||
} else if (keyword.equals(getString(R.string.documentsDownloadModuleLabel))) {
|
||||
activity = new Intent(ctx, DownloadsManager.class);
|
||||
activity.putExtra("downloadsAreaCode", Constants.DOCUMENTS_AREA_CODE);
|
||||
startActivityForResult(activity, Constants.DOWNLOADSMANAGER_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.sharedsDownloadModuleLabel))) {
|
||||
activity = new Intent(ctx, DownloadsManager.class);
|
||||
activity.putExtra("downloadsAreaCode", Constants.SHARE_AREA_CODE);
|
||||
startActivityForResult(activity, Constants.DOWNLOADSMANAGER_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.marksModuleLabel))) {
|
||||
activity = new Intent(ctx, DownloadsManager.class);
|
||||
activity.putExtra("downloadsAreaCode", Constants.MARKS_AREA_CODE);
|
||||
startActivityForResult(activity, Constants.DOWNLOADSMANAGER_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.myGroupsModuleLabel))) {
|
||||
activity = new Intent(ctx, MyGroupsManager.class);
|
||||
activity.putExtra("courseCode", Courses.getSelectedCourseCode());
|
||||
startActivityForResult(activity, Constants.MYGROUPSMANAGER_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.introductionModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.INTRODUCTION_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.INTRODUCTION_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.faqsModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.FAQS_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.FAQS_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.bibliographyModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.BIBLIOGRAPHY_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.BIBLIOGRAPHY_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.syllabusPracticalsModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.SYLLABUSPRACTICALS_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.SYLLABUSPRACTICALS_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.syllabusLecturesModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.SYLLABUSLECTURES_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.SYLLABUSLECTURES_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.linksModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.LINKS_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.LINKS_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.teachingguideModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.TEACHINGGUIDE_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.TEACHINGGUIDE_REQUEST_CODE);
|
||||
} else if (keyword.equals(getString(R.string.assessmentModuleLabel))) {
|
||||
activity = new Intent(ctx, Information.class);
|
||||
activity.putExtra("requestCode", Constants.ASSESSMENT_REQUEST_CODE);
|
||||
startActivityForResult(activity, Constants.ASSESSMENT_REQUEST_CODE);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
mExpandableListView.setOnChildClickListener(mExpandableClickListener);
|
||||
}
|
||||
|
||||
private void refreshMainMenu() {
|
||||
mExpandableListAdapter = new TextExpandableListAdapter(this, mHeaderData,
|
||||
R.layout.image_list_item,
|
||||
new String[] {
|
||||
NAME
|
||||
}, new int[] {
|
||||
R.id.listText
|
||||
},
|
||||
mChildData, 0,
|
||||
null, new int[] {}
|
||||
);
|
||||
|
||||
mExpandableListView.setAdapter(mExpandableListAdapter);
|
||||
mExpandableListView.setVisibility(View.VISIBLE);
|
||||
|
||||
Log.i(TAG, "Refreshed Main Menu");
|
||||
}
|
||||
|
||||
private HashMap<String, Object> getMenuItem(int resName, int resImage) {
|
||||
final HashMap<String, Object> menuItem = new HashMap<>();
|
||||
|
||||
menuItem.put(NAME, getString(resName));
|
||||
menuItem.put(IMAGE, getString(resImage));
|
||||
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
private void clearMenu() {
|
||||
mNotifyLayout.setVisibility(View.GONE);
|
||||
|
||||
mHeaderData.clear();
|
||||
mChildData.clear();
|
||||
mUsersData.clear();
|
||||
mMessagesData.clear();
|
||||
|
||||
Log.i(TAG, "Cleared Main Menu");
|
||||
}
|
||||
|
||||
private void loadCourses() {
|
||||
listCourses = dbHelper.getAllRows(DataBaseHelper.DB_TABLE_COURSES, "", "shortName");
|
||||
if (!listCourses.isEmpty()) {
|
||||
Course c = (Course) listCourses.get(0);
|
||||
|
||||
Courses.setSelectedCourseCode(c.getId());
|
||||
Courses.setSelectedCourseShortName(c.getShortName());
|
||||
Courses.setSelectedCourseFullName(c.getFullName());
|
||||
|
||||
Login.setCurrentUserRole(c.getUserRole());
|
||||
} else {
|
||||
Preferences.initializeSelectedCourse();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.main_activity_actions, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_refresh:
|
||||
getCurrentCourses();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -33,14 +33,14 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import es.ugr.swad.swadroid.Constants;
|
||||
import es.ugr.swad.swadroid.Preferences;
|
||||
import es.ugr.swad.swadroid.SWADroidTracker;
|
||||
import es.ugr.swad.swadroid.model.Course;
|
||||
import es.ugr.swad.swadroid.model.Event;
|
||||
import es.ugr.swad.swadroid.model.FrequentUser;
|
||||
import es.ugr.swad.swadroid.model.Group;
|
||||
import es.ugr.swad.swadroid.model.GroupType;
|
||||
import es.ugr.swad.swadroid.model.Model;
|
||||
|
@ -53,6 +53,7 @@ import es.ugr.swad.swadroid.model.TestQuestion;
|
|||
import es.ugr.swad.swadroid.model.TestTag;
|
||||
import es.ugr.swad.swadroid.model.User;
|
||||
import es.ugr.swad.swadroid.model.UserAttendance;
|
||||
import es.ugr.swad.swadroid.preferences.Preferences;
|
||||
import es.ugr.swad.swadroid.utils.Crypto;
|
||||
import es.ugr.swad.swadroid.utils.OldCrypto;
|
||||
import es.ugr.swad.swadroid.utils.Utils;
|
||||
|
@ -88,7 +89,7 @@ public class DataBaseHelper {
|
|||
/**
|
||||
* Indicates if there are changes on db
|
||||
*/
|
||||
public static boolean dbCleaned = false;
|
||||
private static boolean dbCleaned = false;
|
||||
/**
|
||||
* Table name for courses
|
||||
*/
|
||||
|
@ -171,6 +172,10 @@ public class DataBaseHelper {
|
|||
*/
|
||||
@Deprecated
|
||||
public static final String DB_TABLE_ROLLCALL = "rollcall";
|
||||
/**
|
||||
* Table name for frequent recipients
|
||||
*/
|
||||
public static final String DB_TABLE_FREQUENT_RECIPIENTS = "frequent_recipients";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -241,29 +246,37 @@ public class DataBaseHelper {
|
|||
String firstParam = null;
|
||||
String secondParam = null;
|
||||
|
||||
if (table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE)) {
|
||||
firstParam = "qstCod";
|
||||
secondParam = "crsCod";
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS)) {
|
||||
firstParam = "qstCod";
|
||||
secondParam = "ansCod";
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_USERS_COURSES)) {
|
||||
firstParam = "userCode";
|
||||
secondParam = "crsCod";
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_GROUPS_COURSES)) {
|
||||
firstParam = "grpCod";
|
||||
secondParam = "crsCod";
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES)) {
|
||||
firstParam = "grpTypCod";
|
||||
secondParam = "grpCod";
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_EVENTS_COURSES)) {
|
||||
firstParam = "eventCode";
|
||||
secondParam = "crsCod";
|
||||
} else {
|
||||
Log.e("selectParamsPairTable", "Table " + table + " not exists");
|
||||
switch (table) {
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE:
|
||||
firstParam = "qstCod";
|
||||
secondParam = "crsCod";
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS:
|
||||
firstParam = "qstCod";
|
||||
secondParam = "ansCod";
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_USERS_COURSES:
|
||||
firstParam = "userCode";
|
||||
secondParam = "crsCod";
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_GROUPS_COURSES:
|
||||
firstParam = "grpCod";
|
||||
secondParam = "crsCod";
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES:
|
||||
firstParam = "grpTypCod";
|
||||
secondParam = "grpCod";
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_EVENTS_COURSES:
|
||||
firstParam = "eventCode";
|
||||
secondParam = "crsCod";
|
||||
break;
|
||||
default:
|
||||
Log.e("selectParamsPairTable", "Table " + table + " not exists");
|
||||
break;
|
||||
}
|
||||
|
||||
return new Pair<String, String>(firstParam, secondParam);
|
||||
return new Pair<>(firstParam, secondParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -290,144 +303,172 @@ public class DataBaseHelper {
|
|||
Pair<String, String> params;
|
||||
long id;
|
||||
|
||||
if (table.equals(DataBaseHelper.DB_TABLE_COURSES)) {
|
||||
o = new Course(ent.getInt("id"),
|
||||
ent.getInt("userRole"),
|
||||
ent.getString("shortName"),
|
||||
ent.getString("fullName"));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE) ||
|
||||
table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS) ||
|
||||
table.equals(DataBaseHelper.DB_TABLE_USERS_COURSES) ||
|
||||
table.equals(DataBaseHelper.DB_TABLE_GROUPS_COURSES) ||
|
||||
table.equals(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES) ||
|
||||
table.equals(DataBaseHelper.DB_TABLE_EVENTS_COURSES)) {
|
||||
switch (table) {
|
||||
case DataBaseHelper.DB_TABLE_COURSES:
|
||||
o = new Course(ent.getInt("id"),
|
||||
ent.getInt("userRole"),
|
||||
ent.getString("shortName"),
|
||||
ent.getString("fullName"));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE:
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS:
|
||||
case DataBaseHelper.DB_TABLE_USERS_COURSES:
|
||||
case DataBaseHelper.DB_TABLE_GROUPS_COURSES:
|
||||
case DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES:
|
||||
case DataBaseHelper.DB_TABLE_EVENTS_COURSES:
|
||||
|
||||
params = selectParamsPairTable(table);
|
||||
params = selectParamsPairTable(table);
|
||||
|
||||
o = new PairTable<Integer, Integer>(table,
|
||||
ent.getInt(params.getFirst()),
|
||||
ent.getInt(params.getSecond()));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_NOTIFICATIONS)) {
|
||||
o = new SWADNotification(ent.getInt("notifCode"),
|
||||
ent.getInt("eventCode"),
|
||||
crypto.decrypt(ent.getString("eventType")),
|
||||
ent.getLong("eventTime"),
|
||||
crypto.decrypt(ent.getString("userSurname1")),
|
||||
crypto.decrypt(ent.getString("userSurname2")),
|
||||
crypto.decrypt(ent.getString("userFirstname")),
|
||||
crypto.decrypt(ent.getString("userPhoto")),
|
||||
crypto.decrypt(ent.getString("location")),
|
||||
crypto.decrypt(ent.getString("summary")),
|
||||
ent.getInt("status"),
|
||||
crypto.decrypt(ent.getString("content")),
|
||||
Utils.parseStringBool(ent.getString("seenLocal")),
|
||||
Utils.parseStringBool(ent.getString("seenRemote")));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTIONS)) {
|
||||
id = ent.getInt("id");
|
||||
PairTable<?, ?> q = (PairTable<?, ?>) getRow(DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE, "qstCod", Long.toString(id));
|
||||
o = new PairTable<>(table,
|
||||
ent.getInt(params.getFirst()),
|
||||
ent.getInt(params.getSecond()));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_NOTIFICATIONS:
|
||||
String nickName = ent.getString("userNickname");
|
||||
String decryptedNickname = (nickName != null && !nickName.isEmpty())? crypto.decrypt(nickName) : "";
|
||||
|
||||
if (q != null) {
|
||||
o = new TestQuestion(id,
|
||||
(Integer) q.getFirst(),
|
||||
ent.getString("stem"),
|
||||
ent.getString("ansType"),
|
||||
Utils.parseStringBool(ent.getString("shuffle")),
|
||||
ent.getString("feedback"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_ANSWERS)) {
|
||||
id = ent.getId();
|
||||
int ansInd = ent.getInt("ansInd");
|
||||
PairTable<?, ?> a = (PairTable<?, ?>) getRow(DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS, "ansCod", Long.toString(id));
|
||||
o = new SWADNotification(ent.getInt("notifCode"),
|
||||
ent.getInt("eventCode"),
|
||||
crypto.decrypt(ent.getString("eventType")),
|
||||
ent.getLong("eventTime"),
|
||||
decryptedNickname,
|
||||
crypto.decrypt(ent.getString("userSurname1")),
|
||||
crypto.decrypt(ent.getString("userSurname2")),
|
||||
crypto.decrypt(ent.getString("userFirstname")),
|
||||
crypto.decrypt(ent.getString("userPhoto")),
|
||||
crypto.decrypt(ent.getString("location")),
|
||||
crypto.decrypt(ent.getString("summary")),
|
||||
ent.getInt("status"),
|
||||
crypto.decrypt(ent.getString("content")),
|
||||
Utils.parseStringBool(ent.getString("seenLocal")),
|
||||
Utils.parseStringBool(ent.getString("seenRemote")));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTIONS:
|
||||
id = ent.getInt("id");
|
||||
PairTable<?, ?> q = getRow(DataBaseHelper.DB_TABLE_TEST_QUESTIONS_COURSE, "qstCod", Long.toString(id));
|
||||
|
||||
if (a != null) {
|
||||
o = new TestAnswer(id,
|
||||
ansInd,
|
||||
(Integer) a.getFirst(),
|
||||
Utils.parseStringBool(ent.getString("correct")),
|
||||
ent.getString("answer"),
|
||||
ent.getString("answerFeedback"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_TAGS)) {
|
||||
id = ent.getInt("tagCod");
|
||||
TestTag t = (TestTag) getRow(DataBaseHelper.DB_TABLE_TEST_QUESTION_TAGS, "tagCod", Long.toString(id));
|
||||
if (q != null) {
|
||||
o = new TestQuestion(id,
|
||||
(Integer) q.getFirst(),
|
||||
ent.getString("stem"),
|
||||
ent.getString("ansType"),
|
||||
Utils.parseStringBool(ent.getString("shuffle")),
|
||||
ent.getString("feedback"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_ANSWERS:
|
||||
id = ent.getId();
|
||||
int ansInd = ent.getInt("ansInd");
|
||||
PairTable<?, ?> a = getRow(DataBaseHelper.DB_TABLE_TEST_QUESTION_ANSWERS, "ansCod", Long.toString(id));
|
||||
|
||||
if (t != null) {
|
||||
o = new TestTag(id,
|
||||
t.getQstCodList(),
|
||||
ent.getString("tagTxt"),
|
||||
if (a != null) {
|
||||
o = new TestAnswer(id,
|
||||
ansInd,
|
||||
(Integer) a.getFirst(),
|
||||
Utils.parseStringBool(ent.getString("correct")),
|
||||
ent.getString("answer"),
|
||||
ent.getString("answerFeedback"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_TAGS:
|
||||
id = ent.getInt("tagCod");
|
||||
TestTag t = getRow(DataBaseHelper.DB_TABLE_TEST_QUESTION_TAGS, "tagCod", Long.toString(id));
|
||||
|
||||
if (t != null) {
|
||||
o = new TestTag(id,
|
||||
t.getQstCodList(),
|
||||
ent.getString("tagTxt"),
|
||||
ent.getInt("tagInd"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_CONFIG:
|
||||
o = new Test(ent.getInt("id"),
|
||||
ent.getInt("min"),
|
||||
ent.getInt("def"),
|
||||
ent.getInt("max"),
|
||||
ent.getString("feedback"),
|
||||
ent.getLong("editTime"));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_TEST_QUESTION_TAGS:
|
||||
ArrayList<Integer> l = new ArrayList<>();
|
||||
l.add(ent.getInt("qstCod"));
|
||||
o = new TestTag(ent.getInt("tagCod"),
|
||||
l,
|
||||
null,
|
||||
ent.getInt("tagInd"));
|
||||
} else {
|
||||
o = null;
|
||||
}
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_CONFIG)) {
|
||||
o = new Test(ent.getInt("id"),
|
||||
ent.getInt("min"),
|
||||
ent.getInt("def"),
|
||||
ent.getInt("max"),
|
||||
ent.getString("feedback"),
|
||||
ent.getLong("editTime"));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_TEST_QUESTION_TAGS)) {
|
||||
ArrayList<Integer> l = new ArrayList<Integer>();
|
||||
l.add(ent.getInt("qstCod"));
|
||||
o = new TestTag(ent.getInt("tagCod"),
|
||||
l,
|
||||
null,
|
||||
ent.getInt("tagInd"));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_USERS)) {
|
||||
try {
|
||||
o = new User(ent.getInt("userCode"),
|
||||
null, // wsKey
|
||||
ent.getString("userID"),
|
||||
ent.getString("userNickname"),
|
||||
ent.getString("userSurname1"),
|
||||
ent.getString("userSurname2"),
|
||||
ent.getString("userFirstname"),
|
||||
ent.getString("photoPath"),
|
||||
null, //userBirthday
|
||||
ent.getInt("userRole"));
|
||||
} catch (ParseException e) {
|
||||
//Send exception details to Google Analytics
|
||||
SWADroidTracker.sendException(mCtx, e, false);
|
||||
}
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_USERS_ATTENDANCES)) {
|
||||
o = new UserAttendance(ent.getInt("userCode"),
|
||||
ent.getInt("eventCode"),
|
||||
Utils.parseIntBool(ent.getInt("present")));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_EVENTS_ATTENDANCES)) {
|
||||
o = new Event(ent.getLong("id"),
|
||||
Utils.parseIntBool(ent.getInt("hidden")),
|
||||
crypto.decrypt(ent.getString("userSurname1")),
|
||||
crypto.decrypt(ent.getString("userSurname2")),
|
||||
crypto.decrypt(ent.getString("userFirstName")),
|
||||
crypto.decrypt(ent.getString("userPhoto")),
|
||||
ent.getLong("startTime"),
|
||||
ent.getLong("endTime"),
|
||||
Utils.parseIntBool(ent.getInt("commentsTeachersVisible")),
|
||||
crypto.decrypt(ent.getString("title")),
|
||||
crypto.decrypt(ent.getString("text")),
|
||||
crypto.decrypt(ent.getString("groups")),
|
||||
crypto.decrypt(ent.getString("status")));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_GROUPS)) {
|
||||
long groupTypeCode = getGroupTypeCodeFromGroup(ent.getLong("id"));
|
||||
o = new Group(ent.getLong("id"),
|
||||
ent.getString("groupName"),
|
||||
groupTypeCode,
|
||||
ent.getInt("maxStudents"),
|
||||
ent.getInt("open"),
|
||||
ent.getInt("students"),
|
||||
ent.getInt("fileZones"),
|
||||
ent.getInt("member"));
|
||||
} else if (table.equals(DataBaseHelper.DB_TABLE_GROUP_TYPES)) {
|
||||
o = new GroupType(ent.getLong("id"),
|
||||
ent.getString("groupTypeName"),
|
||||
ent.getLong("courseCode"),
|
||||
ent.getInt("mandatory"),
|
||||
ent.getInt("multiple"),
|
||||
ent.getLong("openTime"));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_USERS:
|
||||
try {
|
||||
o = new User(ent.getInt("userCode"),
|
||||
null, // wsKey
|
||||
ent.getString("userID"),
|
||||
ent.getString("userNickname"),
|
||||
ent.getString("userSurname1"),
|
||||
ent.getString("userSurname2"),
|
||||
ent.getString("userFirstname"),
|
||||
ent.getString("photoPath"),
|
||||
null, //userBirthday
|
||||
ent.getInt("userRole"));
|
||||
} catch (ParseException e) {
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_USERS_ATTENDANCES:
|
||||
o = new UserAttendance(ent.getInt("userCode"),
|
||||
ent.getInt("eventCode"),
|
||||
Utils.parseIntBool(ent.getInt("present")));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_EVENTS_ATTENDANCES:
|
||||
o = new Event(ent.getLong("id"),
|
||||
Utils.parseIntBool(ent.getInt("hidden")),
|
||||
crypto.decrypt(ent.getString("userSurname1")),
|
||||
crypto.decrypt(ent.getString("userSurname2")),
|
||||
crypto.decrypt(ent.getString("userFirstName")),
|
||||
crypto.decrypt(ent.getString("userPhoto")),
|
||||
ent.getLong("startTime"),
|
||||
ent.getLong("endTime"),
|
||||
Utils.parseIntBool(ent.getInt("commentsTeachersVisible")),
|
||||
crypto.decrypt(ent.getString("title")),
|
||||
crypto.decrypt(ent.getString("text")),
|
||||
crypto.decrypt(ent.getString("groups")),
|
||||
crypto.decrypt(ent.getString("status")));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_GROUPS:
|
||||
long groupTypeCode = getGroupTypeCodeFromGroup(ent.getLong("id"));
|
||||
o = new Group(ent.getLong("id"),
|
||||
ent.getString("groupName"),
|
||||
groupTypeCode,
|
||||
ent.getInt("maxStudents"),
|
||||
ent.getInt("open"),
|
||||
ent.getInt("students"),
|
||||
ent.getInt("fileZones"),
|
||||
ent.getInt("member"));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_GROUP_TYPES:
|
||||
o = new GroupType(ent.getLong("id"),
|
||||
ent.getString("groupTypeName"),
|
||||
ent.getLong("courseCode"),
|
||||
ent.getInt("mandatory"),
|
||||
ent.getInt("multiple"),
|
||||
ent.getLong("openTime"));
|
||||
break;
|
||||
case DataBaseHelper.DB_TABLE_FREQUENT_RECIPIENTS:
|
||||
o = new FrequentUser(ent.getString("idUser"),
|
||||
crypto.decrypt(ent.getString("nicknameRecipient")),
|
||||
crypto.decrypt(ent.getString("surname1Recipient")),
|
||||
crypto.decrypt(ent.getString("surname2Recipient")),
|
||||
crypto.decrypt(ent.getString("firstnameRecipient")),
|
||||
crypto.decrypt(ent.getString("photoRecipient")),
|
||||
ent.getInt("userCode"),
|
||||
false,
|
||||
ent.getDouble("score"));
|
||||
break;
|
||||
}
|
||||
|
||||
return (T) o;
|
||||
|
@ -440,7 +481,7 @@ public class DataBaseHelper {
|
|||
* @return A list of Model's subclass objects
|
||||
*/
|
||||
public <T extends Model> List<T> getAllRows(String table) {
|
||||
List<T> result = new ArrayList<T>();
|
||||
List<T> result = new ArrayList<>();
|
||||
List<Entity> rows = db.getEntityList(table);
|
||||
T row;
|
||||
|
||||
|
@ -462,7 +503,7 @@ public class DataBaseHelper {
|
|||
* @return A list of Model's subclass objects
|
||||
*/
|
||||
public <T extends Model> List<T> getAllRows(String table, String where, String orderby) {
|
||||
List<T> result = new ArrayList<T>();
|
||||
List<T> result = new ArrayList<>();
|
||||
List<Entity> rows = db.getEntityList(table, where, orderby);
|
||||
T row;
|
||||
|
||||
|
@ -525,6 +566,22 @@ public class DataBaseHelper {
|
|||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all tablenames of the database
|
||||
*
|
||||
* @return A list of all tablenames of the database
|
||||
*/
|
||||
public List<String> getAllTablenames() {
|
||||
List<String> result = new ArrayList<>();
|
||||
Cursor cursor = db.rawQuery("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name", null);
|
||||
|
||||
while (cursor.moveToNext()) {
|
||||
result.add(cursor.getString(0));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an user
|
||||
*
|
||||
|
@ -560,8 +617,7 @@ public class DataBaseHelper {
|
|||
null,
|
||||
ent.getInt("userRole"));
|
||||
} catch (ParseException e) {
|
||||
//Send exception details to Google Analytics
|
||||
SWADroidTracker.sendException(mCtx, e, false);
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -575,7 +631,7 @@ public class DataBaseHelper {
|
|||
* @return A list of User's id
|
||||
*/
|
||||
public List<Long> getUsersCourse(long courseCode) {
|
||||
List<Long> result = new ArrayList<Long>();
|
||||
List<Long> result = new ArrayList<>();
|
||||
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_USERS_COURSES, "crsCod = '" + courseCode + "'");
|
||||
if (rows != null) {
|
||||
|
@ -593,7 +649,7 @@ public class DataBaseHelper {
|
|||
* @return A list of User's id
|
||||
*/
|
||||
public List<Long> getUserIdsEvent(int eventCode) {
|
||||
List<Long> result = new ArrayList<Long>();
|
||||
List<Long> result = new ArrayList<>();
|
||||
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_USERS_ATTENDANCES, "eventCode = '" + eventCode + "'");
|
||||
if (rows != null) {
|
||||
|
@ -611,7 +667,7 @@ public class DataBaseHelper {
|
|||
* @return A list of @link{UserAttendance} related to the selected event
|
||||
*/
|
||||
public List<UserAttendance> getUsersEvent(int eventCode) {
|
||||
List<UserAttendance> result = new ArrayList<UserAttendance>();
|
||||
List<UserAttendance> result = new ArrayList<>();
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_USERS_ATTENDANCES, "eventCode = '" + eventCode + "'");
|
||||
|
||||
if (rows != null) {
|
||||
|
@ -656,7 +712,7 @@ public class DataBaseHelper {
|
|||
* @return A list of Event
|
||||
*/
|
||||
public List<Event> getEventsCourse(long crsCod) {
|
||||
List<Event> result = new ArrayList<Event>();
|
||||
List<Event> result = new ArrayList<>();
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_EVENTS_COURSES, "crsCod = '" + crsCod + "'");
|
||||
|
||||
if (rows != null) {
|
||||
|
@ -724,7 +780,7 @@ public class DataBaseHelper {
|
|||
List<Entity> rows = db.getEntityList(table, "id = " + groupId);
|
||||
Group g = null;
|
||||
if (rows != null)
|
||||
g = (Group) createObjectByTable(table, rows.get(0));
|
||||
g = createObjectByTable(table, rows.get(0));
|
||||
return g;
|
||||
}
|
||||
|
||||
|
@ -735,7 +791,7 @@ public class DataBaseHelper {
|
|||
* @return A list of group codes belonging to the selected course
|
||||
*/
|
||||
public List<Long> getGroupCodesCourse(long courseCode) {
|
||||
List<Long> result = new ArrayList<Long>();
|
||||
List<Long> result = new ArrayList<>();
|
||||
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_COURSES, "crsCod = '" + courseCode + "'");
|
||||
if (rows != null) {
|
||||
|
@ -754,7 +810,7 @@ public class DataBaseHelper {
|
|||
* @return List of Groups
|
||||
*/
|
||||
public List<Group> getGroupsOfType(long groupTypeCode) {
|
||||
List<Group> groups = new ArrayList<Group>();
|
||||
List<Group> groups = new ArrayList<>();
|
||||
List<Long> groupCodes = getGroupsCodesOfType(groupTypeCode);
|
||||
if (!groupCodes.isEmpty()) {
|
||||
for (Long groupCode : groupCodes) {
|
||||
|
@ -806,7 +862,7 @@ public class DataBaseHelper {
|
|||
* @return List of group codes
|
||||
*/
|
||||
private List<Long> getGroupsCodesOfType(long groupTypeCode) {
|
||||
List<Long> groupCodes = new ArrayList<Long>();
|
||||
List<Long> groupCodes = new ArrayList<>();
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, "grpTypCod = '" + groupTypeCode + "'");
|
||||
if (rows != null) {
|
||||
for (Entity row : rows) {
|
||||
|
@ -824,10 +880,10 @@ public class DataBaseHelper {
|
|||
*/
|
||||
public List<Group> getUserLoggedGroups(long courseCode) {
|
||||
List<Long> groupCodes = getGroupCodesCourse(courseCode);
|
||||
List<Group> groups = new ArrayList<Group>();
|
||||
List<Group> groups = new ArrayList<>();
|
||||
if (!groupCodes.isEmpty()) {
|
||||
for (Long groupCode : groupCodes) {
|
||||
Group g = (Group) getRow(DataBaseHelper.DB_TABLE_GROUPS, "id", String.valueOf(groupCode));
|
||||
Group g = getRow(DataBaseHelper.DB_TABLE_GROUPS, "id", String.valueOf(groupCode));
|
||||
if (g.isMember()) groups.add(g);
|
||||
}
|
||||
}
|
||||
|
@ -861,7 +917,7 @@ public class DataBaseHelper {
|
|||
*/
|
||||
public boolean isUserEnrolledCourse(String userID, long selectedCourseCode) {
|
||||
boolean enrolled = false;
|
||||
User u = (User) getRow(DataBaseHelper.DB_TABLE_USERS, "userID", userID);
|
||||
User u = getRow(DataBaseHelper.DB_TABLE_USERS, "userID", userID);
|
||||
|
||||
if (u != null) {
|
||||
String sentencia = "SELECT userCode AS _id, crsCod" +
|
||||
|
@ -890,16 +946,19 @@ public class DataBaseHelper {
|
|||
* @param courseCode Course code to be referenced
|
||||
* @return Cursor access to the groups
|
||||
*/
|
||||
public List<Group> getGroups(long courseCode, String... filter) {
|
||||
public List<Group> getGroups(long courseCode) {
|
||||
String select = "SELECT grpCod FROM " + DataBaseHelper.DB_TABLE_GROUPS_COURSES + " WHERE crsCod = " + courseCode + ";";
|
||||
Cursor groupCodes = db.getDB().rawQuery(select, null);
|
||||
|
||||
List<Group> groups = new ArrayList<Group>(groupCodes.getCount());
|
||||
List<Group> groups = new ArrayList<>(groupCodes.getCount());
|
||||
|
||||
while (groupCodes.moveToNext()) {
|
||||
Group group = (Group) this.getRow(DataBaseHelper.DB_TABLE_GROUPS, "id", String.valueOf(groupCodes.getInt(0)));
|
||||
Group group = this.getRow(DataBaseHelper.DB_TABLE_GROUPS, "id", String.valueOf(groupCodes.getInt(0)));
|
||||
groups.add(group);
|
||||
}
|
||||
|
||||
groupCodes.close();
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
|
@ -932,6 +991,7 @@ public class DataBaseHelper {
|
|||
ent.setValue("eventCode", n.getEventCode());
|
||||
ent.setValue("eventType", crypto.encrypt(n.getEventType()));
|
||||
ent.setValue("eventTime", eventTime);
|
||||
ent.setValue("userNickname", crypto.encrypt(n.getUserNickname()));
|
||||
ent.setValue("userSurname1", crypto.encrypt(n.getUserSurname1()));
|
||||
ent.setValue("userSurname2", crypto.encrypt(n.getUserSurname2()));
|
||||
ent.setValue("userFirstname", crypto.encrypt(n.getUserFirstName()));
|
||||
|
@ -1145,13 +1205,13 @@ public class DataBaseHelper {
|
|||
//update all the relationship
|
||||
long groupCode = g.getId();
|
||||
rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_COURSES, "grpCod =" + groupCode);
|
||||
Course course = (Course) getRow(DataBaseHelper.DB_TABLE_COURSES, "id", String.valueOf(courseCode));
|
||||
Course course = getRow(DataBaseHelper.DB_TABLE_COURSES, "id", String.valueOf(courseCode));
|
||||
|
||||
//course code is a foreign key. Therefore, to avoid a database error,
|
||||
//it should not insert/modify rows in the relationship table if the course does not exists
|
||||
if (course != null) {
|
||||
if (rows.isEmpty()) {
|
||||
PairTable<Long, Long> pair = new PairTable<Long, Long>(DataBaseHelper.DB_TABLE_GROUPS_COURSES, g.getId(), courseCode);
|
||||
PairTable<Long, Long> pair = new PairTable<>(DataBaseHelper.DB_TABLE_GROUPS_COURSES, g.getId(), courseCode);
|
||||
insertPairTable(pair);
|
||||
} else {
|
||||
rows.get(0).setValue("crsCod", courseCode);
|
||||
|
@ -1168,9 +1228,9 @@ public class DataBaseHelper {
|
|||
//if(groupType != null){
|
||||
rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, "grpCod=" + groupCode);
|
||||
if (rows.isEmpty()) {
|
||||
insertPairTable(new PairTable<Long, Long>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode, groupCode));
|
||||
insertPairTable(new PairTable<>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode, groupCode));
|
||||
} else {
|
||||
PairTable<Object, Object> prev = new PairTable<Object, Object>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, rows.get(0).getValue("grpTypCod"), rows.get(0).getValue("grpCod"));
|
||||
PairTable<Object, Object> prev = new PairTable<>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, rows.get(0).getValue("grpTypCod"), rows.get(0).getValue("grpCod"));
|
||||
PairTable<Object, Object> current = new PairTable<Object, Object>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode, groupCode);
|
||||
updatePairTable(prev, current);
|
||||
}
|
||||
|
@ -1186,7 +1246,7 @@ public class DataBaseHelper {
|
|||
*/
|
||||
public boolean insertGroupType(GroupType gt) {
|
||||
boolean returnValue = true;
|
||||
GroupType row = (GroupType) getRow(DataBaseHelper.DB_TABLE_GROUP_TYPES, "id", String.valueOf(gt.getId()));
|
||||
GroupType row = getRow(DataBaseHelper.DB_TABLE_GROUP_TYPES, "id", String.valueOf(gt.getId()));
|
||||
if (row == null) {
|
||||
insertEntity(DataBaseHelper.DB_TABLE_GROUP_TYPES, gt);
|
||||
} else {
|
||||
|
@ -1198,9 +1258,9 @@ public class DataBaseHelper {
|
|||
public boolean insertCollection(String table, List<Model> currentModels, long... courseCode) {
|
||||
boolean result = true;
|
||||
Collection<? extends Model> modelsDB = getAllRows(table);
|
||||
List<Model> newModels = new ArrayList<Model>();
|
||||
List<Model> obsoleteModel = new ArrayList<Model>();
|
||||
List<Model> modifiedModel = new ArrayList<Model>();
|
||||
List<Model> newModels = new ArrayList<>();
|
||||
List<Model> obsoleteModel = new ArrayList<>();
|
||||
List<Model> modifiedModel = new ArrayList<>();
|
||||
|
||||
beginTransaction();
|
||||
|
||||
|
@ -1356,6 +1416,51 @@ public class DataBaseHelper {
|
|||
ent.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a new Frequent Recipient
|
||||
*
|
||||
* @param user the frequent recipient to insert in the list
|
||||
*/
|
||||
public void insertFrequentRecipient(FrequentUser user) {
|
||||
Entity ent = new Entity(DataBaseHelper.DB_TABLE_FREQUENT_RECIPIENTS);
|
||||
ent.setValue("idUser", user.getidUser());
|
||||
ent.setValue("nicknameRecipient", crypto.encrypt(user.getUserNickname()));
|
||||
ent.setValue("surname1Recipient", crypto.encrypt(user.getUserSurname1()));
|
||||
ent.setValue("surname2Recipient", crypto.encrypt(user.getUserSurname2()));
|
||||
ent.setValue("firstnameRecipient", crypto.encrypt(user.getUserFirstname()));
|
||||
ent.setValue("photoRecipient", crypto.encrypt(user.getUserPhoto()));
|
||||
ent.setValue("score", user.getScore());
|
||||
ent.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a list of frequent recipients
|
||||
*
|
||||
* @param list the list of users
|
||||
* @return number of users inserted in the table
|
||||
*/
|
||||
public int insertFrequentsList(List<FrequentUser> list) {
|
||||
int numElements = 0;
|
||||
|
||||
for(int i=0; i<list.size(); i++){
|
||||
FrequentUser user = list.get(i);
|
||||
|
||||
Entity ent = new Entity(DataBaseHelper.DB_TABLE_FREQUENT_RECIPIENTS);
|
||||
ent.setValue("idUser", user.getidUser());
|
||||
ent.setValue("nicknameRecipient", crypto.encrypt(user.getUserNickname()));
|
||||
ent.setValue("surname1Recipient", crypto.encrypt(user.getUserSurname1()));
|
||||
ent.setValue("surname2Recipient", crypto.encrypt(user.getUserSurname2()));
|
||||
ent.setValue("firstnameRecipient", crypto.encrypt(user.getUserFirstname()));
|
||||
ent.setValue("photoRecipient", crypto.encrypt(user.getUserPhoto()));
|
||||
ent.setValue("score", user.getScore());
|
||||
ent.save();
|
||||
|
||||
numElements++;
|
||||
}
|
||||
|
||||
return numElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a course in database
|
||||
*
|
||||
|
@ -1431,6 +1536,7 @@ public class DataBaseHelper {
|
|||
long eventCode = actual.getEventCode();
|
||||
String eventType = crypto.encrypt(actual.getEventType());
|
||||
String eventTime = String.valueOf(actual.getEventTime());
|
||||
String userNickname = crypto.encrypt(actual.getUserNickname());
|
||||
String userSurname1 = crypto.encrypt(actual.getUserSurname1());
|
||||
String userSurname2 = crypto.encrypt(actual.getUserSurname2());
|
||||
String userFirstname = crypto.encrypt(actual.getUserFirstName());
|
||||
|
@ -1447,6 +1553,7 @@ public class DataBaseHelper {
|
|||
ent.setValue("eventCode", eventCode);
|
||||
ent.setValue("eventType", eventType);
|
||||
ent.setValue("eventTime", eventTime);
|
||||
ent.setValue("userNickname", userNickname);
|
||||
ent.setValue("userSurname1", userSurname1);
|
||||
ent.setValue("userSurname2", userSurname2);
|
||||
ent.setValue("userFirstname", userFirstname);
|
||||
|
@ -1473,6 +1580,7 @@ public class DataBaseHelper {
|
|||
long eventCode = actual.getEventCode();
|
||||
String eventType = crypto.encrypt(actual.getEventType());
|
||||
String eventTime = String.valueOf(actual.getEventTime());
|
||||
String userNickname = crypto.encrypt(actual.getUserNickname());
|
||||
String userSurname1 = crypto.encrypt(actual.getUserSurname1());
|
||||
String userSurname2 = crypto.encrypt(actual.getUserSurname2());
|
||||
String userFirstname = crypto.encrypt(actual.getUserFirstName());
|
||||
|
@ -1489,6 +1597,7 @@ public class DataBaseHelper {
|
|||
ent.setValue("eventCode", eventCode);
|
||||
ent.setValue("eventType", eventType);
|
||||
ent.setValue("eventTime", eventTime);
|
||||
ent.setValue("userNickname", userNickname);
|
||||
ent.setValue("userSurname1", userSurname1);
|
||||
ent.setValue("userSurname2", userSurname2);
|
||||
ent.setValue("userFirstname", userFirstname);
|
||||
|
@ -1741,7 +1850,7 @@ public class DataBaseHelper {
|
|||
insertEntity(DataBaseHelper.DB_TABLE_GROUPS, currentGroup, ent);
|
||||
|
||||
rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_COURSES, "grpCod =" + groupCode);
|
||||
Course course = (Course) getRow(DataBaseHelper.DB_TABLE_COURSES, "id", String.valueOf(courseCode));
|
||||
Course course = getRow(DataBaseHelper.DB_TABLE_COURSES, "id", String.valueOf(courseCode));
|
||||
//course code is a foreign key. Therefore, to avoid a database error,
|
||||
//it should not insert/modify rows in the relationship table if the course does not exists
|
||||
if (course != null) {
|
||||
|
@ -1757,16 +1866,16 @@ public class DataBaseHelper {
|
|||
} else returnValue = false;
|
||||
|
||||
if (groupTypeCode.length > 0) {
|
||||
GroupType groupType = (GroupType) getRow(DataBaseHelper.DB_TABLE_GROUP_TYPES, "id", String.valueOf(groupTypeCode[0]));
|
||||
GroupType groupType = getRow(DataBaseHelper.DB_TABLE_GROUP_TYPES, "id", String.valueOf(groupTypeCode[0]));
|
||||
//group type code is a foreign key. Therefore, to avoid a database error,
|
||||
//it should not insert/modify rows in the relationship table if the group type does not exists
|
||||
if (groupType != null) {
|
||||
rows = db.getEntityList(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, "grpCod=" + groupCode);
|
||||
if (!rows.isEmpty()) {
|
||||
insertPairTable(new PairTable<Long, Long>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode[0], groupCode));
|
||||
insertPairTable(new PairTable<>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode[0], groupCode));
|
||||
|
||||
} else {
|
||||
PairTable<Object, Object> prev = new PairTable<Object, Object>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, rows.get(0).getValue("grpTypCod"), rows.get(0).getValue("grpCod"));
|
||||
PairTable<Object, Object> prev = new PairTable<>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, rows.get(0).getValue("grpTypCod"), rows.get(0).getValue("grpCod"));
|
||||
PairTable<Object, Object> current = new PairTable<Object, Object>(DataBaseHelper.DB_TABLE_GROUPS_GROUPTYPES, groupTypeCode[0], groupCode);
|
||||
updatePairTable(prev, current);
|
||||
|
||||
|
@ -1778,6 +1887,21 @@ public class DataBaseHelper {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Frequent Recipient with the new score
|
||||
*
|
||||
* @param nickname the identifier of recipient
|
||||
* @param score the score to order the frequent recipients list
|
||||
*/
|
||||
public void updateFrequentRecipient(String nickname, Double score) {
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_FREQUENT_RECIPIENTS, "nicknameRecipient = '" + nickname + "'");
|
||||
|
||||
for(Entity ent : rows) {
|
||||
ent.setValue("score", score);
|
||||
ent.save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a User from database
|
||||
*
|
||||
|
@ -1829,6 +1953,20 @@ public class DataBaseHelper {
|
|||
for (Entity ent : rows) {
|
||||
ent.delete();
|
||||
}
|
||||
}/**
|
||||
* Removes all rows from a database table matching the given condition
|
||||
*
|
||||
* @param where condition to remove a row
|
||||
* @return numRowsDeleted Number of deleted rows
|
||||
*/
|
||||
public int removeAllRows(String table, String where) {
|
||||
List<Entity> rows = db.getEntityList(table, where);
|
||||
|
||||
for (Entity ent : rows) {
|
||||
ent.delete();
|
||||
}
|
||||
|
||||
return rows.size();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1910,7 +2048,7 @@ public class DataBaseHelper {
|
|||
String orderBy = "T.tagTxt ASC";
|
||||
String groupBy = "T.id";
|
||||
Cursor dbCursor = db.getDB().query(tables, columns, where, null, groupBy, null, orderBy);
|
||||
List<TestTag> result = new ArrayList<TestTag>();
|
||||
List<TestTag> result = new ArrayList<>();
|
||||
List<Integer> qstCodList;
|
||||
int idOld = -1;
|
||||
TestTag t = null;
|
||||
|
@ -1919,7 +2057,7 @@ public class DataBaseHelper {
|
|||
int id = dbCursor.getInt(0);
|
||||
|
||||
if (id != idOld) {
|
||||
qstCodList = new ArrayList<Integer>();
|
||||
qstCodList = new ArrayList<>();
|
||||
|
||||
String tagTxt = dbCursor.getString(1);
|
||||
qstCodList.add(dbCursor.getInt(2));
|
||||
|
@ -1934,6 +2072,8 @@ public class DataBaseHelper {
|
|||
}
|
||||
}
|
||||
|
||||
dbCursor.close();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1954,7 +2094,7 @@ public class DataBaseHelper {
|
|||
String orderby = " ORDER BY RANDOM()";
|
||||
String limit = " LIMIT " + maxQuestions;
|
||||
Cursor dbCursorQuestions, dbCursorAnswers;
|
||||
List<TestQuestion> result = new ArrayList<TestQuestion>();
|
||||
List<TestQuestion> result = new ArrayList<>();
|
||||
List<TestAnswer> answers;
|
||||
int tagsListSize = tagsList.size();
|
||||
int answerTypesListSize = answerTypesList.size();
|
||||
|
@ -2007,7 +2147,7 @@ public class DataBaseHelper {
|
|||
|
||||
where = " WHERE Q.qstCod=" + qstCod + " AND Q.ansCod=A._id";
|
||||
dbCursorAnswers = db.getDB().rawQuery(select + tables + where + orderby, null);
|
||||
answers = new ArrayList<TestAnswer>();
|
||||
answers = new ArrayList<>();
|
||||
while (dbCursorAnswers.moveToNext()) {
|
||||
long ansCod = dbCursorAnswers.getLong(0);
|
||||
int ansInd = dbCursorAnswers.getInt(1);
|
||||
|
@ -2020,19 +2160,23 @@ public class DataBaseHelper {
|
|||
|
||||
q.setAnswers(answers);
|
||||
result.add(q);
|
||||
|
||||
dbCursorAnswers.close();
|
||||
}
|
||||
|
||||
dbCursorQuestions.close();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear old notifications
|
||||
* Clean old notifications by size
|
||||
*
|
||||
* @param size Max table size
|
||||
*/
|
||||
public void clearOldNotifications(int size) {
|
||||
public void cleanOldNotificationsBySize(int size) {
|
||||
String where = null;
|
||||
String orderby = "eventTime ASC";
|
||||
String orderby = "CAST(eventTime as INTEGER) ASC";
|
||||
List<Entity> rows = db.getEntityList(DataBaseHelper.DB_TABLE_NOTIFICATIONS, where, orderby);
|
||||
int numRows = rows.size();
|
||||
int numDeletions = numRows - size;
|
||||
|
@ -2043,6 +2187,21 @@ public class DataBaseHelper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean old notifications by age
|
||||
*
|
||||
* @param age Max age in seconds
|
||||
* @return numRowsDeleted Number of deleted notifications
|
||||
*/
|
||||
public int cleanOldNotificationsByAge(int age) {
|
||||
long now = Calendar.getInstance().getTime().getTime() / 1000; // in seconds
|
||||
|
||||
// Remove notifications older than 'age' seconds
|
||||
String where = "CAST(eventTime as INTEGER) < " + String.valueOf(now - age);
|
||||
|
||||
return removeAllRows(DataBaseHelper.DB_TABLE_NOTIFICATIONS, where);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypts the notifications data
|
||||
*/
|
||||
|
@ -2154,7 +2313,6 @@ public class DataBaseHelper {
|
|||
* Delete all tables from database
|
||||
*/
|
||||
public void clearDB() {
|
||||
SWADroidTracker.sendScreenView(mCtx, TAG + " clearDB");
|
||||
db.deleteTables();
|
||||
Log.i(TAG, "All tables deleted");
|
||||
}
|
||||
|
@ -2163,7 +2321,7 @@ public class DataBaseHelper {
|
|||
* Clean data of all tables from database. Removes users photos from external storage
|
||||
*/
|
||||
public void cleanTables() {
|
||||
SWADroidTracker.sendScreenView(mCtx, TAG + " cleanTables");
|
||||
Log.i(TAG, "Emptying all tables");
|
||||
|
||||
db.emptyTables();
|
||||
compactDB();
|
||||
|
@ -2179,8 +2337,7 @@ public class DataBaseHelper {
|
|||
try {
|
||||
wait();
|
||||
} catch (InterruptedException e) {
|
||||
//Send exception details to Google Analytics
|
||||
SWADroidTracker.sendException(mCtx, e, false);
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2204,8 +2361,8 @@ public class DataBaseHelper {
|
|||
|
||||
notifyAll();
|
||||
} else {
|
||||
//Send exception details to Google Analytics
|
||||
SWADroidTracker.sendException(mCtx, new DataBaseHelperException("No active transactions"), false);
|
||||
Exception e = new DataBaseHelperException("No active transactions");
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2217,6 +2374,7 @@ public class DataBaseHelper {
|
|||
* Compact the database
|
||||
*/
|
||||
private void compactDB() {
|
||||
Log.i(TAG, "Compacting database");
|
||||
db.getDB().execSQL("VACUUM;");
|
||||
Log.i(TAG, "Database compacted");
|
||||
}
|
||||
|
@ -2233,8 +2391,11 @@ public class DataBaseHelper {
|
|||
/**
|
||||
* Upgrades the database structure
|
||||
*/
|
||||
public void upgradeDB(Context context) {
|
||||
public void upgradeDB() {
|
||||
int dbVersion = db.getDB().getVersion();
|
||||
|
||||
Log.i(TAG, "Upgrading database");
|
||||
|
||||
/*
|
||||
* Modify database keeping data:
|
||||
* 1. Create temporary table __DB_TABLE_GROUPS (with the new model)
|
||||
|
@ -2294,4 +2455,5 @@ public class DataBaseHelper {
|
|||
public static void setDbCleaned(boolean state) {
|
||||
dbCleaned = state;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* This file is part of SWADroid.
|
||||
*
|
||||
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*
|
||||
* SWADroid is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* SWADroid is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package es.ugr.swad.swadroid.gui;
|
||||
|
||||
import static es.ugr.swad.swadroid.utils.NotificationUtils.SWADROID_CHANNEL_ID;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import es.ugr.swad.swadroid.modules.notifications.Notifications;
|
||||
import es.ugr.swad.swadroid.utils.NotificationUtils;
|
||||
|
||||
/**
|
||||
* Class for create notification alerts.
|
||||
*
|
||||
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*/
|
||||
public class AlertNotificationFactory {
|
||||
public static final String CHANNEL_NAME = "Background Service";
|
||||
public static NotificationCompat.Builder createAlertNotificationBuilder(Context context, String contentTitle, String contentText,
|
||||
String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon,
|
||||
boolean autocancel, boolean ongoing, boolean onlyAlertOnce) {
|
||||
|
||||
int flags = 0;
|
||||
|
||||
NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context, SWADROID_CHANNEL_ID)
|
||||
.setAutoCancel(autocancel)
|
||||
.setSmallIcon(smallIcon)
|
||||
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), largeIcon))
|
||||
.setContentTitle(contentTitle)
|
||||
.setContentText(contentText)
|
||||
.setTicker(ticker)
|
||||
.setOngoing(ongoing)
|
||||
.setOnlyAlertOnce(onlyAlertOnce)
|
||||
.setWhen(System.currentTimeMillis());
|
||||
//.setLights(Color.GREEN, 500, 500);
|
||||
|
||||
//Launch activity on alert click
|
||||
if (pendingIntent != null) {
|
||||
notifBuilder.setContentIntent(pendingIntent);
|
||||
}
|
||||
|
||||
//Add sound, vibration and lights
|
||||
flags |= Notification.DEFAULT_SOUND;
|
||||
flags |= Notification.DEFAULT_VIBRATE;
|
||||
flags |= Notification.DEFAULT_LIGHTS;
|
||||
|
||||
notifBuilder.setDefaults(flags);
|
||||
|
||||
return notifBuilder;
|
||||
}
|
||||
|
||||
public static NotificationCompat.Builder createProgressNotificationBuilder(Context context, String contentTitle, String contentText,
|
||||
String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon,
|
||||
boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) {
|
||||
|
||||
NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context,
|
||||
contentTitle,
|
||||
contentText,
|
||||
ticker,
|
||||
pendingIntent,
|
||||
smallIcon,
|
||||
largeIcon,
|
||||
autocancel,
|
||||
ongoing,
|
||||
onlyAlertOnce);
|
||||
|
||||
notifBuilder.setProgress(maxProgress, progress, indeterminate);
|
||||
|
||||
return notifBuilder;
|
||||
}
|
||||
|
||||
public static Notification createAlertNotification(Context context, String contentTitle, String contentText,
|
||||
String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon,
|
||||
boolean autocancel, boolean ongoing, boolean onlyAlertOnce) {
|
||||
|
||||
NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context,
|
||||
contentTitle,
|
||||
contentText,
|
||||
ticker,
|
||||
pendingIntent,
|
||||
smallIcon,
|
||||
largeIcon,
|
||||
autocancel,
|
||||
ongoing,
|
||||
onlyAlertOnce);
|
||||
|
||||
//Create alert
|
||||
return notifBuilder.build();
|
||||
}
|
||||
|
||||
public static Notification createProgressNotification(Context context, String contentTitle, String contentText,
|
||||
String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon,
|
||||
boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) {
|
||||
|
||||
NotificationCompat.Builder notifBuilder = createProgressNotificationBuilder(context,
|
||||
contentTitle,
|
||||
contentText,
|
||||
ticker,
|
||||
pendingIntent,
|
||||
smallIcon,
|
||||
largeIcon,
|
||||
autocancel,
|
||||
ongoing,
|
||||
onlyAlertOnce,
|
||||
maxProgress,
|
||||
progress,
|
||||
indeterminate);
|
||||
|
||||
//Create alert
|
||||
return notifBuilder.build();
|
||||
}
|
||||
|
||||
public static Notification createBackgroundNotification(Context context, String contentTitle, int smallIcon, int largeIcon, PendingIntent pendingIntent) {
|
||||
NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context, SWADROID_CHANNEL_ID)
|
||||
.setOngoing(true)
|
||||
.setSmallIcon(smallIcon)
|
||||
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), largeIcon))
|
||||
.setContentTitle(contentTitle)
|
||||
.setPriority(NotificationManager.IMPORTANCE_HIGH)
|
||||
.setCategory(Notification.CATEGORY_SERVICE)
|
||||
.setContentIntent(pendingIntent);
|
||||
|
||||
//Create alert
|
||||
return notifBuilder.build();
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
public static void createNotificationChanel(Context context) {
|
||||
NotificationChannel channel = new NotificationChannel(SWADROID_CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
assert manager != null;
|
||||
channel.setLightColor(Color.BLUE);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
|
||||
public static void showAlertNotification(Context context, Notification notif, int notifId) {
|
||||
NotificationManager notifManager;
|
||||
|
||||
//Obtain a reference to the notification service
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
NotificationUtils mNotificationUtils = new NotificationUtils(context);
|
||||
notifManager = mNotificationUtils.getManager();
|
||||
} else {
|
||||
notifManager =
|
||||
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
}
|
||||
|
||||
//Send alert
|
||||
notifManager.notify(notifId, notif);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,6 @@
|
|||
package es.ugr.swad.swadroid.gui;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -22,7 +19,6 @@ import org.apache.commons.io.IOUtils;
|
|||
import java.io.InputStream;
|
||||
|
||||
import es.ugr.swad.swadroid.R;
|
||||
import es.ugr.swad.swadroid.SWADroidTracker;
|
||||
|
||||
/**
|
||||
* Class for create dialogs.
|
||||
|
@ -80,7 +76,7 @@ public class DialogFactory {
|
|||
in_s.read(b);
|
||||
String content = new String(b, "UTF-8");*/
|
||||
|
||||
String content = IOUtils.toString(in_s);
|
||||
String content = IOUtils.toString(in_s, "UTF-8");
|
||||
IOUtils.closeQuietly(in_s);
|
||||
|
||||
WebView webview = (WebView) promptsView.findViewById(R.id.webview_dialog);
|
||||
|
@ -209,12 +205,8 @@ public class DialogFactory {
|
|||
.setCancelable(cancelable)
|
||||
.setPositiveButton(acceptLabel, positiveListener)
|
||||
.setNegativeButton(cancelLabel, negativeListener);
|
||||
|
||||
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
alertDialogBuilder.setIconAttribute(android.R.attr.alertDialogIcon);
|
||||
} else {
|
||||
alertDialogBuilder.setIcon(R.drawable.ic_dialog_alert);
|
||||
}
|
||||
|
||||
alertDialogBuilder.setIconAttribute(android.R.attr.alertDialogIcon);
|
||||
|
||||
if(messageId != -1) {
|
||||
alertDialogBuilder.setMessage(messageId);
|
||||
|
@ -245,8 +237,6 @@ public class DialogFactory {
|
|||
* @param tag Module tag
|
||||
* @param message Error message string
|
||||
* @param ex Exception thrown
|
||||
* @param sendException true if the error report has to be sent
|
||||
* false otherwise
|
||||
* @param isDebuggable true if the application is debuggable (develop mode). Activates Logcat messages
|
||||
* false otherwise
|
||||
* @param onClickListener ClickListener associated to the neutral button
|
||||
|
@ -254,78 +244,19 @@ public class DialogFactory {
|
|||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public static AlertDialog createErrorDialog(Context context, String tag, String message, Exception ex,
|
||||
boolean sendException, boolean isDebuggable, DialogInterface.OnClickListener onClickListener) {
|
||||
boolean isDebuggable, DialogInterface.OnClickListener onClickListener) {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context)
|
||||
.setTitle(R.string.title_error_dialog)
|
||||
.setMessage(message)
|
||||
.setNeutralButton(R.string.close_dialog, onClickListener);
|
||||
|
||||
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
alertDialogBuilder.setIconAttribute(android.R.attr.alertDialogIcon);
|
||||
} else {
|
||||
alertDialogBuilder.setIcon(R.drawable.ic_dialog_alert);
|
||||
}
|
||||
|
||||
alertDialogBuilder.setIconAttribute(android.R.attr.alertDialogIcon);
|
||||
|
||||
if (ex != null) {
|
||||
Log.e(tag, ex.getMessage(), ex);
|
||||
|
||||
// Send exception details to Google Analytics
|
||||
if (!isDebuggable && sendException) {
|
||||
SWADroidTracker.sendException(context, ex, false);
|
||||
}
|
||||
}
|
||||
|
||||
return alertDialogBuilder.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the progress UI and hides the content view.
|
||||
*
|
||||
* @param ctx Activity
|
||||
* @param show true for show the progress animation
|
||||
* false otherwise
|
||||
* @param view View for show the content after the progress animation
|
||||
* @param progressView View for show the progress animation
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||
public static void showProgress(Activity ctx, final boolean show, int view, int progressView) {
|
||||
final View contentView = ctx.findViewById(view);
|
||||
final View progressAnimation = ctx.findViewById(progressView);
|
||||
|
||||
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
|
||||
// for very easy animations. If available, use these APIs to fade-in
|
||||
// the progress spinner.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
|
||||
int shortAnimTime = ctx.getResources().getInteger(android.R.integer.config_shortAnimTime);
|
||||
|
||||
progressAnimation.setVisibility(View.VISIBLE);
|
||||
progressAnimation.animate()
|
||||
.setDuration(shortAnimTime)
|
||||
.alpha(show ? 1 : 0)
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
progressAnimation.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
contentView.setVisibility(View.VISIBLE);
|
||||
contentView.animate()
|
||||
.setDuration(shortAnimTime)
|
||||
.alpha(show ? 0 : 1)
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
contentView.setVisibility(show ? View.GONE
|
||||
: View.VISIBLE);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// The ViewPropertyAnimator APIs are not available, so simply show
|
||||
// and hide the relevant UI components.
|
||||
progressAnimation.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
contentView.setVisibility(show ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package es.ugr.swad.swadroid.gui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Manager for Font Awesome icons
|
||||
*
|
||||
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*/
|
||||
public class FontManager {
|
||||
|
||||
public static final String ROOT = "fonts/",
|
||||
FONTAWESOME = ROOT + "fontawesome-webfont.ttf";
|
||||
|
||||
private static Map<String, Typeface> TYPEFACE = new HashMap<String, Typeface>();
|
||||
|
||||
public static Typeface getTypeface(Context context, String font) {
|
||||
Typeface typeface = TYPEFACE.get(font);
|
||||
|
||||
if (typeface == null) {
|
||||
typeface = Typeface.createFromAsset(context.getAssets(), font);
|
||||
TYPEFACE.put(font, typeface);
|
||||
}
|
||||
|
||||
return typeface;
|
||||
}
|
||||
|
||||
public static void markAsIconContainer(View v, Typeface typeface) {
|
||||
if (v instanceof ViewGroup) {
|
||||
ViewGroup vg = (ViewGroup) v;
|
||||
for (int i = 0; i < vg.getChildCount(); i++) {
|
||||
View child = vg.getChildAt(i);
|
||||
markAsIconContainer(child, typeface);
|
||||
}
|
||||
} else if (v instanceof TextView) {
|
||||
((TextView) v).setTypeface(typeface);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -44,7 +44,6 @@ public class ImageExpandableListAdapter extends SimpleExpandableListAdapter {
|
|||
private final LayoutInflater layoutInflater;
|
||||
private final ArrayList<HashMap<String, Object>> groupData;
|
||||
private final ArrayList<ArrayList<HashMap<String, Object>>> childData;
|
||||
Context context;
|
||||
|
||||
private static final String TAG = "ImageExpandableListAdapter";
|
||||
private static int convertViewCounter = 0;
|
||||
|
@ -196,12 +195,12 @@ public class ImageExpandableListAdapter extends SimpleExpandableListAdapter {
|
|||
public boolean addGroup(int groupPosition, HashMap<String, Object> group, ArrayList<HashMap<String, Object>> childs) {
|
||||
if (groupPosition >= getGroupCount()) {
|
||||
groupData.add(groupPosition, group);
|
||||
final ArrayList<HashMap<String, Object>> groupData = new ArrayList<HashMap<String, Object>>();
|
||||
final ArrayList<HashMap<String, Object>> groupData = new ArrayList<>();
|
||||
childData.add(groupPosition, groupData);
|
||||
childData.get(groupPosition).addAll(childs);
|
||||
} else {
|
||||
groupData.add(getGroupCount(), group);
|
||||
final ArrayList<HashMap<String, Object>> groupData = new ArrayList<HashMap<String, Object>>();
|
||||
final ArrayList<HashMap<String, Object>> groupData = new ArrayList<>();
|
||||
childData.add(getGroupCount() - 1, groupData);
|
||||
childData.get(getGroupCount() - 1).addAll(childs);
|
||||
}
|
|
@ -32,6 +32,8 @@ import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
|
|||
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||
*/
|
||||
public class ImageFactory {
|
||||
private static ImageLoader loader = ImageLoader.getInstance();
|
||||
|
||||
/**
|
||||
* Initializes a cached image loader
|
||||
* @param ctx Application context
|
||||
|
@ -45,7 +47,6 @@ public class ImageFactory {
|
|||
public static ImageLoader init(Context ctx, boolean cacheMemory, boolean cacheDisk,
|
||||
int imageEmpty, int imageFail, int imageLoading) {
|
||||
|
||||
ImageLoader loader = ImageLoader.getInstance();
|
||||
Builder builder = new DisplayImageOptions.Builder();
|
||||
DisplayImageOptions options;
|
||||
|
||||
|
@ -71,6 +72,10 @@ public class ImageFactory {
|
|||
.defaultDisplayImageOptions(options)
|
||||
.build();
|
||||
|
||||
if(loader.isInited()) {
|
||||
loader.destroy();
|
||||
}
|
||||
|
||||
loader.init(config);
|
||||
|
||||
return loader;
|
||||
|
@ -88,7 +93,7 @@ public class ImageFactory {
|
|||
public static void displayImage(Context ctx, String uri, ImageView imageView,
|
||||
boolean cacheMemory, boolean cacheDisk, int imageEmpty, int imageFail, int imageLoading) {
|
||||
|
||||
ImageLoader loader = init(ctx, cacheMemory, cacheDisk, imageEmpty,
|
||||
init(ctx, cacheMemory, cacheDisk, imageEmpty,
|
||||
imageFail, imageLoading);
|
||||
|
||||
loader.displayImage(uri, imageView);
|
|
@ -15,7 +15,7 @@ import es.ugr.swad.swadroid.R;
|
|||
|
||||
public class ImageListAdapter extends ArrayAdapter<ImageListItem> {
|
||||
|
||||
Context context;
|
||||
private Context context;
|
||||
|
||||
public ImageListAdapter(Context context, int resourceId,
|
||||
List<ImageListItem> items) {
|
||||
|
@ -30,7 +30,7 @@ public class ImageListAdapter extends ArrayAdapter<ImageListItem> {
|
|||
}
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder = null;
|
||||
ViewHolder holder;
|
||||
ImageListItem imageListItem = getItem(position);
|
||||
|
||||
LayoutInflater mInflater = (LayoutInflater) context
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user