Compare commits

...

1420 Commits

Author SHA1 Message Date
Kuba Szczodrzyński
2d6d823a87
Merge branch 'develop-v4' into develop 2025-02-02 17:40:10 +01:00
Kuba Szczodrzyński
02a9724587
[4.14] Update build.gradle, signing and changelog 2025-02-02 17:04:56 +01:00
Kuba Szczodrzyński
c17237015e
Merge branch 'develop-v4' into develop 2025-02-02 17:03:32 +01:00
Kuba Szczodrzyński
2681794676
[Actions] Fix release workflow trigger tag name pattern 2025-02-02 16:59:23 +01:00
Kuba Szczodrzyński
42e59ac0db
[Actions] Update actions/upload-artifact to v4 2025-02-02 16:25:52 +01:00
Kuba Szczodrzyński
cac98ee3d4
[App] Force full sync on update 2025-02-02 15:48:11 +01:00
Kuba Szczodrzyński
aeecc48639
[App] Disable profile archiver permanently, force app sync on first login 2025-02-01 23:40:00 +01:00
Kuba Szczodrzyński
db444d89f0
[UI/Grades] Add config options for university grades 2025-02-01 23:00:21 +01:00
Kuba Szczodrzyński
29971777a7
[UI/Grades] Add "no grade" entity in USOS, count ECTS points by term 2025-02-01 22:24:27 +01:00
Kuba Szczodrzyński
88cd18b8c6
[UI/Grades] Allow filtering by semester for university grades 2025-02-01 21:40:46 +01:00
Kuba Szczodrzyński
30a77f1a99
[UI/Grades] Update views for university grades 2025-01-31 23:10:07 +01:00
Kuba Szczodrzyński
6de7ee9cee
[API/Usos] Store term names, add term ID to grades 2025-01-31 21:31:02 +01:00
Kuba Szczodrzyński
d44b85073a
[API/Usos] Implement basic grades support 2025-01-31 21:03:00 +01:00
Kuba Szczodrzyński
514fbafd00
[API/Usos] Change team codes to include unique ID or current year 2025-01-31 19:16:03 +01:00
Kuba Szczodrzyński
c35222cdfd
[API/Usos] Fix year end date on new school year 2025-01-31 19:03:31 +01:00
Kuba Szczodrzyński
37a94595c0
[UI] Enable colored app bars on scroll (#211)
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 25s
* Extract fragment scroll listener to separate file

* Replace canRefresh with isScrolled

* Add empty helper class to animate app bar color

* Implement AppBarColorAnimator

* Rename getRefreshScrollingView() to getScrollingView()

* Set isScrolled on drag start

* Clear isScrolled on fling to top

* Add getSyncParams() to fragments

* Convert getAppBars() to property

* Tint TabLayout background drawable
2024-07-09 18:15:03 +02:00
Kuba Szczodrzyński
58d9dec33c
[App] Enable nightly app updates, check every 12 hours
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 26s
2024-07-08 20:49:01 +02:00
Kuba Szczodrzyński
095403cc76
Merge branch 'master' into develop 2024-07-08 15:49:43 +02:00
Kuba Szczodrzyński
7f3a607246
[App] Fix RecyclerTabLayout ProGuard rules 2024-07-08 15:39:44 +02:00
Kuba Szczodrzyński
ffee78d4f7
[UI] Fix closing bottom sheet on scrim view click 2024-07-08 15:39:07 +02:00
Kuba Szczodrzyński
f2a20c3aae
Merge branch 'hotfix/nologin'
Some checks failed
Push (master) / Build for Google Play (AAB) (push) Failing after 1s
2024-07-08 14:39:02 +02:00
Kuba Szczodrzyński
1e7dbba995
[4.13.7] Update build.gradle, signing and changelog 2024-07-08 14:10:29 +02:00
Kuba Szczodrzyński
0b8f3fe94b
[Actions] Add build fixes from develop 2024-07-08 14:10:23 +02:00
Kuba Szczodrzyński
0e8b0673ca
[App] Add Demo login method 2024-07-08 13:28:54 +02:00
Kuba Szczodrzyński
8450f6953e
[UI] Enable swipe-to-refresh on home, grades, behaviour fragments
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 28s
2024-07-07 23:22:37 +02:00
Kuba Szczodrzyński
ddefda08f1
[App] Simplify enabling Dev Mode on nightly builds 2024-07-07 22:55:20 +02:00
Mateusz T
c5b173b40a
[API/Usos] Remove non-digit characters from student number (#189)
* Save only USOS ID number without indexes

* Checking student number is or is not empty

* Apply suggestions from code review

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-07-07 22:24:50 +02:00
Kuba Szczodrzyński
f10bc42c7b
[UI] Implement RecyclerTabLayout, enable swipe-to-refresh in timetable (#209)
* Enable swipe-to-refresh in timetable

* Add basic RecyclerTabLayout view

* Implement tab scrolling in RecyclerTabLayout

* Implement tab clicking in RecyclerTabLayout

* Add selected tab indicator to RecyclerTabLayout

* Add ProGuard rules for RecyclerTabLayout

* Set RecyclerTabLayout background
2024-07-07 22:18:00 +02:00
Kuba Szczodrzyński
6371d71b7a
[UI] Add SimpleDialog class, migrate app dialogs (#208)
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 21s
* Make onShow() abstract and onDismiss() suspend

* Add dialog suspend show method

* Add SimpleDialog, support text field and choice items in BaseDialog

* Migrate MaterialAlertDialogBuilder to SimpleDialog

* Remove dialog onShow and onDismiss listeners
2024-07-06 19:36:59 +02:00
Kuba Szczodrzyński
09f0c986e0
[UI] Reformat layout XMLs, cleanup NavLib code (#207)
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 19s
* Remove Themes and getColorFromAttr() usage

* Reformat all layout XML files

* Remove <layout> from non-data binding XMLs

* Cleanup unused NavLib code

* Migrate NavBottomSheet to view binding, remove unused components

* Add IIcon.toDrawable() extension

* Make BottomSheet scrim opacity linear

* Support touch events on BottomSheet scrim
2024-07-05 18:46:37 +02:00
Kuba Szczodrzyński
10043cc62c
[UI] Migrate to base fragment classes, restructure base modules (#206)
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 20s
* Replace android:visibility with android:isVisible

* Move base dialogs and views to .ui.base

* Move uncategorized classes to ui.main

* Fix view classes in XML

* Add BaseFragment, use for LazyFragment

* Migrate fragments to BaseFragment

* Move activity setup from BaseFragment, recreate Job on attach

* Move BaseFragment initialization to onResume

* Add base PagerFragment, add TemplateFragment to drawer

* Support swipe-to-refresh in base fragments

* Remove SwipeRefreshLayout split implementation

* Rename onViewCreated to onViewReady

* Remove LazyFragment

* Save page selection in PagerFragment, migrate AttendanceFragment

* Migrate fragments to PagerFragment

* Migrate contributors to a fragment

* Migrate TimetableFragment to PagerFragment

* Fix disabling SwipeToRefresh on page scroll

* Fix crash in CrashActivity
2024-07-04 22:14:52 +02:00
Kuba Szczodrzyński
f795412551
[Actions] Use Europe/Warsaw timezone for build dates
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 23s
2024-07-02 14:01:05 +02:00
Kuba Szczodrzyński
6a7020a516
[Gradle] Fix copying signed release APK 2024-07-02 13:44:59 +02:00
Adam Rurański
137ea65e0f
[UI] Make snowfall condition consistent (#195)
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 17s
2024-07-01 22:39:47 +02:00
koliwbr
50ef7f8617
[Git] Fix build status badges in README (#193)
* Popraw statusy budowania w README

* Update README.md

---------

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-07-01 22:38:43 +02:00
Kuba Szczodrzyński
e1dbc2f050
[App] Refactor app core modules, use Timber for logging (#205)
* [App] Fix config migration issues

* Move .sync to .core

* Move .firebase, .network, .managers, .receivers, .sync to .core

* Replace HyperLog with Timber

* Cleanup logs every 7 days

* Rename NotificationChannelManager, reformat App

* Create FirebaseManager, ShortcutManager
2024-07-01 22:35:11 +02:00
Kuba Szczodrzyński
77e1acbb1e
[App] Disable R8 full mode, support devModePassword, fix build timestamp 2024-07-01 11:53:14 +02:00
Kuba Szczodrzyński
6e19f37d79
[Actions] Refactor build workflows, fix Gradle rename task
Some checks failed
Schedule/dispatch / Check new changes (push) Failing after 1m11s
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
2024-06-30 19:51:21 +02:00
0823e72328
[UI] Upgrade to Material 3 design, refactor some core elements (#201)
* Material 3 theme and color support, filled cards

* Change drawer header, dark bottombar color

* Replace MaterialComponents with Material3

* wielki powrót pr m3 do szkolnego (nie czytajcie tego kodu)

* fix M3 UI code & upgrade kotlin

* update dependencies

* fix missing Intent receiver flags for Tiramisu+

* fix kapt errors related to SelectiveDAO + migrate BuildConfig

* adapt code to updated dependencies + align lessons (based by szkolny-eu/szkolny-android#196)

* fix: no query filtering

* fix: duplicated items in about card

* fix: "Back button opens drawer" (redundant super call)

* fix: too small heading in agenda dialog

* adapt notes fragment to MD3

* add lock layout function (szkolny-eu/szkolny-android#199)

* hide classroom heading when no classroom is specified

* add support for grade column codes

* grades: join code and category together

* add cosmetic ui changes + fix build issues

* fix proguard rules (attempt 1)

* add new Retrofit2 rules

* add new ProGuard rules + fix QR scanning

* fix agenda view crash when building release variant

* improve LessonDetailsDialog

* remove duplicated string extension

* set separate app ID & icon for debug version

* remove unneeded import statement

* fix collapsing toolbar title when doing back gesture

* remove useless dependencies

* fix UI issues on old Android versions

* fix missing color resources + cleanup dependencies

* fix release building issue

* fix release building issue & remove ripple from NavView

* move version badge to the top bar

* Revert changes introduced by rebase

* Update NavLib from sadorowo/NavLib

* Revert "add lock layout function (szkolny-eu/szkolny-android#199)"

This reverts commit 2fd7038d0c0b43f2d39333d2e556bde066cd28b6.

* Revert "add support for grade column codes"

* Revert unnecessary code changes, part 1

* Lower minSdk to 19

* Revert unnecessary code changes, part 2

* Add new application logo

* Restore bottom bar support in NavLib, revert unnecessary changes

* Use new IconicsMaterialButton in MessageFragment

* Migrate NavView to view binding

* Support IconButton in IconicsMaterialButton

* Cleanup NavLib w600dp styles

* Remove NavLib text styles

* Refactor all application themes, update styles in layouts

* Move enums and config entry to .data, fix app crashing

* Rename non-theme styles to AppStyle

* Restructure app config classes, move config to .data

* Add Theme enum and UiManager, support basic theme changing

* Actually support basic theme changing

* Serialize enum as string, fix config migration, bring back DebugDb

* Fix changing themes, apply night mode in App

* Fix resolving ColorStateList attributes, add LabPlaygroundFragment

* add Iconics methods into ProGuard rules

* Replace home card icon buttons, remove unused icons

* Update gradle properties

* Update build.gradle

* Remove unnecessary dependencies

* Remove playstore icon

* Apply fixes after review

---------

Co-authored-by: Adam Kasprzycki <66315787+santoni0@users.noreply.github.com>
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-06-30 16:12:07 +02:00
Kuba Szczodrzyński
fadf1d7754
[Gradle] Add NavLib 0.8.0 as local module
Some checks failed
Nightly build / Prepare build environment (push) Has been cancelled
Nightly build / Build APK (push) Has been cancelled
Nightly build / Sign APK (push) Has been cancelled
Nightly build / Publish APK (push) Has been cancelled
2024-06-18 17:45:26 +02:00
Kuba Szczodrzyński
1071a0848a
Merge branch 'develop' 2023-03-25 10:10:42 +01:00
Kuba Szczodrzyński
cefb0deba8
[Actions] Rename changelog output name. 2023-03-25 10:09:36 +01:00
Kuba Szczodrzyński
53c813f014
Merge branch 'develop' 2023-03-24 22:35:54 +01:00
Kuba Szczodrzyński
90a151c129
[4.13.6] Update build.gradle, signing and changelog. 2023-03-24 22:27:27 +01:00
Kuba Szczodrzyński
9fd9721ae7
[UI] Hide Debugging menu without dev mode. 2023-03-24 22:24:33 +01:00
Kuba Szczodrzyński
ceca75ef4b
[UI/Timetable] Add option to sync current week. 2023-03-24 22:16:34 +01:00
Kuba Szczodrzyński
21c00bbe53
[API] Fix detecting session cookies. Remove expired cookies. 2023-03-24 22:09:31 +01:00
Kuba Szczodrzyński
db00566ebf
[UI/Login] Fallback reCAPTCHA to WebView activity. 2023-03-24 22:09:31 +01:00
B.O.S.S
07ab1b984f
[API/Librus] Fix login. (#176) 2023-03-24 22:09:03 +01:00
Kuba Szczodrzyński
8177d4aa2d
[Widgets] Fix pending intents mutability. Hide timetable sync button. 2023-03-24 11:13:00 +01:00
Kuba Szczodrzyński
beff1b6460
[App] Fix cookie persistence. 2023-03-24 10:56:35 +01:00
Kuba Szczodrzyński
31b569b02e
[4.13.5] Update build.gradle, signing and changelog. 2023-03-22 23:16:28 +01:00
Kuba Szczodrzyński
8bf77817d2
[UI] Fix writing files on Android 13 and newer. 2023-03-22 23:15:45 +01:00
Kuba Szczodrzyński
87b7bd9b30
Merge branch 'develop' 2022-12-27 12:30:23 +01:00
Kuba Szczodrzyński
27b61adf1d
[Actions] Fix Play release publishing workflow. 2022-12-27 12:30:03 +01:00
Kuba Szczodrzyński
8d7dc511ea
Merge branch 'develop' 2022-12-27 12:09:04 +01:00
Kuba Szczodrzyński
a0244841ad
[4.13.4] Update build.gradle, signing and changelog. 2022-12-26 14:45:29 +01:00
Kuba Szczodrzyński
12c0c6f2ec
[UI] Always show event subject dropdown for university school. 2022-12-26 14:43:42 +01:00
Kuba Szczodrzyński
aaa3b8626e
[UI] Update event types for university school. 2022-12-26 14:01:25 +01:00
Kuba Szczodrzyński
48c9e2dfe3
[4.13.3] Update build.gradle, signing and changelog. 2022-12-06 10:35:23 +01:00
Kuba Szczodrzyński
81d4801d27
[UI] Add snowfall to CounterActivity. Enable in February as well. 2022-12-06 10:34:12 +01:00
Kuba Szczodrzyński
5f8016061d
[API/Vulcan] Fix wrong serializing of null in JSON causing API error. 2022-12-06 10:22:47 +01:00
Kuba Szczodrzyński
5007587192
[UI/Agenda] Allow prioritizing event subject over event type. 2022-11-30 11:29:43 +01:00
Kuba Szczodrzyński
dfd1083e41
[UI/Timetable] Show lesson replacing notes in all places. 2022-11-30 10:41:43 +01:00
Kuba Szczodrzyński
a322986df5
Merge branch 'develop' 2022-11-28 20:39:51 +01:00
Kuba Szczodrzyński
678baf46e5
[4.13.2] Update build.gradle, signing and changelog. 2022-11-28 20:30:11 +01:00
Kuba Szczodrzyński
4077fe448d
[4.13.2-rc.4] Update build.gradle, signing and changelog. 2022-11-25 16:52:16 +01:00
Kuba Szczodrzyński
f085e17ef7
[API/Vulcan] Once again fix ignoring 404 response on Addressbook. 2022-11-25 16:51:35 +01:00
Kuba Szczodrzyński
7fd2cad46b
[4.13.2-rc.3] Update build.gradle, signing and changelog. 2022-11-25 16:13:58 +01:00
Kuba Szczodrzyński
93dc2ac9ab
[API/Vulcan] Fix ignoring 404 response on Addressbook. 2022-11-25 16:11:50 +01:00
Kuba Szczodrzyński
ac53e267fc
[4.13.2-rc.2] Update build.gradle, signing and changelog. 2022-11-25 14:55:49 +01:00
Kuba Szczodrzyński
86eb1a0f42
[API/Vulcan] Actually ignore 404 response on Addressbook. 2022-11-25 14:54:05 +01:00
Kuba Szczodrzyński
710d82da27
[4.13.2-rc.1] Update build.gradle, signing and changelog. 2022-11-25 14:40:39 +01:00
Kuba Szczodrzyński
0123f50810
[API/Vulcan] Ignore 404 response on Addressbook. 2022-11-25 14:20:22 +01:00
Kuba Szczodrzyński
6d3eb65445
[API/Mobidziennik] Do not clear email field if not set. 2022-11-15 22:20:00 +01:00
Kuba Szczodrzyński
a9a0630226
[4.13.1] Update build.gradle, signing and changelog. 2022-11-03 22:59:40 +01:00
Kuba Szczodrzyński
ec7577f999
[App] Revert to use old devMode config key. 2022-11-03 22:29:22 +01:00
Kuba Szczodrzyński
05c7c0012c
[UI] Fix home cards order not saving. 2022-11-03 22:28:59 +01:00
B.O.S.S
d65c6db954
[API/Librus] Fix getting read date in messages for multiple receivers. (#154) 2022-11-03 21:53:01 +01:00
Oskar
771dc437e6
[Strings] Translate home timetable card "all lessons" to English. (#152) 2022-10-30 12:45:27 +01:00
B.O.S.S
3d5d3847cc
[API/Librus] Fix getting teacher name in notices. (#151) 2022-10-30 12:44:59 +01:00
kuba2k2
726c22b70a
Merge branch 'develop' 2022-10-26 22:21:13 +02:00
Kuba Szczodrzyński
18cc60a80b
[4.13] Update build.gradle, signing and changelog. 2022-10-26 20:55:50 +02:00
Kuba Szczodrzyński
fedde9f739
[UI/Home] Show all next lessons before school day start. 2022-10-26 20:34:48 +02:00
kuba2k2
9fde97bef0
[App] Share Lesson and Event notes to specific team only. 2022-10-26 11:14:32 +02:00
kuba2k2
742bd03e9e
[Lab] Fix JSON page crashing because of serializing AppDb. 2022-10-26 10:31:03 +02:00
Kuba Szczodrzyński
62ffc652ab
[4.13-rc.5] Update build.gradle, signing and changelog. 2022-10-25 20:50:19 +02:00
Kuba Szczodrzyński
bfd2e9883a
[App] Refactor getting profile config. 2022-10-25 20:48:10 +02:00
Kuba Szczodrzyński
00e077d01f
[UI] Fix notes not showing in note list dialog. 2022-10-25 20:07:48 +02:00
Kuba Szczodrzyński
c21d89cf60
[UI] Fix SettingsAboutCard having duplicate items. 2022-10-25 19:58:26 +02:00
Kuba Szczodrzyński
f52cc1b197
[UI] Make shared notes for lessons use a stable ID. 2022-10-25 19:58:09 +02:00
kuba2k2
c90ad97f55
[UI] Remove "enable shared events" setting. Reorder settings a bit. 2022-10-25 17:33:38 +02:00
Kuba Szczodrzyński
845e09d875
[API/Usos] Add prefixes to classroom and building names. 2022-10-25 12:36:11 +02:00
Kuba Szczodrzyński
158b69a8d3
[Lab] Fix full sync buttons. 2022-10-25 12:35:51 +02:00
Kuba Szczodrzyński
9535f53563
[App] Refactor profile methods as extensions. 2022-10-25 12:19:59 +02:00
Kuba Szczodrzyński
eeb3fc4621
[4.13-rc.4] Update build.gradle, signing and changelog. 2022-10-24 23:33:54 +02:00
Kuba Szczodrzyński
41693a9fc8
[App] Respect user setting before notifying about updates. 2022-10-24 23:33:02 +02:00
Kuba Szczodrzyński
d3599b8c89
[UI] Fix DateDropdown next week Friday not visible. 2022-10-24 23:32:21 +02:00
Kuba Szczodrzyński
ffd81f8b82
[UI] Add setting to share events/notes by default. 2022-10-24 23:32:09 +02:00
Kuba Szczodrzyński
2c34924052
[UI] Mark Firebase-received events as manual. Update legend icons. 2022-10-24 22:41:15 +02:00
Kuba Szczodrzyński
26ad6373e6
[4.13-rc.3] Update build.gradle, signing and changelog. 2022-10-23 23:16:23 +02:00
Kuba Szczodrzyński
cac8f94407
[Gradle] Update Chucker to fix Android 12 crash issue. 2022-10-23 23:16:08 +02:00
Kuba Szczodrzyński
6628b97faf
[API/Usos] Fix detecting term start and end date. 2022-10-23 23:11:49 +02:00
Kuba Szczodrzyński
8424414317
[Login] Fix configOverrides NPE during login. 2022-10-23 23:11:20 +02:00
Kuba Szczodrzyński
d8bb927703
[4.13-rc.2] Update build.gradle, signing and changelog. 2022-10-22 22:34:24 +02:00
Kuba Szczodrzyński
c8e8c172a2
[App] Rework update handling. 2022-10-22 22:10:04 +02:00
Kuba Szczodrzyński
0d4dee765a
[Lab] Allow setting custom API key. 2022-10-22 12:56:15 +02:00
Kuba Szczodrzyński
fd407b2b03
[Config] Set highest data version by default. 2022-10-22 12:31:40 +02:00
Kuba Szczodrzyński
40ed5a221f
[App] Fix crashes while deserializing AppData and Config. 2022-10-22 12:19:23 +02:00
Kuba Szczodrzyński
5150467372
[4.13-rc.1] Update build.gradle, signing and changelog. 2022-10-22 00:02:57 +02:00
Kuba Szczodrzyński
63c5720f63
[App] Move per-register settings to JSON resource. Rewrite Config to use delegates. (#150)
* [App] Add base for AppData loading.

* [UI] Fix timetable widget date navigation.

* [UI] Migrate register-specific behavior to use AppData.

* [App] Implement new delegate-based config base.

* [Config] Migrate config and profile config.

* [Config] Remove defaults from migrations.

* [App] Apply event types and config overrides from AppData.

* [Events] Change default event types for university type school.
2022-10-21 23:59:53 +02:00
Kuba Szczodrzyński
6c93cd4217
[4.13-beta.3] Update build.gradle, signing and changelog. 2022-10-20 22:02:01 +02:00
Kuba Szczodrzyński
649d4f619a
[UI] Hide unavailable settings depending on LoginType. 2022-10-20 21:59:01 +02:00
Kuba Szczodrzyński
ba10d10a10
[API] Refactor integer-based types to enum classes. (#145)
* [App] Add enum classes for common IDs.

* [App] Rename enum package names.

* [App] Migrate code to use new enums.

* [DB] Migrate loginStoreMode IDs to be unique.

* [UI] Fix minor issues after refactor.

* [API] Update sync method signature.

* [UI] Correct pop-to-home and back button drawer behavior.

* [App] Update Bundle extensions usage.

* [App] Migrate notification types to enum.

* [UI] Make Lab fragment compatible with enums.

* [API] Make EndpointTimer use FeatureType.

* [App] Migrate config & API lists to sets.
2022-10-20 21:58:10 +02:00
Kuba Szczodrzyński
1450d63fcb
[4.13-beta.2] Update build.gradle, signing and changelog. 2022-10-18 22:06:18 +02:00
Kuba Szczodrzyński
2ec06bc39a
[UI] Fix timetable lesson height. Add missing timetable settings. 2022-10-18 11:49:46 +02:00
Kuba Szczodrzyński
6f12227c2e
[4.13-beta.1] Update build.gradle, signing and changelog. 2022-10-17 22:56:22 +02:00
Kuba Szczodrzyński
3a91f87ccd
Merge pull request #142 from szkolny-eu/feature/usos
[API] Add USOS API support.
2022-10-17 22:52:08 +02:00
Kuba Szczodrzyński
52a53334ca
[Strings] Add USOS error descriptions. 2022-10-17 22:30:23 +02:00
Kuba Szczodrzyński
3ab9602865
[API/Usos] Fix re-logging in after user action. 2022-10-17 16:06:29 +02:00
kuba2k2
dc19043f73
[API/Usos] Implement basic error handling. 2022-10-17 12:56:07 +02:00
Kuba Szczodrzyński
cf25507850
[API/Usos] Save lecturers as teachers. Add team class. 2022-10-16 18:41:37 +02:00
Kuba Szczodrzyński
044cedff99
[Usos] Override lesson colors by activity type. 2022-10-16 18:13:22 +02:00
Kuba Szczodrzyński
4de066bf5f
[API/Usos] Implement Timetable. 2022-10-16 17:21:36 +02:00
Kuba Szczodrzyński
8d174bda01
Merge remote-tracking branch 'origin/develop' into feature/usos 2022-10-16 16:54:44 +02:00
Kuba Szczodrzyński
e2fd714070
[UI/Timetable] Show subject-based lesson colors. (#141)
* [UI/Timetable] Add timetable config dialog and implement UI options.

* [UI/Timetable] Fix reloading timetable after changing config.

* [UI/Timetable] Fix calculating lesson range boundaries.

* [UI/Timetable] Add coloring subject names.
2022-10-16 12:47:54 +02:00
Kuba Szczodrzyński
8097e8d06d
[API/Usos] Add syncing Courses and Terms. 2022-10-16 00:09:51 +02:00
Kuba Szczodrzyński
93ccdbdeb7
[API/Login] Make user action handling more universal. 2022-10-15 21:24:30 +02:00
Kuba Szczodrzyński
7ded400a30
[API/Usos] Implement first login. 2022-10-15 19:07:12 +02:00
Kuba Szczodrzyński
2ff784066e
[API/Usos] Implement OAuth authorization flow. 2022-10-14 21:44:58 +02:00
Kuba Szczodrzyński
6c96875c83
[API/Login] Allow passing LoginStore params in user action requests. 2022-10-14 19:44:22 +02:00
kuba2k2
9f3aaf6e86
[API] Move register platforms to new endpoint. 2022-10-14 14:43:40 +02:00
Kuba Szczodrzyński
55369eaa8b
[UI/Timetable] Add Timetable settings. (#140)
* [UI/Timetable] Add timetable config dialog and implement UI options.

* [UI/Timetable] Fix reloading timetable after changing config.

* [UI/Timetable] Fix calculating lesson range boundaries.
2022-10-14 00:25:22 +02:00
Adam Kasprzycki
c983c16907
[UI] Request notifications permission on API >= 33. (#143)
* Added requesting notifications permission on Android 13 devices

* Move permission check to PermissionManager

* Request permission on home screen
2022-10-14 00:24:00 +02:00
kuba2k2
c7362bce12
[API/Usos] Add base rest API class. 2022-10-13 21:27:55 +02:00
kuba2k2
7935d0f097
[API] Pass parameters to user action required errors. 2022-10-13 11:45:17 +02:00
Kuba Szczodrzyński
4b64277948
[API/Usos] Add basic USOS API structure. 2022-10-11 23:23:11 +02:00
Kuba Szczodrzyński
ef0996c80e
Merge branch 'develop' 2022-09-23 12:05:03 +02:00
Kuba Szczodrzyński
132729bbd9
[4.12.1] Update build.gradle, signing and changelog. 2022-09-23 11:32:08 +02:00
Kuba Szczodrzyński
6d36ab27d1
[UI/Login] Fix QR scanning icon not showing. 2022-09-23 11:30:23 +02:00
Kuba Szczodrzyński
11fabb231f
[4.12] Update build.gradle, signing and changelog. 2022-09-21 21:09:23 +02:00
Kuba Szczodrzyński
6fd999f88c
[UI/Widget] Fix showing lesson details dialog. 2022-09-21 21:02:09 +02:00
Kuba Szczodrzyński
7711413b30
[API/Vulcan] Fix getting MessageBoxes and changing message read status. 2022-09-21 20:43:18 +02:00
Kuba Szczodrzyński
cdc0c9d458
[4.11.9] Update build.gradle, signing and changelog. 2022-09-18 23:06:41 +02:00
Kuba Szczodrzyński
8e5f750a80
[Manifest] Remove APK install to comply with Google Play policies. 2022-09-18 23:05:46 +02:00
Kuba Szczodrzyński
f4e7e8978c
[API/Vulcan] Ensure messageBoxKey before syncing addressbook. 2022-09-18 22:52:43 +02:00
Kuba Szczodrzyński
14952307b3
Merge branch 'develop' 2022-09-17 23:06:32 +02:00
Kuba Szczodrzyński
96c542d6d2
[4.11.8] Update build.gradle, signing and changelog. 2022-09-17 18:02:11 +02:00
Kuba Szczodrzyński
77d22b87aa
[API] Move unused resources to the e-register graveyard. 2022-09-17 17:49:56 +02:00
Kuba Szczodrzyński
37c68443bd
[API] Remove EduDziennik implementation [*] 2022-09-17 17:39:45 +02:00
Kuba Szczodrzyński
9dbb5d70e9
[App] Fix PendingIntent crashing on API 31+. 2022-09-17 17:21:13 +02:00
Kuba Szczodrzyński
99afa77a63
[4.11.7] Update build.gradle, signing and changelog. 2022-09-17 16:00:38 +02:00
Kuba Szczodrzyński
a5d0f4212d
[UI/Login] Make Lab accessible from login page. 2022-09-17 15:00:34 +02:00
Kuba Szczodrzyński
a85f935eb4
[UI/Home] Improve displaying cancelled lessons in timetable card. 2022-09-17 14:58:54 +02:00
Antoni Czaplicki
bb44fa066c
[API/Vulcan] Migrate to new MessageBox API. (#134)
* Implement fetching vulcan messages from new api

* Bump kotlin version and fix timetable card lessons size display

* Revert formatting changes

* Revert disabling message composing

* Revert MultiDex changes and dependency upgrades

* Add missing MultiDex dependency, update Google Services

* Separate MessageBoxes sync, revert API data behavior changes

* Revert migrating MessageRecipient to Kotlin

* Use loginId from MessageBox address book

* Revert using compatible HTML mode in Vulcan

* Implement message meta and read status changing

* Always set attachment lists

* Fix setting tutor role description

* Implement sending messages

* Replace millis constant with WEEK

* Revert timetable changes

* Remove unused DataVulcan properties

* Ensure UUID-format recipient IDs

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2022-09-17 12:31:35 +02:00
Kuba Szczodrzyński
54a61c6254
[Gradle] Update dependencies, update target SDK to 33 2022-09-09 12:47:20 +02:00
Kuba Szczodrzyński
ac10874bf1
[4.11.6] Update build.gradle, signing and changelog. 2022-05-27 21:09:40 +02:00
B.O.S.S
fa55b4901a
[Messages/Librus] Disable text styling. (#130) 2022-05-27 18:55:24 +02:00
Kuba Szczodrzyński
86c41d9191
Merge branch 'develop' 2022-04-19 23:13:15 +02:00
Kuba Szczodrzyński
0f90430387
[4.11.5] Update build.gradle, signing and changelog. 2022-04-18 11:31:24 +02:00
Sylwester Zinkiewicz
745523c620
[UI] Fix touch events on swipe refresh pages (API 32+). (#129)
* [Hotfix] Fix touch events on swipe refresh pages (API 32)

* Add API SDK version check
2022-04-18 11:28:34 +02:00
Kuba Szczodrzyński
c1ef0e9d11
Merge branch 'develop' 2022-03-14 18:46:37 +01:00
Kuba Szczodrzyński
8911ce2bc1
[4.11.4] Update build.gradle, signing and changelog. 2022-03-14 17:45:11 +01:00
Kuba Szczodrzyński
2990fc5479
[Firebase] Disable notifications for past shared events. 2022-03-14 17:08:35 +01:00
Kuba Szczodrzyński
48b7adb564
[UI/Grades] Group unknown subjects without specified name. 2022-03-14 17:05:16 +01:00
Kuba Szczodrzyński
2e97467c57
Merge branch 'develop' 2022-02-21 22:12:46 +01:00
Kuba Szczodrzyński
f8ac9e793a
[4.11.3] Update build.gradle, signing and changelog. 2022-02-21 21:48:28 +01:00
Kuba Szczodrzyński
148597e578
[UI/Messages] Fix sending message not showing the message fragment. 2022-02-21 21:46:16 +01:00
Kuba Szczodrzyński
6c50a80b42
[UI/Timetable] Fix syncing a week not refreshing the current page. 2022-02-21 21:08:59 +01:00
Kuba Szczodrzyński
1bf0679e92
[App] Disable SSLProvider in Google Play builds. 2022-02-21 20:36:17 +01:00
Kuba Szczodrzyński
5b5dc5cade
[Gradle] Add non-Play flavor without self-updater. 2022-02-21 20:19:29 +01:00
Kuba Szczodrzyński
46de915965
Merge branch 'develop' 2022-02-05 21:11:40 +01:00
Kuba Szczodrzyński
98a89b1ca1
[4.11.2] Update build.gradle, signing and changelog. 2022-02-05 17:47:00 +01:00
Kuba Szczodrzyński
6d1e18cce2
[Strings] Update copyright dates. 2022-02-05 17:44:57 +01:00
Kuba Szczodrzyński
8fe0f88be4
[Strings] Fix a typo. 2022-02-05 17:39:40 +01:00
Kuba Szczodrzyński
aeed735521
[Mobidziennik] Fix syncing message lists. 2022-02-05 17:39:15 +01:00
Kuba Szczodrzyński
e314fafaff
[4.11.1] Update build.gradle, signing and changelog. 2022-01-14 15:23:31 +01:00
B.O.S.S
2ab0dd7546
[API/Librus] Revert getting time in teacher free days. (#124) 2021-12-16 12:23:33 +01:00
B.O.S.S
aa06868a4e
[API/Librus] Fix LibrusApiTeacherFreeDays. (#123)
* [API/Librus] Remove LibrusApiTeacherFreeDayTypes

* [API/Librus] Fix LibrusApiTeacherFreeDay

* [API/Librus] LibrusApiTeacherFreeDay: Clean up values of unused variables

* [API/Librus] LibrusApiTeacherFreeDay: Remove unnecessary variables

* [API/Librus] LibrusApiTeacherFreeDay: Assign null to 'name' object
2021-12-10 21:48:11 +01:00
Kuba Szczodrzyński
9a6d56ec77
Merge branch 'develop' 2021-11-01 14:00:30 +01:00
Kuba Szczodrzyński
2b104e6463
[4.11] Update build.gradle, signing and changelog. 2021-11-01 13:05:51 +01:00
Kuba Szczodrzyński
afb1863827
[Strings] Fix compilation problem. 2021-10-31 20:25:34 +01:00
Kuba Szczodrzyński
d8228748e4
[4.11-rc.3] Update build.gradle, signing and changelog. 2021-10-31 20:16:12 +01:00
Antoni Czaplicki
b0608c47c4
[Strings] Update English translation. (#117)
* Update translations

* Apply suggestions from code review

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update translations

* Update translations

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-10-31 20:15:24 +01:00
Kuba Szczodrzyński
dda0d88f19
[API/Vulcan] Fix Web login with multiple student IDs. 2021-10-31 18:19:18 +01:00
Antoni Czaplicki
a1b5560977
[API/Vulcan] Fix teachers endpoint last sync date. (#116) 2021-10-31 14:24:39 +01:00
Antoni Czaplicki
86f5811bda
[Login] Fix incorrect case mode validation. (#115) 2021-10-31 14:24:20 +01:00
Antoni Czaplicki
3f11e75985
[Lab] Add Open Chucker button. (#114) 2021-10-31 14:23:59 +01:00
Kuba Szczodrzyński
c39b5442c9
[API/Vulcan] Fix teacher list subjects retrieving. 2021-10-31 10:12:35 +01:00
Kuba Szczodrzyński
3b80adf355
[4.11-rc.2] Update build.gradle, signing and changelog. 2021-10-30 22:04:13 +02:00
Kuba Szczodrzyński
cae41d17b6
[Actions] Use Eclipse Temurin and gradle-build-action. 2021-10-30 22:02:59 +02:00
Kuba Szczodrzyński
519d75d9d9 [API/Vulcan] Force presence of a TeamClass. 2021-10-30 21:55:47 +02:00
Kuba Szczodrzyński
cb953ea8a8 [Config] Fix only notes card visible on new profiles. 2021-10-30 21:55:47 +02:00
Kuba Szczodrzyński
52968cafad [Proguard] Add a rule for Note. 2021-10-30 21:55:47 +02:00
Kuba Szczodrzyński
b7755dae96
[4.11-rc.1] Update build.gradle, signing and changelog. 2021-10-29 17:32:53 +02:00
Kuba Szczodrzyński
113ecc0ef1
[Gradle] Fix showing correct app version on debug builds. 2021-10-29 17:32:05 +02:00
Kuba Szczodrzyński
23bd9b8e05
[Strings] Update copyright dates. 2021-10-29 16:51:55 +02:00
Kuba Szczodrzyński
decfd2068a
[Signing] Fix incorrect version name for debug builds. 2021-10-29 16:48:53 +02:00
Kuba Szczodrzyński
a88cfb8ae3 [Notes] Hide notes button in day dialog. 2021-10-29 16:48:12 +02:00
Kuba Szczodrzyński
50cb0acc7d [Notes] Fix home card on click target fragment. 2021-10-29 16:48:12 +02:00
Kuba Szczodrzyński
27413a9745
[Messages] Fix HTML line break decoding and encoding. 2021-10-29 16:46:32 +02:00
Kuba Szczodrzyński
49a093201b
[Teachers] Make the list action buttons bigger. 2021-10-29 15:39:58 +02:00
Kuba Szczodrzyński
7c925cb88a
[UI] Add Notes feature. (#99)
* [DB] Add Room schema export location.

* [DB] Add Note entity and migration 96.

* Add correct database schema

* [Notes] Implement basic note list UI.

* [DB] Implement Noteable in Full entities. Add note relation and filtering.

* [Notes] Make Note searchable.

* [UI] Disable onClick listeners in adapters when null.

* [UI] Implement showing note list in dialog.

* [UI] Update note dialogs UI.

* [Notes] Add note details dialog.

* [Notes] Extract note dialogs header into a separate layout.

* [Notes] Add note editor dialog.

* [Notes] Show note icons in dialogs and lists.

* [Notes] Add showing substitute text.

* [Notes] Add replacing notes icon.

* [Notes] Add sharing and receiving notes.

* [Notes] Add notes list UI fragment.

* [Notes] Implement adding notes without owner.

* [Notes] Add color names.

* [Notes] Add notes card on home screen.

* [Notes] Add notes card migration.
2021-10-28 22:35:30 +02:00
Kuba Szczodrzyński
8745d7d526
[API/Szkolny] Fix user/device registration after API errors. (#111) 2021-10-28 12:11:00 +02:00
Antoni Czaplicki
e02246f97d
[UI] Add teacher list action buttons. (#105)
* Update code

TODO: Change icons color

* Change "More" icon, update teachers list

* Update code

* Update code

* Reformat code

* Apply suggestions from code review

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update code

* Update app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update code

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-10-24 18:29:04 +02:00
Antoni Czaplicki
e629e03b33
[UI/Login] Implement login QR code scanning. (#100)
* Enable Vulcan QR login [WiP]

* [UI/Login] Implement login QR scanning.

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-10-23 17:23:42 +02:00
Kuba Szczodrzyński
e2ad3758e0
[Config] Fix notification filter setting not loading. 2021-10-22 17:03:20 +02:00
Kuba Szczodrzyński
f3e2d21b89
[UI] Refactor app dialogs. (#103)
* [UI] Add new base dialog classes.

* [UI] Migrate dialogs to the new base classes.
2021-10-22 16:57:10 +02:00
Kuba Szczodrzyński
fd62653d79
[Hotfix] Fix merge problems and migration 96 crashing. 2021-10-19 17:06:26 +02:00
Kuba Szczodrzyński
ca3e6f7fc9
Merge pull request #101 from szkolny-eu/feature/structure-refactor
Refactor the code structure
2021-10-19 16:26:26 +02:00
Kuba Szczodrzyński
d8abac1917
Merge branch 'develop' into feature/structure-refactor
# Conflicts:
#	app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Teacher.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersAdapter.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt
2021-10-19 13:45:29 +02:00
Antoni Czaplicki
2807659da3
[UI] Add teachers list feature. (#94)
* Add teachers list feature

* Fix

* some fixes

* Auto stash before merge of "develop" and "origin/develop"

* Add teachers list feature

* Fix

* some fixes

* [UI] Fix updating badges crashing with expanded items.

* Add support for fetching teachers from vulcan, fix some code

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Teacher.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update some code

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Teacher.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/db/entity/Teacher.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/db/migration/Migration96.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Optimize code

* Fix loadTarget algorithm

* Apply suggestions from code review

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

* Update app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-10-18 23:46:39 +02:00
Kuba Szczodrzyński
7884bf4077
[Refactor] Cleanup most compilation warnings. 2021-10-17 23:02:27 +02:00
Kuba Szczodrzyński
59f80c049c
[Refactor] Split Extensions into separate files. 2021-10-17 22:18:00 +02:00
Kuba Szczodrzyński
f1e58db151
[Refactor] Flatten .ui package. 2021-10-17 21:02:35 +02:00
Kuba Szczodrzyński
74b766f18a
[UI] Add text styling to manual events. (#96)
* [UI] Move text styling outside of messages module.

* [UI] Add text styling to event manual dialog.

* [UI/Events] Implement showing HTML-formatted content.

* [UI] Fix searching in styled event topic. Create HtmlMode enum.

* [UI] Add HTML Simple mode to text styling manager. Fix CharSequence replacing.

* [Events] Disable self-shared event notifications.

* [UI] Fix simple HTML mode format. Fix HTML in notifications.

* [HTML] Replace usages of Html and HtmlCompat with BetterHtml.

* [Events] Fix editing self-added events from other devices.

* [Events] Implement receiving and fix showing HTML-formatted events.

* [UI/Events] Add observing changes in event details dialog.

* [Firebase] Disable self-shared event notifications.
2021-10-16 19:37:41 +02:00
Kuba Szczodrzyński
7e0f69d95d
[Gradle] Migrate JCenter dependencies to JitPack. (#97)
* [Gradle] Replace JCenter-based dependencies with JitPack.

* [API] Fix Jsoup usage after dependency update.
2021-10-15 22:37:46 +02:00
Kuba Szczodrzyński
fa318d4509
[UI] Update Iconics to remove the span workaround. 2021-10-13 19:23:17 +02:00
Kuba Szczodrzyński
63b74a9fda
[Mobidziennik] Add prefix and suffix for server name login field. 2021-10-11 20:23:57 +02:00
Kuba Szczodrzyński
1a543814f4
[UI] Implement homework searching. (#93)
* [Messages] Create message type checking methods.

* [UI] Refactor messages searching to a separate module.

* [Refactor] Move dialogs.event to modules package.

* [Refactor] Move classes from modules.messages to separate packages.

* [Homework] Implement searching homework lists.

* [Homework] Fix highlighting search query in addedBy text.

* [Homework] Workaround IconicsTextView discarding span data.

* [Messages] Make attachments searchable.

* [Events] Show icons for events with attachments.

* [Homework] Workaround IconicsTextView discarding span data, again.

* [Search] Fix serialization crashes with searchable models.

* [Messages] Fix searching in HTML body.
2021-10-10 19:21:50 +02:00
Kuba Szczodrzyński
50ae767fcd
[Messages] Add saving messages as draft. (#92)
* [Messages/Compose] Move original message handling code to MessageManager.

* [Messages/Compose] Add draft saving dialog on back button press.

* [Messages/Compose] Implement saving messages as draft.

* [Messages/Compose] Fix missing line breaks when saving/loading HTML.

* [Messages] Fix download button icon padding.

* [Messages] Fix showing correct message read date.

* [Messages] Improve (and fix) scrolling to previous list position.

* [Messages] Fix message body trimming.

* [Messages/Compose] Add draft-related bottom sheet items.

* [Refactor] Cleanup MainActivity code.

* [Messages/Compose] Set htmlCompatible to true by default.

* [Messages/Compose] Show confirmation dialog when navigating with unsaved changes.

* [Messages] Restore message body bottom padding.

* [Messages] Fix download button icon padding, again.
2021-10-09 22:48:41 +02:00
Kuba Szczodrzyński
44263ac95f
[Messages] Add support for starring messages. (#86)
* [UI/Messages] Add stars to message list layout.

* [Messages] Move text styling-related code to a manager.

* [Messages] Implement starring messages. Move more code to the manager. Update UI.

* [UI] Add padding to the no data text.

* [Messages] Fix checking sent message recipient read state.

* [Messages] Add star icon padding.
2021-10-08 21:43:11 +02:00
Kuba Szczodrzyński
a6aca42c8c
Merge pull request #91 from szkolny-eu/hotfix/messages
[UI] Various messages fixes.
2021-10-08 16:50:09 +02:00
Kuba Szczodrzyński
83daae46b8
[Messages] Fix multiplied recipients with more than one profile. 2021-10-07 11:57:23 +02:00
Kuba Szczodrzyński
6611fc5843
[Messages] Disable showing 0-byte attachment sizes. 2021-10-07 11:43:54 +02:00
Kuba Szczodrzyński
fe82c86c93
[Messages/Compose] Fix recipient adding dialog empty. 2021-10-07 11:28:56 +02:00
Kuba Szczodrzyński
692555732d
[Messages/Compose] Add text styling support. (#85)
* [UI/Messages] Add draft text styling support.

* [UI/Messages] Improve mid-word span styling. Restore subscript and superscript styles.

* [UI/Messages] Replace framework spans with custom classes on replying.

* [Messages/Compose] Move UI-related code to separate classes.

* [UI/Messages] Disable text style buttons when not in focus.

* [Messages/Compose] Disable text styling on Vulcan.

* [UI/Messages] Add hint toasts to text style toggles.

* [UI/Messages] Add button to clear text styling.

* [Messages/Compose] Fix XML formatting.
2021-10-05 20:28:29 +02:00
Kuba Szczodrzyński
d59286bb05
Merge pull request #84 from szkolny-eu/feature/mobidziennik-homework-attachments
[API/Mobidziennik] Fix showing homework attachments.
2021-10-03 16:02:58 +02:00
Kuba Szczodrzyński
91cfa7e945
[API/Mobidziennik] Implement syncing extra lessons. (#83) 2021-10-03 16:02:36 +02:00
Kuba Szczodrzyński
2d277e80cc
[UI] Restore showing message attachment size. 2021-10-02 16:15:32 +02:00
Kuba Szczodrzyński
3cdca5eb33
[API/Mobidziennik] Fix showing homework attachments. 2021-10-02 16:15:02 +02:00
Kuba Szczodrzyński
591abb4bb8
Merge pull request #81 from szkolny-eu/hotfix/mobidziennik-event-description
[API/Mobidziennik] Implement getting full event description.
2021-10-01 21:18:52 +02:00
Kuba Szczodrzyński
0b4421c7a7
[API/Mobidziennik] Implement getting full event description. 2021-10-01 21:06:48 +02:00
Kuba Szczodrzyński
325efd8b14
[Data] Refactor checking homework event type. 2021-10-01 19:46:11 +02:00
Antoni Czaplicki
959168771b
[UI] Add secret features. (#73)
* Add easter egg

* Remove big file

* Reformat code

* Remove unneded blank lines, optimize some code

* Fix small issue

* Update easter egg logic

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-10-01 18:40:44 +02:00
Kuba Szczodrzyński
41217190bb
Merge branch 'develop' 2021-09-23 22:09:20 +02:00
Kuba Szczodrzyński
18c306b9ea
[4.10] Update build.gradle, signing and changelog. 2021-09-22 13:55:01 +02:00
Kuba Szczodrzyński
c6be1a7954
[Strings] Update copyright dates. 2021-09-22 13:52:06 +02:00
Antoni Czaplicki
e8e9f04050
[UI] Show attendance info in timetable and lesson dialog. (#74)
* Show attendance in timetable view

* Optimize code and UX

* Update some code

* Update attendance layout

* Fix timetable view

* Bump iconics version

* Change umbrella icon

* Update app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.kt

* Update app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.kt

* Update app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.kt

* Update app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.kt

* Update lesson cell margins

* Add attendance info in lesson dialog

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-09-22 00:03:31 +02:00
Kuba Szczodrzyński
3700a71c39
Merge pull request #75 from szkolny-eu/feature/availability-refactor
[API] Refactor register availability checking module.
2021-09-18 21:13:01 +02:00
Kuba Szczodrzyński
60f0628f5e
[Lab] Fix disabling Chucker and Dev Mode. Add new Lab options. 2021-09-18 16:37:24 +02:00
Kuba Szczodrzyński
80dcd9aa69
[API] Refactor register availability checking module. 2021-09-18 16:36:17 +02:00
Kuba Szczodrzyński
d60e622626
Merge branch 'develop' 2021-09-11 00:31:21 +02:00
Kuba Szczodrzyński
91b685576b
[4.9] Update build.gradle, signing and changelog. 2021-09-10 23:54:09 +02:00
Antoni Czaplicki
2e3e3dcf3c
[Lab] Add button to disable devmode and Chucker toggle. (#70)
* Add option to disable/enable chucker and option to disable dev mode from lab page

* Change "chucker" to "enableChucker"

* Update App.kt
2021-09-10 23:47:46 +02:00
Kuba Szczodrzyński
118f5e1794
[API/Vulcan] Fix missing attendance. (#72) 2021-09-10 23:45:29 +02:00
Kuba Szczodrzyński
e902352a4b
Merge pull request #69 from szkolny-eu/hotfix/message-attachments
[Messages] Fix downloading and displaying attachment on API 30+.
2021-09-10 23:44:26 +02:00
Kuba Szczodrzyński
2f7fcb6dc3
[API/Mobidziennik] Fix Web timetable scrapper. 2021-09-10 17:41:39 +02:00
Kuba Szczodrzyński
21ddb9d706
[Git] Update .gitignore for .idea. 2021-09-10 17:20:12 +02:00
Kuba Szczodrzyński
efa63452e7
[App] Fix Apply Changes not working due to manifest changes. 2021-09-10 17:17:31 +02:00
Kuba Szczodrzyński
83f84de019
[UI] Fix attachments view cut off on API 30+. 2021-09-10 17:11:21 +02:00
Kuba Szczodrzyński
b9aca981e5
[App] Change app-wide storage dir to Download subfolder. 2021-09-10 16:56:52 +02:00
Antoni Czaplicki
5913707519
[UI] Use number keyboard in the PIN field in Vulcan. (#68) 2021-09-10 06:49:17 +02:00
Kuba Szczodrzyński
dd6a2c0979
[API/Mobidziennik] Add Web timetable scrapper. (#66)
* [API] Add utils for getting teacher, subject and team by name.

* [API/Mobidziennik] Add Web timetable scrapper.

* [API/Mobidziennik] Add missing Regexes.
2021-09-09 23:14:24 +02:00
Kuba Szczodrzyński
9fdee6e0c7
[UI] Fix restoring header background dialog. (#65) 2021-09-09 23:14:07 +02:00
Czapla
b31bf5c1ab
[API/Vulcan] Fix missing timetable entries. (#67) 2021-09-09 23:13:39 +02:00
Czapla
cf4906f2f4
[API/Vulcan] Fix sending messages. (#64)
* Fix sending message

* Add checking for address name/hash when sending message.

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-09-09 18:52:04 +02:00
Kuba Szczodrzyński
680a5dfea3
[Mobidziennik] Fix missing linebreaks when sending messages. (#63) 2021-09-08 22:49:14 +02:00
Kuba Szczodrzyński
c1062cd7ed
[UI] Update drawer header background. (#62) 2021-09-08 22:49:00 +02:00
Kuba Szczodrzyński
8edc581f0b
[UI] Fix multiplicated day dialog in Agenda. (#61) 2021-09-08 22:48:48 +02:00
Kuba Szczodrzyński
ea9d801d08
[DB] Workaround missing event types after profile archiving. (#60) 2021-09-08 22:48:35 +02:00
Kuba Szczodrzyński
8f72e11d0c
[UI] Center "no data" text view. (#59) 2021-09-08 22:48:21 +02:00
Tomasz F
452271e8c0
[UI] Add list of contributors in Settings. (#15)
* Contributors item in settings

* Move contributors activity to settings package && actualize branch

* Update AndroidManifest.xml

* Getting contributors from github api

* Cleaning code

* Fetching data from szkolny api, displaying content, a lot of changes :D

* Strings

* Remove androidx legacy library

* Revert manifest changes

* Remove logging in SzkolnyApi

* Fix app name spelling

* Revert changes to dimens.xml

* Refactor contributors code

* Revert changes to dimens.xml

Again

* Revert changes to build.gradle

* Revert changes to gradle-wrapper.properties

* Revert changes to gradle.properties

* Make user name nullable

* Add caching, refactor plurals, add progress bar

* Update contributors UI

* Shorten activity name in manifest

* Remove unneeded line break

* Remove fragment_translators.xml

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-09-08 19:11:14 +02:00
doteq
7b4effe889
[UI] Fix block timetable export. (#57)
* Use MediaStore on SDK level >= 29 for timetable export

* Fix imports

* Use subdirectory in the Photos folder

* Use MediaStore for all API levels

* Remove not-null assertion

* Remove unnecessary outputStream close.

* Use File constructor for directory path

* Use File(File, String) constructor

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-09-07 22:11:29 +02:00
Kuba Szczodrzyński
e2bf48d1b6
[Actions] Use JDK 11. 2021-09-02 18:27:51 +02:00
Kuba Szczodrzyński
c88056ddb9
[Gradle] Update library dependencies. 2021-09-02 17:49:01 +02:00
Kuba Szczodrzyński
96dbb0a057
[Gradle] Update Kotlin to v1.5.20. 2021-09-02 17:48:02 +02:00
Kuba Szczodrzyński
288c80ea26
[Gradle] Update wrapper and AGP to match AS 2020.3.1. 2021-09-02 17:40:34 +02:00
Kuba Szczodrzyński
5a217aca01
[4.8.2] Update build.gradle, signing and changelog. 2021-06-15 18:13:18 +02:00
doteq
4bed62aa6f
[UI] Fix timetable crash when syncing (#54)
* Fix removeView

* Use removeView() instead of removeAllViews()

* Remove dayView from layout file
2021-06-11 22:06:07 +02:00
arin
a4d604e146
[API/Librus] Update JST Client ID (#53)
@6Arin9
2021-06-11 00:05:54 +02:00
Kuba Szczodrzyński
ae4405ef78
[4.8.1] Update build.gradle, signing and changelog. 2021-06-06 16:50:04 +02:00
Kuba Szczodrzyński
71ca51e813
[Strings] Update copyright dates. 2021-06-06 16:47:10 +02:00
B.O.S.S
1bf07d736f
[API/Librus] Update client ID (#51)
@BxOxSxS
2021-06-02 22:59:57 +02:00
Kuba Szczodrzyński
c011f550bb
Merge branch 'develop' 2021-05-26 22:32:14 +02:00
Kuba Szczodrzyński
909899612e
Revert "[Actions] Change Firebase token to service account file."
This reverts commit 4184fbb2cd7bde19fc0447057b0e4373db51b03f.
2021-05-26 21:51:52 +02:00
Kuba Szczodrzyński
4184fbb2cd
[Actions] Change Firebase token to service account file. 2021-05-26 20:44:48 +02:00
Kuba Szczodrzyński
75010c0771
[4.8] Update build.gradle, signing and changelog. 2021-05-26 20:01:08 +02:00
Kuba Szczodrzyński
5562498e84
Merge pull request #48 from szkolny-eu/feature/notification-long-text
[Notifications] Add long description text
2021-05-26 20:00:08 +02:00
Kuba Szczodrzyński
c2d0940a80
Merge pull request #46 from szkolny-eu/hotfix/mobidziennik-message-list
[Mobidziennik] Fix sending messages returning a not found error
2021-05-26 19:59:49 +02:00
Kuba Szczodrzyński
baa98f25c5
[UI] Fix easter egg prize receiving. 2021-05-26 19:09:10 +02:00
Kuba Szczodrzyński
26645ee83c
[DB] Add migration 93. 2021-05-26 19:00:24 +02:00
Kuba Szczodrzyński
85d74bec1c
[UI] Add long text for notification descriptions. 2021-05-26 19:00:09 +02:00
Kuba Szczodrzyński
fd0fc652a3
Merge pull request #47 from szkolny-eu/feature/elearning-events
[Agenda] Add e-learning event type.
2021-05-26 18:52:41 +02:00
Kuba Szczodrzyński
c85dac2e4d
[Strings] Update copyright dates. Fix event mark as done translation. 2021-05-26 18:00:37 +02:00
Kuba Szczodrzyński
c855f08f9c
[API/Mobidziennik] Update messages search query to contain student name. 2021-05-26 17:46:03 +02:00
Kuba Szczodrzyński
a31c68e87a
[Agenda] Add e-learning event type and DB migration. 2021-04-19 14:18:28 +02:00
Kuba Szczodrzyński
99021f6b3a
Merge pull request #39 from szkolny-eu/feature/messages-fixes
[Messages] UI updates and fixes
2021-04-14 22:45:44 +02:00
Kuba Szczodrzyński
e2b47db3fd
Merge branch 'develop' into feature/messages-fixes 2021-04-14 22:42:54 +02:00
Kuba Szczodrzyński
8609956ae7
[UI/Timetable] Add current time marker line. (#30) 2021-04-14 22:41:06 +02:00
Kuba Szczodrzyński
e25ca930e0
Merge pull request #28 from szkolny-eu/feature/agenda-updates
[UI] Agenda updates
2021-04-14 22:40:27 +02:00
Kuba Szczodrzyński
47ec1899a1
[UI/Messages] Add greeting text configuration dialog. 2021-04-14 21:08:27 +02:00
Kuba Szczodrzyński
1e8fb6a9ae
[UI/Messages] Restore search string after closing a message. Add message counter. 2021-04-14 20:19:04 +02:00
Kuba Szczodrzyński
02eb5b7ee4
[UI/Agenda] Disable not available config options. 2021-04-14 17:03:44 +02:00
Kuba Szczodrzyński
776806caef
[UI/Agenda] Update DayDialog for showing event group. 2021-04-14 17:03:30 +02:00
Kuba Szczodrzyński
755b846b50
[UI/Agenda] Move common code to EventManager. 2021-04-14 16:34:31 +02:00
Kuba Szczodrzyński
73f3ba17de
Merge branch 'develop' into feature/agenda-updates 2021-04-14 14:57:00 +02:00
Kuba Szczodrzyński
07fb1e0e12
[UI] Refactor dropdown inputs code. 2021-04-14 11:59:58 +02:00
Kuba Szczodrzyński
297867cbf3
[UI] Add event type colors to type dropdown. 2021-04-14 11:21:45 +02:00
Kuba Szczodrzyński
db598af28a
[UI] Add legend in event details dialog. 2021-04-14 10:20:00 +02:00
Kuba Szczodrzyński
ec765c9070
[UI] Fix updating event dialog when editing or removing. 2021-04-14 10:16:22 +02:00
Kuba Szczodrzyński
5eaa754401
[UI] Add icons for done and manual events. 2021-04-13 20:50:51 +02:00
Mateusz Idziejczak
b48b5589f4
[UI] Add eggfall. (#22)
* Add eggfall

* Add egg.png

* Add more eggs

* [Gradle] Update android-snowfall to a fork.

* [Eggfall] Add randomizing egg images.

* [UI] Restore snowfall icon. Add separate eggfall setting.

* [Eggfall] Limit eggfall to near-easter date only.

Co-authored-by: GitHub <noreply@github.com>
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-04-12 17:18:53 +02:00
Mateusz Idziejczak
634ef16bc5
[UI] Add notification icons. (#23)
* Add notification icons

* Change color of icons

* [Notifications] Update icon colors.

* [Notifications] Update lucky number icon.

* Add icons to Notifications List Fragment

* Update notifications_list_item.xml

* Move the gravity to the LinearLayout

* add paddingLeft

* Change IconicsImageView to View.

* Rearrange XML attributes.

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-04-12 17:17:52 +02:00
Kuba Szczodrzyński
ccf0bdaf05
[4.7.1] Update build.gradle, signing and changelog. 2021-04-12 14:35:43 +02:00
Kuba Szczodrzyński
4647da7803
[IDE] Fix XML tags reordering when formatting. 2021-04-12 14:27:51 +02:00
Kuba Szczodrzyński
613f271c4e
Merge pull request #29 from szkolny-eu/hotfix/flavor-aware-availability
[App] Make registerAvailability flavor-aware.
2021-04-12 14:25:49 +02:00
Kuba Szczodrzyński
8b1529f240
[App] Make registerAvailability flavor-aware. 2021-04-12 13:13:10 +02:00
Mateusz Idziejczak
3eb09033bf
[Strings] Update copyright date (#26)
* Update copyright date

* Update copyright in other languages
2021-04-12 12:26:52 +02:00
Kuba Szczodrzyński
12619f6bde
[Agenda] Update scroll listeners code. 2021-04-12 11:50:54 +02:00
Kuba Szczodrzyński
f5ceaa9afe
[Agenda] Add unread badges to events and groups. 2021-04-11 22:08:33 +02:00
Kuba Szczodrzyński
777ae945e0
[Agenda] Implement grouping events by type. 2021-04-10 22:26:43 +02:00
Kuba Szczodrzyński
3eae8fb58b
[Agenda] Add config dialog. Add compact mode. 2021-04-10 20:51:29 +02:00
Kuba Szczodrzyński
b14ef5cd78
[Agenda] Limit event text to 3 lines max. 2021-04-10 18:49:24 +02:00
Kuba Szczodrzyński
98bf4f3bdc
[Agenda] Implement updating event list when changed. 2021-04-09 21:52:04 +02:00
Kuba Szczodrzyński
2d6cf50ca7
[Agenda] Refactor agenda UI code. 2021-04-09 15:32:44 +02:00
Kuba Szczodrzyński
95baf9fb9c
[UI/Dialogs] Add context menu for teachers' names. (#21)
* [UI] Rearrange BetterLink code.

* [UI/Dialogs] Add context menu for teachers' names.

* [Proguard] Update rules for BetterLink reflection.

* [Proguard] Fix rules for BetterLink reflection.
2021-04-08 00:39:59 +02:00
Kuba Szczodrzyński
61b7410bd0
Merge branch 'develop' 2021-04-07 18:43:05 +02:00
Kuba Szczodrzyński
dd0972b528
[Actions] Fix publishing in Google Play release workflow. 2021-04-07 18:42:50 +02:00
Kuba Szczodrzyński
d5c10fbd2b
Merge branch 'develop' 2021-04-07 18:31:03 +02:00
Kuba Szczodrzyński
d17f6297d3
[4.7] Update build.gradle, signing and changelog. 2021-04-07 18:22:54 +02:00
Kuba Szczodrzyński
3ae785a45c
[Actions] Limit Google Play changelog to 500 chars. 2021-04-06 21:50:51 +02:00
Kuba Szczodrzyński
dd254d4bec
[Actions] Fix nightly workflow changes detection. 2021-04-06 18:20:09 +02:00
Kuba Szczodrzyński
e04bd75f1f
[UI/Login] Add version information in login chooser. 2021-04-06 18:17:24 +02:00
Kuba Szczodrzyński
929ccb53db
[Strings] Fix invalid format exception in attendance. 2021-04-05 21:59:23 +02:00
Kuba Szczodrzyński
72319a4613
[API] Disable API caching for signed builds. 2021-04-05 21:52:38 +02:00
Kuba Szczodrzyński
e389e6c073
[4.7-rc.2] Update build.gradle, signing and changelog. 2021-04-05 21:04:29 +02:00
Kuba Szczodrzyński
cd6951dcbb
[UI] Add highlighting user mentions in changelog. 2021-04-05 21:02:49 +02:00
Kuba Szczodrzyński
02d60754b6
[UI] Fix changelog dialog link highlighting. 2021-04-05 20:38:51 +02:00
Kuba Szczodrzyński
6884251646
[UI] Fix English translation typo. 2021-04-05 20:12:38 +02:00
Kuba Szczodrzyński
582e2059d8
[App] Move buildTimestamp to manifest to improve build performance. 2021-04-05 20:00:38 +02:00
Kuba Szczodrzyński
ea2974bfae
[App] Improve unofficial build type info on debug. 2021-04-05 19:46:22 +02:00
Kuba Szczodrzyński
b8ff649c96
[UI] Move privacy policy dialog to login chooser. 2021-04-05 19:45:57 +02:00
Marcin Kowalicki
8661ecdafb
Finish English translation (#12)
* [Feature] Espionage 0.5 speed

* [Languages] Start translating app to English

* [Languages] More English translations

* [Languages] Finish English translation

* Fix bugs in typing

* Revert "[Feature] Espionage 0.5 speed"

This reverts commit b925d3137a724cd744970eb313c4799832c50a4f.

* Remove Espionage [*]

* Another typo

* Fix things that were described in review

* Fix typo

* Hour -> Time

* Update line breaks in strings file.

* Remove unneeded whitespace.

* Update English translations.

Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2021-04-05 19:07:25 +02:00
Kuba Szczodrzyński
fe8cbc061d
Merge pull request #14 from szkolny-eu/feature/readme-update
README update
2021-04-05 19:06:41 +02:00
Kuba Szczodrzyński
b4459e1fd4
[Git] Add workflow badges to README. 2021-04-05 13:08:21 +02:00
Kuba Szczodrzyński
fd6553871f
[Git] Add banner image to README. 2021-04-05 13:00:30 +02:00
Kuba Szczodrzyński
a4ca44e1ce
[Git] Add README banner image. 2021-04-05 12:58:54 +02:00
Kuba Szczodrzyński
e124c429d1
[Actions] Update nightly build schedule. 2021-04-05 11:25:22 +02:00
Kuba Szczodrzyński
e9a2dae1e4 [Gradle] Fix moving artifacts to release folder, again. 2021-04-05 10:56:13 +02:00
Kuba Szczodrzyński
8b0f3490e3 [UI/Settings] Fix hiding hiding sticks from old without devMode. 2021-04-04 22:41:20 +02:00
Kuba Szczodrzyński
131606a6cf
Merge pull request #13 from szkolny-eu/feature/gh-actions
Add GitHub Actions
2021-04-04 22:36:55 +02:00
Kuba Szczodrzyński
cacafa205e
Merge pull request #9 from Zaptyp/patch-1
Correction of spelling and punctuation errors
2021-04-04 22:36:42 +02:00
Kuba Szczodrzyński
9c620de1e7 [Actions] Add nightly build workflow. 2021-04-04 21:43:00 +02:00
Kuba Szczodrzyński
3e98fb967b [Actions] Add Google Play build workflow. 2021-04-04 21:42:08 +02:00
Kuba Szczodrzyński
8db81478f3 [Actions] Add release build workflow. 2021-04-04 21:41:55 +02:00
Kuba Szczodrzyński
8f9861bac6 [Actions] Add workflow utilities scripts. 2021-04-04 21:41:36 +02:00
Kuba Szczodrzyński
5b35e3500e [Gradle] Fix moving app bundles to release folder. 2021-04-04 20:37:02 +02:00
Kuba Szczodrzyński
fc4c297bef [App] Add more info to build details dialog. 2021-04-03 22:22:18 +02:00
Kuba Szczodrzyński
e7cb699bcf [App] Fix unofficial build notice formatting. 2021-04-03 15:58:59 +02:00
Kuba Szczodrzyński
5301b4efad [Gradle] Add moving app bundles to release folder. 2021-04-03 15:35:00 +02:00
Kuba Szczodrzyński
bf595dd09c [App] Fix detecting correct remote repository name. 2021-04-03 15:13:10 +02:00
Patryk
cb4b168b2a
Update README.md 2021-04-02 10:12:13 +02:00
Patryk
b2fcbb8289
Correction of spelling and punctuation errors
Correction of spelling and punctuation errors and improved text appearance.
2021-04-02 06:55:27 +02:00
Kuba Szczodrzyński
df7982d11b [4.7-rc.1] Update build.gradle, signing and changelog. 2021-04-01 19:47:18 +02:00
Kuba Szczodrzyński
7ed9bac0db
Merge pull request #7 from szkolny-eu/feature/code-publish
Prepare for publishing source code
2021-04-01 19:38:20 +02:00
Kuba Szczodrzyński
e6c42ccb87 [Git] Add trademarks notice. 2021-04-01 18:41:08 +02:00
Kuba Szczodrzyński
73378571a2 [Git] Add README.md. 2021-04-01 18:22:39 +02:00
Kuba Szczodrzyński
1cb18b554b [Git] Add LICENSE. 2021-04-01 16:30:06 +02:00
Kuba Szczodrzyński
b9e7e80e11 [App] Add browsing commit file tree in Open repo button. 2021-03-31 11:23:02 +02:00
Kuba Szczodrzyński
114d855c81 [App] Fix detecting signed builds. 2021-03-31 11:09:21 +02:00
Kuba Szczodrzyński
1108f2eb71 [Gradle] Add configuration to store output files in release directory. 2021-03-31 10:51:59 +02:00
Kuba Szczodrzyński
2a3b1422ef Merge branch 'develop' into feature/code-publish 2021-03-31 09:38:31 +02:00
Kuba Szczodrzyński
5690a136f1
Merge pull request #8 from szkolny-eu/feature/code-cleanup
Code cleanup
2021-03-31 09:37:18 +02:00
Kuba Szczodrzyński
4bea803220 Merge branch 'develop' into feature/code-cleanup 2021-03-31 08:52:05 +02:00
Kuba Szczodrzyński
5ac1f94302
Merge pull request #6 from szkolny-eu/feature/iconics-update
Iconics update
2021-03-31 08:49:47 +02:00
Kuba Szczodrzyński
62fdfe754e [UI] Add requesting storage permissions when generating timetable. 2021-03-30 23:21:32 +02:00
Kuba Szczodrzyński
9ba1bf130f [UI] Migrate MaterialDateTimePicker to material-components. 2021-03-30 22:55:46 +02:00
Kuba Szczodrzyński
37c0ff2ac7 [UI] Migrate MaterialDialogs to material-components. 2021-03-30 15:26:52 +02:00
Kuba Szczodrzyński
6287f694f4 [UI] Replace dropdown arrow drawable with Iconics. 2021-03-30 11:11:17 +02:00
Kuba Szczodrzyński
4469323fe0 [Refactor] Remove unused classes and resources. 2021-03-30 11:01:18 +02:00
Kuba Szczodrzyński
ebbb9e4904 [UI] Update UI to maintain icon size consistency. 2021-03-29 22:55:56 +02:00
Kuba Szczodrzyński
7e38445c98 [Gradle] Update NavLib and Iconics. 2021-03-29 22:51:48 +02:00
Kuba Szczodrzyński
bf03601e83 [UI/Profile] Fix profile image icon button ripple. 2021-03-29 21:16:15 +02:00
Kuba Szczodrzyński
e6dec4c6c0 [Api] Move FSLogin realms URL to GitHub sites. 2021-03-29 20:15:14 +02:00
Kuba Szczodrzyński
891be2f9dd [UI/App] Add build date field to build info dialog. 2021-03-29 10:43:34 +02:00
Kuba Szczodrzyński
1f6da2babe [Api] Add sending app build type and flavor headers. 2021-03-29 10:32:59 +02:00
Kuba Szczodrzyński
cce47ed472 [Api] Implement caching invalid API signature response. 2021-03-29 10:21:20 +02:00
Kuba Szczodrzyński
2808c66840 [UI/Login] Fix ignoring API signature errors in login chooser. 2021-03-29 09:41:50 +02:00
Kuba Szczodrzyński
17351066d1 Revert "Librus 2021 Hack Working 100% Legit."
This reverts commit 9ccb6e0a24cd917a4e2624f563ab1006a04bdc89.
2021-03-29 09:31:01 +02:00
Kuba Szczodrzyński
b5d5685b4c [API] Add ignoring signature errors. 2021-03-28 23:50:50 +02:00
Kuba Szczodrzyński
3093850a4a [API] Add API error codes and descriptions. 2021-03-28 23:29:38 +02:00
Kuba Szczodrzyński
93233f6afa [UI/App] Add Open repo button in build info dialog. 2021-03-28 22:54:18 +02:00
Kuba Szczodrzyński
76838fcc41 [App] Change official version validation requirement. 2021-03-28 22:47:19 +02:00
Kuba Szczodrzyński
34e44a7a36 [UI/App] Update build info dialog colors and text style. 2021-03-28 22:45:20 +02:00
Kuba Szczodrzyński
5242d15ebd [UI/Settings] Add build details dialog in About card. 2021-03-28 22:37:20 +02:00
Kuba Szczodrzyński
fe90fc6442 Merge branch 'develop' into feature/code-publish 2021-03-28 22:22:37 +02:00
Kuba Szczodrzyński
dc08abac53
Merge pull request #4 from szkolny-eu/hotfix/android-4-fixes
Android 4.x fixes
2021-03-28 22:16:29 +02:00
Kuba Szczodrzyński
f72f8228f0
Merge branch 'develop' into hotfix/android-4-fixes 2021-03-28 22:16:11 +02:00
Kuba Szczodrzyński
5c87ae2711
Merge pull request #5 from szkolny-eu/feature/new-settings
Add new Settings UI
2021-03-28 22:14:16 +02:00
Kuba Szczodrzyński
abcd6916b3 [App] Add remote repository validation. 2021-03-27 17:03:17 +01:00
Kuba Szczodrzyński
6824960731 [App] Implement basic app validation and related UI. 2021-03-27 16:28:09 +01:00
Kuba Szczodrzyński
726a37d5d6 [UI] Add build details dialog. 2021-03-27 14:33:10 +01:00
Kuba Szczodrzyński
704a55d789 [UI] Update version info in Settings. 2021-03-27 14:09:38 +01:00
Kuba Szczodrzyński
bf5fb5f623 [UI] Update main activity badge. 2021-03-27 14:06:30 +01:00
Kuba Szczodrzyński
1af65de548 [App] Implement BuildManager. 2021-03-27 14:04:37 +01:00
Kuba Szczodrzyński
06407ee439 [Gradle] Add build flavors. 2021-03-27 14:00:06 +01:00
Kuba Szczodrzyński
db265fa12b [Gradle] Include Git info in build config. 2021-03-27 12:55:05 +01:00
Kuba Szczodrzyński
e721261e84 [UI/Profile] Add showing profile config on long click in drawer. 2021-03-25 19:53:11 +01:00
Kuba Szczodrzyński
c5eb67271e [UI] Fix debugging fragment icon missing. 2021-03-25 19:38:00 +01:00
Kuba Szczodrzyński
a5f5c740c9 [UI/Licenses] Update list of open source licenses. 2021-03-25 19:37:25 +01:00
Kuba Szczodrzyński
1b271bd20e [EventBus] Fix crash when opening EventManualDialog. 2021-03-25 19:02:23 +01:00
Kuba Szczodrzyński
d191982da6 [UI] Remove old SettingsNewFragment. 2021-03-25 17:59:31 +01:00
Kuba Szczodrzyński
6e9a0b217d [UI] Remove unused permission checking. 2021-03-25 17:57:05 +01:00
Kuba Szczodrzyński
df4b6ec3e5 [UI/Profile] Fix new profile image not showing. 2021-03-25 17:51:25 +01:00
Kuba Szczodrzyński
d9b91d6de8 [UI/Settings] Add requesting camera permissions in web push fragment. 2021-03-25 17:47:02 +01:00
Kuba Szczodrzyński
dd6e536f88 [UI/Settings] Add requesting camera permissions to pick image. 2021-03-25 17:43:43 +01:00
Kuba Szczodrzyński
a5cbee2b45 [UI/Settings] Fix profile image button icon background. 2021-03-25 17:29:43 +01:00
Kuba Szczodrzyński
7a43ef4dee [App] Remove unneeded profile settings. 2021-03-25 16:45:14 +01:00
Kuba Szczodrzyński
549a542879 [UI/Settings] Fix picking images from camera app. 2021-03-25 16:40:30 +01:00
Kuba Szczodrzyński
0f84732f80 [UI/Settings] Add new profile config dialog. Implement choosing background images. 2021-03-25 16:40:18 +01:00
Kuba Szczodrzyński
4045da7fc5 [App] Disable TLSv1.3 requirement for SSLProvider. 2021-03-25 13:19:52 +01:00
Kuba Szczodrzyński
ae6af77aef [UI] Fix message buttons margin. 2021-03-25 13:13:11 +01:00
Kuba Szczodrzyński
fdad2d9e1a [UI] Fix timetable lesson colors. 2021-03-25 13:06:23 +01:00
Kuba Szczodrzyński
2d01a8c4d4 [UI] Fix nightly badge background tint. 2021-03-25 12:59:42 +01:00
Kuba Szczodrzyński
6c4a1b54ba [Layout] Migrate marginTop/marginBottom to marginVertical. 2021-03-25 12:51:37 +01:00
Kuba Szczodrzyński
37879ca07e [Layout] Migrate marginLeft/marginRight to marginHorizontal. 2021-03-25 12:48:28 +01:00
Kuba Szczodrzyński
2834ab1050 [Layout] Migrate marginStart/marginEnd to marginHorizontal. 2021-03-25 12:45:07 +01:00
Kuba Szczodrzyński
9ef37c46ef [Layout] Migrate paddingTop/paddingBottom to paddingVertical. 2021-03-25 11:54:52 +01:00
Kuba Szczodrzyński
1364691a46 [Layout] Migrate paddingLeft/paddingRight to paddingHorizontal. 2021-03-25 11:49:22 +01:00
Kuba Szczodrzyński
2933e214c6 [Layout] Migrate paddingStart/paddingEnd to paddingHorizontal. 2021-03-25 11:37:40 +01:00
Kuba Szczodrzyński
a58a557fd0 [UI] Fix action switch/checkbox item padding. 2021-03-25 11:18:40 +01:00
Kuba Szczodrzyński
43d71c082b [App] Fix internet and SSL connection. 2021-03-24 23:02:18 +01:00
Kuba Szczodrzyński
3eb99a4bf5 [App] Change companion values to lateinit. 2021-03-24 22:41:28 +01:00
Kuba Szczodrzyński
ea7b4438e8 [Refactor] Remove unused class and resources. 2021-03-23 15:50:27 +01:00
Kuba Szczodrzyński
208d097986 [UI] Add new Settings fragment. 2021-03-22 21:01:04 +01:00
Kuba Szczodrzyński
07561c6484
Merge pull request #3 from szkolny-eu/feature/module-refactor
Refactor Gradle dependencies and project modules
2021-03-22 19:05:30 +01:00
Kuba Szczodrzyński
930ad12f5b [Git] Update .gitignore, remove ignored files. 2021-03-22 19:03:51 +01:00
Kuba Szczodrzyński
b4595446a3 [Gradle] Change wrapper distribution from bin to all. 2021-03-22 17:07:17 +01:00
Kuba Szczodrzyński
efcd2d80da [Gradle] Assign strict versions where required. 2021-03-21 23:47:14 +01:00
Kuba Szczodrzyński
da953c9b1c [Gradle] Update CommunityMaterial to v5.8.55. 2021-03-21 23:39:51 +01:00
Kuba Szczodrzyński
177ffd92f7 [Proguard] Remove unneeded rules. Move app proguard rules. 2021-03-21 22:49:43 +01:00
Kuba Szczodrzyński
85379b0beb [Gradle] Remove unused dependencies. 2021-03-21 22:42:37 +01:00
Kuba Szczodrzyński
cf4aa552e7 [Gradle] Update NavLib to fix multiple item selection issue. 2021-03-21 22:30:19 +01:00
Kuba Szczodrzyński
b6d625a1fc [Gradle] Update most libraries. Rearrange dependencies. 2021-03-21 21:01:28 +01:00
Kuba Szczodrzyński
78333e0077 [Gradle] Remove wear module. 2021-03-21 20:14:54 +01:00
Kuba Szczodrzyński
ea3598bb6d [Gradle] Extract selective-dao dependency. 2021-03-21 20:11:37 +01:00
Kuba Szczodrzyński
e91d99652c [Gradle] Extract szkolny-font dependency. Migrate Iconics to v5. 2021-03-21 20:11:24 +01:00
Kuba Szczodrzyński
d78dad5090 [Gradle] Extract agendacalendarview dependency. 2021-03-20 23:41:59 +01:00
Kuba Szczodrzyński
0615593d94 [Gradle] Extract mhttp dependency. 2021-03-20 21:34:14 +01:00
Kuba Szczodrzyński
15f9db5ca6 [Gradle] Extract nachos dependency. 2021-03-20 20:11:50 +01:00
Kuba Szczodrzyński
75b3485ab4 [Gradle] Extract cafebar dependency. 2021-03-20 19:26:58 +01:00
Kuba Szczodrzyński
50e7bf14d4 [Gradle] Extract material-about-library dependency. 2021-03-20 18:15:21 +01:00
Kuba Szczodrzyński
147f4c39e5 [4.6.1] Update build.gradle, signing and changelog. 2021-03-04 22:27:50 +01:00
Kuba Szczodrzyński
9e95d05182 [Login] Add logging Firebase events on login. 2021-03-04 22:15:51 +01:00
Kacper Ziubryniewicz
9ccb6e0a24 Librus 2021 Hack Working 100% Legit. 2021-03-01 22:42:31 +01:00
Kuba Szczodrzyński
fd31cafd8f Merge branch 'develop' 2021-02-26 23:45:28 +01:00
Kuba Szczodrzyński
92d7a46314 [4.6] Update build.gradle, signing and changelog. 2021-02-26 23:41:04 +01:00
Kuba Szczodrzyński
7aaefa977b [Mobidziennik/Web] Add attendance migration. 2021-02-26 23:30:14 +01:00
Kuba Szczodrzyński
530034d7da [Mobidziennik/Web] Fix custom attendance type symbols. 2021-02-26 23:30:14 +01:00
Kuba Szczodrzyński
44647946e0
Merge pull request #2 from szkolny-eu/feature/idziennik-rip
Remove iDziennik implementation [*]
2021-02-26 23:29:11 +01:00
Kuba Szczodrzyński
efd63797e4 [Mobidziennik/Web] Force trimming searched subject name. 2021-02-26 23:08:06 +01:00
Kuba Szczodrzyński
74820fe67d [Mobidziennik/Web] Fix counting e-attendance. 2021-02-26 23:07:31 +01:00
Kuba Szczodrzyński
e825af0ff0 [Mobidziennik/Web] Fix getting a sent message. 2021-02-26 22:46:52 +01:00
Kuba Szczodrzyński
256f6c8732 [Idziennik] Remove iDziennik implementation [*] 2021-02-26 22:30:01 +01:00
Kuba Szczodrzyński
22abad35cc
Merge pull request #1 from szkolny-eu/feature/vulcan-hebe
Vulcan Hebe implementation
2021-02-26 20:41:51 +01:00
Kuba Szczodrzyński
6a33088352 [Vulcan/Web] Fix extracting school symbol. 2021-02-26 20:37:21 +01:00
Kuba Szczodrzyński
01c41645ab [Vulcan/Web] Update error descriptions. 2021-02-26 20:33:56 +01:00
Kuba Szczodrzyński
54f74d2a3c [Vulcan/Hebe] Match error codes to login form fields. 2021-02-26 20:28:18 +01:00
Kuba Szczodrzyński
e0688fe79b [Vulcan/Hebe] Update error descriptions. 2021-02-26 20:25:58 +01:00
Kuba Szczodrzyński
36c7bb1127 [Vulcan/Hebe] Add full sync migration. 2021-02-26 20:10:52 +01:00
Kuba Szczodrzyński
045205754e [Vulcan/Api] Remove Vulcan API implementation [*] 2021-02-26 19:39:56 +01:00
Kuba Szczodrzyński
e34e4d6906 [Lab] Add JSON editor. 2021-02-26 17:27:17 +01:00
Kuba Szczodrzyński
481af64137 [Login] Reformat LoginInfo. 2021-02-26 13:22:13 +01:00
Kuba Szczodrzyński
2b3a7f6b41 [Vulcan/Web] Release web login mode as testing. 2021-02-26 13:10:50 +01:00
Kuba Szczodrzyński
e3fe03c5fc [Vulcan] Update logo to the new design. 2021-02-26 13:06:48 +01:00
Kuba Szczodrzyński
9740e0b7bf [Login] Fix crashing on register availability error. 2021-02-26 11:53:04 +01:00
Kuba Szczodrzyński
58a26cc0c6 [Vulcan/Hebe] Fix error handling. 2021-02-26 11:52:45 +01:00
Kuba Szczodrzyński
d201c0c448 [Vulcan/Hebe] Add server error code handling. 2021-02-25 22:09:00 +01:00
Kuba Szczodrzyński
359432d24d [4.6-beta.1] Update build.gradle, signing and changelog. 2021-02-25 19:54:19 +01:00
Kuba Szczodrzyński
edf8ec20f0 [Proguard] Add rules for FSLogin. 2021-02-25 19:53:41 +01:00
Kuba Szczodrzyński
3ad9e5da1f [Vulcan/Web] Update web login to work with FSLogin Realms. 2021-02-25 19:29:06 +01:00
Kacper Ziubryniewicz
459bbf78b2 [Vulcan/Hebe] Add getting attachments in homework. 2021-02-24 23:45:27 +01:00
Kuba Szczodrzyński
d0baf02750 [Vulcan/Hebe] Remove login method dependency. 2021-02-24 22:09:51 +01:00
Kuba Szczodrzyński
a5bb7d9c6e [Lab] Add option to full sync and clear profile. 2021-02-24 21:53:59 +01:00
Kacper Ziubryniewicz
a939d95ea3 [Vulcan/Hebe] Add getting attachments in messages. 2021-02-24 21:18:35 +01:00
Kuba Szczodrzyński
4c081c970e [Vulcan/Hebe] Exclude more endpoints from first semester sync. 2021-02-23 12:50:37 +01:00
Kuba Szczodrzyński
b75ab76c2a [Vulcan/Web] Fix checking login expiry time. 2021-02-23 12:48:17 +01:00
Kuba Szczodrzyński
9da6dbccb3 [Vulcan/Web] Fix registering mobile device. 2021-02-23 12:47:52 +01:00
Kuba Szczodrzyński
66444ae35b [Vulcan/Web] Fix extracting permissions string. 2021-02-23 12:47:20 +01:00
Kuba Szczodrzyński
3e8b3de2b7 [Vulcan/Web] Move web data to loginStore per-symbol. 2021-02-23 12:00:01 +01:00
Kuba Szczodrzyński
85ac5769a1 [4.5.1-beta.1] Update build.gradle, signing and changelog. 2021-02-22 23:25:44 +01:00
Kuba Szczodrzyński
93e3d5994a [Vulcan/Hebe] Restore sending date range when getting attendance. 2021-02-22 23:20:32 +01:00
Kuba Szczodrzyński
0cf24c527b [Vulcan/Hebe] Fix logging tag in notices class. 2021-02-22 23:04:10 +01:00
Kuba Szczodrzyński
97c5acd6ba [Vulcan/Hebe] Fix checking for current year. 2021-02-22 22:59:02 +01:00
Kuba Szczodrzyński
30aeb70647 [Vulcan/Hebe] Add filtering data by current school year. 2021-02-22 22:54:13 +01:00
Kuba Szczodrzyński
b599d679c4 [Vulcan/Hebe] Implement sending messages. 2021-02-22 22:43:36 +01:00
Kacper Ziubryniewicz
1eecd24d91 [Vulcan/Hebe] Add getting notices. 2021-02-22 22:40:28 +01:00
Kuba Szczodrzyński
c698dfdb73 [Vulcan/Hebe] Add getting grade summary. 2021-02-22 21:33:42 +01:00
Kuba Szczodrzyński
c7a44f5ced [Vulcan/Hebe] Implement push notifications. 2021-02-22 19:13:25 +01:00
Kuba Szczodrzyński
c8ee6ff1e7 [Vulcan/Hebe] Add getting lucky number. 2021-02-22 18:49:53 +01:00
Kuba Szczodrzyński
552acd4043 [Vulcan/Web] Fix web login. 2021-02-22 18:23:27 +01:00
Kuba Szczodrzyński
ede101ea20 [Vulcan/Hebe] Add saving lesson topic in attendance. 2021-02-22 17:51:52 +01:00
Kuba Szczodrzyński
13c2640ed5 [UI] Hide API deprecation message on other profiles. 2021-02-22 17:43:34 +01:00
Kuba Szczodrzyński
dd0739fd4b Merge branch 'develop' into feature/vulcan-hebe 2021-02-22 17:36:48 +01:00
Kuba Szczodrzyński
9023f13932 [Vulcan/Hebe] Add missing copyright to files. 2021-02-22 17:18:40 +01:00
Kuba Szczodrzyński
f8456fb087 [Lab] Add archiver enabled checkbox. 2021-02-22 16:37:53 +01:00
Kuba Szczodrzyński
df7044cc64 Merge branch 'develop' 2021-02-22 00:18:20 +01:00
Kuba Szczodrzyński
9b48041cd9 [4.5] Update build.gradle, signing and changelog. 2021-02-22 00:03:52 +01:00
Kuba Szczodrzyński
46cecf3474 Merge branch 'feature/vulcan-hebe' into develop 2021-02-21 23:57:25 +01:00
Kuba Szczodrzyński
c27254bcad [Vulcan] Remove API login mode form. 2021-02-21 23:55:11 +01:00
Kuba Szczodrzyński
80333cdea4 [Vulcan] Add API deprecation message. 2021-02-21 23:52:45 +01:00
Kuba Szczodrzyński
6aee3ea420 [4.5-beta.2] Update build.gradle, signing and changelog. 2021-02-21 23:36:55 +01:00
Kuba Szczodrzyński
a11a44b768 [Vulcan/Hebe] Add handling custom presence types. 2021-02-21 23:30:20 +01:00
Kuba Szczodrzyński
e869107101 [Vulcan/Hebe] Add syncing both semesters during first sync. 2021-02-21 23:26:43 +01:00
Kuba Szczodrzyński
5903bbe59d [Vulcan/Hebe] Fix getting attendance. 2021-02-21 23:03:06 +01:00
Kuba Szczodrzyński
6c0ddd3e6d [Vulcan/Hebe] Add setting message status as read. 2021-02-21 22:55:26 +01:00
Kacper Ziubryniewicz
621a7ac642 [Vulcan/Hebe] Add getting attendance. 2021-02-21 22:28:54 +01:00
Kuba Szczodrzyński
e86b47fb1b [Vulcan/Hebe] Add getting messages. 2021-02-21 21:50:44 +01:00
Kuba Szczodrzyński
98fb7ac8c9 [Vulcan/Web] Fix Proguard rules for platform selection. 2021-02-21 19:15:53 +01:00
Kuba Szczodrzyński
f49e39e858 [Vulcan/Hebe] Add getting teacher list and addressbook. 2021-02-21 19:13:47 +01:00
Kuba Szczodrzyński
8fc57cd3f5 [Vulcan/Hebe] Fix getting classroom name. 2021-02-21 17:22:21 +01:00
Kuba Szczodrzyński
a9eda087e0 [Extensions] Update Gson extensions to check type. 2021-02-21 17:20:13 +01:00
Kuba Szczodrzyński
3f36a284ee [4.5-beta.1] Update build.gradle, signing and changelog. 2021-02-21 16:40:40 +01:00
Kuba Szczodrzyński
1814fd67e1 [Strings] Update copyright date. 2021-02-21 16:39:02 +01:00
Kuba Szczodrzyński
54e49af943 [Vulcan/Hebe] Add getting timetable and lesson changes. 2021-02-21 16:18:33 +01:00
Kuba Szczodrzyński
d6a67a0da6 [Vulcan/Hebe] Add getting homework list. 2021-02-21 12:18:53 +01:00
Kuba Szczodrzyński
28725c6400 [Vulcan/Hebe] Add getting exams. 2021-02-21 00:27:42 +01:00
Kuba Szczodrzyński
4fc965d970 [Vulcan/Hebe] Add saving unit ID. 2021-02-20 23:52:40 +01:00
Kuba Szczodrzyński
2aaf713d58 [Vulcan/Hebe] Add next sync and data removing in grades. 2021-02-20 23:45:27 +01:00
Kuba Szczodrzyński
c7d2ac4e3e [Vulcan/Hebe] Add getting grades. 2021-02-20 23:07:23 +01:00
Kuba Szczodrzyński
ae20c30c88 [Vulcan/Hebe] Fix Firebase token for registration. 2021-02-20 21:31:52 +01:00
Kuba Szczodrzyński
aef3f66654 [Vulcan/Hebe] Add API list helper. Separate student list code. 2021-02-20 20:11:54 +01:00
Kuba Szczodrzyński
c7abde8f11 [Vulcan/Hebe] Update login mode requirement. 2021-02-20 18:51:08 +01:00
Kuba Szczodrzyński
2fcff33bd6 [Vulcan/Hebe] Add hebe API login implementation. 2021-02-19 13:37:31 +01:00
Kuba Szczodrzyński
b08e4c2d3d [Gradle] Update OkHttp to 3.12.13. 2021-02-19 13:24:12 +01:00
Kuba Szczodrzyński
73ff09052c [Gradle] Bump target SDK to 30. 2021-02-17 14:43:00 +01:00
Kuba Szczodrzyński
9649afd43f [Gradle] Update libraries and dependencies. 2021-02-17 14:42:08 +01:00
Kuba Szczodrzyński
ed3a245b51 [UI/Login] Add new easter eggs. 2020-10-18 22:14:41 +02:00
Kuba Szczodrzyński
477730708f [UI/Login] Add refresh button in platform list. 2020-10-17 23:44:17 +02:00
Kuba Szczodrzyński
f39d0c595d [UI/Login] Add recommended, testing and dev only badges to login modes. 2020-10-17 23:10:07 +02:00
Kuba Szczodrzyński
0a127ac6ee Merge branch 'develop' 2020-10-17 00:22:35 +02:00
Kuba Szczodrzyński
46407f9647 [4.4.3] Update build.gradle, signing and changelog. 2020-10-16 23:54:48 +02:00
Kuba Szczodrzyński
6ecb97b87e [Login/Podlasie] Add option to logout other devices. 2020-10-16 23:50:44 +02:00
Kuba Szczodrzyński
ecdaaeae65 [API/Vulcan] Add KO1 routing rule. 2020-10-16 18:06:34 +02:00
Kuba Szczodrzyński
a0c302b663 [App] Swap devMode with debugMode. Fix hiding sticks from old. 2020-10-16 17:18:19 +02:00
Kuba Szczodrzyński
b31039ecd9 [API/Mobidziennik] Fix getting recipient list. 2020-10-16 16:57:00 +02:00
Kacper Ziubryniewicz
5c84086f42 [Settings/Grades] Add hiding sticks from old. 2020-10-14 22:26:47 +02:00
Kacper Ziubryniewicz
752cdfa8d6 Implement wear module base. 2020-09-17 18:05:17 +02:00
Kuba Szczodrzyński
6b75715e87 Merge branch 'develop' 2020-09-05 19:39:17 +02:00
Kuba Szczodrzyński
8e3d404352 [4.4.2] Update build.gradle, signing and changelog. 2020-09-05 19:14:11 +02:00
Kuba Szczodrzyński
810cfd8092 [API] Rename response parameters to fix compatibility. 2020-09-05 19:13:37 +02:00
Kuba Szczodrzyński
bd2a9524c6 [UI] Use HtmlCompat instead of Html. Fix a typo. 2020-09-05 18:47:30 +02:00
Kuba Szczodrzyński
d780d5118d [Proguard] Add rules to fix API responses. 2020-09-05 18:38:53 +02:00
Kuba Szczodrzyński
b9e0d91220 Merge branch 'develop' 2020-09-04 15:44:55 +02:00
Kuba Szczodrzyński
f1570b8eb9 [4.4.1] Update build.gradle, signing and changelog. 2020-09-04 15:44:26 +02:00
Kuba Szczodrzyński
de0f29a09e [API/Mobidziennik] Fix getting attendance when a day has no lessons. 2020-09-04 00:04:23 +02:00
Kuba Szczodrzyński
c0d11c91e3 [API/Mobidziennik] Fix trimming subject name in timetable. 2020-09-03 23:51:56 +02:00
Kuba Szczodrzyński
22c540a3d4 [UI] Improve register unavailable dialog and card. 2020-09-03 23:50:53 +02:00
Kuba Szczodrzyński
0d5bb331f3 Merge branch 'develop' 2020-09-03 14:09:55 +02:00
Kuba Szczodrzyński
b7e35d0322 [4.4] Update build.gradle, signing and changelog. 2020-09-03 14:08:54 +02:00
Kuba Szczodrzyński
7bcd6bf038 [Sync] Implement checking register availability. Improve app updates. 2020-09-03 13:39:46 +02:00
Kuba Szczodrzyński
0e52fb7386 Merge branch 'develop' 2020-08-29 00:01:16 +02:00
Kuba Szczodrzyński
ea4591144b [4.3.1] Update build.gradle, signing and changelog. 2020-08-29 00:00:38 +02:00
Kuba Szczodrzyński
7627d184a2 [API/Librus] Update client parameters. 2020-08-28 23:47:28 +02:00
Kuba Szczodrzyński
076b485fda [API] Enable back sync before school year. 2020-08-28 23:27:34 +02:00
Kuba Szczodrzyński
339bb9c8f6 Merge branch 'develop' 2020-08-28 15:32:36 +02:00
Kuba Szczodrzyński
09cb97e367 [4.3] Update build.gradle, signing and changelog. 2020-08-28 15:26:42 +02:00
Kuba Szczodrzyński
4e1f2ed41a [UI] Update date in about card subtext. Make gradlew executable. 2020-08-27 12:07:07 +02:00
Kuba Szczodrzyński
281b6a95ef [API] Fix for syncing new profiles after archiving. 2020-08-27 00:10:19 +02:00
Kacper Ziubryniewicz
e40871c0d0 [UI] Update register names, again. 2020-08-26 22:15:48 +02:00
Kacper Ziubryniewicz
b74eeed994 [UI] Update register names. 2020-08-26 21:36:30 +02:00
Kuba Szczodrzyński
ccde482364 [UI] Update register names. 2020-08-25 23:48:51 +02:00
Kuba Szczodrzyński
a02033d0f3 [API] Fix archiving compatibility for older app versions. 2020-08-25 22:25:21 +02:00
Kuba Szczodrzyński
6c6bc89f57 [UI] Improve archive-related UI. Add archived info home card. 2020-08-25 19:14:11 +02:00
Kuba Szczodrzyński
1e3da45340 [UI] Remove unused home cards. 2020-08-25 17:02:12 +02:00
Kuba Szczodrzyński
0d366adddb [UI] Implement showing archived profiles in drawer. 2020-08-25 16:01:11 +02:00
Kuba Szczodrzyński
2c24eba46d [UI] Show bottom bar badge in debug versions. 2020-08-25 12:05:58 +02:00
Kuba Szczodrzyński
7c6dbca986 [API] Implement basic profile archiving. 2020-08-25 10:46:50 +02:00
Kuba Szczodrzyński
33a8fa2a1e [API] Fix doubled sync on API error. 2020-08-24 18:56:26 +02:00
Kuba Szczodrzyński
300e2c4bc2 [API/Librus] Fix doubled sync on reCaptcha timeout. 2020-08-24 18:16:47 +02:00
Kuba Szczodrzyński
f883318bd2 [Gradle] Fix compilation issues in latest Android Studio. 2020-08-24 17:42:53 +02:00
Kuba Szczodrzyński
b44fa6b2e4 Merge branch 'develop' 2020-05-22 14:49:24 +02:00
Kuba Szczodrzyński
5460c1e2a0 [4.2.1] Update build.gradle, signing and changelog. 2020-05-21 23:12:25 +02:00
Kuba Szczodrzyński
137c975e81 [API/Vulcan] Add getting Firebase token from server. 2020-05-21 22:07:31 +02:00
Kacper Ziubryniewicz
001de4a88c [Firebase] Fix getting FCM tokens and try to fix Vulcan registering. 2020-05-20 22:04:39 +02:00
Kuba Szczodrzyński
5dcb3fd580 [Data] Fix setting correct time zone in ISO date parsing. 2020-05-18 12:22:21 +02:00
Kuba Szczodrzyński
f13995aa5c [API/Mobidziennik] Fix lucky number extraction. 2020-05-18 11:42:58 +02:00
Kuba Szczodrzyński
e23deb5ca6 [API/Podlasie] Fix security token generation. 2020-05-18 11:41:27 +02:00
Kuba Szczodrzyński
9cc98fcf08 Merge branch 'develop' 2020-05-17 17:52:28 +02:00
Kuba Szczodrzyński
d688b379a2 [4.2] Update build.gradle, signing and changelog. 2020-05-16 21:27:56 +02:00
Kuba Szczodrzyński
d6a796e25e [Login] Crop Podlasie logo. Add Feedback activity, remove help icon. 2020-05-16 20:59:28 +02:00
Kuba Szczodrzyński
e02d3e571d [API/Librus] Fix some more captcha errors. 2020-05-16 20:52:16 +02:00
Kuba Szczodrzyński
907b75b22d [Proguard] Add rule for app login platform. 2020-05-16 20:46:54 +02:00
Kuba Szczodrzyński
c3660b5f80 [Login] Change Librus logo. Disable Synergia & Vulcan e-mail login. 2020-05-16 20:44:56 +02:00
Kuba Szczodrzyński
7ff10df70c [Login] Fix not showing sync fragment. 2020-05-16 20:33:37 +02:00
Kacper Ziubryniewicz
83e1b21ec3 [API/Podlasie] Add downloading attachments in homework. 2020-05-14 18:54:37 +02:00
Kacper Ziubryniewicz
deb54e4b24 [API/Podlasie] Add getting homework. 2020-05-14 12:06:52 +02:00
Kacper Ziubryniewicz
48873caecc [DB/Grades] Fix DataRemoveModel deleting models instead of marking as don't keep. 2020-05-14 11:43:22 +02:00
Kacper Ziubryniewicz
cadd1a3dbd Merge branch 'feature/prymus' into develop 2020-05-13 23:16:34 +02:00
Kacper Ziubryniewicz
f09f069b2c [API/Podlasie] Move event description to homework body. 2020-05-13 22:56:22 +02:00
Kacper Ziubryniewicz
1fb5aaed5d [UI/Podlasie] Show homework fragment in drawer. 2020-05-13 22:55:45 +02:00
Kacper Ziubryniewicz
65ba330d5f [API/Podlasie] Fix encoding in events topic. 2020-05-13 22:49:01 +02:00
Kacper Ziubryniewicz
795317f13f [API/Podlasie] Add getting teachers. 2020-05-13 22:47:05 +02:00
Kacper Ziubryniewicz
031cc05209 [API/Podlasie] Add getting events. 2020-05-13 22:17:50 +02:00
Kacper Ziubryniewicz
0ac8e1d9c1 [API/Podlasie] Add getting the lucky number. 2020-05-13 19:56:41 +02:00
Kacper Ziubryniewicz
4389dc9d79 [API/Podlasie] Add getting grades proposals. 2020-05-13 19:37:24 +02:00
Kacper Ziubryniewicz
b13257cb78 [API/Podlasie] Add getting grades. 2020-05-13 17:33:42 +02:00
Kacper Ziubryniewicz
fcffa2afeb [API/Podlasie] Fix saving class team, add main endpoint and getting the timetable. 2020-05-13 16:56:42 +02:00
Kacper Ziubryniewicz
3c2f85f263 Merge branch 'develop' into feature/prymus 2020-05-12 20:37:15 +02:00
Kacper Ziubryniewicz
0a2323acf3 [API/Podlasie] Implement first login and login page. 2020-05-12 20:25:45 +02:00
Kuba Szczodrzyński
45c2948ed1 [Login] Fix not showing errors after one successful login. 2020-05-12 18:23:29 +02:00
Kuba Szczodrzyński
f72a6103b5 Merge branch 'feature/new-login' into develop 2020-05-12 18:20:08 +02:00
Kuba Szczodrzyński
9261848369 [API] Improve Lab fragment. Fix OkHttp crashing on API <21. 2020-05-12 13:41:40 +02:00
Kacper Ziubryniewicz
7f4e45c57c Merge branch 'develop' into feature/prymus 2020-05-11 21:06:18 +02:00
Kacper Ziubryniewicz
180154b684 Merge branch 'new-login' into develop 2020-05-11 20:59:38 +02:00
Kacper Ziubryniewicz
a4f58eb19b [API/Podlasie] Implement basic Podlasie e-register support. 2020-05-11 20:41:13 +02:00
Kuba Szczodrzyński
fada483d55 [Login] Add missing e-registers. 2020-05-11 20:37:25 +02:00
Kuba Szczodrzyński
3ae9ba3d61 Merge branch 'develop' into feature/new-login
# Conflicts:
#	app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/login/VulcanLoginApi.kt
#	app/src/main/res/values/strings.xml
2020-05-11 19:06:07 +02:00
Kacper Ziubryniewicz
15102fe818 [Hotfix] Suppress ConvertSecondaryConstructorToPrimary in LibrusLoginApi. 2020-05-11 18:14:15 +02:00
Kuba Szczodrzyński
8864bb2a5e [UI] Add new app icon and splash logo. 2020-05-11 13:42:30 +02:00
Kacper Ziubryniewicz
ef1cdd5b20 [API/Librus] Use Synergia message module when messages module login fails. 2020-05-10 19:44:44 +02:00
Kuba Szczodrzyński
35f4f34342 [API/Vulcan] Add syncing first semester. Disable counting releases in attendance. 2020-05-09 23:01:42 +02:00
Kacper Ziubryniewicz
1a8134459a [API/Librus] Implement downloading messages using Synergia endpoints. 2020-05-09 20:11:09 +02:00
Kacper Ziubryniewicz
a6ce3a5068 [API/Librus] Make downloading attachments use Synergia. 2020-05-09 20:11:09 +02:00
Kacper Ziubryniewicz
328b20f78b [Fix] Increase HTTP client timeout duration. 2020-05-09 20:11:09 +02:00
Kuba Szczodrzyński
771712da99 [UI/Attendance] Fix counting issues. Add attendance details dialog. 2020-05-09 19:18:18 +02:00
Kuba Szczodrzyński
65e0e10db6 [4.1] Update build.gradle, signing and changelog. 2020-05-09 15:23:44 +02:00
Kuba Szczodrzyński
62e0e53354 [DB] Force attendance sync in models migration. 2020-05-09 10:59:25 +02:00
Kuba Szczodrzyński
a5461a488a [UI] Fix attendance type list crash. 2020-05-09 10:53:19 +02:00
Kuba Szczodrzyński
192dd0c4c7 [UI] Add listing attendance by type. 2020-05-08 22:19:55 +02:00
Kuba Szczodrzyński
c49755c0eb [API/Librus] Fix messages login when ReCaptcha is needed. 2020-05-08 20:46:51 +02:00
Kuba Szczodrzyński
c8c758958d [API/Mobidziennik] Fix web attendance without lesson topic. 2020-05-07 15:48:16 +02:00
Kuba Szczodrzyński
e068f1944f [UI] Add attendance summary page. Disable presence notifications. 2020-05-05 22:57:24 +02:00
Kuba Szczodrzyński
97412a3736 [UI] Add German translation. 2020-05-05 21:46:18 +02:00
Kuba Szczodrzyński
9167d53a1a [UI] Add new attendance UI module. 2020-05-04 22:47:27 +02:00
Kuba Szczodrzyński
6436a17036 [API] Fix signatures for nightly versions. 2020-05-04 09:28:39 +02:00
Kuba Szczodrzyński
5ab5dbe940 [UI] Show nightly version badge in main activity. 2020-05-03 13:11:04 +02:00
Kacper Ziubryniewicz
d68ab0d010 [Fix] Suppress i18n warning in GradesConfigDialog. 2020-05-02 23:55:20 +02:00
Kuba Szczodrzyński
f70a1f5730 [DB] Fix homework added date migration. 2020-05-01 22:03:13 +02:00
Kacper Ziubryniewicz
85106a01d7 [API/Librus] Add online lesson URL to events description. 2020-04-30 21:41:42 +02:00
Kuba Szczodrzyński
90e99e241a [UI/Home] Show textual period grades in grades card. 2020-04-29 15:23:30 +02:00
Kuba Szczodrzyński
3f61ab8299 [DB] Refactor database and entities. 2020-04-29 15:14:45 +02:00
Kuba Szczodrzyński
f685a4dceb [API/Vulcan] Implement Vulcan lucky numbers. 2020-04-22 20:05:36 +02:00
Kuba Szczodrzyński
67b794ce2b Merge branch 'develop' 2020-04-20 19:13:49 +02:00
Kuba Szczodrzyński
e8dad29e5d Merge branch 'develop' into feature/new-login 2020-04-20 19:05:05 +02:00
Kuba Szczodrzyński
13a3f66db3 Merge branch 'api-v2' into develop
# Conflicts:
#	.gitignore
#	app/build.gradle
#	app/src/main/assets/pl-changelog.html
#	app/src/main/java/pl/szczodrzynski/edziennik/App.java
#	app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt
#	app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java
#	app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java
#	app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java
#	app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java
#	app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java
#	app/src/main/res/values-en/strings.xml
#	app/src/main/res/values/strings.xml
#	build.gradle
#	gradle/wrapper/gradle-wrapper.properties
2020-04-20 19:00:53 +02:00
Kuba Szczodrzyński
dc9e6081c5 [4.0] Update build.gradle, signing and changelog. 2020-04-19 22:06:19 +02:00
Kuba Szczodrzyński
26f8c03570 [UI] Show class name and school year in subname. Fix setting language. 2020-04-19 22:01:29 +02:00
Kuba Szczodrzyński
97e0f36f09 [UI] Fix semester grades overlapping when scrolling. 2020-04-19 21:37:39 +02:00
Kuba Szczodrzyński
27e49b10fd [API] Implement draft Vulcan Web login. 2020-04-19 19:27:27 +02:00
Kuba Szczodrzyński
97dc8d12f1 [Login] Add new login user interface. 2020-04-16 11:01:53 +02:00
Kuba Szczodrzyński
9b13552b73 [API/Mobidziennik] Fix downloading attachments. 2020-04-16 09:45:28 +02:00
Kuba Szczodrzyński
d8559637a5 [Strings] Fix HTML tags missing in translations. 2020-04-13 22:43:26 +02:00
Kuba Szczodrzyński
00a90a14dc [API] Fix downloading attachments with different name. Handle UTF encoded download names. 2020-04-07 13:57:12 +02:00
Kuba Szczodrzyński
d56afb034b [API] Add Vulcan OneDrive attachment downloading. Add asking for permissions on demand. 2020-04-07 12:16:48 +02:00
Kuba Szczodrzyński
0327ba37f1 [Strings] Update English translation. 2020-04-07 09:10:38 +02:00
Kuba Szczodrzyński
12a54e58b5 [API] Add Vulcan message & homework attachments. Fix Mobidziennik homework attachments. 2020-04-06 22:50:00 +02:00
Kuba Szczodrzyński
238250e8c9 [API/Mobidziennik] Fix homework attachment downloading. 2020-04-06 19:28:04 +02:00
Kuba Szczodrzyński
041bfc6cc0 [4.0-rc.5] Update build.gradle, signing and changelog. 2020-04-05 23:59:13 +02:00
Kuba Szczodrzyński
8a4866cb62 [Messages] Add new attachments view. Allow replying to deleted messages. 2020-04-05 23:56:56 +02:00
Kuba Szczodrzyński
0e4d609bbf [Messages] Fix search in sent messages. Implement removing messages. 2020-04-05 23:39:32 +02:00
Kuba Szczodrzyński
f07b12bd87 [Grades] Fix marking yearly grades as seen. 2020-04-05 22:04:23 +02:00
Kuba Szczodrzyński
0413dbffa2 [Messages] Implement saving list position on message open. 2020-04-05 21:40:12 +02:00
Kuba Szczodrzyński
c214b48409 [Messages] Add a search bar. Fix Grades not loading. 2020-04-05 20:06:35 +02:00
Kuba Szczodrzyński
91a6366548 [Messages] Fix opening messages. 2020-04-04 23:14:40 +02:00
Kacper Ziubryniewicz
03c9932b8c [API/Edudziennik] Add getting whole homework body. 2020-04-04 22:24:15 +02:00
Kacper Ziubryniewicz
ea4919a25d [API/Librus] Add handling missing attachment error. 2020-04-04 22:23:31 +02:00
Kuba Szczodrzyński
f98b174857 [UI] Refactor Messages fragment. 2020-04-04 21:31:14 +02:00
Kuba Szczodrzyński
c0aeb0d2f3 [UI] Add showing unseen events. Add Lab fragment. 2020-04-03 20:58:51 +02:00
Kuba Szczodrzyński
fcb627aac6 [Messages/Compose] Fix underlined word under the caret. 2020-04-02 15:38:16 +02:00
Kuba Szczodrzyński
7f0aea29cd [API/Librus] Fix HTML to string conversion in homework. Add force download homework button in debug mode. 2020-04-02 12:56:24 +02:00
Kuba Szczodrzyński
f6dcbb6594 [API/Librus] Disable Messages login when downloading homework attachment. 2020-04-02 11:19:44 +02:00
Kuba Szczodrzyński
b790421693 [API/Idziennik] Correct showing proposed descriptive grades. Clarify some connection errors. 2020-04-02 11:17:47 +02:00
Kacper Ziubryniewicz
f5a7799924 [API/Librus] Fix getting homework without attachments. 2020-04-02 09:37:22 +02:00
Kacper Ziubryniewicz
b052b5bd66 [API/Librus] Add getting homework body and downloading homework attachments. 2020-04-01 22:55:20 +02:00
Kuba Szczodrzyński
12d8de1def [API] Implement Idziennik homework attachment downloading. Change attachment events to sticky. 2020-04-01 21:49:05 +02:00
Kuba Szczodrzyński
9303483470 [API] Implement Mobidziennik homework attachment downloading. Modify the interface a bit. Show attachments in UI. 2020-04-01 17:07:50 +02:00
Kuba Szczodrzyński
f8adc86a0e [Events] Fix for duplicated events when metadata is doubled. 2020-04-01 17:04:06 +02:00
Kuba Szczodrzyński
db57c258c5 [API] Add trimming whitespaces from events' titles. 2020-04-01 16:56:47 +02:00
Kuba Szczodrzyński
ddb2760c16 [Events] Add Mobidziennik event attachment listing. 2020-03-31 20:04:32 +02:00
Kuba Szczodrzyński
14d267a95a [API] Fix task cancelling with the notification. [UI] Add event downloading progress bar. 2020-03-31 18:20:24 +02:00
Kuba Szczodrzyński
a6c4053896 [API] Add interface method to get event details. 2020-03-31 15:18:34 +02:00
Kuba Szczodrzyński
949a68ec1d [Homework] Add mark as done confirmation dialog. Refactor code a bit. 2020-03-31 09:06:32 +02:00
Kuba Szczodrzyński
93333a8c48 [Homework] Fix showing done homework on every profile. 2020-03-31 08:34:08 +02:00
Kuba Szczodrzyński
da48c059ec [4.0-rc.4] Update build.gradle, signing and changelog. 2020-03-30 23:29:34 +02:00
Kuba Szczodrzyński
ee5566d1ef [Events] Add toast hint to mark as done button. 2020-03-30 23:28:50 +02:00
Kuba Szczodrzyński
b794b30346 [UI] Fix disabling pull to refresh when changing page using tab layout. 2020-03-30 23:16:35 +02:00
Kuba Szczodrzyński
0db6393bb0 [Events] Add showing green check when event is done. Hide done events from homework current list. 2020-03-30 23:02:19 +02:00
Kuba Szczodrzyński
fcc3c55110 [Events] Fix preserving isDone value. Improve DataRemoveModel method of keeping items. 2020-03-30 22:37:48 +02:00
Kuba Szczodrzyński
328c07eaf4 [Messages] Fix Librus attachment downloading. Add option to force (re)download an attachment. 2020-03-30 19:48:56 +02:00
Kuba Szczodrzyński
b004ec048e [UI] Refactor Grades, Notifications, Homework fragments to better match unified templates. 2020-03-30 18:55:28 +02:00
Kacper Ziubryniewicz
b9f83875a0 [Event] Add isDone attribute and marking events as done. 2020-03-30 18:19:19 +02:00
Kuba Szczodrzyński
8c869d082b [UI] Add pager fragment templates. Move all templates to 'template' module. Fix swipe to refresh with pager fragments. 2020-03-30 12:50:21 +02:00
Kuba Szczodrzyński
043f8210ba [UI] Add lazy loading to fragments with view pager. 2020-03-29 23:11:17 +02:00
Kuba Szczodrzyński
41a79caf83 [API/Mobidziennik] Change data remove model to include only possible types. 2020-03-29 21:06:39 +02:00
Kuba Szczodrzyński
0427fa6087 [Events] Add support for selective updates and upserting. 2020-03-29 18:05:56 +02:00
Kuba Szczodrzyński
2f3c912dbe [Config] Disable teacher absence notifications by default. Add missing migration values. 2020-03-29 16:27:05 +02:00
Kuba Szczodrzyński
219a7443c0 [4.0-rc.3] Update build.gradle, signing and changelog. 2020-03-29 15:31:49 +02:00
Kuba Szczodrzyński
6deb408d80 [API/Librus] Fix attachment downloading, once again. 2020-03-29 15:30:30 +02:00
Kuba Szczodrzyński
c6e1ff2164 [Events] Fix event sorting. Fix showing event teacher name. 2020-03-29 15:26:48 +02:00
Kuba Szczodrzyński
bc0918a115 [API/Librus] Fix attachment downloading. 2020-03-29 15:16:35 +02:00
Kacper Ziubryniewicz
55ff9173be [API/Liburs] Fix unseen teacher absence metadata and add notifications for new teacher absences. 2020-03-28 17:08:36 +01:00
Kuba Szczodrzyński
d4d548846f [Refactor] Refactor EventDao class. 2020-03-28 11:17:39 +01:00
Kuba Szczodrzyński
ef4527f140 [Refactor] Rewrite events to Kotlin. 2020-03-27 18:51:56 +01:00
Kuba Szczodrzyński
0b1e7242bb [API/Mobidziennik] Fix some errors. 2020-03-27 14:05:03 +01:00
Kuba Szczodrzyński
30b6ac2a06 [4.0-rc.2] Update build.gradle, singing and changelog. 2020-03-26 20:46:03 +01:00
Kuba Szczodrzyński
a7fa7cb5e4 [API/Librus] Fix a typo. 2020-03-26 20:45:46 +01:00
Kuba Szczodrzyński
f3e87f9016 [API/Librus] Fix missing login data error. 2020-03-26 20:42:58 +01:00
Kuba Szczodrzyński
a983af6c28 [4.0-rc.1] Update build.gradle, singing and changelog. 2020-03-26 20:40:00 +01:00
Kacper Ziubryniewicz
114c841f0c [API/Liburs] Fix Librus API push config endpoint. 2020-03-26 20:34:59 +01:00
Kuba Szczodrzyński
e271048577 [UI] Clarify some errors. Fix deselecting the mini drawer. 2020-03-26 18:48:54 +01:00
Kuba Szczodrzyński
b8c5925e82 [API/Librus] Fix attendance NPE. 2020-03-26 17:55:39 +01:00
Kuba Szczodrzyński
9bda6c8869 [API/Librus] Disable push config with no premium. Disable API homework. Enable Synergia homework. 2020-03-26 16:31:11 +01:00
Kuba Szczodrzyński
d1608d308c [API/Librus] Disable login with credentials in Messages. 2020-03-26 15:57:13 +01:00
Kuba Szczodrzyński
b8e1e1d33a [Event/Manual] Fix dropdowns not showing any data. 2020-03-25 17:36:22 +01:00
Kuba Szczodrzyński
8099a037e7 [Proguard] Update proguard rules to fix BetterLink and MiniDrawer. 2020-03-24 21:03:19 +01:00
Kuba Szczodrzyński
af23c932a6 [API] Change the Cookie jar to fix most cookie problems. 2020-03-24 20:43:41 +01:00
Kuba Szczodrzyński
4edabbb186 [Messages/Compose] Enable HTML messages for Idziennik. 2020-03-24 16:31:46 +01:00
Kuba Szczodrzyński
37a5bea79b [Libraries] Update gradle, NavLib and Firebase. 2020-03-24 16:29:45 +01:00
Kuba Szczodrzyński
40cdc7d713 [4.0-beta.14] Update build.gradle, signing and changelog. 2020-03-24 12:54:42 +01:00
Kuba Szczodrzyński
49825aca48 [API/Librus] Fix message attachment downloading. 2020-03-24 12:51:49 +01:00
Kuba Szczodrzyński
1d57c4e705 [Settings] Replace hardcoded Discord invite link with a redirect. 2020-03-21 16:57:01 +01:00
Kacper Ziubryniewicz
87ae5787ee [UX] Fix app quiting in home when back button opens drawer function active. 2020-03-20 21:39:38 +01:00
Kacper Ziubryniewicz
20f16c25a3 [API/Liburs] Fix getting wrong homework description in Synergia. 2020-03-20 15:47:12 +01:00
Kacper Ziubryniewicz
6f1ec79d9b [UX] Fix back button opens drawer function always opening the drawer. 2020-03-20 14:21:13 +01:00
Kuba Szczodrzyński
18c7eea89c [API/Mobidziennik] Fix messages exception when no table found. Handle server problem maintenance error. 2020-03-19 23:25:01 +01:00
Kuba Szczodrzyński
f73060aeb6 [API/Idziennik] Fix announcements error. 2020-03-19 23:04:23 +01:00
Kuba Szczodrzyński
2f653b83b6 [Errors] Clarify some HTTP error explanations. 2020-03-19 23:00:39 +01:00
Kuba Szczodrzyński
445dec907d [Home] Change card swipe direction to left. Add config dialog to bottom sheet. 2020-03-19 22:29:42 +01:00
Kuba Szczodrzyński
927316d24b [Firebase] Disable sync by firebase when profile is excluded from auto sync. 2020-03-19 20:18:52 +01:00
Kuba Szczodrzyński
3957453ed6 [UI] Fix displaying lists for correct profile in event manual dialog. 2020-03-19 20:09:35 +01:00
Kuba Szczodrzyński
0296c704cb [UI] Update dialog NoDisplay theme. 2020-03-19 20:02:50 +01:00
Kuba Szczodrzyński
1e7fe972de [API/Librus] Fix setting messages as read. 2020-03-19 19:49:55 +01:00
Kuba Szczodrzyński
c95bc656ea [UI] Add context menus in messages and events to quickly run an action. 2020-03-19 17:55:12 +01:00
Kuba Szczodrzyński
a082d95b04 [Events/Manual] Remove saving progress toasts. 2020-03-18 14:39:21 +01:00
Kuba Szczodrzyński
6866dd4801 [Widgets/Timetable] Fix "no lessons" and "no timetable" texts overlapping. 2020-03-18 12:48:04 +01:00
Kuba Szczodrzyński
2186da416e [Timetable] Fix displaying "no lessons" when all lessons in next 7 days are cancelled. 2020-03-18 12:45:53 +01:00
Kuba Szczodrzyński
22d859fcde [UI] Set main snackbar dismiss timeout to 7 seconds. 2020-03-18 12:44:57 +01:00
Kuba Szczodrzyński
39514b69b3 [API/Vulcan] Fix API url slash issue when migrating from 3.x. 2020-03-18 12:44:28 +01:00
Kuba Szczodrzyński
c384736840 [Grades] Fix counting average without weight. 2020-03-17 16:06:22 +01:00
Kuba Szczodrzyński
507657f273 [UI/Messages] Improve HTML lists presentation. 2020-03-17 16:05:21 +01:00
Kuba Szczodrzyński
60641742ed [4.0-beta.13] Update build.gradle, signing and changelog. 2020-03-15 23:05:03 +01:00
Kuba Szczodrzyński
0fc6f07986 [Homework] Fix homework list sorting. 2020-03-15 22:20:35 +01:00
Kuba Szczodrzyński
1b2bdc0580 [Login] Add QR scanner to Vulcan & Librus JST login. Implement incorrect token error in Librus JST. 2020-03-15 21:46:46 +01:00
Kuba Szczodrzyński
9bac239f77 [API/Librus] Add handling message not found error. Fix for duplicated errors and exceptions. 2020-03-15 20:15:10 +01:00
Kuba Szczodrzyński
371acb2d2a [Events] Disable shared notification for past events. 2020-03-15 20:01:23 +01:00
Kuba Szczodrzyński
454f82e139 [Events] Disable shared notification with registration disabled. Add registration enable prompt when sharing events. 2020-03-15 19:59:48 +01:00
Kuba Szczodrzyński
e8da249353 [UI] Fix date dropdown selecting wrong month. Refactor event dialogs a bit. 2020-03-15 14:54:26 +01:00
Kuba Szczodrzyński
c7950c53da [API/Vulcan] Fix adding unknown subject in timetable. Fix selecting correct TeamClass in timetable. 2020-03-15 12:12:00 +01:00
Kacper Ziubryniewicz
b5502478e4 [Dialog/EventManual] Add process dialog and fix some things. 2020-03-14 23:27:16 +01:00
Kuba Szczodrzyński
4480a7e486 [API/Librus] Fix indicating parent account during first login. 2020-03-13 16:37:30 +01:00
Kuba Szczodrzyński
7c7dff743b [API] Optimize App Sync a bit. 2020-03-13 16:22:43 +01:00
Kuba Szczodrzyński
c568cd3f2e [Messages] Replace hardcoded message colors with brightened/darkened versions instead of white/black. 2020-03-12 18:46:16 +01:00
Kuba Szczodrzyński
6ec2bc6f21 [API/Mobidziennik] Fix duplicated line breaks when getting message. 2020-03-12 13:55:02 +01:00
Kuba Szczodrzyński
af3b6f3a97 [UI] Replace material date pickers with the DatePickerDialog. Add time picker to time dropdown. 2020-03-11 21:11:35 +01:00
Kuba Szczodrzyński
d855118610 [Attendance] Revert changing attendance item font. 2020-03-11 19:58:56 +01:00
Kuba Szczodrzyński
c9992d9fe8 [UI] Make fragments disable pull to refresh when not scrolled to the top. 2020-03-11 19:18:24 +01:00
Kuba Szczodrzyński
85fe2636cc [Home] Disable pull to refresh while swiping a card. 2020-03-11 18:41:37 +01:00
Kuba Szczodrzyński
35f4a31a76 [Home] Implement dismissing, adding and removing cards. Remove debug card. 2020-03-11 18:25:28 +01:00
Kuba Szczodrzyński
1e494ebb70 [Feedback] Implement feedback fragment in feedback activity. 2020-03-11 17:36:41 +01:00
Kuba Szczodrzyński
ed93627505 [Grades] Implement not counting selected grades to average. 2020-03-11 16:57:12 +01:00
Kuba Szczodrzyński
b9b4b0036f [Grades] Update fonts and colors a bit. 2020-03-11 16:25:54 +01:00
Kuba Szczodrzyński
4aa31424d6 [4.0-beta.12] Update build.gradle, signing and changelog. 2020-03-10 23:50:24 +01:00
Kuba Szczodrzyński
8a825227cb [Timetable] Disable setting metadata for normal type lessons. 2020-03-10 23:45:40 +01:00
Kuba Szczodrzyński
cc1b581d7e [Grades] Show custom plus/minus value annotation in GradeDetailsDialog. 2020-03-10 23:44:02 +01:00
Kuba Szczodrzyński
9936d90ae2 [Dropdown/Date] Clarify strings a bit (makes sense during weekends). 2020-03-10 22:04:13 +01:00
Kuba Szczodrzyński
df1a241b2b [Timetable] Fix showing "no timetable" when all nearest lessons are cancelled. Fix a crash in timetable fragment. 2020-03-10 22:01:30 +01:00
Kuba Szczodrzyński
ae89b33fb7 [Events/Manual] Implement syncing timetable when no lessons for the selected date. 2020-03-10 21:49:02 +01:00
Kuba Szczodrzyński
e05b483f5c [Grades] Disable counting grade value when custom values not specified. 2020-03-10 21:45:38 +01:00
Kuba Szczodrzyński
715f536b23 [MainActivity] Fix some critical errors. 2020-03-10 20:57:04 +01:00
Kuba Szczodrzyński
930813fb8a [Agenda] Try to fix agenda fragment not attached crashes. 2020-03-10 20:25:14 +01:00
Kuba Szczodrzyński
acd5e9b998 [Timetable] Implement lazy day loading. Introduce TimetableManager class. 2020-03-10 19:27:18 +01:00
Kuba Szczodrzyński
06011bf4ae [Grades] Add grades config and mark as read menu items. 2020-03-10 18:38:28 +01:00
Kacper Ziubryniewicz
30e15b813c [HotFix/Timers] Change timers intervals from 1s to 500ms. 2020-03-09 22:03:44 +01:00
Kuba Szczodrzyński
fcd7a7f349 [Grades] Make home card use GradeView. Update GradeDetailsDialog text color. Remove deprecated items. 2020-03-09 20:39:48 +01:00
Kuba Szczodrzyński
42ef40439e [Grades] Implement showing unseen badges and marking as seen. Change default "hide improved" config value. 2020-03-09 20:18:11 +01:00
Kuba Szczodrzyński
098beb14fe [Timetable/Generate] Add automatic timetable sync when no timetable for the selected week. 2020-03-09 14:57:14 +01:00
Kuba Szczodrzyński
0b186a754a [API/Librus] Implement behaviour grades with types. Use optional "Phrase" in text grades. 2020-03-08 20:12:37 +01:00
Kuba Szczodrzyński
d00963b53d [Grades] Implement getting correct grade colors. 2020-03-08 19:39:23 +01:00
Kuba Szczodrzyński
e282af0e80 [Grades] Add option to hide improved grades. Make counting average without weight configurable. 2020-03-08 17:57:44 +01:00
Kuba Szczodrzyński
630361849c [Notifications] Implement Quiet hours. Add missing timetable manual strings. 2020-03-08 17:22:14 +01:00
Kuba Szczodrzyński
88a1de50ca [Changelog] Update the changelog a bit. 2020-03-07 20:14:05 +01:00
Kuba Szczodrzyński
d8263d0b6a [Timetable/Manual] Add database migration to implement new model. 2020-03-07 20:09:22 +01:00
Kuba Szczodrzyński
611ab0f100 [Events/Manual] Create custom views for dropdowns. Simplify dialog code. Fix wrong start time saving. 2020-03-07 20:03:47 +01:00
Kuba Szczodrzyński
70c307b796 [UI/Grades] Change some fonts. 2020-03-07 11:54:47 +01:00
Kuba Szczodrzyński
054a233ad6 [API/Librus] Handle some more maintenance cases. 2020-03-07 09:45:45 +01:00
Kuba Szczodrzyński
55268f1c43 [4.0-beta.11] Update build.gradle, signing and changelog. 2020-03-06 23:23:33 +01:00
Kuba Szczodrzyński
1bec6d281c [Grades] Implement Grades editor. 2020-03-06 21:24:01 +01:00
Kuba Szczodrzyński
f17a02be54 [Grades] Implement new Grades module (UI & API changes). 2020-03-06 21:09:05 +01:00
Kuba Szczodrzyński
4e8fdd2225 [API/Idziennik] Fix incorrect exam type. 2020-03-06 09:25:35 +01:00
Kuba Szczodrzyński
59819b4a96 [Base] Update TemplateFragment. 2020-03-04 19:09:53 +01:00
Kuba Szczodrzyński
673378d8d9 [UI/Home] Improve no data text font in home cards. 2020-03-04 19:02:50 +01:00
Kuba Szczodrzyński
30044d6b21 [Timetable] Ignore last lessons if cancelled and jump to the next day. 2020-03-03 18:06:55 +01:00
Kuba Szczodrzyński
ee43d40680 [API/Librus] Fix device not registered error in push config. 2020-03-03 10:35:48 +01:00
Kacper Ziubryniewicz
1354faf8c7 [Dialog/GenerateBlockTimetable] Make better dialog layout. 2020-02-29 00:43:38 +01:00
Kuba Szczodrzyński
1bfb3781ab [UI/Lists] Add missing item dividers. Try to improve attendance & grades design. 2020-02-28 23:45:46 +01:00
Kuba Szczodrzyński
d7d0c6f822 [UI/Events] Add button tooltips in dialogs. Add showing weekday in home card. Add 'go to timetable' button in details dialog. 2020-02-28 23:01:38 +01:00
Kuba Szczodrzyński
2bea18dc3c [Home/Events] Add new card to home fragment. Disable debug card swapping. 2020-02-28 22:38:03 +01:00
Kuba Szczodrzyński
f998f2d956 [Home/Timetable] Remove "?" lessons from timetable card. 2020-02-28 21:10:03 +01:00
Kuba Szczodrzyński
faa77ee5fb [Widgets/Timetable] Show crossed out classroom in lesson change if no new classroom specified. 2020-02-28 21:10:03 +01:00
Kacper Ziubryniewicz
88ec463284 [Gradle] Update gradle. 2020-02-28 18:33:28 +01:00
Kuba Szczodrzyński
b7df71d7d9 [API/Grades] Fix proposed/final grades added date in Mobidziennik, Idziennik. 2020-02-27 23:41:41 +01:00
Kuba Szczodrzyński
6a28dbd2c4 [API/Idziennik] Add changing the selected student/register (web) to get grades in some cases. 2020-02-27 23:36:41 +01:00
Kuba Szczodrzyński
010f7fa1fe [API/Idziennik] Add getting lucky number from website. Fix API lucky number date. 2020-02-27 23:01:47 +01:00
Kuba Szczodrzyński
209f98594f [Widgets/Timetable] Show lessons date in unified timetable widget. 2020-02-27 22:32:02 +01:00
Kuba Szczodrzyński
54121c99a3 [Login/Captcha] Update captcha to fit smaller screens. Fix Librus invalid login error with captcha. 2020-02-26 21:27:03 +01:00
Kuba Szczodrzyński
f6f1370edf [Debug] Add new debug mode. Include hidden Chucker in release. 2020-02-26 20:37:55 +01:00
Kacper Ziubryniewicz
d5863485f9 [API/Edudziennik] Fix getting attendance for the second semester. 2020-02-25 19:28:53 +01:00
Kuba Szczodrzyński
afc88d316b [4.0-beta.10] Update build.gradle, signing and changelog. 2020-02-24 18:27:21 +01:00
Kuba Szczodrzyński
b141279811 [API/Librus] Update Client ID. Add handling of invalid Client ID error. 2020-02-24 18:06:53 +01:00
Kuba Szczodrzyński
3c8afb0609 [3.2.2] Update build.gradle and changelog. Update Librus Client ID and user agent. 2020-02-24 16:55:24 +01:00
Kuba Szczodrzyński
1997ea25d5 [Gradle] Update gradle and libraries. 2020-02-24 15:29:18 +01:00
Kuba Szczodrzyński
f4b49eecd4 [UI] Update theme accent colors. 2020-02-24 15:29:18 +01:00
Kuba Szczodrzyński
a4493ec964 [Notifications] Add filtering notifications to show during sync. 2020-02-24 15:29:18 +01:00
Kacper Ziubryniewicz
af8bda9e92 [Dialog/Day] Add showing lessons count and length. 2020-02-23 23:17:28 +01:00
Kacper Ziubryniewicz
06d252e4ca [Notifications] Fix chucker notifications throwing an error toast. 2020-02-23 17:40:02 +01:00
Kuba Szczodrzyński
67be456bb0 [Firebase/Librus] Implement Librus push registration and receiving. Fix not passing lastSync to endpoint. 2020-02-21 22:49:24 +01:00
Kuba Szczodrzyński
aa5e225148 [Firebase/Vulcan] Fix not converting received string to JsonObject. 2020-02-21 22:32:50 +01:00
Kuba Szczodrzyński
367f46fac8 [API/Librus] Fix captcha showing as incorrect login error. Add handling CSRF error. 2020-02-21 21:32:06 +01:00
Kuba Szczodrzyński
d2f14093ec [API] Fix sync error in case of an internal, handled error. 2020-02-21 20:41:57 +01:00
Kuba Szczodrzyński
43ed621879 [Errors] Fix error reporting from snackbar. 2020-02-21 20:35:18 +01:00
Kuba Szczodrzyński
15c8134d13 [Firebase/Vulcan] Implement push notifications sync. 2020-02-20 21:20:51 +01:00
Kuba Szczodrzyński
c2b8f71467 [4.0-beta.9] Update build.gradle, signing and changelog. 2020-02-19 23:33:30 +01:00
Kuba Szczodrzyński
a6b91c3a14 [Models] Add basic error protection in Date, Time. 2020-02-19 23:04:28 +01:00
Kuba Szczodrzyński
164cfbfd0d [API/Mobidziennik] Fix getting grade added dates, colors and averages. 2020-02-19 22:59:32 +01:00
Kuba Szczodrzyński
0bb340e96e [API/Mobidziennik] Implement web attendance scrapper. 2020-02-19 18:58:57 +01:00
Kuba Szczodrzyński
f0447dc455 [API/Mobidziennik] Fix too much clearing grades from DB. Add performance debugging to Data and ApiService. 2020-02-19 16:38:11 +01:00
Kuba Szczodrzyński
626bbfa7a4 [API/Mobidziennik] Add sent messages endpoint. 2020-02-18 20:10:05 +01:00
Kuba Szczodrzyński
169a900f01 [API] Implement passing last sync time to endpoints. 2020-02-18 18:58:51 +01:00
Kuba Szczodrzyński
d0992eaf54 [API] Implement error handling and exception catching in Szkolny API. 2020-02-16 22:50:06 +01:00
Kuba Szczodrzyński
fc21d757c3 [API/Szkolny] Restrict AppSync to run only every 24 hours (if no WebPush needed). 2020-02-16 14:30:13 +01:00
Kuba Szczodrzyński
54363ee919 [UI/Timetable] Add lesson type annotation in LessonDetailsDialog. 2020-02-16 14:12:55 +01:00
Kuba Szczodrzyński
fdad3b9997 [Push/Mobidziennik] Add support for behaviour grades push. 2020-02-16 13:44:45 +01:00
Kuba Szczodrzyński
4ad826ebe8 [API] Implement Librus Captcha. Refactor notification constants. Update empty account error as a dialog. 2020-02-16 13:42:14 +01:00
Kuba Szczodrzyński
f5e1e9fdd9 [Deprecated] Remove ServerRequest, GenericDialog. 2020-02-15 18:53:38 +01:00
Kuba Szczodrzyński
82b232d0e5 [Messages/Compose] Add dropdown icon to show all recipient categories. Add before-send confirmation dialog. 2020-02-15 14:36:36 +01:00
Kuba Szczodrzyński
c8c1fe5367 [4.0-beta.8] Update build.gradle and signing. 2020-02-14 22:39:13 +01:00
Kuba Szczodrzyński
71128e0244 [Messages/Compose] Fix text layout jumping and scrolling off-screen when typing a long message. 2020-02-14 22:28:58 +01:00
Kacper Ziubryniewicz
453bcaa1f6 [Dialog/Day] Show lesson changes and teacher absences in the day dialog. 2020-02-13 23:04:29 +01:00
Kuba Szczodrzyński
48898ab1d4 [Widgets] Fix profile separator text color. 2020-02-13 13:44:20 +01:00
Kuba Szczodrzyński
a095520d0d [UI/Agenda] Fix subject, teacher and time display in all day events. 2020-02-13 13:33:04 +01:00
Kuba Szczodrzyński
2e0c6fa6a5 [Errors] Add request body in error reporting. 2020-02-13 09:57:59 +01:00
Kuba Szczodrzyński
bfbc0861df [Notifications] Disable notifications about past events & timetable changes. 2020-02-12 23:05:03 +01:00
Kuba Szczodrzyński
3a500f3f28 [API/Librus] Fix student name not normalized, short name not having a trailing dot (remove legacy code). 2020-02-12 19:20:39 +01:00
Kacper Ziubryniewicz
df8094c39c [Dialog/LessonChanges] Add a new lesson changes dialog. 2020-02-11 16:34:40 +01:00
Kacper Ziubryniewicz
448fd0e884 [API/Librus] Fix marking removed announcements as read. 2020-02-10 23:53:04 +01:00
Kuba Szczodrzyński
4717b4549e [Feedback] Fix crashing when null message is received. 2020-02-09 23:03:37 +01:00
Kuba Szczodrzyński
57a8d72f1c [Feedback] Fix received messages not displaying for user. 2020-02-09 23:00:01 +01:00
Kuba Szczodrzyński
7e57617e04 [Feedback] Update proguard rules for feedback message entity. 2020-02-09 22:03:41 +01:00
Kuba Szczodrzyński
37ddd643ac [Feedback] Hide notification when feedback is open. Fix mixing messages when a thread is open. 2020-02-09 15:10:03 +01:00
Kuba Szczodrzyński
bcf3fef303 [Widget/Timetable] Fix no lessons text not legible on dark background. 2020-02-09 14:34:38 +01:00
Kuba Szczodrzyński
7ac4d24106 [4.0-beta.7] Update build.gradle, signing and changelog. 2020-02-08 23:16:54 +01:00
Kuba Szczodrzyński
93e5bce778 [Feedback] Fix showing wrong names, improve messages filtering by device id. 2020-02-08 23:12:32 +01:00
Kuba Szczodrzyński
d48beba307 [Notifications] Fix timetable notification not having subject name. 2020-02-08 23:11:59 +01:00
Kacper Ziubryniewicz
760338496c [Dialog/GenerateBlockTimetable] Add option for showing teacher names. 2020-02-08 01:33:34 +01:00
Kacper Ziubryniewicz
b52e7a3078 [Database] Remove unnecessary migration. 2020-02-04 20:59:13 +01:00
Kacper Ziubryniewicz
78c5b6b2a5 [Database] Fix migrations from 3.2.1 to 4.0-beta. 2020-02-04 00:31:56 +01:00
Kuba Szczodrzyński
60a3c38951 [API/Vulcan] Add automatic semester date and ID updating. 2020-02-01 21:41:09 +01:00
Kuba Szczodrzyński
4763033f24 [4.0-beta.6] Update build.gradle, signing and changelog. 2020-01-28 22:53:52 +01:00
Kuba Szczodrzyński
3b0570d21c Revert "[Sync] Lower the priority of sync notification."
This reverts commit 1677be9e6fa30478564df94201ea0f8193d6e5b8.
2020-01-28 22:47:59 +01:00
Kacper Ziubryniewicz
16bf478d1a [UI/Agenda] Rewrite agenda in Kotlin and add lesson change counters. 2020-01-26 22:20:46 +01:00
Kuba Szczodrzyński
5bf181b6d1 [Feedback] Implement notifications. 2020-01-26 22:03:20 +01:00
Kuba Szczodrzyński
21b2e5d194 [Feedback] Add new feedback fragment and API. 2020-01-26 20:05:32 +01:00
Kacper Ziubryniewicz
759afcf3ca [Database/Migrations] Move migrations to files. 2020-01-25 17:23:47 +01:00
Kacper Ziubryniewicz
d48c7844a4 [UI/Settings] Add grades config dialog to settings fragment. 2020-01-25 13:31:40 +01:00
Kacper Ziubryniewicz
7d8caa8df7 [API/Librus] Use added by teacher id instead of lesson teacher in attendance. 2020-01-25 12:42:03 +01:00
Kacper Ziubryniewicz
62f53930da [Dialog/GradesConfig] Add grades view config dialog. 2020-01-22 23:09:07 +01:00
Kacper Ziubryniewicz
9a45cbb679 [UI] Add keepScreenOn in counter activity and bell sync dialog. 2020-01-22 23:08:23 +01:00
Kuba Szczodrzyński
8e5a10f6d8 [API/Mobidziennik] Implement getting email for push registration. 2020-01-21 20:44:49 +01:00
Kuba Szczodrzyński
10c57d2272 [Sync] Lower the priority of sync notification. 2020-01-20 23:10:35 +01:00
Kuba Szczodrzyński
67d4d0f898 [Sync] Fix doubled and dead notifications during sync. 2020-01-20 21:36:53 +01:00
Kuba Szczodrzyński
97e0d04842 [API] Partially revert "Include device object in each request." 2020-01-20 21:34:22 +01:00
Kuba Szczodrzyński
3ba30ede92 [Sync] Fix sync notification crashing on Oreo+. 2020-01-20 20:26:52 +01:00
Kuba Szczodrzyński
1035e411ab [API] Include device object in each request. 2020-01-20 19:43:14 +01:00
Kuba Szczodrzyński
d5ae4b7ec9 [Home/Grades] Remove filtering grades by semester. 2020-01-20 19:30:20 +01:00
Kuba Szczodrzyński
111d040cf9 [Updates] Fix no update toast not visible. 2020-01-20 19:27:59 +01:00
Kuba Szczodrzyński
8cc594d170 [Widget/Timetable] Fix widget crashing with NO_LESSONS item. 2020-01-20 19:27:06 +01:00
Kuba Szczodrzyński
d8a8bed68d [4.0-beta.5] Update build.gradle and signing. 2020-01-19 22:42:29 +01:00
Kuba Szczodrzyński
eedbd954bd [Updates] Add toast for error while checking and for no updates. 2020-01-19 22:35:12 +01:00
Kuba Szczodrzyński
0eb8366027 [Changelog] Fix changelog dialog appearance on Android N+. 2020-01-19 22:29:34 +01:00
Kuba Szczodrzyński
894135104b [4.0-beta.4] Update build.gradle, signing and changelog. 2020-01-19 22:18:20 +01:00
Kuba Szczodrzyński
7b2e408efc [Sync] Make sync not possible for archived profiles. Translate some error codes. 2020-01-19 22:17:57 +01:00
Kuba Szczodrzyński
e4115c122e [Errors] Add reporting app version name along with the error. 2020-01-19 21:57:17 +01:00
Kuba Szczodrzyński
537b16949e [Updates] Fix running update worker in Java. 2020-01-19 21:52:08 +01:00
Kuba Szczodrzyński
ca60ceb2a7 [Firebase] Implement handling app updates. 2020-01-19 21:49:58 +01:00
Kuba Szczodrzyński
0fad12fea5 [Updates] Change update channel to beta. 2020-01-19 21:39:28 +01:00
Kuba Szczodrzyński
6cd2c23aac [Firebase] Implement handling server messages. 2020-01-19 21:31:37 +01:00
Kuba Szczodrzyński
512baaa43f [Errors] Include parser error body when reporting HTTP errors. 2020-01-19 20:34:10 +01:00
Kuba Szczodrzyński
d097fcc973 [API/Librus] Fix classrooms name short extraction when name contains two spaces. 2020-01-19 20:22:41 +01:00
Kacper Ziubryniewicz
621dbd459c [API/Vulcan] Fix marking messages as seen. 2020-01-19 20:03:25 +01:00
Kuba Szczodrzyński
840ab4b0c4 [Models] Remove unused models and classes. 2020-01-19 19:30:38 +01:00
Kuba Szczodrzyński
904be34a87 [Notifications] Fix showing an empty notification where the list is empty. 2020-01-19 19:19:30 +01:00
Kuba Szczodrzyński
b7fc6fcc38 [Structure] Refactor App class to Kotlin. Rewrite SzkolnyTask and posting notifications. Remove dependency on AppConfig. Update libraries and gradle. 2020-01-19 19:07:27 +01:00
Kuba Szczodrzyński
55c6e40d6d [DB] Convert AppDb to Kotlin. 2020-01-19 18:44:57 +01:00
Kacper Ziubryniewicz
4dfb015057 [Firebase/Librus] Implement basic push integration. 2020-01-19 01:17:33 +01:00
Kacper Ziubryniewicz
e40a0ba2bb [Strings] Add missing translations. 2020-01-18 00:44:13 +01:00
Kacper Ziubryniewicz
fd48f10df9 [Dialog/EventDetails] Show toast when calendar app not found instead of crashing. 2020-01-18 00:26:26 +01:00
Kuba Szczodrzyński
6a54e7fef7 [Firebase] Implement Mobidziennik push service. 2020-01-16 09:27:30 +01:00
Kacper Ziubryniewicz
5c4d6ed140 [API/Edudziennik] Fix getting attendances. 2020-01-15 23:19:33 +01:00
Kacper Ziubryniewicz
9ed1be3594 [UI/DrawerProfiles] Add button for marking everything as read in every profile. 2020-01-15 22:58:22 +01:00
Kacper Ziubryniewicz
c5ce582678 [API/Edudziennik] Fix fix for semesters and getting grades on first login. 2020-01-15 22:26:38 +01:00
Kacper Ziubryniewicz
2050083bce [API/Edudziennik] Fix semesters and getting grades on first login. 2020-01-15 21:19:48 +01:00
Kacper Ziubryniewicz
92e6bdb562 [API/iDziennik] Fix regex getting school year in first login. 2020-01-13 22:42:30 +01:00
Kuba Szczodrzyński
93e70c38b7 [Firebase] Implement base for per-register FCM tasks. 2020-01-12 21:39:06 +01:00
Kuba Szczodrzyński
45b96179a5 [DB] Fix timetable migration crashing app. 2020-01-12 21:33:46 +01:00
Kacper Ziubryniewicz
a29a534a40 [API/Edudziennik] Fix showing notifications for presence attendances. 2020-01-12 19:45:20 +01:00
Kuba Szczodrzyński
8e2297359c [Firebase] Implement new custom FCM service. 2020-01-11 19:07:25 +01:00
Kuba Szczodrzyński
92ba7248ef [UI] Fix vector drawables crashing on API < 21. 2020-01-11 13:56:09 +01:00
Kuba Szczodrzyński
f657d37cbd [DB/Timetable] Fix migration fixing wrong primary key columns. 2020-01-10 22:23:14 +01:00
Kuba Szczodrzyński
9e312f60bf [APIService] Fix showing notification with no service running. 2020-01-10 21:34:55 +01:00
Kuba Szczodrzyński
85f72b78f7 [DB/Timetable] Fix wrong primary key columns. 2020-01-10 21:33:59 +01:00
Kuba Szczodrzyński
40acb67ceb [Errors] Fix Timeout error detection (SocketTimeoutException inherits from InterruptedIOException). 2020-01-10 16:44:54 +01:00
Kuba Szczodrzyński
3ae8100bda [4.0-beta.3] Update build.gradle, signing and changelog. 2020-01-10 11:17:42 +01:00
Kuba Szczodrzyński
1a3dc41edf [API/Idziennik] Fix error when historical grade has no color. 2020-01-10 11:14:43 +01:00
Kuba Szczodrzyński
27f9b8a04e Update gradle. Add Chucker. 2020-01-10 09:30:02 +01:00
Kuba Szczodrzyński
86669a491a Update .gitignore 2020-01-09 21:14:08 +01:00
Kuba Szczodrzyński
b111d33b04 [Widget/Config] Disable Unified lucky number widget in config activity. 2020-01-09 21:11:43 +01:00
Kacper Ziubryniewicz
ea5720d1c8 [API/Edudziennik] Fix grades colors. 2020-01-08 21:12:10 +01:00
Kacper Ziubryniewicz
53675122c6 [Dialog/EventDetails] Add feature for saving events in calendar app. 2020-01-08 20:51:06 +01:00
Kacper Ziubryniewicz
4ba7997bc1 [Database] Fix bug with teacher and subject id when sharing event. 2020-01-07 21:37:58 +01:00
Kuba Szczodrzyński
19c446d267 [Widgets/LuckyNumber] Implement a widget. Not knowing if it works or not, sorry. 2020-01-07 11:42:51 +01:00
Kuba Szczodrzyński
1abb9ac378 [API] Fix config not reading from DB. Do not sync device if not changed. 2020-01-07 10:45:21 +01:00
Kuba Szczodrzyński
f9c7492726 [Widget/Timetable] Fix past lessons (today) not displayed. 2020-01-07 10:14:43 +01:00
Kuba Szczodrzyński
6ece6ca52a [UI/Counter] Add Bell Sync option in counter activity. 2020-01-07 09:48:24 +01:00
Kuba Szczodrzyński
f6a8e9d2fa [4.0-beta.2] Update build.gradle, signing and changelog. 2020-01-06 22:34:46 +01:00
Kuba Szczodrzyński
878de34546 [Widgets] Implement new Notifications widget. 2020-01-06 22:26:54 +01:00
Kacper Ziubryniewicz
7b97ef316d [Structure] Change database file structure. Rewrite converters to Kotlin. 2020-01-06 21:25:34 +01:00
Kacper Ziubryniewicz
aafa87c661 [Deprecated] Remove deprecated home fragment. 2020-01-06 19:17:28 +01:00
Kacper Ziubryniewicz
26eb2e4381 [Announcements/Liburs] Fix error on marking as read and make announcement show even when there's no Internet connection. 2020-01-06 18:24:43 +01:00
Kacper Ziubryniewicz
4b08ea7a89 [Dialog/GenerateBlockTimetable] Fix not showing cancelled lessons. 2020-01-06 17:47:57 +01:00
Kuba Szczodrzyński
7f1f2d0039 [API/Mobidziennik] Implement Lesson Ranges. Make Cancelled lesson use old* variables. 2020-01-06 17:30:38 +01:00
Kuba Szczodrzyński
0227762ddc [API/DataRemoveModel] Make DAO not remove TYPE_NO_LESSON entries. 2020-01-06 16:54:35 +01:00
Kuba Szczodrzyński
ff0de8afc2 [UI/Dialogs] Remove debug toasts. Remove old Event List Dialog. 2020-01-06 16:43:31 +01:00
Kuba Szczodrzyński
ddf66ef061 [UI/Dialogs] Fix "No events" text alignment. 2020-01-06 16:36:48 +01:00
Kuba Szczodrzyński
52ecfba0a5 [API/Librus] Add Lessons endpoint and showing correct attendance subjects. 2020-01-06 16:27:37 +01:00
Kuba Szczodrzyński
e123ff1bec [Timetable] Fix Timetable crashing with Swipe Refresh Layout and no parent. 2020-01-06 15:57:15 +01:00
Kuba Szczodrzyński
45753583ee [UI/Login] Fix back button not working on Login Chooser. 2020-01-06 15:56:23 +01:00
Kuba Szczodrzyński
5a77c481a2 [Extensions] Make asJsonObjectList return non-nullable JsonObjects. 2020-01-06 15:05:33 +01:00
Kuba Szczodrzyński
4e796542d7 [ZXing] Try to fix QR code scanner crashing (Proguard). 2020-01-06 14:53:51 +01:00
Kuba Szczodrzyński
ae42c227a8 [API/Idziennik] Add showing error on getting recipient list with no permissions. Translate some error codes. 2020-01-06 14:53:51 +01:00
Kuba Szczodrzyński
fc58035bbf [UI/Timetable] Temporarily fix page scrolling issues. 2020-01-06 14:53:51 +01:00
Kuba Szczodrzyński
834c4fc5f4 [UI/Attendance] Disable Mobidziennik sync reminder. 2020-01-06 14:53:51 +01:00
Kuba Szczodrzyński
33fcffd2bd [API/Vulcan] Fix incorrect Attendance type. 2020-01-06 14:53:51 +01:00
Kacper Ziubryniewicz
18b83e2ed8 [Database] Remove deprecated Lesson and LessonChange. 2020-01-06 13:32:32 +01:00
Kacper Ziubryniewicz
f05b39736c [Dialogs/GenerateBlockTimetable] Add new dialog. 2020-01-06 00:11:03 +01:00
Kacper Ziubryniewicz
31a293c5c0 [Extensions] Add trigger extension instead of using performClick on checkboxes. 2020-01-05 23:42:35 +01:00
Kacper Ziubryniewicz
1e6952c86a [Utils] Fix time diff. 2020-01-05 23:39:48 +01:00
Kuba Szczodrzyński
21ad38d33f [UI/Login] Fix login summary list not showing all profiles. 2020-01-05 18:29:49 +01:00
Kuba Szczodrzyński
1589a05a37 [Colors] Update default profile image colors (colorFromName). 2020-01-05 18:29:49 +01:00
Kuba Szczodrzyński
3f19e5d465 [Messages] Fix Messages Fragment crash. 2020-01-05 18:29:49 +01:00
Kacper Ziubryniewicz
5e9bd98bba [API/LuckyNumber] Always set lucky number seen metadata to true. 2020-01-05 16:39:05 +01:00
Kacper Ziubryniewicz
d626d98421 [API/Edudziennik] Fix error when limited access. Remove timetable not public. 2020-01-05 15:30:15 +01:00
Kacper Ziubryniewicz
bce74a408c [API/Edudziennik] Save cookie with semester in student data. Change semester date on semester change. 2020-01-04 23:05:36 +01:00
Kuba Szczodrzyński
30c5b2d1c9 Refactor Profiles, Login Stores and Login activity (hoping it works). 2020-01-04 22:08:56 +01:00
Kacper Ziubryniewicz
95a150f7d8 [API/Librus] Show map value in descriptive grades. 2020-01-04 13:43:49 +01:00
Kacper Ziubryniewicz
45d31d2358 [Grades] Count only proposal and final grades to average with value greater than 0. 2020-01-04 13:43:17 +01:00
Kacper Ziubryniewicz
fb59dfc677 [API/FakeLibrus] Change http to https protocol. 2020-01-04 13:42:20 +01:00
Kacper Ziubryniewicz
30303f50ac [API/Edudziennik] Use new getTeacher methods. Add teamId to lessons. 2020-01-04 00:47:03 +01:00
Kacper Ziubryniewicz
a2fa133831 [Home/TimetableCard] Fix downloading timetable for a specific week. 2020-01-04 00:25:56 +01:00
Kacper Ziubryniewicz
d735dcea05 [API/Mobidziennik] Use toIntOrNull instead of try catch in the lucky number extractor. 2020-01-04 00:15:56 +01:00
Kacper Ziubryniewicz
a96fcabba5 [API/Edudziennik] Fix getting grades with null value. 2020-01-03 23:51:36 +01:00
Kacper Ziubryniewicz
21fd59c196 [API/Edudziennik] Save and use semester cookie instead of currentSemester in profile. 2020-01-03 23:48:50 +01:00
Kacper Ziubryniewicz
15f126416f [API/Librus] Use normal grade categories in text grades. 2020-01-03 15:23:37 +01:00
Kacper Ziubryniewicz
7f1f9f81a6 [API/Librus] Remove text grade categories from features. 2020-01-02 21:29:27 +01:00
Kuba Szczodrzyński
de6b77baba [4.0-beta.1] It's here. Finally. 2020-01-02 20:05:14 +01:00
Kuba Szczodrzyński
c8e3a3d258 [Messages/Compose] Change reply greeting text. Remove debugging toasts. 2020-01-02 20:03:52 +01:00
Kuba Szczodrzyński
52ef24ae7b [Messages/Compose] Fix when adding duplicated recipient. 2020-01-02 20:02:48 +01:00
Kuba Szczodrzyński
1553173300 [Messages/Compose] Fix deselecting recipients in dialog. 2020-01-02 19:57:48 +01:00
Kuba Szczodrzyński
f5b2c24ee3 [Messages/Compose] Fix browsing Teacher category in dialog. 2020-01-02 19:28:51 +01:00
Kuba Szczodrzyński
2ddbc6bbac [Gradle] Move java-json to app/libs. 2020-01-02 18:49:43 +01:00
Kuba Szczodrzyński
eae7189981 [Messages] Add sending messages and fix stuff. 2020-01-02 18:27:58 +01:00
Kacper Ziubryniewicz
f292b3637d [API/Librus] Fix syncing past homework. 2020-01-02 15:38:43 +01:00
Kacper Ziubryniewicz
aff0b361a2 It's the new year bruh. 2020-01-02 09:02:15 +01:00
Kacper Ziubryniewicz
9f78b86c57 [API/Edudziennik] Add getting notes. 2020-01-01 19:41:52 +01:00
Kacper Ziubryniewicz
4950627850 [API/Librus] Fix null in homework description. 2020-01-01 18:58:29 +01:00
Kacper Ziubryniewicz
5265f3eb6a [API/Edudziennik] Add getting events. 2020-01-01 18:47:09 +01:00
Kacper Ziubryniewicz
3cca5e8e9a [DataRemoveModel/Events] Add removing future except list of types. 2020-01-01 18:46:43 +01:00
Kacper Ziubryniewicz
e9ca109c57 [Errors] Rewrite crash activity in Kotlin and add error reporting. 2019-12-31 18:48:06 +01:00
Kuba Szczodrzyński
344da53888 [Errors] Add reporting the error ID. 2019-12-31 14:28:37 +01:00
Kuba Szczodrzyński
62ae3c4c4b [Edudziennik] Add to changelog. Update Edudziennik feature list. 2019-12-31 12:45:57 +01:00
Kuba Szczodrzyński
6f95eb3c3f [Errors] Update error details dialog, implement error reporting. 2019-12-31 12:45:57 +01:00
Kuba Szczodrzyński
f350a86946 [UI/Changelog] Add new changelog dialog. Update for v4.0-beta.1 2019-12-31 12:45:57 +01:00
Kacper Ziubryniewicz
868e529e62 [API/Edudziennik] Add saving teachers login ids. 2019-12-31 12:23:38 +01:00
Kuba Szczodrzyński
62d82c88a1 [API/Szkolny] Fix respecting registration status of profile in App Sync. 2019-12-30 22:44:45 +01:00
Kacper Ziubryniewicz
a86e995113 [API/Librus] Fix announcement mark as read request and fix observer in announcements. 2019-12-29 20:40:54 +01:00
Kacper Ziubryniewicz
5e2c7e89ab [Hotfix] Fix crashing in grades subject adapter. 2019-12-29 20:22:48 +01:00
Kacper Ziubryniewicz
4a38906194 [API/Edudziennik] Add getting homework. 2019-12-29 19:41:03 +01:00
Kacper Ziubryniewicz
cc3e6d97dd [Strings/Sync] Change all "Pobieram…" to "Pobieranie…" 2019-12-29 19:01:12 +01:00
Kacper Ziubryniewicz
90d6fb56d1 [API/Librus] Add rest of the grade types and categories... 2019-12-29 18:51:47 +01:00
Kacper Ziubryniewicz
9b5cf3f636 [API/Librus] Add getting descriptive grades and its categories. 2019-12-29 17:48:54 +01:00
Kacper Ziubryniewicz
3723abbbbb [API/Idziennik] Add getting attachments. 2019-12-28 17:02:43 +01:00
Kacper Ziubryniewicz
a626427788 [API/Idziennik] Add getting message. 2019-12-28 14:09:32 +01:00
Kacper Ziubryniewicz
35d88f8c78 [API/Librus] Add marking announcements as read. 2019-12-27 20:10:42 +01:00
Kacper Ziubryniewicz
c65872b29b [Errors] Add showing errors details. 2019-12-26 23:44:24 +01:00
Kacper Ziubryniewicz
e472d34f4d [Announcements] Add idString column and add getting attachments in Edudziennik. 2019-12-26 22:59:43 +01:00
Kacper Ziubryniewicz
1257596104 [API/Edudziennik] Change grade categories and descriptions and change back lucky number sync frequency to always. 2019-12-26 00:43:03 +01:00
Kacper Ziubryniewicz
5dd6519d27 [Attendance] Change TYPE_FREE to TYPE_DAY_FREE. 2019-12-26 00:10:14 +01:00
Kacper Ziubryniewicz
e607577407 [Attendance] Add free attendance type. 2019-12-25 23:51:52 +01:00
Kacper Ziubryniewicz
ade12e729f [Grades] Change point grade types names. 2019-12-25 22:50:21 +01:00
Kacper Ziubryniewicz
eee83ebb94 [API/Edudziennik] Fix getting grades and add support for point grades. 2019-12-25 22:46:29 +01:00
Kacper Ziubryniewicz
39ff47e866 [API/Edudziennik] Fix downloading timetable out of the school year. 2019-12-25 22:19:02 +01:00
Kacper Ziubryniewicz
6c81a506e9 [API/Edudziennik] Add error reasons and add grade description. 2019-12-25 13:15:03 +01:00
Kacper Ziubryniewicz
a24620de31 [API/Edudziennik] Add limited access basic handling and add setting next sync for lucky number. 2019-12-25 02:38:54 +01:00
Kacper Ziubryniewicz
70de47408a [API/Edudziennik] Add getting teachers and *change endpoint IDs.* 2019-12-25 02:17:20 +01:00
Kacper Ziubryniewicz
04103d1c84 [API/Edudziennik] Move getting grades to other endpoint and add getting subjects. 2019-12-25 01:49:37 +01:00
Kuba Szczodrzyński
d20102c3bd [3.9.17-dev] Update build.gradle and signing 2019-12-25 00:02:51 +01:00
Kacper Ziubryniewicz
f165ee32e5 [API/Edudziennik] Fix getting teacher in timetable and fix getting team name. 2019-12-24 15:52:15 +01:00
Kacper Ziubryniewicz
60ad2e81f3 [API/Edudziennik] Add getting attendance. 2019-12-24 15:39:22 +01:00
Kacper Ziubryniewicz
5ca8b642da [API/Edudziennik] Add getting event type in events. 2019-12-24 14:44:01 +01:00
Kacper Ziubryniewicz
f40cd7f26c [API/Edudziennik] Add userCode 2019-12-24 14:04:46 +01:00
Kacper Ziubryniewicz
e04b519e9b [API/Edudziennik] Move getting grades and info to new endpoints. 2019-12-24 13:41:06 +01:00
Kacper Ziubryniewicz
658e59bed6 [API/Edudziennik] Add getting teams and exams. 2019-12-24 13:26:06 +01:00
Kacper Ziubryniewicz
cb5eb19abc [API/Timetable] Move timetableNotPublic to student data. 2019-12-24 12:01:09 +01:00
Kacper Ziubryniewicz
d336531ca8 [API/Edudziennik] Use Regexes instead of Jsoup in first login. 2019-12-23 23:20:45 +01:00
Kacper Ziubryniewicz
30ee71f4e3 [API/Edudziennik] Add getting grades and add basic error handling. 2019-12-23 22:56:23 +01:00
Kacper Ziubryniewicz
844d5b33bc [API/Edudziennik] Fix getting students on first login. 2019-12-23 20:31:44 +01:00
Kacper Ziubryniewicz
e3741f1c75 [API/Edudziennik] Add getting timetable. 2019-12-23 18:34:39 +01:00
Kacper Ziubryniewicz
21a6e4d8c6 [API/Edudziennik] Add start and lucky number endpoint. 2019-12-23 16:33:20 +01:00
Kacper Ziubryniewicz
ec14ba76c9 [Edudziennik] Add first login. 2019-12-23 15:15:38 +01:00
Kacper Ziubryniewicz
90e7b1e9c7 [Edudziennik] Implement base of the new e-register. 2019-12-23 00:46:06 +01:00
Kacper Ziubryniewicz
a09d943344 [API/IDziennik] Fix final grade names. 2019-12-22 23:42:03 +01:00
Kacper Ziubryniewicz
52ac40c826 [API/Grades] Add data remove model for grades. 2019-12-22 23:21:03 +01:00
Kacper Ziubryniewicz
8f8eb64364 [APIv2/Librus] Show starting points only when greater than 0. 2019-12-22 22:22:46 +01:00
Kacper Ziubryniewicz
fe40ab0ab4 [Home/LuckyNumberCard] Fix crashing because of invalid argument type. 2019-12-22 22:13:03 +01:00
Kacper Ziubryniewicz
5991ef820f [Home/TimetableCard] Add counting in seconds. 2019-12-22 21:31:12 +01:00
Kacper Ziubryniewicz
d67c2a90b1 [Hotfix] Fix null cast exception in timetable day fragment. 2019-12-22 20:44:41 +01:00
Kacper Ziubryniewicz
e85d6fbc3b [UI/Counter] Add new counter activity. 2019-12-22 20:05:01 +01:00
Kuba Szczodrzyński
62a9604bd2 [UI/Home] Debug card is bacc. 2019-12-22 15:36:57 +01:00
Kuba Szczodrzyński
0aae2174c1 [UI/Timetable] Update date selection algorithm and no lessons info. Show empty timetable info in widget. 2019-12-21 22:56:54 +01:00
Kacper Ziubryniewicz
b66bd6fec9 [Dialog/BellSync] Add showing info when there are no lessons. 2019-12-21 21:19:29 +01:00
Kuba Szczodrzyński
b399a3f5ad [UI/Timetable] Handle no timetable or no lessons in Home card. 2019-12-21 17:39:17 +01:00
Kacper Ziubryniewicz
1f5927eec0 [Manifest] Set the default theme to dark. 2019-12-20 23:49:47 +01:00
Kacper Ziubryniewicz
2d838e7003 [Dialog/BellSync] Add coroutine timer and make some small changes. 2019-12-20 23:48:47 +01:00
Kuba Szczodrzyński
f242c30476 [API/Events] Update Event Manual dialog sharing. 2019-12-20 22:00:55 +01:00
Kacper Ziubryniewicz
2cf204ff79 [Dialog/BellSync] Implement bell sync dialog. 2019-12-20 00:40:14 +01:00
Kuba Szczodrzyński
38fc9e97bb [3.9.16-dev] Update build.gradle and signing 2019-12-19 22:33:41 +01:00
Kuba Szczodrzyński
3e4accb82c [UI/WebPush] Implement Web Push pairing fragment and API. Add more templates. 2019-12-19 21:57:01 +01:00
Kuba Szczodrzyński
b905283b61 [UI/Dialogs] Disable timetable fragment refreshing on event removing. 2019-12-18 23:55:15 +01:00
Kuba Szczodrzyński
c7e5df5c91 [UI/Dialogs] Remove old Manual Event Dialog. Disable timetable fragment refreshing on event save. Add new Event Details Dialog. 2019-12-18 23:50:24 +01:00
Kuba Szczodrzyński
99006d7923 [UI/Dialogs] Update Lesson Details dialog when no classroom/teacher. Fix double events when metadata duplicated for different type. 2019-12-18 22:06:43 +01:00
Kuba Szczodrzyński
16320b4486 [UI/Events] Update Day Dialog. Add Event List Adapter to Timetable Lesson Dialog. 2019-12-18 20:07:38 +01:00
Kuba Szczodrzyński
d70b0c0c3f [UI] Implement new Event Adapter and Day Dialog (partially). 2019-12-16 22:26:00 +01:00
Kuba Szczodrzyński
41cebc554f [UI] 'Cause it's winter. 2019-12-15 21:27:50 +01:00
Kuba Szczodrzyński
6a2c863fcc [3.2.1] Update build.gradle and changelog 2019-12-15 19:05:22 +01:00
Kuba Szczodrzyński
92e0fc2847 [Sync] Fix showing notifications. Implement notifications web push. 2019-12-15 16:43:24 +01:00
Kuba Szczodrzyński
9978a11c52 [Proguard] Update Proguard rules for Retrofit and JNI code. 2019-12-15 15:59:46 +01:00
Kacper Ziubryniewicz
cf77623e9c [UI/Agenda] Add FAB to add events and make the dialog open with the selected date. 2019-12-15 00:42:28 +01:00
Kacper Ziubryniewicz
7ce4acc687 [Structure] Move API to data package. 2019-12-15 00:28:31 +01:00
Kuba Szczodrzyński
ffbac126bd [3.9.15-dev] Implement C++ Native password signer library. 2019-12-14 22:56:56 +01:00
Kuba Szczodrzyński
0f11b02047 [3.9.14-dev] 2019-12-14 17:48:16 +01:00
Kacper Ziubryniewicz
b8cf731dd0 [Dialog/EventManual] Unshare using eventObject instead of editingEvent. 2019-12-14 17:31:34 +01:00
Kuba Szczodrzyński
ad5afac174 [Login/Librus] Implement Librus JST login form. 2019-12-14 17:21:29 +01:00
Kacper Ziubryniewicz
cf69273de1 [APIv1/Mobidziennik] Add API key. 2019-12-14 14:17:37 +01:00
Kacper Ziubryniewicz
13279a915d [API/Mobidziennik] Add API key and fix tasks not finishing 2019-12-14 14:06:43 +01:00
Kacper Ziubryniewicz
3defe2d343 [API] Remove deprecated server sync. 2019-12-14 01:03:12 +01:00
Kacper Ziubryniewicz
2c86414e74 [API/Szkolny] Change api structure, make SzkolnyTask and add sharing events. 2019-12-14 01:02:28 +01:00
Kuba Szczodrzyński
9e4f816009 [Event] Update sharing dialog 2019-12-13 22:07:42 +01:00
Kacper Ziubryniewicz
b48afde7f1 [Dialog/EventManual] Add editing and removing events and fix a few bugs. 2019-12-10 23:23:26 +01:00
Kacper Ziubryniewicz
13cdaadcf7 [Dialog/EventManual] Add default type support and remove old dialog from the agenda fragment. 2019-12-10 22:31:33 +01:00
Kacper Ziubryniewicz
44fc1c4532 [Dialogs] Remove deprecated dialogs. 2019-12-09 17:58:56 +01:00
Kacper Ziubryniewicz
ddb1ecaa99 [UI/Settings] Add setting for showing drawer on back pressed. 2019-12-09 17:24:41 +01:00
Kacper Ziubryniewicz
50ada5f95b [APIv2/Szkolny] Move profiles parameter to getEvents function 2019-12-09 16:37:21 +01:00
Kacper Ziubryniewicz
40ba9e8434 [APIv2/Szkolny] Add Szkolny API and add getting shared events. 2019-12-09 16:35:37 +01:00
Kuba Szczodrzyński
d6f9b81de6 [API] Add Server Sync Task 2019-12-08 19:12:38 +01:00
Kacper Ziubryniewicz
b085d94fea [APIv2/Librus] Fix announcements duplicate ids (migrate from crc16 to crc32) 2019-12-08 15:00:38 +01:00
Kacper Ziubryniewicz
90343e1e39 [UI/Messages] Fix message body text color in messages fragment 2019-12-08 00:51:42 +01:00
Kacper Ziubryniewicz
883d8f31c4 [Database/Announcements] Make announcements sort by start date. 2019-12-08 00:28:46 +01:00
Kacper Ziubryniewicz
2e18c5a668 [APIv2/Librus] Add behaviour grade comments, change features names and fix semester start points 2019-12-07 23:57:49 +01:00
Kacper Ziubryniewicz
c1ca104021 [UI/Announcements] Make better announcements look. 2019-12-07 20:46:00 +01:00
Kuba Szczodrzyński
e7db4e9326 [Gradle] Update gradle wrapper. 2019-12-06 20:31:45 +01:00
Kacper Ziubryniewicz
203a42eb1b [UI/Messages] Fix colors in messages body. 2019-12-04 23:59:27 +01:00
Kacper Ziubryniewicz
c83f20983b [APIv2/Librus] Fix replacing weird XML tags in messages. 2019-12-04 23:59:09 +01:00
Kacper Ziubryniewicz
25f504cadf [APIv2/Librus] Add getting behaviour grades and its categories. 2019-12-03 23:44:55 +01:00
Kuba Szczodrzyński
07ce718e3c [Widget] Fix showing all-day event on every lesson. 2019-12-03 19:42:25 +01:00
Kuba Szczodrzyński
83264b5973 [Config] Fix reading backgrounds value. 2019-12-03 19:39:48 +01:00
Kuba Szczodrzyński
1acf1547d5 [3.9.13-dev] 2019-12-02 22:24:55 +01:00
Kuba Szczodrzyński
5d3de35c10 [UI/Timetable] Fix non-null cast exception. 2019-12-02 22:20:53 +01:00
Kuba Szczodrzyński
8f8d613f6e [UI] Update libraries & NavLib to fix missing badges on most profiles. 2019-12-02 22:10:36 +01:00
Kuba Szczodrzyński
6a161b3c97 [UI/Timetable] Add showing event indicators on lessons. 2019-12-02 21:25:18 +01:00
Kacper Ziubryniewicz
3e97572100 [Dialog/Events] Use new event dialog in homework fragment and event list dialog. 2019-12-02 19:36:19 +01:00
Kuba Szczodrzyński
fc3b6fd1e0 [UI/Event] Fix stuff because i'm dumb 2019-12-02 19:07:30 +01:00
Kuba Szczodrzyński
9bc7f9ac11 [UI/Event] Make use of default values in event manual dialog. 2019-12-02 19:04:30 +01:00
Kuba Szczodrzyński
0a2f252405 [UI/Home] Implement home card swapping and saving. 2019-12-02 18:12:52 +01:00
Kuba Szczodrzyński
09bc658f97 [UI] Fix blank screen when loading activity. 2019-12-02 18:11:12 +01:00
Kuba Szczodrzyński
7b04202a00 [Config] Add the rest of config. Migrate from AppConfig and remove most values from AppConfig. 2019-12-01 22:35:42 +01:00
Kacper Ziubryniewicz
acf364166b [Notifications/LessonChange] Fix lesson change notifications text. 2019-12-01 21:54:59 +01:00
Kacper Ziubryniewicz
4e88efae94 [Home/Grades] Fix padding. 2019-12-01 20:25:50 +01:00
Kacper Ziubryniewicz
8df24dc1c4 [Dialog/Events] Create adapter outside of the observer. 2019-12-01 20:25:28 +01:00
Kacper Ziubryniewicz
8482c27689 [Timetable] Add marking lessons as seen in timetable. 2019-12-01 20:23:48 +01:00
Kacper Ziubryniewicz
d1265dc1f2 [Dialog/Events] Make new event list dialog. 2019-11-30 23:33:20 +01:00
Kacper Ziubryniewicz
47d395de71 [Home] Add home grades card. 2019-11-29 23:16:50 +01:00
Kuba Szczodrzyński
5b443e02a3 [Mobidziennik] Fix getting grades with no category. Add support for comments. 2019-11-29 18:59:47 +01:00
Kuba Szczodrzyński
f8a7d52b1d [Mobidziennik] Fix extracting when attachment has no size. 2019-11-29 17:51:16 +01:00
Kuba Szczodrzyński
a133a96819 [UI/Messages] Make message list scroll to last opened message. 2019-11-29 17:29:23 +01:00
Kuba Szczodrzyński
c71b8f994c [Messages] Implement Mobidziennik attachments. Fix multiplying attachments in UI. 2019-11-28 23:32:10 +01:00
Kuba Szczodrzyński
9b02c97926 [UI/Messages] Convert adapter to Kotlin. 2019-11-28 23:12:21 +01:00
Kuba Szczodrzyński
ab06efc934 [Librus/Attachment] A huge structure reformat. 2019-11-28 23:00:25 +01:00
Kuba Szczodrzyński
928b73f139 [Config] Implement per-profile config. Update timetable card. 2019-11-28 21:45:27 +01:00
Kacper Ziubryniewicz
a36fb09bc3 [Dialog/Event] Add event adding in the new event manual dialog. 2019-11-28 15:11:23 +01:00
Kacper Ziubryniewicz
eaed4b76aa [Timetable] Fix showing question marks in lesson changes. 2019-11-26 23:11:14 +01:00
Kacper Ziubryniewicz
6d8960f089 [Home/Timetable] Add click listener to timetable card. 2019-11-26 22:56:43 +01:00
Kacper Ziubryniewicz
ca3b6d0705 [APIv2/Idziennik] Fix getting subject and rewrite getting proposed grades. 2019-11-26 22:28:52 +01:00
Kuba Szczodrzyński
c2e7931ea6 [Config] Implement (basic) new app config storage. 2019-11-26 21:55:04 +01:00
Kacper Ziubryniewicz
d1a5d8cba9 [APIv2/Vulcan] Fix start time in events. 2019-11-26 21:44:35 +01:00
Kacper Ziubryniewicz
c2f91e6867 [APIv2] Move AppError to API directory. 2019-11-26 21:10:31 +01:00
Kacper Ziubryniewicz
55e32b8d88 [APIv2/Librus] Temporarily fix subject in attendance. 2019-11-26 21:02:33 +01:00
Kuba Szczodrzyński
462b1df767 [3.9.12-dev] 2019-11-25 22:55:09 +01:00
Kacper Ziubryniewicz
d17d2c8417 [APIv2/Librus] Fix looking for the lesson in getting homework. 2019-11-25 22:53:55 +01:00
Kacper Ziubryniewicz
6892832fff [APIv2/Idziennik] Add getting homework and rewrite getting exams. 2019-11-25 22:53:55 +01:00
Kuba Szczodrzyński
66d54c7c45 [APIv2/Librus] Fix messages login. 2019-11-25 22:40:14 +01:00
Kuba Szczodrzyński
d432685aa8 [Update] Fix update downloading from notification. 2019-11-25 22:23:55 +01:00
Kuba Szczodrzyński
37f3d76fb8 [UI] Implement home timetable card. 2019-11-25 22:17:08 +01:00
Kacper Ziubryniewicz
7961a74995 [APIv2/Events] Fix fetching events and homework. Add DataRemoveModel for events. 2019-11-25 21:13:55 +01:00
Kuba Szczodrzyński
9d590508ad [APIv2/Librus] Fix messages session ID extraction. 2019-11-25 15:00:51 +01:00
Kuba Szczodrzyński
f79b7eaf83 [3.9.11-dev] 2019-11-24 21:47:05 +01:00
Kuba Szczodrzyński
ae13bf946f [Home] Remove useless dummy cards. 2019-11-24 21:21:37 +01:00
Kuba Szczodrzyński
f116c4f1f4 [Home] Implement basic timetable card. 2019-11-24 21:15:01 +01:00
Kacper Ziubryniewicz
867c8920a8 [APIv2/Messages] Add downloading attachments. 2019-11-24 20:55:04 +01:00
Kuba Szczodrzyński
6e6dd34872 [UI] Add new Home fragment. Add Lucky number card and number selection dialog. 2019-11-24 19:41:17 +01:00
Kacper Ziubryniewicz
0759468fa7 [Sync] Add syncing all to manual sync dialog. 2019-11-24 16:47:10 +01:00
Kacper Ziubryniewicz
1b1fb09211 [APIv2/Vulcan] Fix problems with week start in timetable. 2019-11-24 16:31:51 +01:00
Kacper Ziubryniewicz
de414c912c [Sync] Fix error when user selects no features. 2019-11-24 13:20:42 +01:00
Kacper Ziubryniewicz
d274a2fed1 [Timetable] Change date receiver argument to timetableDate. 2019-11-24 13:20:22 +01:00
Kacper Ziubryniewicz
285b7e9b9e [Timetable] Make going to the specified date on the notification click. 2019-11-24 12:57:00 +01:00
Kacper Ziubryniewicz
875efcff7e [APIv2/Timetable] Fix ID in lessons. 2019-11-24 12:11:39 +01:00
Kacper Ziubryniewicz
07ae37167d [Notifications/Timetable] Make notifications for timetable changes 2019-11-24 11:09:45 +01:00
Kacper Ziubryniewicz
f689f4d427 [APIv2/Timetable] Fix lesson changes metadata. 2019-11-24 10:36:20 +01:00
Kuba Szczodrzyński
19bc2b8b37 [3.9.10-dev] New UI + stability fixes 2019-11-23 23:26:19 +01:00
Kacper Ziubryniewicz
673116e27e [Settings/About] Add a new developer to about! 2019-11-23 23:09:03 +01:00
Kacper Ziubryniewicz
59fcb0a050 [APIv2/Timetable] Add lesson change metadata only when the lesson is today or in the future 2019-11-23 22:40:20 +01:00
Kacper Ziubryniewicz
cd76f99bbf [APIv2/Timetable] Add showing unread lesson changes 2019-11-23 22:26:21 +01:00
Kacper Ziubryniewicz
6a4994b9c2 [APIv2/Timetable] Make swipe refresh download timetable for the selected week 2019-11-23 21:57:30 +01:00
Kacper Ziubryniewicz
63960c5e05 [APIv2/Timetable] Add selecting date, marking as read and fix stepForward in Date 2019-11-23 21:27:52 +01:00
Kacper Ziubryniewicz
540afb6a28 [Home] Start making new home timetable card in Kotlin 2019-11-23 19:41:55 +01:00
Kacper Ziubryniewicz
ae10b8abbd [APIv2/Idziennik] Add new timetable getting and fix week start 2019-11-23 19:40:32 +01:00
Kacper Ziubryniewicz
db2ebab879 [APIv2/Vulcan] Add missing Lublin endpoints 2019-11-23 19:39:13 +01:00
Kuba Szczodrzyński
6ec3d062df [UI] Update header image. Fix fragment bundle passing. 2019-11-23 19:37:00 +01:00
Kuba Szczodrzyński
86b6060a09 [UI] Migrate to outlined icons. 2019-11-23 18:32:18 +01:00
Kuba Szczodrzyński
83d123e341 [UI] New notifications view. 2019-11-22 22:41:40 +01:00
Kuba Szczodrzyński
34061695f9 [UI] Update colored placeholder icons. 2019-11-22 19:23:49 +01:00
Kuba Szczodrzyński
de68476442 [UI/Event] Add Sync text to manual event dialog. 2019-11-22 18:42:45 +01:00
Kuba Szczodrzyński
678a81a44b [APIv2/Vulcan] Improve Vulcan login when migrating from APIv1. 2019-11-22 18:42:11 +01:00
Kuba Szczodrzyński
cfb3096d53 [Sync] Add better task cancelling and better frozen task detection. 2019-11-22 18:41:15 +01:00
Kuba Szczodrzyński
9b7aca745a [3.9.9-dev] 2019-11-21 19:18:04 +01:00
Kuba Szczodrzyński
82852389fa [UI] Update indentation, again. Fix manual event color selecting. 2019-11-21 18:43:01 +01:00
Kuba Szczodrzyński
ce06084e6f [Timetable] Fix lessons removing, again. 2019-11-21 18:24:02 +01:00
Kacper Ziubryniewicz
3ca051983f [APIv2/Timetable] Add searching for the next lesson by team id 2019-11-20 22:43:48 +01:00
Kacper Ziubryniewicz
cd379e4175 [APIv2/Librus] Add getting grade comments 2019-11-20 21:16:18 +01:00
Kuba Szczodrzyński
62fdfa2b6f [UI] Update manual event dialog. Fix timetable errors. 2019-11-20 21:13:43 +01:00
Kuba Szczodrzyński
9866017f7e [APIv2/Vulcan] Fix timetable teams issue. Fix missing login data error. 2019-11-20 19:51:50 +01:00
Kuba Szczodrzyński
67f98b08c6 [Update] Update update code to allow update from direct download. 2019-11-20 17:11:08 +01:00
Kuba Szczodrzyński
fdb5f7ec02 [APIv2/Mobidziennik] Implement getting message details. 2019-11-18 22:57:23 +01:00
Kuba Szczodrzyński
04c3c7ca6e [APIv2] Handle Librus Portal maintenance. 2019-11-18 18:55:52 +01:00
Kuba Szczodrzyński
f424315d97 [3.9.8-dev] 2019-11-17 23:17:37 +01:00
Kuba Szczodrzyński
c907a8df37 [APIv2] Librus: better error handling. Timetable: fix widget crashing with NPE. 2019-11-17 23:16:13 +01:00
Kuba Szczodrzyński
37ea65e3fc [Timetable] Add SwipeToRefresh. Select start&end hours based on lesson ranges. 2019-11-16 21:16:18 +01:00
Kuba Szczodrzyński
a3e5f824c8 [UI] Fix messages & homework refresh layout sensitivity. 2019-11-16 18:46:01 +01:00
Kuba Szczodrzyński
e0c850a455 [Gradle] Update Tachyon to support creating DayView programmatically. 2019-11-16 17:07:07 +01:00
Kuba Szczodrzyński
1c6815f708 [3.9.7-dev] 2019-11-15 22:00:18 +01:00
Kuba Szczodrzyński
9a20511935 [UI] Set pull-to-refresh colors. 2019-11-15 21:16:58 +01:00
Kuba Szczodrzyński
965f5e73d9 [Bugs] Update gradle. Fix crashes in the timetable widget. 2019-11-15 19:55:46 +01:00
Kuba Szczodrzyński
13b58a1d56 [3.9.6-dev] Widgets. Timetables. RIP APIv1. 2019-11-15 00:02:00 +01:00
Kuba Szczodrzyński
0a3261b8b3 [APIv2/Mobidziennik] Fix incorrect profile ID in teams & timetable. 2019-11-14 23:46:53 +01:00
Kuba Szczodrzyński
dbdfc7fdd8 [Widget] Add new Timetable widget with APIv2. 2019-11-14 23:33:13 +01:00
Kuba Szczodrzyński
56062f5bfa [Timetable] Fix day fragment crashing on restoring saved instance 2019-11-14 22:13:32 +01:00
Kuba Szczodrzyński
0cbba2eb45 [Models] Make Time comparable. Implement faster Date.stepForward 2019-11-14 19:31:50 +01:00
Kacper Ziubryniewicz
aa84356dd6 [APIv2/Vulcan] Add getting timetable with lesson changes 2019-11-14 00:41:34 +01:00
Kuba Szczodrzyński
efaad0a4dd [APIv1] Remove remaining APIv1 components. [*] 2019-11-13 22:37:30 +01:00
Kuba Szczodrzyński
71015c0137 [APIv1] Remove most APIv1 components. 2019-11-13 22:26:12 +01:00
Kuba Szczodrzyński
85b5667a7e [Sync] New manual sync dialog. Remove most APIv1 dependencies. 2019-11-13 21:57:47 +01:00
Kacper Ziubryniewicz
dfdc6817a1 [APIv2/Vulcan] Fix getting sent messages with unknown recipient 2019-11-13 21:01:09 +01:00
Kuba Szczodrzyński
058345b9c9 [Error] Add user friendly error strings. Add error snackbar to activity & login. 2019-11-13 19:44:08 +01:00
Kuba Szczodrzyński
831b7876b4 [APIv2] Fix duplicated error code 2019-11-13 18:23:21 +01:00
Kuba Szczodrzyński
729cf6f08e [Settings] New Profile removal dialog. 2019-11-13 17:19:25 +01:00
Kuba Szczodrzyński
860a16b32d [3.9.5-dev] Messages & manual events 2019-11-13 17:19:25 +01:00
Kacper Ziubryniewicz
9f871c077b [APIv2/Librus] Fix getting messages with unknown recipient 2019-11-13 00:00:28 +01:00
Kacper Ziubryniewicz
a8f89abf7d [APIv2/Vulcan] Add changing message status 2019-11-12 23:59:48 +01:00
Kuba Szczodrzyński
16102de619 [Event] Add new manual event dialog 2019-11-12 23:35:47 +01:00
Kuba Szczodrzyński
472e768369 [Gradle] Update MaterialDrawer and NavLib 2019-11-12 23:35:13 +01:00
Kuba Szczodrzyński
131a769c26 [Gradle] Update dependencies 2019-11-12 22:05:40 +01:00
Kuba Szczodrzyński
4a0a6c54e4 [Timetable] Make timetable sync disable the button on click. 2019-11-12 14:36:20 +01:00
Kuba Szczodrzyński
c83abe57d5 [Messages] Implement APIv2 in MessageFragment. 2019-11-12 14:11:35 +01:00
Kacper Ziubryniewicz
c6e2519dcc [APIv2/Librus] Add getting message info 2019-11-12 00:30:26 +01:00
Kuba Szczodrzyński
74db524db6 [Timetable] Add lesson details dialog. 2019-11-11 23:59:45 +01:00
Kuba Szczodrzyński
810976d976 [3.9.4-dev] The Timetable Release 2019-11-11 19:22:15 +01:00
Kuba Szczodrzyński
eb0540b5cb [Timetable] Fix adding NO_LESSONS in Mobidziennik. Change ID generation. 2019-11-11 19:14:02 +01:00
Kuba Szczodrzyński
124437fd73 [Login] Allow fake login with DevMode. 2019-11-11 18:41:39 +01:00
Kuba Szczodrzyński
69b512e3d1 [Timetable] Extract string resources. Increase offscreen page limit. 2019-11-11 18:32:49 +01:00
Kuba Szczodrzyński
29d74e14bd [Timetable] Fix scrolling to first lesson. Update lesson ID generation. 2019-11-11 18:13:37 +01:00
Kuba Szczodrzyński
f42ec8435a [Timetable] Show user friendly day name in view pager. 2019-11-11 15:46:04 +01:00
Kuba Szczodrzyński
1052b824db [Timetable] Make it sync only timetable when getting a single week. 2019-11-11 14:52:09 +01:00
Kuba Szczodrzyński
0742a6a74c [Timetable] Fix removing all lessons when not needed. 2019-11-11 14:16:31 +01:00
Kuba Szczodrzyński
d4e9e1730f [APIv2] Implement getting timetable for one week. Support arguments in EdziennikTask. Create new DataRemoveModel. 2019-11-11 14:11:05 +01:00
Kuba Szczodrzyński
4eeaa54a47 [Timetable] Implement Librus timetable with lesson changes and shifts. Update UI. 2019-11-10 22:57:19 +01:00
Kacper Ziubryniewicz
5fa7409317 [APIv2/Librus] Add getting normal lessons 2019-11-10 21:49:40 +01:00
Kuba Szczodrzyński
0bcd190714 [APIv2] Add Librus Fake login. 2019-11-10 20:27:26 +01:00
Kuba Szczodrzyński
563f08b0ab [UI] Update Timetable lesson layout. Add lesson number text. 2019-11-10 18:53:45 +01:00
Kuba Szczodrzyński
1b75424604 [APIv2/UI] Add new Timetable module. Implement in Mobidziennik. 2019-11-10 17:53:10 +01:00
Kuba Szczodrzyński
01ac26e67b [Sync] Fix background sync on Android O+. 2019-11-07 17:50:12 +01:00
Kuba Szczodrzyński
434ddd1342 [3.9.2-dev] Add persistent debug logging. 2019-11-06 22:49:26 +01:00
Kuba Szczodrzyński
3925496595 [3.9.1-dev] Fix Librus Messages crash. 2019-11-06 21:49:40 +01:00
Kuba Szczodrzyński
5711c02170 [Home] Fix the private variable error. 2019-11-05 22:22:28 +01:00
Kuba Szczodrzyński
ca1c691bf0 [3.9.0-dev] Update build.gradle and changelog 2019-11-05 22:12:15 +01:00
Kuba Szczodrzyński
39c8a743bb [Login/Librus] Add Librus captcha activity/dialog. 2019-11-05 21:42:16 +01:00
Kuba Szczodrzyński
14cd548dff [Sync] Add more AppManager intents to launch. 2019-11-05 18:49:40 +01:00
Kacper Ziubryniewicz
b72324805f [APIv2] Move onSuccess from callback to an argument 2019-11-05 18:20:41 +01:00
Kacper Ziubryniewicz
a049effa61 [APIv2/Librus] Add getting normal grade categories 2019-11-05 18:16:42 +01:00
Kacper Ziubryniewicz
23d55ec571 [APIv2/Vulcan] Add getting sent messages 2019-11-05 17:30:38 +01:00
Kuba Szczodrzyński
385fe21d16 [APIv2/Librus] Implement error handling. Catch exceptions in ApiService. 2019-11-05 11:27:29 +01:00
Kuba Szczodrzyński
399ae7e3dc [APIv2/Idziennik] Update Web login expiry time. 2019-11-03 21:30:51 +01:00
Kuba Szczodrzyński
22726f8566 [ApiService] Refactor the service, requesting, cancelling. Make compatible with other API tasks. 2019-11-03 21:26:48 +01:00
Kuba Szczodrzyński
d789d08f31 [Sync] Fix auto sync when screen is off/device is in Doze mode. 2019-11-03 16:10:30 +01:00
Kuba Szczodrzyński
07863fed6f [Sync] Implement APIv2 auto sync using WorkManager. 2019-11-03 15:01:12 +01:00
Kuba Szczodrzyński
dcd355851d [Login] Remove Login migration fragment (fix). 2019-11-02 19:25:44 +01:00
Kuba Szczodrzyński
aa161b5b0e [Login] Remove Login migration fragment. 2019-11-02 19:20:39 +01:00
Kuba Szczodrzyński
99ab9d586f [APIv2] Revert changes in Data. 2019-11-02 13:31:24 +01:00
Kacper Ziubryniewicz
33c009befe [APIv2/Vulcan] Add getting received messages 2019-11-02 00:06:23 +01:00
Kuba Szczodrzyński
64019dccf7 [APIv2/Vulcan] Update uonet-request-signer. Update removing profile. Fix minor issues. 2019-11-01 22:30:39 +01:00
Kuba Szczodrzyński
e3bb607303 [APIv2/Vulcan] Use Wulkanowy uonet-request-signer. 2019-11-01 21:31:26 +01:00
Kuba Szczodrzyński
0b211c4f12 [APIv2/Vulcan] Fix first login. Add Attendance, Proposed grades. Complete Dictionaries. 2019-11-01 21:21:25 +01:00
Kuba Szczodrzyński
38d0a173af [Gradle] Fix AgendaCalendarView dependencies. 2019-11-01 21:19:30 +01:00
Kuba Szczodrzyński
31b502bb6c Merge branch 'develop' 2019-10-31 17:58:02 +01:00
Kuba Szczodrzyński
fa99b7fd11 [3.2] Update build.gradle and changelog 2019-10-31 17:57:41 +01:00
Kuba Szczodrzyński
9c5653b52e [Gradle] Fix AgendaCalendarView dependencies. 2019-10-31 17:20:07 +01:00
Kuba Szczodrzyński
88ad8523a0 [UI] Disable bottom menu gain attention ripple. 2019-10-31 17:19:25 +01:00
Kuba Szczodrzyński
a15f59fbd1 [API/Vulcan] Add edu.lublin.eu register support. 2019-10-31 15:40:59 +01:00
Kuba Szczodrzyński
bf73c75872 [APIv2/Librus] Change teacher free day types sync frequency. 2019-10-31 15:36:12 +01:00
Kuba Szczodrzyński
dd99771c0b [APIv2/Idziennik] Add Messages - received and sent. 2019-10-30 21:13:49 +01:00
Kuba Szczodrzyński
01657ca002 [APIv2/Mobidziennik] Reformat Grades a bit. 2019-10-29 23:20:03 +01:00
Kuba Szczodrzyński
f2b3603531 [APIv2/Idziennik] Fix Attendance and Exams. Add Lucky number. 2019-10-29 23:17:13 +01:00
Kuba Szczodrzyński
d6d73b19ec [APIv2/Mobidziennik] Fix a terrible mistake. 2019-10-29 23:01:11 +01:00
Kuba Szczodrzyński
2ad8a308b3 [APIv2/Idziennik] Better request parameter adding. 2019-10-28 23:21:57 +01:00
Kuba Szczodrzyński
81c6275255 [APIv2/Idziennik] Add Proposed grades, Exams, Notices, Announcements and broken Attendance. 2019-10-28 23:18:59 +01:00
Kuba Szczodrzyński
cfc5db2fe8 [APIv2/Idziennik] Add Grades. 2019-10-28 22:12:04 +01:00
Kuba Szczodrzyński
5e90e9aa71 [APIv2/Mobidziennik] Make use of String.fixName() 2019-10-28 19:54:53 +01:00
Kuba Szczodrzyński
debb0b1507 [APIv2/Idziennik] Fix login, add timetable. List features. 2019-10-28 19:54:15 +01:00
Kuba Szczodrzyński
188470a043 [UI/Settings] Add option to change app language. 2019-10-28 16:33:25 +01:00
Kuba Szczodrzyński
f452a1b81c [Utils] Update CRC16 generation method. 2019-10-27 21:25:01 +01:00
Kuba Szczodrzyński
42f70da162 [UI/Settings] Add option to change app language. 2019-10-27 21:00:23 +01:00
Kuba Szczodrzyński
4e8b80822b [APIv2/Idziennik] Add Idziennik implementation (Web, Api login + first login) 2019-10-27 19:45:14 +01:00
Kuba Szczodrzyński
7ce7859a5f [UI/Login] Display class and school year in summary, show e-register logo icon. 2019-10-27 19:43:43 +01:00
Kuba Szczodrzyński
13b970f4e8 [APIv2] Optimize first login. Add extracting account name, class name, school year. Add Vulcan error handling. Fix Vulcan first login. 2019-10-27 19:40:50 +01:00
Kuba Szczodrzyński
054426c9cc [APIv2/DB] Add profile account name, class, school year fields. 2019-10-27 18:03:58 +01:00
Kuba Szczodrzyński
10c439afad [APIv2/Template] Add first login template. 2019-10-27 15:38:43 +01:00
Kuba Szczodrzyński
46dd543b48 [APIv2] Librus/Synergia request: error handling. Mobidziennik: fix login error code. 2019-10-27 15:30:24 +01:00
Kacper Ziubryniewicz
28e0f3487c [APIv2/Debug] Add debug button for marking all announcements as read 2019-10-26 15:13:03 +02:00
Kacper Ziubryniewicz
ca10ee2fe5 [Debug] Make debug mode for debug build 2019-10-26 15:04:11 +02:00
Kacper Ziubryniewicz
3e99c111bd [APIv2/Librus] Add marking all announcements as read using Synergia 2019-10-26 14:36:21 +02:00
Kacper Ziubryniewicz
843a8e4298 [APIv2/Librus] Make getting received messages sync always 2019-10-26 00:22:14 +02:00
Kacper Ziubryniewicz
454e8caa0d [APIv2/Librus] Add getting received and sent messages 2019-10-26 00:14:14 +02:00
Kacper Ziubryniewicz
e38dc011bd [APIv2/Librus] Fix new homework notifications (Synergia) 2019-10-26 00:11:23 +02:00
Kacper Ziubryniewicz
9aef3d56df [APIv2/Librus] Fix Librus messages requests 2019-10-25 22:12:45 +02:00
Kacper Ziubryniewicz
8c099bc137 [APIv2/Librus] Add handling denied access in messages 2019-10-25 00:24:55 +02:00
Kacper Ziubryniewicz
de82bc7e4d [APIv2/Librus] Add Librus Messages endpoint 2019-10-25 00:15:26 +02:00
Kacper Ziubryniewicz
5166228915 [APIv2/Librus] Parse document in LibrusSynergia instead of endpoints 2019-10-25 00:14:25 +02:00
Kuba Szczodrzyński
35ed31f6b9 [APIv2/Librus] Add Attendance types, Classrooms, Event types, Notices, Notice types, PT meetings. Simplify JSON array iteration. 2019-10-24 22:15:35 +02:00
Kuba Szczodrzyński
05ce790587 [APIv2] Add Librus Units. Add Classroom, NoticeType, AttendanceType entities. 2019-10-23 23:02:02 +02:00
Kacper Ziubryniewicz
ff7f015146 [APIv2/Librus] Add getting student info (student number) using Synergia 2019-10-23 22:59:45 +02:00
Kacper Ziubryniewicz
e2150e3018 [APIv2/Librus] Add Synergia endpoint template 2019-10-23 22:59:45 +02:00
Kacper Ziubryniewicz
bbf8f05d3c [APIv2/Vulcan] Add getting notices 2019-10-23 22:59:45 +02:00
Kuba Szczodrzyński
36c810fdbe [APIv2/Librus] Add Virtual classes, Users, Subjects. 2019-10-23 21:11:39 +02:00
Kuba Szczodrzyński
7822810b91 [APIv2] Implement APIv2 in first login activity. 2019-10-23 19:13:54 +02:00
Kuba Szczodrzyński
9fefae3da3 [APIv2] Improve Librus sync timers. Make saveData update app.profile. Decide when to sync lucky number. 2019-10-23 19:12:28 +02:00
Kacper Ziubryniewicz
74ce9cd38d [APIv2/Librus] Add getting homework using Synergia 2019-10-23 00:05:35 +02:00
Kacper Ziubryniewicz
bfcbeb7140 [APIv2/Librus] Add Synergia request 2019-10-23 00:03:40 +02:00
Kuba Szczodrzyński
5d3bebfdce [APIv2] Implement swipe to refresh with ApiService. 2019-10-22 22:37:02 +02:00
Kuba Szczodrzyński
b8f58328cb [APIv2/Vulcan] Add faster request signing. 2019-10-22 22:34:13 +02:00
Kacper Ziubryniewicz
3540b09623 [APIv2/Vulcan] Temporary fix for signing requests 2019-10-22 10:30:19 +02:00
Kuba Szczodrzyński
25744037f5 [DB] Fix migration compatibility for different app versions 2019-10-21 17:25:46 +02:00
Kacper Ziubryniewicz
0395598efb Merge branch 'develop' into api-v2
# Conflicts:
#	app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java
2019-10-21 16:52:52 +02:00
Kacper Ziubryniewicz
f44b64fcc5 [APIv2/Vulcan] Add getting homework 2019-10-21 00:28:27 +02:00
Kacper Ziubryniewicz
2a7535920e [APIv2/Vulcan] Add getting team if it doesn't exist 2019-10-21 00:27:24 +02:00
Kacper Ziubryniewicz
9e6741d542 [APIv2/Vulcan] Add getting events 2019-10-20 22:45:44 +02:00
Kacper Ziubryniewicz
0e5a32b253 [APIv2/Vulcan] Fix setting semester dates 2019-10-20 22:35:13 +02:00
Kacper Ziubryniewicz
929287a553 [APIv2/Vulcan] Add getting basic dictionaries (teachers and subjects) 2019-10-20 14:55:35 +02:00
Kacper Ziubryniewicz
a0fe24ada0 [APIv2/Vulcan] Add getting grades 2019-10-20 14:08:06 +02:00
Kacper Ziubryniewicz
dd34e7d008 [APIv2/Vulcan] Add Vulcan first login 2019-10-20 00:00:50 +02:00
Kacper Ziubryniewicz
92fb83ccf9 [APIv2/Vulcan] Add Vulcan Api 2019-10-19 20:38:30 +02:00
Kacper Ziubryniewicz
b32ebe4479 [APIv2/Librus] Move some code 2019-10-19 13:51:01 +02:00
Kacper Ziubryniewicz
e138ca6eab [APIv2/Librus] Add getting and showing teacher absence reason 2019-10-19 13:33:50 +02:00
Kacper Ziubryniewicz
cf8afc03bc [APIv2/Librus] Add getting teacher absences 2019-10-19 13:21:15 +02:00
Kuba Szczodrzyński
8dc358b075 [APIv2] Notifications - DB entity, move to APIv2. Add Server event sync and web push. 2019-10-18 22:12:40 +02:00
Kuba Szczodrzyński
24ab2e7795 [LuckyNumber] Add lucky number metadata. Migrate Date field to int. 2019-10-18 08:46:55 +02:00
Kacper Ziubryniewicz
3f85825c4a [API/Librus] Add showing classroom in substitutions 2019-10-17 15:07:06 +02:00
Kacper Ziubryniewicz
c03eca3804 [APIv2/Librus] Use apply in getting lucky numbers 2019-10-17 14:35:10 +02:00
Kuba Szczodrzyński
f79263e628 [APIv2] Implement Grades remove model. Implement Librus first login. 2019-10-15 06:49:19 +02:00
Kuba Szczodrzyński
e91b4fcf8b [APIv2/Mobidziennik] Implement First login. 2019-10-14 15:44:02 +02:00
Kuba Szczodrzyński
0b7f9a08ef [Profile] Remove all Profile.loggedIn usages. 2019-10-14 15:31:34 +02:00
Kuba Szczodrzyński
440b76d302 [APIv2/Login] EventBus: sticky events in Service. Add first login request in fragment. 2019-10-14 15:30:34 +02:00
Kuba Szczodrzyński
c433a615db [Database] Fix homework/event types migration. 2019-10-14 15:20:21 +02:00
Kacper Ziubryniewicz
7b5269a1fe [APIv2/Librus] Add getting classes 2019-10-14 14:04:02 +02:00
Kacper Ziubryniewicz
33cfaef454 [APIv2/Librus] Add getting the lucky number 2019-10-14 13:33:07 +02:00
Kacper Ziubryniewicz
fe62c93602 [Gradle] Update gradle to 3.5.1 2019-10-14 12:46:36 +02:00
Kuba Szczodrzyński
bdc0ceb11d [APIv2] Simplify endpoint choosing. Optimize imports. 2019-10-14 10:59:11 +02:00
Kuba Szczodrzyński
b35df5ef11 [APIv2] Add API first login method. Better cancellation handling. 2019-10-14 10:25:44 +02:00
Kuba Szczodrzyński
b59887d4e0 [APIv2/Mobidziennik] Change all messages list sync frequency. 2019-10-14 10:02:24 +02:00
Kuba Szczodrzyński
da9ccf6d29 [APIv2] Update Feature lists and progress strings. 2019-10-13 20:06:45 +02:00
Kuba Szczodrzyński
6b80d7cbd0 [APIv2] Update Feature shouldSync method. 2019-10-13 19:40:56 +02:00
Kacper Ziubryniewicz
0e17a70193 Merge remote-tracking branch 'origin/api-v2' into api-v2 2019-10-13 17:01:27 +02:00
Kacper Ziubryniewicz
6ff439b20d [Database/Librus] Fix duplicate homework 2019-10-13 17:00:54 +02:00
Kacper Ziubryniewicz
70d35e12e5 [APIv2/Librus] Fix attendance metadata 2019-10-13 16:34:44 +02:00
Kuba Szczodrzyński
7561087c78 Merge remote-tracking branch 'origin/api-v2' into api-v2 2019-10-13 16:27:58 +02:00
Kacper Ziubryniewicz
42b56fa4a2 [APIv2/Librus] Add getting announcements 2019-10-13 16:17:39 +02:00
Kacper Ziubryniewicz
fb945470c0 [APIv2/Librus] Add getting attendances and their types 2019-10-13 15:45:21 +02:00
Kacper Ziubryniewicz
4f9b9c5f7b [Copyright] Add profile_settings.xml to .gitignore 2019-10-12 23:29:21 +02:00
Kacper Ziubryniewicz
3b273440cc [APIv2/Librus] Add getting homework 2019-10-12 23:25:53 +02:00
Kuba Szczodrzyński
b0fb87acdb [APIv2] Add Feature priority setter and shouldSync method. 2019-10-12 17:01:21 +02:00
Kacper Ziubryniewicz
ea36e8e9bd [Home] Add marking everything as read in the home fragment 2019-10-11 23:38:40 +02:00
Kuba Szczodrzyński
0875d13737 [APIv2/Librus] Update endpoint list structure 2019-10-11 23:09:23 +02:00
Kuba Szczodrzyński
39050cdee5 Merge remote-tracking branch 'origin/api-v2' into api-v2 2019-10-11 23:00:50 +02:00
Kuba Szczodrzyński
7594fdd578 [APIv2/Mobidziennik] Add Messages All+Inbox 2019-10-11 23:00:19 +02:00
Kacper Ziubryniewicz
93d5596942 [APIv2/Librus] Add events syncing and fix NPE in grades 2019-10-11 22:07:50 +02:00
Kuba Szczodrzyński
93fcc0deb7 Merge remote-tracking branch 'origin/api-v2' into api-v2 2019-10-11 21:36:59 +02:00
Kacper Ziubryniewicz
f6b50fbb58 [API/Librus] Fix grade syncing 2019-10-11 20:27:24 +02:00
Kacper Ziubryniewicz
cf0aa2788d [API/Debug] Make debugging active profile in the home fragment 2019-10-11 20:03:03 +02:00
Kuba Szczodrzyński
67fbb96cd9 [APIv2/Mobidziennik] Refactor data structure 2019-10-11 16:42:24 +02:00
Kuba Szczodrzyński
ed8ca00a85 [APIv2] Add Grades. Update Firebase push receivers. 2019-10-11 16:24:45 +02:00
Kuba Szczodrzyński
7b3e2a9ea0 [APIv2/Mobidziennik] Add Lucky number, Class calendar, better exception handling 2019-10-10 18:56:05 +02:00
Kuba Szczodrzyński
7686c451e6 Merge branch 'develop' 2019-10-09 19:16:15 +02:00
Kuba Szczodrzyński
7eaa4caae2 [3.1.1] Update build.gradle and changelog 2019-10-09 19:15:03 +02:00
Kuba Szczodrzyński
931d09d0b0 Add database migration (unset last full sync) 2019-10-09 18:50:17 +02:00
Kuba Szczodrzyński
554faf06a1 [UI] Change bottom bar color to window background 2019-10-09 18:22:33 +02:00
Kuba Szczodrzyński
38c5f5d7f6 [UI] Change lesson time counter refresh intervals 2019-10-09 18:22:03 +02:00
Kuba Szczodrzyński
015416f2a8 [API/Librus] Fix for not clearing the grade category list 2019-10-09 18:20:54 +02:00
Kuba Szczodrzyński
2730c73413 [APIv2/Mobidziennik] Add Homework, Events, Timetable. Fix Users. 2019-10-09 17:23:44 +02:00
Kuba Szczodrzyński
bbaa405c59 [APIv2/Mobidziennik] Add Notices, Grades, fix Attendance 2019-10-08 19:16:19 +02:00
Kuba Szczodrzyński
6127e574db [APIv2] Implement few Mobidziennik endpoints. Add grade category type. 2019-10-07 23:03:39 +02:00
Kuba Szczodrzyński
1b53c35ec5 [APIv2] Fix Librus grades exception. Improve error handling and sync cancellation. 2019-10-07 20:50:44 +02:00
Kacper Ziubryniewicz
359fd4efed [API/Librus] Add grades 2019-10-07 20:04:23 +02:00
Kuba Szczodrzyński
f7412fea7f [APIv2] Update Mobidziennik API. Update Data structure. 2019-10-06 22:58:13 +02:00
Kuba Szczodrzyński
f0bf6b8b81 [APIv2] Add sparse array extensions - simplify getting data from database. 2019-10-06 20:58:05 +02:00
Kuba Szczodrzyński
7a06593821 [APIv2] Add Vulcan login. Refactor API structure. Add request debug logging. 2019-10-06 18:13:31 +02:00
Kuba Szczodrzyński
ddf4fb0b46 [APIv2] Add Mobidziennik login & API prototype. Refactor some classes 2019-10-05 23:42:37 +02:00
Kuba Szczodrzyński
535d608829 [APIv2] Add e-register Template 2019-10-05 14:26:01 +02:00
Kuba Szczodrzyński
18e469af71 [Database] Fix lesson ranges database entity in index 2019-10-05 14:24:23 +02:00
Kuba Szczodrzyński
ce921b9b85 [APIv2] Update endpoint timer features 2019-10-05 13:12:35 +02:00
Kuba Szczodrzyński
bb0a366ef1 [APIv2/Librus] Refactor structure 2019-10-05 12:28:45 +02:00
Kuba Szczodrzyński
fabacfdcca [APIv2/Librus] Update endpoints: API/Schools, API/Events 2019-10-05 12:26:52 +02:00
Kuba Szczodrzyński
648699547e [APIv2] Fix receivers and other weird things 2019-10-04 20:24:47 +02:00
Kuba Szczodrzyński
c8c933fb20 [APIv2] Implement endpoint timers. Fix compilation issues after merge. 2019-10-04 17:14:56 +02:00
Kuba Szczodrzyński
870a429f3d Add back Librus test 2019-10-03 22:16:16 +02:00
Kuba Szczodrzyński
23a9f24d52 Fix compilation issues after merge 2019-10-03 21:10:21 +02:00
Kuba Szczodrzyński
48a2ae3599 Merge branch 'develop' into api-v2 2019-10-03 21:07:17 +02:00
Kuba Szczodrzyński
04f3ce4d64 Merge branch 'develop' 2019-10-02 20:44:19 +02:00
Kuba Szczodrzyński
57a70aa777 [3.1] Update secret password 2019-10-02 19:07:47 +02:00
Kuba Szczodrzyński
cfdde4483f [3.1] Update build.gradle 2019-10-02 19:06:51 +02:00
Kuba Szczodrzyński
c568a1f571 [Settings] Update about section copyright text 2019-10-02 18:01:23 +02:00
Kuba Szczodrzyński
74639e2b03 [Settings] Save profile after teacher absences setting change 2019-10-02 17:59:54 +02:00
Kuba Szczodrzyński
a849f0e8a2 [Project] Add kubasz copyright file to git 2019-10-02 17:16:10 +02:00
Kuba Szczodrzyński
ca022e1d8a [Translations] Teacher absence showing setting 2019-10-02 17:11:39 +02:00
Kacper Ziubryniewicz
bc82f7edf6 [Project] Add copyright files to git 2019-10-02 12:56:50 +02:00
Kacper Ziubryniewicz
46d0459070 [Settings] Add setting for showing teacher absences 2019-10-02 12:52:39 +02:00
Kacper Ziubryniewicz
0a578e9a28 Move help and feedback to the other module 2019-10-02 12:19:12 +02:00
Kuba Szczodrzyński
4c6b467847 [APIv2] Finalize the basic API service. Add notification. Add exported broadcast receiver. 2019-10-01 21:27:09 +02:00
Kuba Szczodrzyński
92880d40cf [APIv2/Librus] Update endpoint choosing algorithm 2019-10-01 11:32:53 +02:00
Kuba Szczodrzyński
d2f06a256f [APIv2] Update API, add endpoint choosing algorithm 2019-10-01 07:03:12 +02:00
Kuba Szczodrzyński
293afca964 [3.1-beta.2] Update build.gradle 2019-09-29 22:14:15 +02:00
Kuba Szczodrzyński
b8304e7441 [UI/Agenda] Fix event list truncated & update tools preview 2019-09-29 22:06:51 +02:00
Kuba Szczodrzyński
d1164c8acd [UI/Agenda] Fix lesson change list truncated 2019-09-29 22:02:24 +02:00
Kuba Szczodrzyński
9a3ab838b7 [UI/Agenda] Fix teacher absence list truncated 2019-09-29 21:48:35 +02:00
Kuba Szczodrzyński
e0a1a9a2ab Fix proguard config for Event and EventType 2019-09-29 20:59:20 +02:00
Kuba Szczodrzyński
7da3101678 Delete unused MaterialDrawer module 2019-09-29 20:45:53 +02:00
Kuba Szczodrzyński
81a67f9dcc [3.1-beta.1] Update build.gradle and changelog 2019-09-29 20:39:38 +02:00
Kuba Szczodrzyński
fef69da3cc Delete unused MaterialDrawer module 2019-09-29 20:18:21 +02:00
Kuba Szczodrzyński
783734bf9e [API/Vulcan] Make Grade's added date include exact time 2019-09-29 20:14:11 +02:00
Kuba Szczodrzyński
4d8f43dde4 Update .gitignore and proguard config 2019-09-29 20:11:21 +02:00
Kuba Szczodrzyński
982a12b5c1 [Misc] IDEA configs and unnecessary files. 2019-09-29 19:53:26 +02:00
Kacper Ziubryniewicz
fd034128e8 [Agenda] Add showing teachers absence time hours 2019-09-29 18:49:15 +02:00
Kacper Ziubryniewicz
fea51fc493 Merge branch 'feature/teacher-absence' into develop 2019-09-29 17:58:22 +02:00
Kacper Ziubryniewicz
d7b2369a32 [Agenda] Add showing teachers absence time 2019-09-29 17:57:10 +02:00
Kacper Ziubryniewicz
2c4e0e3121 [Agenda] Add teacher absence in event list dialog 2019-09-29 17:40:54 +02:00
Kuba Szczodrzyński
2ae6d2a4a0 [APIv2] Update LibrusTest 2019-09-29 17:22:44 +02:00
Kuba Szczodrzyński
0bf2026a64 [APIv2] Add API Service. Update other APIv2 components. Update Profile DAO 2019-09-29 17:19:38 +02:00
Kacper Ziubryniewicz
b17675ec0c Merge branch 'develop' into feature/teacher-absence 2019-09-29 16:09:38 +02:00
Kacper Ziubryniewicz
1a74c2a174 [API/Librus] Add syncing grade comments 2019-09-29 15:54:59 +02:00
Kacper Ziubryniewicz
07d4616974 [Homework] Optimize sorting using layout manager 2019-09-29 12:54:41 +02:00
Kacper Ziubryniewicz
8d86f9c7af [Homework/UI] Make better gaining attention on FAB 2019-09-29 12:44:20 +02:00
Kacper Ziubryniewicz
54b56768c1 [Homework] Fix homework sorting 2019-09-29 12:39:07 +02:00
Kacper Ziubryniewicz
c8f24611ba [Agenda] Add teachers absence dialog 2019-09-29 01:17:08 +02:00
Kacper Ziubryniewicz
0b0cd4c76e [Agenda] Add teachers absence counting as event 2019-09-29 00:07:29 +02:00
Kacper Ziubryniewicz
f4b997b41f [Api/Librus] Add syncing and saving teacher absence 2019-09-28 22:14:57 +02:00
Kacper Ziubryniewicz
ce0f2f74df Code structure reformat (#1)
Code structure reformat
2019-09-28 18:29:46 +02:00
Kacper Ziubryniewicz
7d136d9d77 [Structure] Change file names (remove Register before fragment names) 2019-09-28 15:56:07 +02:00
Kacper Ziubryniewicz
26c801ebee [Structure] Move daos and models to database modules 2019-09-28 15:17:03 +02:00
Kacper Ziubryniewicz
165a804ba9 [Structure] Move fragments, activities and adapters to specific modules 2019-09-28 14:37:05 +02:00
Kacper Ziubryniewicz
2d0f94a3a2 [API] Make grade categories synchronize without fullSync 2019-09-27 23:49:44 +02:00
Kacper Ziubryniewicz
eb9ec3e0de [UI/Translations] Make some small fixes and add more translations 2019-09-27 23:45:34 +02:00
Kacper Ziubryniewicz
b844914654 [UI] Refactor homework fragment and fix typos 2019-09-27 23:27:15 +02:00
Kuba Szczodrzyński
5edd4d5922 Add Chucker 2019-09-27 18:41:58 +02:00
Kuba Szczodrzyński
6b93ea25c6 Merge branch 'hotfix-3.0.3' into develop 2019-09-26 22:36:43 +02:00
Kuba Szczodrzyński
3a6087e421 Merge branch 'hotfix-3.0.3' 2019-09-26 22:36:28 +02:00
Kuba Szczodrzyński
518a8ea542 [3.0.3] Update build.gradle and changelog 2019-09-26 22:26:34 +02:00
Kuba Szczodrzyński
773b590d79 [API/Vulcan] Fix for null OddzialKod in students list. 2019-09-26 20:25:57 +02:00
Kuba Szczodrzyński
8a30c6c7ce [API/Vulcan] Fix messages mark-as-read. Fix sent messages & attendances sync. 2019-09-26 18:48:45 +02:00
Kuba Szczodrzyński
1bdafd489c [API/Vulcan] Add marking message as read in the e-register. 2019-09-25 22:37:44 +02:00
Kuba Szczodrzyński
9cc4da5fe9 [API/Vulcan] Temporarily try to fix attendances not syncing. 2019-09-25 22:26:28 +02:00
Kuba Szczodrzyński
33ca55401b [API/Vulcan] Swap grade category and description. 2019-09-25 22:23:47 +02:00
Kuba Szczodrzyński
37e57d2f73 [API/Librus] Fix timetable with no HourFrom and HourTo. 2019-09-25 21:48:28 +02:00
Kuba Szczodrzyński
554097fc7d [API/Librus] Fix r() IndexOutOfBounds. Fix Descriptive grades NPE. 2019-09-25 21:40:03 +02:00
Kuba Szczodrzyński
2870931481 [APIv2/Librus] Update Librus Messages login method. 2019-09-25 21:28:04 +02:00
Kuba Szczodrzyński
0cea6af5b1 Merge branch 'hotfix-3.0.2' into develop 2019-09-25 18:49:09 +02:00
Kuba Szczodrzyński
3e6b0250d0 Merge branch 'hotfix-3.0.2' 2019-09-25 18:47:47 +02:00
Kuba Szczodrzyński
349bcc851d [3.0.2] Update build.gradle and changelog 2019-09-25 18:40:57 +02:00
Kuba Szczodrzyński
df52029a29 [API/Librus] Add Librus descriptive grades ("Bieżące oceny opisowe") support. 2019-09-24 21:45:49 +02:00
Kacper Ziubryniewicz
e344be0fa1 Add basic getting school free days in API 2019-09-24 21:00:47 +02:00
Kuba Szczodrzyński
4cbb573d17 [APIv2/Librus] Update Librus login methods. 2019-09-24 20:12:25 +02:00
Kuba Szczodrzyński
1a2b51f3f9 [3.0.2-rc.1] Update build.gradle and changelog 2019-09-23 22:07:34 +02:00
Kuba Szczodrzyński
9500ba52fd [UI] Fix status bar icon color in light theme, color&date picker dialogs crashing the app. 2019-09-23 21:53:04 +02:00
Kuba Szczodrzyński
18d9471a94 [UI] Fix web push activity QR scanner 2019-09-23 21:32:12 +02:00
Kuba Szczodrzyński
93b4c03b87 Remove older app version check 2019-09-23 21:26:29 +02:00
Kuba Szczodrzyński
e95d9ee514 [APIv2/Librus] Update Librus Synergia login method. Add Librus Messages login method. 2019-09-23 09:02:59 +02:00
Kuba Szczodrzyński
a785db4d47 [APIv2/Librus] Add Librus Synergia login method. Update structure and error handling. 2019-09-22 22:02:36 +02:00
Kuba Szczodrzyński
76d39ac623 [APIv2/Librus] Create Login methods, update API structure 2019-09-21 23:01:31 +02:00
Kuba Szczodrzyński
1bdee7857c Update Profile, remove older app version check 2019-09-21 23:00:15 +02:00
Kuba Szczodrzyński
9df9f50d01 3.0.1: Update build.gradle 2019-09-20 22:55:09 +02:00
Kuba Szczodrzyński
eab5fdacee Merge branch 'develop' 2019-09-20 22:50:15 +02:00
Kuba Szczodrzyński
a4db208dfd Merge branch 'hotfix-3.0.1' into develop 2019-09-20 22:47:54 +02:00
Kuba Szczodrzyński
8d9459804f Merge branch 'hotfix-3.0.1' 2019-09-20 22:47:00 +02:00
Kuba Szczodrzyński
d7a6c222f7 [API/Iuczniowie] Fix syncing grades without color 2019-09-20 22:41:51 +02:00
Kacper Ziubryniewicz
2eee9e77e3 [UI] Fix scrolling in web push activity 2019-09-20 21:14:58 +02:00
Kuba Szczodrzyński
1bdd13bf23 Remove unnecessary files. 2019-09-20 19:38:25 +02:00
Kuba Szczodrzyński
cd3b69b136 Remove unnecessary files. 2019-09-20 19:37:45 +02:00
Kuba Szczodrzyński
3827aeb9b4 APIv2: Update endpoints 2019-09-20 19:12:47 +02:00
Kuba Szczodrzyński
4b5c14cbd5 APIv2: Prepare schemes 2019-09-20 19:12:05 +02:00
Kuba Szczodrzyński
003ffa2251 APIv2: Create DataEndpoint 2019-09-19 11:23:48 +02:00
Kuba Szczodrzyński
e2d809cceb 3.0.1-rc.1: Update build.gradle and changelog 2019-09-19 11:04:59 +02:00
Kuba Szczodrzyński
b3fa342876 API/Mobidziennik: Fix grades empty subject issue, teacher names with trailing spaces 2019-09-19 10:55:41 +02:00
Kuba Szczodrzyński
dce4ef822b UI: Fix status bar/NavLib issues, temporarily 2019-09-19 10:29:10 +02:00
Kuba Szczodrzyński
d8afa47d2c API/Librus: Fix Classrooms NPE issue 2019-09-19 10:09:33 +02:00
1869 changed files with 101980 additions and 78585 deletions

BIN
.github/apk-badge.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
.github/google-play-badge.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
.github/readme-banner.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

2
.github/utils/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
__pycache__/

55
.github/utils/_get_password.py vendored Normal file
View File

@ -0,0 +1,55 @@
import base64
import secrets
from hashlib import sha256
from typing import Tuple
import mysql.connector as mysql
from Crypto.Cipher import AES
def get_password(
version_name: str,
version_code: int,
db_host: str,
db_user: str,
db_pass: str,
db_name: str,
) -> Tuple[str, bytes]:
db = mysql.connect(
host=db_host,
user=db_user,
password=db_pass,
database=db_name,
auth_plugin="mysql_native_password",
)
password = base64.b64encode(secrets.token_bytes(16)).decode()
iv = secrets.token_bytes(16)
key = f"{version_name}.{password}.{version_code}"
key = sha256(key.encode()).digest()
data = "ThisIsOurHardWorkPleaseDoNotCopyOrSteal(c)2019.KubaSz"
data = sha256(data.encode()).digest()
data = data + (chr(16) * 16).encode()
aes = AES.new(key=key, mode=AES.MODE_CBC, iv=iv)
app_password = base64.b64encode(aes.encrypt(data)).decode()
c = db.cursor()
c.execute(
"INSERT IGNORE INTO _appPasswords (versionCode, appPassword, password, iv) VALUES (%s, %s, %s, %s);",
(version_code, app_password, password, iv),
)
db.commit()
c = db.cursor()
c.execute(
"SELECT password, iv FROM _appPasswords WHERE versionCode = %s;",
(version_code,),
)
row = c.fetchone()
db.close()
return (row[0], row[1])

144
.github/utils/_utils.py vendored Normal file
View File

@ -0,0 +1,144 @@
import re
import subprocess
import sys
from datetime import datetime
from typing import Tuple
VERSION_NAME_REGEX = r'versionName: "(.+?)"'
VERSION_CODE_REGEX = r"versionCode: ([0-9]+)"
VERSION_NAME_FORMAT = 'versionName: "{}"'
VERSION_CODE_FORMAT = "versionCode: {}"
def get_project_dir() -> str:
project_dir = sys.argv[1]
if project_dir[-1:] == "/" or project_dir[-1:] == "\\":
project_dir = project_dir[:-1]
return project_dir
def read_gradle_version(project_dir: str) -> Tuple[int, str]:
GRADLE_PATH = f"{project_dir}/build.gradle"
with open(GRADLE_PATH, "r") as f:
gradle = f.read()
version_name = re.search(VERSION_NAME_REGEX, gradle).group(1)
version_code = int(re.search(VERSION_CODE_REGEX, gradle).group(1))
return (version_code, version_name)
def write_gradle_version(project_dir: str, version_code: int, version_name: str):
GRADLE_PATH = f"{project_dir}/build.gradle"
with open(GRADLE_PATH, "r") as f:
gradle = f.read()
gradle = re.sub(
VERSION_NAME_REGEX, VERSION_NAME_FORMAT.format(version_name), gradle
)
gradle = re.sub(
VERSION_CODE_REGEX, VERSION_CODE_FORMAT.format(version_code), gradle
)
with open(GRADLE_PATH, "w") as f:
f.write(gradle)
def build_version_code(version_name: str) -> int:
version = version_name.split("+")[0].split("-")
version_base = version[0]
version_suffix = version[1] if len(version) == 2 else ""
base_parts = version_base.split(".")
major = int(base_parts[0]) or 0
minor = int(base_parts[1]) if len(base_parts) > 1 else 0
patch = int(base_parts[2]) if len(base_parts) > 2 else 0
beta = 9
rc = 9
if "dev" in version_suffix:
beta = 0
rc = 0
elif "beta." in version_suffix:
beta = int(version_suffix.split(".")[1])
rc = 0
elif "rc." in version_suffix:
beta = 0
rc = int(version_suffix.split(".")[1])
version_code = beta + rc * 10 + patch * 100 + minor * 10000 + major * 1000000
return version_code
def get_changelog(project_dir: str, format: str) -> Tuple[str, str]:
with open(
f"{project_dir}/app/src/main/assets/pl-changelog.html", "r", encoding="utf-8"
) as f:
changelog = f.read()
title = re.search(r"<h3>(.+?)</h3>", changelog).group(1)
content = re.search(r"(?s)<ul>(.+)</ul>", changelog).group(1).strip()
content = "\n".join(line.strip() for line in content.split("\n"))
if format != "html":
content = content.replace("<li>", "- ")
content = content.replace("<br>", "\n")
if format == "markdown":
content = re.sub(r"<u>(.+?)</u>", "__\\1__", content)
content = re.sub(r"<i>(.+?)</i>", "*\\1*", content)
content = re.sub(r"<b>(.+?)</b>", "**\\1**", content)
content = re.sub(r"</?.+?>", "", content)
return (title, content)
def get_commit_log(project_dir: str, format: str, max_lines: int = None) -> str:
last_tag = (
subprocess.check_output("git describe --tags --abbrev=0".split(" "))
.decode()
.strip()
)
log = subprocess.run(
args=f"git log {last_tag}..HEAD --format=%an%x00%at%x00%h%x00%s%x00%D".split(
" "
),
cwd=project_dir,
stdout=subprocess.PIPE,
)
log = log.stdout.strip().decode()
commits = [line.split("\x00") for line in log.split("\n")]
if max_lines:
commits = commits[:max_lines]
output = []
valid = False
for commit in commits:
if not commit[0]:
continue
if "origin/" in commit[4]:
valid = True
if not valid:
continue
date = datetime.fromtimestamp(float(commit[1]))
date = date.strftime("%Y-%m-%d %H:%M:%S")
if format == "html":
output.append(f"<li>{commit[3]} <i> - {commit[0]}</i></li>")
elif format == "markdown":
output.append(f"[{date}] {commit[0]}\n {commit[3]}")
elif format == "markdown_full":
output.append(
f"_[{date}] {commit[0]}_\n` `__`{commit[2]}`__ **{commit[3]}**"
)
elif format == "plain":
output.append(f"- {commit[3]}")
if format == "markdown":
output.insert(0, "```")
output.append("```")
return "\n".join(output)

48
.github/utils/bump_nightly.py vendored Normal file
View File

@ -0,0 +1,48 @@
import re
import sys
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
from _utils import (
get_commit_log,
get_project_dir,
read_gradle_version,
write_gradle_version,
)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: bump_nightly.py <project dir>")
exit(-1)
project_dir = get_project_dir()
(version_code, version_name) = read_gradle_version(project_dir)
version_name = version_name.split("+")[0]
date = datetime.now(tz=ZoneInfo("Europe/Warsaw"))
if date.hour > 6:
version_name += "+daily." + date.strftime("%Y%m%d-%H%M")
else:
date -= timedelta(days=1)
version_name += "+nightly." + date.strftime("%Y%m%d")
print("appVersionName=" + version_name)
print("appVersionCode=" + str(version_code))
write_gradle_version(project_dir, version_code, version_name)
commit_log = get_commit_log(project_dir, format="html", max_lines=10)
with open(
f"{project_dir}/app/src/main/assets/pl-changelog.html", "r", encoding="utf-8"
) as f:
changelog = f.read()
changelog = re.sub(r"<h3>(.+?)</h3>", f"<h3>{version_name}</h3>", changelog)
changelog = re.sub(r"(?s)<ul>(.+)</ul>", f"<ul>\n{commit_log}\n</ul>", changelog)
with open(
f"{project_dir}/app/src/main/assets/pl-changelog.html", "w", encoding="utf-8"
) as f:
f.write(changelog)

41
.github/utils/bump_version.py vendored Normal file
View File

@ -0,0 +1,41 @@
import os
from dotenv import load_dotenv
from _get_password import get_password
from _utils import build_version_code, write_gradle_version
from sign import sign
if __name__ == "__main__":
version_name = input("Enter version name: ")
version_code = build_version_code(version_name)
print(f"Bumping version to {version_name} ({version_code})")
project_dir = "../.."
load_dotenv()
DB_HOST = os.getenv("DB_HOST")
DB_USER = os.getenv("DB_USER")
DB_PASS = os.getenv("DB_PASS")
DB_NAME = os.getenv("DB_NAME")
write_gradle_version(project_dir, version_code, version_name)
(password, iv) = get_password(
version_name, version_code, DB_HOST, DB_USER, DB_PASS, DB_NAME
)
sign(project_dir, version_name, version_code, password, iv, commit=False)
print("Writing mock passwords")
os.chdir(project_dir)
os.system(
"sed -i -E 's/\/\*([0-9a-f]{2} ?){16}\*\//\/*secret password - removed for source code publication*\//g' app/src/main/cpp/szkolny-signing.cpp"
)
os.system(
"sed -i -E 's/\\t0x.., 0x(.)., 0x.(.), 0x.(.), 0x.., 0x.., 0x.., 0x.(.), 0x.., 0x.(.), 0x(.)., 0x(.)., 0x.., 0x.., 0x.., 0x.(.)/\\t0x\\3\\6, 0x\\7\\4, 0x\\1\\8, 0x\\2\\5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff /g' app/src/main/cpp/szkolny-signing.cpp"
)
os.system(
"sed -i -E 's/param1\..(.).(.).(.).(.)..(.)..(.)..(.)..(.).../param1.MTIzNDU2Nzg5MD\\5\\2\\7\\6\\1\\3\\4\8==/g' app/src/main/java/pl/szczodrzynski/edziennik/data/api/szkolny/interceptor/Signing.kt"
)
input("Press any key to finish")

23
.github/utils/check_nightly.py vendored Normal file
View File

@ -0,0 +1,23 @@
import json
import os
import requests
if __name__ == "__main__":
repo = os.getenv("GITHUB_REPOSITORY")
sha = os.getenv("GITHUB_SHA")
if not repo or not sha:
print("Missing GitHub environment variables.")
exit(-1)
with requests.get(
f"https://api.github.com/repos/{repo}/actions/runs?per_page=5&status=success"
) as r:
data = json.loads(r.text)
runs = [run for run in data["workflow_runs"] if run["head_sha"] == sha]
if runs:
print("hasNewChanges=false")
exit(0)
print("hasNewChanges=true")

71
.github/utils/extract_changelogs.py vendored Normal file
View File

@ -0,0 +1,71 @@
import os
import sys
from _utils import get_changelog, get_commit_log, get_project_dir, read_gradle_version
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: extract_changelogs.py <project dir>")
exit(-1)
project_dir = get_project_dir()
(version_code, version_name) = read_gradle_version(project_dir)
print("appVersionName=" + version_name)
print("appVersionCode=" + str(version_code))
dir = f"{project_dir}/app/release/whatsnew-{version_name}/"
os.makedirs(dir, exist_ok=True)
print("changelogDir=" + dir)
(title, changelog) = get_changelog(project_dir, format="plain")
# plain text changelog - Firebase App Distribution
with open(dir + "whatsnew_titled.txt", "w", encoding="utf-8") as f:
f.write(title)
f.write("\n")
f.write(changelog)
print("changelogPlainTitledFile=" + dir + "whatsnew_titled.txt")
print("changelogTitle=" + title)
# plain text changelog, max 500 chars - Google Play
with open(dir + "whatsnew-pl-PL", "w", encoding="utf-8") as f:
changelog_lines = changelog.split("\n")
changelog = ""
for line in changelog_lines:
if len(changelog) + len(line) < 500:
changelog += "\n" + line
changelog = changelog.strip()
f.write(changelog)
print("changelogPlainFile=" + dir + "whatsnew-pl-PL")
# markdown changelog - Discord webhook
(_, changelog) = get_changelog(project_dir, format="markdown")
with open(dir + "whatsnew.md", "w", encoding="utf-8") as f:
f.write(changelog)
print("changelogMarkdownFile=" + dir + "whatsnew.md")
# html changelog - version info in DB
(_, changelog) = get_changelog(project_dir, format="html")
with open(dir + "whatsnew.html", "w", encoding="utf-8") as f:
f.write(changelog)
print("changelogHtmlFile=" + dir + "whatsnew.html")
changelog = get_commit_log(project_dir, format="plain", max_lines=10)
with open(dir + "commit_log.txt", "w", encoding="utf-8") as f:
f.write(changelog)
print("commitLogPlainFile=" + dir + "commit_log.txt")
changelog = get_commit_log(project_dir, format="markdown", max_lines=10)
with open(dir + "commit_log.md", "w", encoding="utf-8") as f:
f.write(changelog)
print("commitLogMarkdownFile=" + dir + "commit_log.md")
changelog = get_commit_log(project_dir, format="html", max_lines=10)
with open(dir + "commit_log.html", "w", encoding="utf-8") as f:
f.write(changelog)
print("commitLogHtmlFile=" + dir + "commit_log.html")

26
.github/utils/find_artifacts.py vendored Normal file
View File

@ -0,0 +1,26 @@
import glob
import os
import sys
from _utils import get_project_dir
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: rename_artifacts.py <project dir>")
exit(-1)
project_dir = get_project_dir()
files = glob.glob(f"{project_dir}/app/release/*.*")
for file in files:
file_relative = file.replace(project_dir + "/", "")
if "-aligned.apk" in file:
os.unlink(file)
elif "-signed.apk" in file:
new_file = file.replace("-signed.apk", ".apk")
if os.path.isfile(new_file):
os.unlink(new_file)
os.rename(file, new_file)
elif ".apk" in file or ".aab" in file:
print("signedReleaseFile=" + file)
print("signedReleaseFileRelative=" + file_relative)

141
.github/utils/save_version.py vendored Normal file
View File

@ -0,0 +1,141 @@
import glob
import os
import sys
from datetime import datetime
from time import time
from zoneinfo import ZoneInfo
import mysql.connector as mysql
from dotenv import load_dotenv
from _utils import get_changelog, get_commit_log, get_project_dir, read_gradle_version
def save_version(
project_dir: str,
db_host: str,
db_user: str,
db_pass: str,
db_name: str,
apk_server_release: str,
apk_server_nightly: str,
):
db = mysql.connect(
host=db_host,
user=db_user,
password=db_pass,
database=db_name,
auth_plugin="mysql_native_password",
)
(version_code, version_name) = read_gradle_version(project_dir)
(_, changelog) = get_changelog(project_dir, format="html")
types = ["dev", "beta", "nightly", "daily", "rc", "release"]
build_type = [x for x in types if x in version_name]
build_type = build_type[0] if build_type else "release"
if "+nightly." in version_name or "+daily." in version_name:
changelog = get_commit_log(project_dir, format="html")
build_type = "nightly"
elif "-dev" in version_name:
build_type = "dev"
elif "-beta." in version_name:
build_type = "beta"
elif "-rc." in version_name:
build_type = "rc"
build_date = int(time())
apk_name = None
bundle_name_play = None
files = glob.glob(f"{project_dir}/app/release/*.*")
output_apk = f"Edziennik_{version_name}_official.apk"
output_aab_play = f"Edziennik_{version_name}_play.aab"
for file in files:
if output_apk in file:
build_date = int(os.stat(file).st_mtime)
apk_name = output_apk
if output_aab_play in file:
build_date = int(os.stat(file).st_mtime)
bundle_name_play = output_aab_play
build_date = datetime.fromtimestamp(
build_date,
tz=ZoneInfo("Europe/Warsaw"),
).strftime("%Y-%m-%d %H:%M:%S")
if build_type in ["nightly", "daily"]:
download_url = apk_server_nightly + apk_name if apk_name else None
else:
# download_url = apk_server_release + apk_name if apk_name else None
download_url = (
f"https://github.com/szkolny-eu/szkolny-android/releases/download/v{version_name}/{apk_name}"
if apk_name
else None
)
if download_url:
print("downloadUrl=" + download_url)
cols = [
"versionCode",
"versionName",
"releaseDate",
"releaseNotes",
"releaseType",
"downloadUrl",
"apkName",
"bundleNamePlay",
]
updated = {
"versionCode": version_code,
"downloadUrl": download_url,
"apkName": apk_name,
"bundleNamePlay": bundle_name_play,
}
values = [
version_code,
version_name,
build_date,
changelog,
build_type,
download_url,
apk_name,
bundle_name_play,
]
values.extend(val for val in updated.values() if val)
updated = ", ".join(f"{col} = %s" for (col, val) in updated.items() if val)
sql = f"INSERT INTO updates ({', '.join(cols)}) VALUES ({'%s, ' * (len(cols) - 1)}%s) ON DUPLICATE KEY UPDATE {updated};"
c = db.cursor()
c.execute(sql, tuple(values))
db.commit()
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: save_version.py <project dir>")
exit(-1)
project_dir = get_project_dir()
load_dotenv()
DB_HOST = os.getenv("DB_HOST")
DB_USER = os.getenv("DB_USER")
DB_PASS = os.getenv("DB_PASS")
DB_NAME = os.getenv("DB_NAME")
APK_SERVER_RELEASE = os.getenv("APK_SERVER_RELEASE")
APK_SERVER_NIGHTLY = os.getenv("APK_SERVER_NIGHTLY")
save_version(
project_dir,
DB_HOST,
DB_USER,
DB_PASS,
DB_NAME,
APK_SERVER_RELEASE,
APK_SERVER_NIGHTLY,
)

82
.github/utils/sign.py vendored Normal file
View File

@ -0,0 +1,82 @@
import os
import re
import sys
from dotenv import load_dotenv
from _get_password import get_password
from _utils import get_project_dir, read_gradle_version
def sign(
project_dir: str,
version_name: str,
version_code: int,
password: str,
iv: bytes,
commit: bool = False,
):
SIGNING_PATH = f"{project_dir}/app/src/main/java/pl/szczodrzynski/edziennik/data/api/szkolny/interceptor/Signing.kt"
CPP_PATH = f"{project_dir}/app/src/main/cpp/szkolny-signing.cpp"
with open(SIGNING_PATH, "r") as f:
signing = f.read()
with open(CPP_PATH, "r") as f:
cpp = f.read()
SIGNING_REGEX = r"\$param1\..*\.\$param2"
CPP_REGEX = r"(?s)/\*.+?toys AES_IV\[16\] = {.+?};"
SIGNING_FORMAT = "$param1.{}.$param2"
CPP_FORMAT = "/*{}*/\nstatic toys AES_IV[16] = {{\n\t{} }};"
iv_hex = " ".join(["{:02x}".format(x) for x in iv])
iv_cpp = ", ".join(["0x{:02x}".format(x) for x in iv])
signing = re.sub(SIGNING_REGEX, SIGNING_FORMAT.format(password), signing)
cpp = re.sub(CPP_REGEX, CPP_FORMAT.format(iv_hex, iv_cpp), cpp)
with open(SIGNING_PATH, "w") as f:
f.write(signing)
with open(CPP_PATH, "w") as f:
f.write(cpp)
if commit:
os.chdir(project_dir)
os.system("git add .")
os.system(
f'git commit -m "[{version_name}] Update build.gradle, signing and changelog."'
)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: sign.py <project dir> [commit]")
exit(-1)
project_dir = get_project_dir()
load_dotenv()
DB_HOST = os.getenv("DB_HOST")
DB_USER = os.getenv("DB_USER")
DB_PASS = os.getenv("DB_PASS")
DB_NAME = os.getenv("DB_NAME")
(version_code, version_name) = read_gradle_version(project_dir)
(password, iv) = get_password(
version_name, version_code, DB_HOST, DB_USER, DB_PASS, DB_NAME
)
print("appVersionName=" + version_name)
print("appVersionCode=" + str(version_code))
sign(
project_dir,
version_name,
version_code,
password,
iv,
commit="commit" in sys.argv,
)

119
.github/utils/webhook_discord.py vendored Normal file
View File

@ -0,0 +1,119 @@
import os
import sys
from datetime import datetime
from zoneinfo import ZoneInfo
import requests
from dotenv import load_dotenv
from _utils import get_changelog, get_commit_log, get_project_dir, read_gradle_version
def post_webhook(
project_dir: str,
apk_file: str,
download_url: str,
webhook_release: str,
webhook_testing: str,
):
(_, version_name) = read_gradle_version(project_dir)
types = ["dev", "beta", "nightly", "daily", "rc", "release"]
build_type = [x for x in types if x in version_name]
build_type = build_type[0] if build_type else None
testing = ["dev", "beta", "nightly", "daily"]
testing = build_type in testing
if testing:
build_date = int(os.stat(apk_file).st_mtime)
if build_date:
build_date = datetime.fromtimestamp(
build_date,
tz=ZoneInfo("Europe/Warsaw"),
).strftime("%Y-%m-%d %H:%M")
# untagged release, get commit log
if build_type in ["nightly", "daily"]:
changelog = get_commit_log(project_dir, format="markdown", max_lines=5)
else:
changelog = get_changelog(project_dir, format="markdown")
webhook = get_webhook_testing(
version_name, build_type, changelog, download_url, build_date
)
requests.post(url=webhook_testing, json=webhook)
else:
changelog = get_changelog(project_dir, format="markdown")
webhook = get_webhook_release(version_name, changelog, download_url)
requests.post(url=webhook_release, json=webhook)
def get_webhook_release(version_name: str, changelog: str, download_url: str):
(title, content) = changelog
return {
"content": (
f"__**{title}**__\n{content}\n[Szkolny.eu {version_name}]({download_url})"
),
}
def get_webhook_testing(
version_name: str,
build_type: str,
changelog: str,
download_url: str,
build_date: str,
):
return {
"embeds": [
{
"title": f"Nowa wersja {build_type} aplikacji Szkolny.eu",
"description": f"Dostępna jest nowa wersja testowa **{build_type}**.",
"color": 2201331,
"fields": [
{
"name": f"Wersja `{version_name}`",
"value": (
f"[Pobierz .APK]({download_url})"
if download_url
else "*Pobieranie niedostępne*"
),
"inline": False,
},
{
"name": "Data kompilacji",
"value": build_date or "-",
"inline": False,
},
{
"name": "Ostatnie zmiany",
"value": changelog or "-",
"inline": False,
},
],
}
]
}
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: webhook_discord.py <project dir>")
exit(-1)
project_dir = get_project_dir()
load_dotenv()
APK_FILE = os.getenv("APK_FILE")
DOWNLOAD_URL = os.getenv("DOWNLOAD_URL")
WEBHOOK_RELEASE = os.getenv("WEBHOOK_RELEASE")
WEBHOOK_TESTING = os.getenv("WEBHOOK_TESTING")
post_webhook(
project_dir,
APK_FILE,
DOWNLOAD_URL,
WEBHOOK_RELEASE,
WEBHOOK_TESTING,
)

195
.github/workflows/_build.yml vendored Normal file
View File

@ -0,0 +1,195 @@
name: "[reusable] Szkolny.eu Build"
on:
workflow_call:
inputs:
nightly:
type: boolean
default: false
build-apk:
type: boolean
default: false
build-aab:
type: boolean
default: false
release-ssh:
type: boolean
default: false
release-github:
type: boolean
default: false
release-firebase:
type: boolean
default: false
release-google-play:
type: boolean
default: false
release-discord:
type: boolean
default: false
secrets:
APK_SERVER_NIGHTLY:
APK_SERVER_RELEASE:
DB_HOST:
DB_NAME:
DB_PASS:
DB_USER:
FIREBASE_APP_ID:
FIREBASE_GROUPS_NIGHTLY:
FIREBASE_GROUPS_RELEASE:
FIREBASE_SERVICE_ACCOUNT_JSON:
KEY_ALIAS_PASSWORD:
KEY_ALIAS:
KEY_STORE_PASSWORD:
KEY_STORE:
PLAY_RELEASE_TRACK:
PLAY_SERVICE_ACCOUNT_JSON:
SSH_IP:
SSH_KEY:
SSH_PATH_NIGHTLY:
SSH_PATH_RELEASE:
SSH_USERNAME:
WEBHOOK_RELEASE:
WEBHOOK_TESTING:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
clean: false
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Python
uses: actions/setup-python@v4
- name: Install Python packages
uses: BSFishy/pip-action@v1
with:
packages: |
python-dotenv
pycryptodome
mysql-connector-python
requests
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Bump nightly version
if: ${{ inputs.nightly }}
run: python $GITHUB_WORKSPACE/.github/utils/bump_nightly.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
- name: Write signing passwords and keystore
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASS: ${{ secrets.DB_PASS }}
DB_NAME: ${{ secrets.DB_NAME }}
KEY_STORE: ${{ secrets.KEY_STORE }}
run: |
python $GITHUB_WORKSPACE/.github/utils/sign.py $GITHUB_WORKSPACE commit >> $GITHUB_OUTPUT
echo $KEY_STORE | base64 --decode > keystore.jks
- name: Clean build artifacts
run: |
rm -rf app/release/*
rm -rf app/build/outputs/apk/*
rm -rf app/build/outputs/bundle/*
- name: Build app with Gradle
if: ${{ inputs.build-apk || inputs.build-aab }}
run: |
chmod +x ./gradlew
./gradlew \
${{ inputs.build-apk && 'assembleOfficialRelease' || '' }} \
${{ inputs.build-aab && 'bundlePlayRelease' || '' }} \
-P android.injected.signing.store.file=${{ github.workspace }}/keystore.jks \
-P android.injected.signing.store.password=${{ secrets.KEY_STORE_PASSWORD }} \
-P android.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} \
-P android.injected.signing.key.password=${{ secrets.KEY_ALIAS_PASSWORD }}
- name: Upload release to server
if: ${{ inputs.release-ssh }}
uses: easingthemes/ssh-deploy@v2.1.6
env:
REMOTE_HOST: ${{ secrets.SSH_IP }}
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
SOURCE: app/release/
TARGET: ${{ inputs.nightly && secrets.SSH_PATH_NIGHTLY || secrets.SSH_PATH_RELEASE }}
- name: Find signed artifacts
id: artifacts
run: python $GITHUB_WORKSPACE/.github/utils/find_artifacts.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
- name: Extract release changelogs
id: changelog
run: python $GITHUB_WORKSPACE/.github/utils/extract_changelogs.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
- name: Save version to database
id: save
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASS: ${{ secrets.DB_PASS }}
DB_NAME: ${{ secrets.DB_NAME }}
APK_SERVER_RELEASE: ${{ secrets.APK_SERVER_RELEASE }}
APK_SERVER_NIGHTLY: ${{ secrets.APK_SERVER_NIGHTLY }}
run: python $GITHUB_WORKSPACE/.github/utils/save_version.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
- name: Release on GitHub
if: ${{ inputs.release-github }}
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.changelog.outputs.changelogTitle }}
body_path: ${{ steps.changelog.outputs.changelogMarkdownFile }}
files: ${{ steps.artifacts.outputs.signedReleaseFile }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Distribute to App Distribution
if: ${{ inputs.release-firebase }}
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
file: ${{ steps.artifacts.outputs.signedReleaseFile }}
groups: ${{ inputs.nightly && secrets.FIREBASE_GROUPS_NIGHTLY || secrets.FIREBASE_GROUPS_RELEASE }}
releaseNotesFile: ${{ inputs.nightly && steps.changelog.outputs.commitLogPlainFile || steps.changelog.outputs.changelogPlainTitledFile }}
- name: Publish AAB to Google Play
if: ${{ inputs.release-google-play }}
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
packageName: pl.szczodrzynski.edziennik
releaseFiles: ${{ steps.artifacts.outputs.signedReleaseFile }}
releaseName: ${{ steps.changelog.outputs.appVersionName }}
track: ${{ secrets.PLAY_RELEASE_TRACK }}
whatsNewDirectory: ${{ steps.changelog.outputs.changelogDir }}
status: completed
- name: Post Discord webhook
if: ${{ inputs.release-discord }}
env:
APK_FILE: ${{ steps.artifacts.outputs.signedReleaseFile }}
DOWNLOAD_URL: ${{ steps.save.outputs.downloadUrl }}
WEBHOOK_RELEASE: ${{ secrets.WEBHOOK_RELEASE }}
WEBHOOK_TESTING: ${{ secrets.WEBHOOK_TESTING }}
run: python $GITHUB_WORKSPACE/.github/utils/webhook_discord.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ steps.changelog.outputs.appVersionName }}
path: |
app/release/whatsnew*/
app/release/*.apk
app/release/*.aab
app/release/*.json
app/release/*.txt

13
.github/workflows/push-master.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: Push (master)
on:
push:
branches: ["master"]
jobs:
build:
name: Build for Google Play (AAB)
uses: szkolny-eu/szkolny-android/.github/workflows/_build.yml@develop
with:
build-aab: true
release-ssh: true
release-google-play: true
secrets: inherit

15
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Release
on:
push:
tags: ["v*.*.*"]
jobs:
build:
name: Build release (APK)
uses: szkolny-eu/szkolny-android/.github/workflows/_build.yml@develop
with:
build-apk: true
release-ssh: true
release-github: true
release-firebase: true
release-discord: true
secrets: inherit

42
.github/workflows/schedule-dispatch.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Schedule/dispatch
on:
schedule:
# 23:30 UTC, 0:30 or 1:30 CET/CEST
- cron: "30 23 * * *"
workflow_dispatch:
jobs:
check:
name: Check new changes
runs-on: ubuntu-latest
outputs:
hasNewChanges: ${{ steps.nightly.outputs.hasNewChanges }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
clean: false
- name: Setup Python
uses: actions/setup-python@v4
- name: Install packages
uses: BSFishy/pip-action@v1
with:
packages: |
requests
- name: Check new changes
id: nightly
run: python $GITHUB_WORKSPACE/.github/utils/check_nightly.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
build:
name: Build nightly release (APK)
needs:
- check
if: ${{ needs.check.outputs.hasNewChanges == 'true' }}
uses: szkolny-eu/szkolny-android/.github/workflows/_build.yml@develop
with:
nightly: true
build-apk: true
release-ssh: true
release-firebase: true
release-discord: true
secrets: inherit

194
.gitignore vendored
View File

@ -1,5 +1,11 @@
# Created by https://www.toptal.com/developers/gitignore/api/android,androidstudio,gradle,java,kotlin
# Edit at https://www.toptal.com/developers/gitignore?templates=android,androidstudio,gradle,java,kotlin
### Android ###
# Built application files
*.apk
*.aar
*.ap_
*.aab
@ -23,7 +29,7 @@ build/
local.properties
# Proguard folder generated by Eclipse
proguard/
# proguard/
# Log Files
*.log
@ -40,7 +46,7 @@ captures/
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
#.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
@ -50,11 +56,12 @@ captures/
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
*.jks
*.keystore
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
# google-services.json
@ -80,3 +87,182 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
### Android Patch ###
gen-external-apklibs
output-metadata.json
# Replacement of .externalNativeBuild directories introduced
# with Android Studio 3.5.
### Java ###
# Compiled class file
# Log file
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
!/*/libs/*.jar
### Kotlin ###
# Compiled class file
# Log file
# BlueJ files
# Mobile Tools for Java (J2ME)
# Package Files #
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
### Gradle ###
.gradle
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
**/build/
### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.
# Built application files
# Files for the ART/Dalvik VM
# Java class files
# Generated files
# Gradle files
# Signing files
.signing/
# Local configuration file (sdk path, etc)
# Proguard folder generated by Eclipse
# Log Files
# Android Studio
/*/build/
/*/local.properties
/*/out
/*/*/build
/*/*/production
*.ipr
*~
*.swp
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Android Patch
# External native build folder generated in Android Studio 2.2 and later
# NDK
obj/
# IntelliJ IDEA
*.iws
/out/
# User-specific configurations
.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/jarRepositories.xml
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Legacy Eclipse project files
.classpath
.project
.cproject
.settings/
# Mobile Tools for Java (J2ME)
# Package Files #
# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
## Plugin-specific files:
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Mongo Explorer plugin
.idea/mongoSettings.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### AndroidStudio Patch ###
!/gradle/wrapper/gradle-wrapper.jar
# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,gradle,java,kotlin
signatures/
.idea/*.xml

View File

@ -1,6 +1,35 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="LAYOUT_SETTINGS">
<value>
<option name="INSERT_LINE_BREAK_BEFORE_NAMESPACE_DECLARATION" value="true" />
</value>
</option>
<option name="MANIFEST_SETTINGS">
<value>
<option name="INSERT_LINE_BREAK_BEFORE_NAMESPACE_DECLARATION" value="true" />
</value>
</option>
<option name="OTHER_SETTINGS">
<value>
<option name="INSERT_LINE_BREAK_BEFORE_NAMESPACE_DECLARATION" value="true" />
</value>
</option>
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="ALLOW_TRAILING_COMMA" value="true" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="JSON">
<indentOptions>
<option name="INDENT_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
@ -112,5 +141,11 @@
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="PARAMETER_ANNOTATION_WRAP" value="2" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

6
.idea/copyright/Antoni.xml generated Normal file
View File

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (c) Antoni Czaplicki &amp;#36;{today.year}-&amp;#36;{today.month}-&amp;#36;{today.day}. " />
<option name="myName" value="Antoni" />
</copyright>
</component>

6
.idea/copyright/Kacper.xml generated Normal file
View File

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (c) Kacper Ziubryniewicz &amp;#36;{today.year}-&amp;#36;{today.month}-&amp;#36;{today.day}" />
<option name="myName" value="Kacper" />
</copyright>
</component>

6
.idea/copyright/kubasz.xml generated Normal file
View File

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (c) Kuba Szczodrzyński &amp;#36;{today.year}-&amp;#36;{today.month}-&amp;#36;{today.day}. " />
<option name="myName" value="kubasz" />
</copyright>
</component>

21
.idea/dictionaries/Kuba.xml generated Normal file
View File

@ -0,0 +1,21 @@
<component name="ProjectDictionaryState">
<dictionary name="Kuba">
<words>
<w>autoryzacji</w>
<w>ciasteczko</w>
<w>csrf</w>
<w>daynight</w>
<w>edziennik</w>
<w>eggfall</w>
<w>elearning</w>
<w>gson</w>
<w>hebe</w>
<w>idziennik</w>
<w>kuba</w>
<w>synergia</w>
<w>szczodrzyński</w>
<w>szkolny</w>
<w>usos</w>
</words>
</dictionary>
</component>

9
.idea/discord.xml generated
View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="true" />
</component>
<component name="ProjectNotificationSettings">
<option name="askShowProject" value="false" />
</component>
</project>

4
.idea/encodings.xml generated
View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

6
.idea/kotlinc.xml generated
View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
</project>

49
.idea/misc.xml generated
View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="androidx.annotation.RecentlyNonNull" />
<option name="myNullables">
<value>
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

621
LICENSE Normal file
View File

@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS

View File

@ -1,59 +0,0 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 6102
versionName "6.1.2"
resValue "string", "materialdrawer_lib_version", "6.1.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debugMinify {
debuggable = true
minifyEnabled = true
proguardFiles 'proguard-android.txt'
}
}
productFlavors {
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation "androidx.appcompat:appcompat:${androidXAppCompat}"
implementation "androidx.recyclerview:recyclerview:${androidXRecyclerView}"
implementation "androidx.annotation:annotation:1.0.2"
implementation "com.google.android.material:material:${googleMaterial}"
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
// add the constraintLayout used to create the items and headers
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
// used to base on some backwards compatible themes
// contains util classes to support various android versions, and clean up code
// comes with the awesome "Holder"-Pattern
// https://github.com/mikepenz/Materialize
api 'com.mikepenz:materialize:1.2.0'
// used to provide out of the box icon font support. simplifies development,
// and provides scalable icons. the core is very very light
// https://github.com/mikepenz/Android-Iconics
api "com.mikepenz:iconics-core:${iconics}"
// used to fill the RecyclerView with the DrawerItems
// and provides single and multi selection, expandable items
// https://github.com/mikepenz/FastAdapter
api 'com.mikepenz:fastadapter:3.3.0'
api 'com.mikepenz:fastadapter-extensions-expandable:3.3.0'
}

View File

@ -1,4 +0,0 @@
POM_NAME=MaterialDrawer Library
POM_DESCRIPTION=The flexible, easy to use, all in one drawer library for your Android project.
POM_ARTIFACT_ID=materialdrawer
POM_PACKAGING=aar

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.mikepenz.materialdrawer" />

View File

@ -1,455 +0,0 @@
package com.mikepenz.materialdrawer;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import pl.droidsonroids.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView;
import android.view.View;
import android.widget.ImageView;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Created by mikepenz on 27.02.15.
*/
public class AccountHeader {
protected final static double NAVIGATION_DRAWER_ACCOUNT_ASPECT_RATIO = 9d / 16d;
protected static final String BUNDLE_SELECTION_HEADER = "bundle_selection_header";
protected final AccountHeaderBuilder mAccountHeaderBuilder;
protected AccountHeader(AccountHeaderBuilder accountHeaderBuilder) {
this.mAccountHeaderBuilder = accountHeaderBuilder;
}
/**
* the protected getter for the AccountHeaderBuilder
*
* @return the AccountHeaderBuilder
*/
protected AccountHeaderBuilder getAccountHeaderBuilder() {
return mAccountHeaderBuilder;
}
/**
* Get the Root view for the Header
*
* @return
*/
public View getView() {
return mAccountHeaderBuilder.mAccountHeaderContainer;
}
/**
* Set the drawer for the AccountHeader so we can use it for the select
*
* @param drawer
*/
public void setDrawer(Drawer drawer) {
mAccountHeaderBuilder.mDrawer = drawer;
}
/**
* Returns the header background view so the dev can set everything on it
*
* @return
*/
public GifImageView getHeaderBackgroundView() {
return mAccountHeaderBuilder.mAccountHeaderBackground;
}
/**
* set the background for the header via the ImageHolder class
*
* @param imageHolder
*/
public void setHeaderBackground(ImageHolder imageHolder) {
ImageHolder.applyTo(imageHolder, mAccountHeaderBuilder.mAccountHeaderBackground);
}
/**
* Set the background for the Header
*
* @param headerBackground
*/
public void setBackground(Drawable headerBackground) {
mAccountHeaderBuilder.mAccountHeaderBackground.setImageDrawable(headerBackground);
}
/**
* set the background for the header as file name
*
* @param headerBackgroundPath
* @return
*/
public void setBackground(String headerBackgroundPath) {
try {
if (headerBackgroundPath.endsWith(".gif")) {
setHeaderBackground(new ImageHolder(new GifDrawable(headerBackgroundPath)));
}
else {
setHeaderBackground(new ImageHolder(Uri.parse(headerBackgroundPath)));
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Set the background for the Header as resource
*
* @param headerBackgroundRes
*/
public void setBackgroundRes(@DrawableRes int headerBackgroundRes) {
mAccountHeaderBuilder.mAccountHeaderBackground.setImageResource(headerBackgroundRes);
}
/**
* Toggle the selection list (show or hide it)
*
* @param ctx
*/
public void toggleSelectionList(Context ctx) {
mAccountHeaderBuilder.toggleSelectionList(ctx);
}
/**
* returns if the selection list is currently shown
*
* @return
*/
public boolean isSelectionListShown() {
return mAccountHeaderBuilder.mSelectionListShown;
}
/**
* set this to false if you want to hide the first line of the selection box in the header (first line would be the name)
*
* @param selectionFirstLineShown
*/
public void setSelectionFirstLineShown(boolean selectionFirstLineShown) {
mAccountHeaderBuilder.mSelectionFirstLineShown = selectionFirstLineShown;
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* set this to false if you want to hide the second line of the selection box in the header (second line would be the e-mail)
*
* @param selectionSecondLineShown
*/
public void setSelectionSecondLineShown(boolean selectionSecondLineShown) {
mAccountHeaderBuilder.mSelectionSecondLineShown = selectionSecondLineShown;
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* set this to define the first line in the selection area if there is no profile
* note this will block any values from profiles!
*
* @param selectionFirstLine
*/
public void setSelectionFirstLine(String selectionFirstLine) {
mAccountHeaderBuilder.mSelectionFirstLine = selectionFirstLine;
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* set this to define the second line in the selection area if there is no profile
* note this will block any values from profiles!
*
* @param selectionSecondLine
*/
public void setSelectionSecondLine(String selectionSecondLine) {
mAccountHeaderBuilder.mSelectionSecondLine = selectionSecondLine;
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* returns the current list of profiles set for this header
*
* @return
*/
public List<IProfile> getProfiles() {
return mAccountHeaderBuilder.mProfiles;
}
/**
* Set a new list of profiles for the header
*
* @param profiles
*/
public void setProfiles(List<IProfile> profiles) {
mAccountHeaderBuilder.mProfiles = profiles;
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* Selects the given profile and sets it to the new active profile
*
* @param profile
*/
public void setActiveProfile(IProfile profile) {
setActiveProfile(profile, false);
}
/**
* Selects the given profile and sets it to the new active profile
*
* @param profile
*/
public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) {
final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile);
//if the selectionList is shown we should also update the current selected profile in the list
if (mAccountHeaderBuilder.mDrawer != null && isSelectionListShown()) {
mAccountHeaderBuilder.mDrawer.setSelection(profile.getIdentifier(), false);
}
//fire the event if enabled and a listener is set
if (fireOnProfileChanged && mAccountHeaderBuilder.mOnAccountHeaderListener != null) {
mAccountHeaderBuilder.mOnAccountHeaderListener.onProfileChanged(null, profile, isCurrentSelectedProfile);
}
}
/**
* Selects a profile by its identifier
*
* @param identifier
*/
public void setActiveProfile(long identifier) {
setActiveProfile(identifier, false);
}
/**
* Selects a profile by its identifier
*
* @param identifier
*/
public void setActiveProfile(long identifier, boolean fireOnProfileChanged) {
if (mAccountHeaderBuilder.mProfiles != null) {
for (IProfile profile : mAccountHeaderBuilder.mProfiles) {
if (profile != null) {
if (profile.getIdentifier() == identifier) {
setActiveProfile(profile, fireOnProfileChanged);
return;
}
}
}
}
}
/**
* get the current active profile
*
* @return
*/
public IProfile getActiveProfile() {
return mAccountHeaderBuilder.mCurrentProfile;
}
/**
* Helper method to update a profile using it's identifier
*
* @param newProfile
*/
public void updateProfile(@NonNull IProfile newProfile) {
updateProfileByIdentifier(newProfile);
}
/**
* Helper method to update a profile using it's identifier
*
* @param newProfile
*/
@Deprecated
public void updateProfileByIdentifier(@NonNull IProfile newProfile) {
int found = getPositionByIdentifier(newProfile.getIdentifier());
if (found > -1) {
mAccountHeaderBuilder.mProfiles.set(found, newProfile);
mAccountHeaderBuilder.updateHeaderAndList();
}
}
/**
* Add new profiles to the existing list of profiles
*
* @param profiles
*/
public void addProfiles(@NonNull IProfile... profiles) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
Collections.addAll(mAccountHeaderBuilder.mProfiles, profiles);
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* Add a new profile at a specific position to the list
*
* @param profile
* @param position
*/
public void addProfile(@NonNull IProfile profile, int position) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
mAccountHeaderBuilder.mProfiles.add(position, profile);
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* remove a profile from the given position
*
* @param position
*/
public void removeProfile(int position) {
if (mAccountHeaderBuilder.mProfiles != null && mAccountHeaderBuilder.mProfiles.size() > position) {
mAccountHeaderBuilder.mProfiles.remove(position);
}
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* remove the profile with the given identifier
*
* @param identifier
*/
public void removeProfileByIdentifier(long identifier) {
int found = getPositionByIdentifier(identifier);
if (found > -1) {
mAccountHeaderBuilder.mProfiles.remove(found);
}
mAccountHeaderBuilder.updateHeaderAndList();
}
/**
* try to remove the given profile
*
* @param profile
*/
public void removeProfile(@NonNull IProfile profile) {
removeProfileByIdentifier(profile.getIdentifier());
}
/**
* Clear the header
*/
public void clear() {
mAccountHeaderBuilder.mProfiles = null;
//calculate the profiles to set
mAccountHeaderBuilder.calculateProfiles();
//process and build the profiles
mAccountHeaderBuilder.buildProfiles();
}
/**
* gets the position of a profile by it's identifier
*
* @param identifier
* @return
*/
private int getPositionByIdentifier(long identifier) {
int found = -1;
if (mAccountHeaderBuilder.mProfiles != null && identifier != -1) {
for (int i = 0; i < mAccountHeaderBuilder.mProfiles.size(); i++) {
if (mAccountHeaderBuilder.mProfiles.get(i) != null) {
if (mAccountHeaderBuilder.mProfiles.get(i).getIdentifier() == identifier) {
found = i;
break;
}
}
}
}
return found;
}
/**
* add the values to the bundle for saveInstanceState
*
* @param savedInstanceState
* @return
*/
public Bundle saveInstanceState(Bundle savedInstanceState) {
if (savedInstanceState != null) {
savedInstanceState.putInt(BUNDLE_SELECTION_HEADER, mAccountHeaderBuilder.getCurrentSelection());
}
return savedInstanceState;
}
public interface OnAccountHeaderListener {
/**
* the event when the profile changes
*
* @param view
* @param profile
* @return if the event was consumed
*/
boolean onProfileChanged(View view, IProfile profile, boolean current);
}
public interface OnAccountHeaderItemLongClickListener {
/**
* the event when the profile item is longClicked inside the list
*
* @param view
* @param profile
* @param current
* @return if the event was consumed
*/
boolean onProfileLongClick(View view, IProfile profile, boolean current);
}
public interface OnAccountHeaderProfileImageListener {
/**
* the event when the profile image is clicked
*
* @param view
* @param profile
* @return if the event was consumed
*/
boolean onProfileImageClick(View view, IProfile profile, boolean current);
/**
* the event when the profile image is long clicked
*
* @param view
* @param profile
* @return if the event was consumed
*/
boolean onProfileImageLongClick(View view, IProfile profile, boolean current);
}
public interface OnAccountHeaderSelectionViewClickListener {
/**
* the event when the user clicks the selection list under the profile icons
*
* @param view
* @param profile
* @return if the event was consumed
*/
boolean onClick(View view, IProfile profile);
}
}

View File

@ -1,447 +0,0 @@
package com.mikepenz.materialdrawer;
import android.content.Context;
import android.os.Build;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.mikepenz.materialdrawer.model.AbstractDrawerItem;
import com.mikepenz.materialdrawer.model.ContainerDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.Selectable;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
import androidx.drawerlayout.widget.DrawerLayout;
/**
* Created by mikepenz on 23.05.15.
*/
class DrawerUtils {
/**
* helper method to handle the onClick of the footer
*
* @param drawer
* @param drawerItem
* @param v
* @param fireOnClick true if we should call the listener, false if not, null to not call the listener and not close the drawer
*/
public static void onFooterDrawerItemClick(DrawerBuilder drawer, IDrawerItem drawerItem, View v, Boolean fireOnClick) {
boolean checkable = !(drawerItem != null && drawerItem instanceof Selectable && !drawerItem.isSelectable());
if (checkable) {
drawer.resetStickyFooterSelection();
v.setActivated(true);
v.setSelected(true);
//remove the selection in the list
drawer.getAdapter().deselect();
//find the position of the clicked footer item
if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) {
LinearLayout footer = (LinearLayout) drawer.mStickyFooterView;
for (int i = 0; i < footer.getChildCount(); i++) {
if (footer.getChildAt(i) == v) {
drawer.mCurrentStickyFooterSelection = i;
break;
}
}
}
}
if (fireOnClick != null) {
boolean consumed = false;
if (fireOnClick) {
if (drawerItem instanceof AbstractDrawerItem && ((AbstractDrawerItem) drawerItem).getOnDrawerItemClickListener() != null) {
consumed = ((AbstractDrawerItem) drawerItem).getOnDrawerItemClickListener().onItemClick(v, -1, drawerItem);
}
if (drawer.mOnDrawerItemClickListener != null) {
consumed = drawer.mOnDrawerItemClickListener.onItemClick(v, -1, drawerItem);
}
}
if (!consumed) {
//close the drawer after click
drawer.closeDrawerDelayed();
}
}
}
/**
* helper method to set the selection of the footer
*
* @param drawer
* @param position
* @param fireOnClick
*/
public static void setStickyFooterSelection(DrawerBuilder drawer, int position, Boolean fireOnClick) {
if (position > -1) {
if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) {
LinearLayout footer = (LinearLayout) drawer.mStickyFooterView;
if (drawer.mStickyFooterDivider) {
position = position + 1;
}
if (footer.getChildCount() > position && position >= 0) {
IDrawerItem drawerItem = (IDrawerItem) footer.getChildAt(position).getTag(R.id.material_drawer_item);
onFooterDrawerItemClick(drawer, drawerItem, footer.getChildAt(position), fireOnClick);
}
}
}
}
/**
* calculates the position of an drawerItem. searching by it's identifier
*
* @param identifier
* @return
*/
public static int getPositionByIdentifier(DrawerBuilder drawer, long identifier) {
if (identifier != -1) {
for (int i = 0; i < drawer.getAdapter().getItemCount(); i++) {
if (drawer.getAdapter().getItem(i).getIdentifier() == identifier) {
return i;
}
}
}
return -1;
}
/**
* gets the drawerItem with the specific identifier from a drawerItem list
*
* @param drawerItems
* @param identifier
* @return
*/
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, long identifier) {
if (identifier != -1) {
for (IDrawerItem drawerItem : drawerItems) {
if (drawerItem.getIdentifier() == identifier) {
return drawerItem;
}
}
}
return null;
}
/**
* gets the drawerItem by a defined tag from a drawerItem list
*
* @param drawerItems
* @param tag
* @return
*/
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, Object tag) {
if (tag != null) {
for (IDrawerItem drawerItem : drawerItems) {
if (tag.equals(drawerItem.getTag())) {
return drawerItem;
}
}
}
return null;
}
/**
* calculates the position of an drawerItem inside the footer. searching by it's identifier
*
* @param identifier
* @return
*/
public static int getStickyFooterPositionByIdentifier(DrawerBuilder drawer, long identifier) {
if (identifier != -1) {
if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) {
LinearLayout footer = (LinearLayout) drawer.mStickyFooterView;
int shadowOffset = 0;
for (int i = 0; i < footer.getChildCount(); i++) {
Object o = footer.getChildAt(i).getTag(R.id.material_drawer_item);
//count up the shadowOffset to return the correct position of the given item
if (o == null && drawer.mStickyFooterDivider) {
shadowOffset = shadowOffset + 1;
}
if (o != null && o instanceof IDrawerItem && ((IDrawerItem) o).getIdentifier() == identifier) {
return i - shadowOffset;
}
}
}
}
return -1;
}
/**
* helper method to handle the headerView
*
* @param drawer
*/
public static void handleHeaderView(DrawerBuilder drawer) {
//use the AccountHeader if set
if (drawer.mAccountHeader != null) {
if (drawer.mAccountHeaderSticky) {
drawer.mStickyHeaderView = drawer.mAccountHeader.getView();
} else {
drawer.mHeaderView = drawer.mAccountHeader.getView();
drawer.mHeaderDivider = drawer.mAccountHeader.mAccountHeaderBuilder.mDividerBelowHeader;
drawer.mHeaderPadding = drawer.mAccountHeader.mAccountHeaderBuilder.mPaddingBelowHeader;
}
}
//sticky header view
if (drawer.mStickyHeaderView != null) {
//add the sticky footer view and align it to the bottom
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, 1);
drawer.mStickyHeaderView.setId(R.id.material_drawer_sticky_header);
drawer.mSliderLayout.addView(drawer.mStickyHeaderView, 0, layoutParams);
//now align the recyclerView below the stickyFooterView ;)
RelativeLayout.LayoutParams layoutParamsListView = (RelativeLayout.LayoutParams) drawer.mRecyclerView.getLayoutParams();
layoutParamsListView.addRule(RelativeLayout.BELOW, R.id.material_drawer_sticky_header);
drawer.mRecyclerView.setLayoutParams(layoutParamsListView);
//set a background color or the elevation will not work
drawer.mStickyHeaderView.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(drawer.mActivity, R.attr.material_drawer_background, R.color.material_drawer_background));
if (drawer.mStickyHeaderShadow) {
//add a shadow
if (Build.VERSION.SDK_INT >= 21) {
drawer.mStickyHeaderView.setElevation(UIUtils.convertDpToPixel(4, drawer.mActivity));
} else {
View view = new View(drawer.mActivity);
view.setBackgroundResource(R.drawable.material_drawer_shadow_bottom);
drawer.mSliderLayout.addView(view, RelativeLayout.LayoutParams.MATCH_PARENT, (int) UIUtils.convertDpToPixel(4, drawer.mActivity));
//now align the shadow below the stickyHeader ;)
RelativeLayout.LayoutParams lps = (RelativeLayout.LayoutParams) view.getLayoutParams();
lps.addRule(RelativeLayout.BELOW, R.id.material_drawer_sticky_header);
view.setLayoutParams(lps);
}
}
//remove the padding of the recyclerView again we have the header on top of it
drawer.mRecyclerView.setPadding(0, 0, 0, 0);
}
// set the header (do this before the setAdapter because some devices will crash else
if (drawer.mHeaderView != null) {
if (drawer.mRecyclerView == null) {
throw new RuntimeException("can't use a headerView without a recyclerView");
}
if (drawer.mHeaderPadding) {
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withHeight(drawer.mHeiderHeight).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.TOP));
} else {
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withHeight(drawer.mHeiderHeight).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.NONE));
}
//set the padding on the top to 0
drawer.mRecyclerView.setPadding(drawer.mRecyclerView.getPaddingLeft(), 0, drawer.mRecyclerView.getPaddingRight(), drawer.mRecyclerView.getPaddingBottom());
}
}
/**
* small helper to rebuild the FooterView
*
* @param drawer
*/
public static void rebuildStickyFooterView(final DrawerBuilder drawer) {
if (drawer.mSliderLayout != null) {
if (drawer.mStickyFooterView != null) {
drawer.mStickyFooterView.removeAllViews();
//create the divider
if (drawer.mStickyFooterDivider) {
addStickyFooterDivider(drawer.mStickyFooterView.getContext(), drawer.mStickyFooterView);
}
//fill the footer with items
DrawerUtils.fillStickyDrawerItemFooter(drawer, drawer.mStickyFooterView, new View.OnClickListener() {
@Override
public void onClick(View v) {
IDrawerItem drawerItem = (IDrawerItem) v.getTag(R.id.material_drawer_item);
com.mikepenz.materialdrawer.DrawerUtils.onFooterDrawerItemClick(drawer, drawerItem, v, true);
}
});
drawer.mStickyFooterView.setVisibility(View.VISIBLE);
} else {
//there was no footer yet. now just create one
DrawerUtils.handleFooterView(drawer, new View.OnClickListener() {
@Override
public void onClick(View v) {
IDrawerItem drawerItem = (IDrawerItem) v.getTag(R.id.material_drawer_item);
DrawerUtils.onFooterDrawerItemClick(drawer, drawerItem, v, true);
}
});
}
setStickyFooterSelection(drawer, drawer.mCurrentStickyFooterSelection, false);
}
}
/**
* helper method to handle the footerView
*
* @param drawer
*/
public static void handleFooterView(DrawerBuilder drawer, View.OnClickListener onClickListener) {
Context ctx = drawer.mSliderLayout.getContext();
//use the StickyDrawerItems if set
if (drawer.mStickyDrawerItems != null && drawer.mStickyDrawerItems.size() > 0) {
drawer.mStickyFooterView = DrawerUtils.buildStickyDrawerItemFooter(ctx, drawer, onClickListener);
}
//sticky footer view
if (drawer.mStickyFooterView != null) {
//add the sticky footer view and align it to the bottom
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 1);
drawer.mStickyFooterView.setId(R.id.material_drawer_sticky_footer);
drawer.mSliderLayout.addView(drawer.mStickyFooterView, layoutParams);
if ((drawer.mTranslucentNavigationBar || drawer.mFullscreen) && Build.VERSION.SDK_INT >= 19) {
drawer.mStickyFooterView.setPadding(0, 0, 0, UIUtils.getNavigationBarHeight(ctx));
}
//now align the recyclerView above the stickyFooterView ;)
RelativeLayout.LayoutParams layoutParamsListView = (RelativeLayout.LayoutParams) drawer.mRecyclerView.getLayoutParams();
layoutParamsListView.addRule(RelativeLayout.ABOVE, R.id.material_drawer_sticky_footer);
drawer.mRecyclerView.setLayoutParams(layoutParamsListView);
//handle shadow on top of the sticky footer
if (drawer.mStickyFooterShadow) {
drawer.mStickyFooterShadowView = new View(ctx);
drawer.mStickyFooterShadowView.setBackgroundResource(R.drawable.material_drawer_shadow_top);
drawer.mSliderLayout.addView(drawer.mStickyFooterShadowView, RelativeLayout.LayoutParams.MATCH_PARENT, ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_sticky_footer_elevation));
//now align the shadow below the stickyHeader ;)
RelativeLayout.LayoutParams lps = (RelativeLayout.LayoutParams) drawer.mStickyFooterShadowView.getLayoutParams();
lps.addRule(RelativeLayout.ABOVE, R.id.material_drawer_sticky_footer);
drawer.mStickyFooterShadowView.setLayoutParams(lps);
}
//remove the padding of the recyclerView again we have the footer below it
drawer.mRecyclerView.setPadding(drawer.mRecyclerView.getPaddingLeft(), drawer.mRecyclerView.getPaddingTop(), drawer.mRecyclerView.getPaddingRight(), ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_padding));
}
// set the footer (do this before the setAdapter because some devices will crash else
if (drawer.mFooterView != null) {
if (drawer.mRecyclerView == null) {
throw new RuntimeException("can't use a footerView without a recyclerView");
}
if (drawer.mFooterDivider) {
drawer.getFooterAdapter().add(new ContainerDrawerItem().withView(drawer.mFooterView).withViewPosition(ContainerDrawerItem.Position.BOTTOM));
} else {
drawer.getFooterAdapter().add(new ContainerDrawerItem().withView(drawer.mFooterView).withViewPosition(ContainerDrawerItem.Position.NONE));
}
}
}
/**
* build the sticky footer item view
*
* @return
*/
public static ViewGroup buildStickyDrawerItemFooter(Context ctx, DrawerBuilder drawer, View.OnClickListener onClickListener) {
//create the container view
final LinearLayout linearLayout = new LinearLayout(ctx);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
linearLayout.setOrientation(LinearLayout.VERTICAL);
//set the background color to the drawer background color (if it has alpha the shadow won't be visible)
linearLayout.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_background, R.color.material_drawer_background));
//create the divider
if (drawer.mStickyFooterDivider) {
addStickyFooterDivider(ctx, linearLayout);
}
fillStickyDrawerItemFooter(drawer, linearLayout, onClickListener);
return linearLayout;
}
/**
* adds the shadow to the stickyFooter
*
* @param ctx
* @param footerView
*/
private static void addStickyFooterDivider(Context ctx, ViewGroup footerView) {
LinearLayout divider = new LinearLayout(ctx);
LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
divider.setMinimumHeight((int) UIUtils.convertDpToPixel(1, ctx));
divider.setOrientation(LinearLayout.VERTICAL);
divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider));
footerView.addView(divider, dividerParams);
}
/**
* helper method to fill the sticky footer with it's elements
*
* @param drawer
* @param container
* @param onClickListener
*/
public static void fillStickyDrawerItemFooter(DrawerBuilder drawer, ViewGroup container, View.OnClickListener onClickListener) {
//add all drawer items
for (IDrawerItem drawerItem : drawer.mStickyDrawerItems) {
View view = drawerItem.generateView(container.getContext(), container);
view.setTag(drawerItem);
if (drawerItem.isEnabled()) {
//UIUtils.setBackground(view, UIUtils.getSelectableBackground(container.getContext(), selected_color, drawerItem.isSelectedBackgroundAnimated()));
view.setOnClickListener(onClickListener);
}
container.addView(view);
//for android API 17 --> Padding not applied via xml
DrawerUIUtils.setDrawerVerticalPadding(view);
}
//and really. don't ask about this. it won't set the padding if i don't set the padding for the container
container.setPadding(0, 0, 0, 0);
}
/**
* helper to extend the layoutParams of the drawer
*
* @param params
* @return
*/
public static DrawerLayout.LayoutParams processDrawerLayoutParams(DrawerBuilder drawer, DrawerLayout.LayoutParams params) {
if (params != null) {
if (drawer.mDrawerGravity != null && (drawer.mDrawerGravity == Gravity.RIGHT || drawer.mDrawerGravity == Gravity.END)) {
params.rightMargin = 0;
if (Build.VERSION.SDK_INT >= 17) {
params.setMarginEnd(0);
}
params.leftMargin = drawer.mActivity.getResources().getDimensionPixelSize(R.dimen.material_drawer_margin);
if (Build.VERSION.SDK_INT >= 17) {
params.setMarginEnd(drawer.mActivity.getResources().getDimensionPixelSize(R.dimen.material_drawer_margin));
}
}
if (drawer.mDrawerWidth > -1) {
params.width = drawer.mDrawerWidth;
} else {
params.width = DrawerUIUtils.getOptimalDrawerWidth(drawer.mActivity);
}
}
return params;
}
}

View File

@ -1,544 +0,0 @@
package com.mikepenz.materialdrawer;
import android.content.Context;
import android.content.res.Configuration;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.mikepenz.fastadapter.FastAdapter;
import com.mikepenz.fastadapter.IAdapter;
import com.mikepenz.fastadapter.adapters.ItemAdapter;
import com.mikepenz.fastadapter.listeners.OnClickListener;
import com.mikepenz.fastadapter.listeners.OnLongClickListener;
import com.mikepenz.materialdrawer.interfaces.ICrossfader;
import com.mikepenz.materialdrawer.model.MiniDrawerItem;
import com.mikepenz.materialdrawer.model.MiniProfileDrawerItem;
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
import com.mikepenz.materialdrawer.model.ProfileDrawerItem;
import com.mikepenz.materialdrawer.model.SecondaryDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
/**
* Created by mikepenz on 15.07.15.
* Don't count this for real yet. it's just a quick try on creating a Gmail like panel
*/
public class MiniDrawer {
public static final int PROFILE = 1;
public static final int ITEM = 2;
private LinearLayout mContainer;
private RecyclerView mRecyclerView;
protected FastAdapter<IDrawerItem> mAdapter;
protected ItemAdapter<IDrawerItem> mItemAdapter;
private Drawer mDrawer;
/**
* Provide the Drawer which will be used as dataSource for the drawerItems
*
* @param drawer
* @return
*/
public MiniDrawer withDrawer(@NonNull Drawer drawer) {
this.mDrawer = drawer;
return this;
}
private AccountHeader mAccountHeader;
/**
* Provide the AccountHeader which will be used as the dataSource for the profiles
*
* @param accountHeader
* @return
*/
public MiniDrawer withAccountHeader(@NonNull AccountHeader accountHeader) {
this.mAccountHeader = accountHeader;
return this;
}
private ICrossfader mCrossFader;
/**
* Provide the Crossfader implementation which is used with this MiniDrawer
*
* @param crossFader
* @return
*/
public MiniDrawer withCrossFader(@NonNull ICrossfader crossFader) {
this.mCrossFader = crossFader;
return this;
}
private boolean mInnerShadow = false;
/**
* set to true if you want to show the innerShadow on the MiniDrawer
*
* @param innerShadow
* @return
*/
public MiniDrawer withInnerShadow(boolean innerShadow) {
this.mInnerShadow = innerShadow;
return this;
}
private boolean mInRTL = false;
/**
* set to true if you want the MiniDrawer in RTL mode
*
* @param inRTL
* @return
*/
public MiniDrawer withInRTL(boolean inRTL) {
this.mInRTL = inRTL;
return this;
}
private boolean mIncludeSecondaryDrawerItems = false;
/**
* set to true if you also want to display secondaryDrawerItems
*
* @param includeSecondaryDrawerItems
* @return
*/
public MiniDrawer withIncludeSecondaryDrawerItems(boolean includeSecondaryDrawerItems) {
this.mIncludeSecondaryDrawerItems = includeSecondaryDrawerItems;
return this;
}
private boolean mEnableSelectedMiniDrawerItemBackground = false;
/**
* set to true if you want to display the background for the miniDrawerItem
*
* @param enableSelectedMiniDrawerItemBackground
* @return
*/
public MiniDrawer withEnableSelectedMiniDrawerItemBackground(boolean enableSelectedMiniDrawerItemBackground) {
this.mEnableSelectedMiniDrawerItemBackground = enableSelectedMiniDrawerItemBackground;
return this;
}
private boolean mEnableProfileClick = true;
/**
* set to false if you do not want the profile image to toggle to the normal drawers profile selection
*
* @param enableProfileClick
* @return this
*/
public MiniDrawer withEnableProfileClick(boolean enableProfileClick) {
this.mEnableProfileClick = enableProfileClick;
return this;
}
private OnMiniDrawerItemClickListener mOnMiniDrawerItemClickListener;
/**
* Define the onMiniDrawerItemClickListener called before any logic in the MiniDrawer is run, allows you to intercept the default behavior
*
* @param onMiniDrawerItemClickListener
* @return this
*/
public MiniDrawer withOnMiniDrawerItemClickListener(OnMiniDrawerItemClickListener onMiniDrawerItemClickListener) {
this.mOnMiniDrawerItemClickListener = onMiniDrawerItemClickListener;
return this;
}
private OnClickListener<IDrawerItem> mOnMiniDrawerItemOnClickListener;
/**
* Define an onClickListener for the MiniDrawer item adapter. WARNING: this will completely overwrite the default behavior
* You may want to check the `OnMiniDrawerItemClickListener` (withOnMiniDrawerItemClickListener) which just hooks into the default behavior
*
* @param onMiniDrawerItemOnClickListener
* @return this
*/
public MiniDrawer withOnMiniDrawerItemOnClickListener(OnClickListener<IDrawerItem> onMiniDrawerItemOnClickListener) {
this.mOnMiniDrawerItemOnClickListener = onMiniDrawerItemOnClickListener;
return this;
}
private OnLongClickListener<IDrawerItem> mOnMiniDrawerItemLongClickListener;
/**
* Define an onLongClickListener for the MiniDrawer item adapter
*
* @param onMiniDrawerItemLongClickListener
* @return
*/
public MiniDrawer withOnMiniDrawerItemLongClickListener(OnLongClickListener<IDrawerItem> onMiniDrawerItemLongClickListener) {
this.mOnMiniDrawerItemLongClickListener = onMiniDrawerItemLongClickListener;
return this;
}
/**
* get the RecyclerView of this MiniDrawer
*
* @return
*/
public RecyclerView getRecyclerView() {
return mRecyclerView;
}
/**
* get the FastAdapter of this MiniDrawer
*
* @return
*/
public FastAdapter<IDrawerItem> getAdapter() {
return mAdapter;
}
/**
* get the ItemAdapter of this MiniDrawer
*
* @return
*/
public ItemAdapter<IDrawerItem> getItemAdapter() {
return mItemAdapter;
}
/**
* get the Drawer used to fill this MiniDrawer
*
* @return
*/
public Drawer getDrawer() {
return mDrawer;
}
/**
* get the AccountHeader used to fill the this MiniDrawer
*
* @return
*/
public AccountHeader getAccountHeader() {
return mAccountHeader;
}
/**
* get the Crossfader used for this MiniDrawer
*
* @return
*/
public ICrossfader getCrossFader() {
return mCrossFader;
}
/**
* the defined FastAdapter.OnClickListener which completely replaces the original behavior
*
* @return
*/
public OnClickListener getOnMiniDrawerItemOnClickListener() {
return mOnMiniDrawerItemOnClickListener;
}
/**
* @return
*/
public OnLongClickListener getOnMiniDrawerItemLongClickListener() {
return mOnMiniDrawerItemLongClickListener;
}
/**
* generates a MiniDrawerItem from a IDrawerItem
*
* @param drawerItem
* @return
*/
public IDrawerItem generateMiniDrawerItem(IDrawerItem drawerItem) {
if (drawerItem instanceof SecondaryDrawerItem) {
if (drawerItem.isExcludeFromMiniDrawer()) {
return null;
}
return mIncludeSecondaryDrawerItems ? new MiniDrawerItem((SecondaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground).withSelectedBackgroundAnimated(false) : null;
} else if (drawerItem instanceof PrimaryDrawerItem) {
if (drawerItem.isExcludeFromMiniDrawer()) {
return null;
}
return new MiniDrawerItem((PrimaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground).withSelectedBackgroundAnimated(false);
} else if (drawerItem instanceof ProfileDrawerItem) {
if (drawerItem.isExcludeFromMiniDrawer()) {
return null;
}
MiniProfileDrawerItem mpdi = new MiniProfileDrawerItem((ProfileDrawerItem) drawerItem);
mpdi.withEnabled(mEnableProfileClick);
return mpdi;
}
return null;
}
/**
* gets the type of a IDrawerItem
*
* @param drawerItem
* @return
*/
public int getMiniDrawerType(IDrawerItem drawerItem) {
if (drawerItem instanceof MiniProfileDrawerItem) {
return PROFILE;
} else if (drawerItem instanceof MiniDrawerItem) {
return ITEM;
}
return -1;
}
/**
* build the MiniDrawer
*
* @param ctx
* @return
*/
public View build(Context ctx) {
mContainer = new LinearLayout(ctx);
if (mInnerShadow) {
if (!mInRTL) {
mContainer.setBackgroundResource(R.drawable.material_drawer_shadow_left);
} else {
mContainer.setBackgroundResource(R.drawable.material_drawer_shadow_right);
}
}
//create and append recyclerView
mRecyclerView = new RecyclerView(ctx);
mContainer.addView(mRecyclerView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
//set the itemAnimator
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
//some style improvements on older devices
mRecyclerView.setFadingEdgeLength(0);
//set the drawing cache background to the same color as the slider to improve performance
//mRecyclerView.setDrawingCacheBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mActivity, R.attr.material_drawer_background, R.color.material_drawer_background));
mRecyclerView.setClipToPadding(false);
//additional stuff
mRecyclerView.setLayoutManager(new LinearLayoutManager(ctx));
//adapter
mItemAdapter = new ItemAdapter<>();
mAdapter = FastAdapter.with(mItemAdapter);
mAdapter.withSelectable(true);
mAdapter.withAllowDeselection(false);
mRecyclerView.setAdapter(mAdapter);
//if the activity with the drawer should be fullscreen add the padding for the statusbar
if (mDrawer != null && mDrawer.mDrawerBuilder != null && (mDrawer.mDrawerBuilder.mFullscreen || mDrawer.mDrawerBuilder.mTranslucentStatusBar)) {
mRecyclerView.setPadding(mRecyclerView.getPaddingLeft(), UIUtils.getStatusBarHeight(ctx), mRecyclerView.getPaddingRight(), mRecyclerView.getPaddingBottom());
}
//if the activity with the drawer should be fullscreen add the padding for the navigationBar
if (mDrawer != null && mDrawer.mDrawerBuilder != null && (mDrawer.mDrawerBuilder.mFullscreen || mDrawer.mDrawerBuilder.mTranslucentNavigationBar) && ctx.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
mRecyclerView.setPadding(mRecyclerView.getPaddingLeft(), mRecyclerView.getPaddingTop(), mRecyclerView.getPaddingRight(), UIUtils.getNavigationBarHeight(ctx));
}
//set the adapter with the items
createItems();
return mContainer;
}
/**
* call this method to trigger the onProfileClick on the MiniDrawer
*/
public void onProfileClick() {
//crossfade if we are cross faded
if (mCrossFader != null) {
if (mCrossFader.isCrossfaded()) {
mCrossFader.crossfade();
}
}
//update the current profile
if (mAccountHeader != null) {
IProfile profile = mAccountHeader.getActiveProfile();
if (profile instanceof IDrawerItem) {
mItemAdapter.set(0, generateMiniDrawerItem((IDrawerItem) profile));
}
}
}
/**
* call this method to trigger the onItemClick on the MiniDrawer
*
* @param selectedDrawerItem
* @return
*/
public boolean onItemClick(IDrawerItem selectedDrawerItem) {
//We only need to clear if the new item is selectable
if (selectedDrawerItem.isSelectable()) {
//crossfade if we are cross faded
if (mCrossFader != null) {
if (mCrossFader.isCrossfaded()) {
mCrossFader.crossfade();
}
}
//update everything
setSelection(selectedDrawerItem.getIdentifier());
return false;
} else {
return true;
}
}
/**
* set the selection of the MiniDrawer
*
* @param identifier the identifier of the item which should be selected (-1 for none)
*/
public void setSelection(long identifier) {
if (identifier == -1) {
mAdapter.deselect();
}
int count = mAdapter.getItemCount();
for (int i = 0; i < count; i++) {
IDrawerItem item = mAdapter.getItem(i);
if (item.getIdentifier() == identifier && !item.isSelected()) {
mAdapter.deselect();
mAdapter.select(i);
}
}
}
/**
* update a MiniDrawerItem (after updating the main Drawer) via its identifier
*
* @param identifier the identifier of the item which was updated
*/
public void updateItem(long identifier) {
if (mDrawer != null && mAdapter != null && mItemAdapter.getAdapterItems() != null && identifier != -1) {
IDrawerItem drawerItem = DrawerUtils.getDrawerItem(getDrawerItems(), identifier);
for (int i = 0; i < mItemAdapter.getAdapterItems().size(); i++) {
if (mItemAdapter.getAdapterItems().get(i).getIdentifier() == drawerItem.getIdentifier()) {
IDrawerItem miniDrawerItem = generateMiniDrawerItem(drawerItem);
if (miniDrawerItem != null) {
mItemAdapter.set(i, miniDrawerItem);
}
}
}
}
}
/**
* creates the items for the MiniDrawer
*/
public void createItems() {
mItemAdapter.clear();
int profileOffset = 0;
if (mAccountHeader != null && mAccountHeader.getAccountHeaderBuilder().mProfileImagesVisible) {
IProfile profile = mAccountHeader.getActiveProfile();
if (profile instanceof IDrawerItem) {
mItemAdapter.add(generateMiniDrawerItem((IDrawerItem) profile));
profileOffset = 1;
}
}
int select = -1;
if (mDrawer != null) {
if (getDrawerItems() != null) {
//migrate to miniDrawerItems
int length = getDrawerItems().size();
int position = 0;
for (int i = 0; i < length; i++) {
IDrawerItem miniDrawerItem = generateMiniDrawerItem(getDrawerItems().get(i));
if (miniDrawerItem != null) {
if (miniDrawerItem.isSelected()) {
select = position;
}
mItemAdapter.add(miniDrawerItem);
position = position + 1;
}
}
if (select >= 0) {
//+1 because of the profile
mAdapter.select(select + profileOffset);
}
}
}
//listener
if (mOnMiniDrawerItemOnClickListener != null) {
mAdapter.withOnClickListener(mOnMiniDrawerItemOnClickListener);
} else {
mAdapter.withOnClickListener(new OnClickListener<IDrawerItem>() {
@Override
public boolean onClick(View v, IAdapter<IDrawerItem> adapter, final IDrawerItem item, final int position) {
int type = getMiniDrawerType(item);
//if a listener is defined and we consume the event return
if (mOnMiniDrawerItemClickListener != null && mOnMiniDrawerItemClickListener.onItemClick(v, position, item, type)) {
return false;
}
if (type == ITEM) {
//fire the onClickListener also if the specific drawerItem is not Selectable
if (item.isSelectable()) {
//make sure we are on the original drawerItemList
if (mAccountHeader != null && mAccountHeader.isSelectionListShown()) {
mAccountHeader.toggleSelectionList(v.getContext());
}
IDrawerItem drawerItem = mDrawer.getDrawerItem(item.getIdentifier());
if (drawerItem != null && !drawerItem.isSelected()) {
//set the selection
mDrawer.setSelection(item, true);
}
} else if (mDrawer.getOnDrawerItemClickListener() != null) {
//get the original `DrawerItem` from the Drawer as this one will contain all information
mDrawer.getOnDrawerItemClickListener().onItemClick(v, position, DrawerUtils.getDrawerItem(getDrawerItems(), item.getIdentifier()));
}
} else if (type == PROFILE) {
if (mAccountHeader != null && !mAccountHeader.isSelectionListShown()) {
mAccountHeader.toggleSelectionList(v.getContext());
}
if (mCrossFader != null) {
mCrossFader.crossfade();
}
}
return false;
}
});
}
mAdapter.withOnLongClickListener(mOnMiniDrawerItemLongClickListener);
mRecyclerView.scrollToPosition(0);
}
/**
* returns always the original drawerItems and not the switched content
*
* @return
*/
private List<IDrawerItem> getDrawerItems() {
return mDrawer.getOriginalDrawerItems() != null ? mDrawer.getOriginalDrawerItems() : mDrawer.getDrawerItems();
}
public interface OnMiniDrawerItemClickListener {
/**
* @param view
* @param position
* @param drawerItem
* @param type either MiniDrawer.PROFILE or MiniDrawer.ITEM
* @return true if the event was consumed
*/
boolean onItemClick(View view, int position, IDrawerItem drawerItem, int type);
}
}

View File

@ -1,232 +0,0 @@
package com.mikepenz.materialdrawer.holder;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.widget.TextView;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.model.utils.BadgeDrawableBuilder;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.Dimension;
import androidx.annotation.DrawableRes;
import androidx.core.view.ViewCompat;
import static androidx.annotation.Dimension.DP;
import static androidx.annotation.Dimension.PX;
/**
* Class to allow defining a BadgeStyle for the `BadgeDrawerItem`
*/
public class BadgeStyle {
private int mGradientDrawable = R.drawable.material_drawer_badge;
private Drawable mBadgeBackground;
private ColorHolder mColor;
private ColorHolder mColorPressed;
private ColorHolder mTextColor;
private ColorStateList mTextColorStateList;
private DimenHolder mCorners;
private DimenHolder mPaddingTopBottom = DimenHolder.fromDp(2); //2 looks best
private DimenHolder mPaddingLeftRight = DimenHolder.fromDp(3); //3 looks best
private DimenHolder mMinWidth = DimenHolder.fromDp(20); //20 looks nice
public int getGradientDrawable() {
return mGradientDrawable;
}
public BadgeStyle withGradientDrawable(@DrawableRes int gradientDrawable) {
this.mGradientDrawable = gradientDrawable;
this.mBadgeBackground = null;
return this;
}
public Drawable getBadgeBackground() {
return mBadgeBackground;
}
public BadgeStyle withBadgeBackground(Drawable badgeBackground) {
this.mBadgeBackground = badgeBackground;
this.mGradientDrawable = -1;
return this;
}
public ColorHolder getColor() {
return mColor;
}
public BadgeStyle withColor(@ColorInt int color) {
this.mColor = ColorHolder.fromColor(color);
return this;
}
public BadgeStyle withColorRes(@ColorRes int color) {
this.mColor = ColorHolder.fromColorRes(color);
return this;
}
public ColorHolder getColorPressed() {
return mColorPressed;
}
public BadgeStyle withColorPressed(@ColorInt int colorPressed) {
this.mColorPressed = ColorHolder.fromColor(colorPressed);
return this;
}
public BadgeStyle withColorPressedRes(@ColorRes int colorPressed) {
this.mColorPressed = ColorHolder.fromColorRes(colorPressed);
return this;
}
public ColorHolder getTextColor() {
return mTextColor;
}
public BadgeStyle withTextColor(@ColorInt int textColor) {
this.mTextColor = ColorHolder.fromColor(textColor);
return this;
}
public BadgeStyle withTextColorRes(@ColorRes int textColor) {
this.mTextColor = ColorHolder.fromColorRes(textColor);
return this;
}
public BadgeStyle withTextColorStateList(ColorStateList textColorStateList) {
this.mTextColor = null;
this.mTextColorStateList = textColorStateList;
return this;
}
public DimenHolder getCorners() {
return mCorners;
}
public BadgeStyle withCorners(@Dimension(unit = PX) int cornersPx) {
this.mCorners = DimenHolder.fromPixel(cornersPx);
return this;
}
public BadgeStyle withCornersDp(@Dimension(unit = DP) int corners) {
this.mCorners = DimenHolder.fromDp(corners);
return this;
}
public BadgeStyle withCorners(DimenHolder corners) {
this.mCorners = corners;
return this;
}
public DimenHolder getPaddingLeftRight() {
return mPaddingLeftRight;
}
public BadgeStyle withPaddingLeftRightPx(@Dimension(unit = PX) int paddingLeftRight) {
this.mPaddingLeftRight = DimenHolder.fromPixel(paddingLeftRight);
return this;
}
public BadgeStyle withPaddingLeftRightDp(@Dimension(unit = DP) int paddingLeftRight) {
this.mPaddingLeftRight = DimenHolder.fromDp(paddingLeftRight);
return this;
}
public BadgeStyle withPaddingLeftRightRes(@DimenRes int paddingLeftRight) {
this.mPaddingLeftRight = DimenHolder.fromResource(paddingLeftRight);
return this;
}
public DimenHolder getPaddingTopBottom() {
return mPaddingTopBottom;
}
public BadgeStyle withPaddingTopBottomPx(@Dimension(unit = PX) int paddingTopBottom) {
this.mPaddingTopBottom = DimenHolder.fromPixel(paddingTopBottom);
return this;
}
public BadgeStyle withPaddingTopBottomDp(@Dimension(unit = DP) int paddingTopBottom) {
this.mPaddingTopBottom = DimenHolder.fromDp(paddingTopBottom);
return this;
}
public BadgeStyle withPaddingTopBottomRes(@DimenRes int paddingTopBottom) {
this.mPaddingTopBottom = DimenHolder.fromResource(paddingTopBottom);
return this;
}
public BadgeStyle withPadding(@Dimension(unit = PX) int padding) {
this.mPaddingLeftRight = DimenHolder.fromPixel(padding);
this.mPaddingTopBottom = DimenHolder.fromPixel(padding);
return this;
}
public BadgeStyle withPadding(DimenHolder padding) {
this.mPaddingLeftRight = padding;
this.mPaddingTopBottom = padding;
return this;
}
public DimenHolder getMinWidth() {
return mMinWidth;
}
public BadgeStyle withMinWidth(@Dimension(unit = PX) int minWidth) {
this.mMinWidth = DimenHolder.fromPixel(minWidth);
return this;
}
public BadgeStyle withMinWidth(DimenHolder minWidth) {
this.mMinWidth = minWidth;
return this;
}
public BadgeStyle() {
}
public BadgeStyle(@ColorInt int color, @ColorInt int colorPressed) {
this.mColor = ColorHolder.fromColor(color);
this.mColorPressed = ColorHolder.fromColor(colorPressed);
}
public BadgeStyle(@DrawableRes int gradientDrawable, @ColorInt int color, @ColorInt int colorPressed, @ColorInt int textColor) {
this.mGradientDrawable = gradientDrawable;
this.mColor = ColorHolder.fromColor(color);
this.mColorPressed = ColorHolder.fromColor(colorPressed);
this.mTextColor = ColorHolder.fromColor(textColor);
}
public void style(TextView badgeTextView) {
style(badgeTextView, null);
}
public void style(TextView badgeTextView, ColorStateList colorStateList) {
Context ctx = badgeTextView.getContext();
//set background for badge
if (mBadgeBackground == null) {
ViewCompat.setBackground(badgeTextView, new BadgeDrawableBuilder(this).build(ctx));
} else {
ViewCompat.setBackground(badgeTextView, mBadgeBackground);
}
//set the badge text color
if (mTextColor != null) {
ColorHolder.applyToOr(mTextColor, badgeTextView, null);
} else if (mTextColorStateList != null) {
badgeTextView.setTextColor(mTextColorStateList);
} else if (colorStateList != null) {
badgeTextView.setTextColor(colorStateList);
}
//set the padding
int paddingLeftRight = mPaddingLeftRight.asPixel(ctx);
int paddingTopBottom = mPaddingTopBottom.asPixel(ctx);
badgeTextView.setPadding(paddingLeftRight, paddingTopBottom, paddingLeftRight, paddingTopBottom);
//set the min width
badgeTextView.setMinWidth(mMinWidth.asPixel(ctx));
}
}

View File

@ -1,25 +0,0 @@
package com.mikepenz.materialdrawer.holder;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
/**
* Created by mikepenz on 13.07.15.
*/
public class ColorHolder extends com.mikepenz.materialize.holder.ColorHolder {
public ColorHolder() {
}
public static ColorHolder fromColorRes(@ColorRes int colorRes) {
ColorHolder colorHolder = new ColorHolder();
colorHolder.setColorRes(colorRes);
return colorHolder;
}
public static ColorHolder fromColor(@ColorInt int colorInt) {
ColorHolder colorHolder = new ColorHolder();
colorHolder.setColorInt(colorInt);
return colorHolder;
}
}

View File

@ -1,34 +0,0 @@
package com.mikepenz.materialdrawer.holder;
import androidx.annotation.DimenRes;
import androidx.annotation.Dimension;
import static androidx.annotation.Dimension.DP;
import static androidx.annotation.Dimension.PX;
/**
* Created by mikepenz on 13.07.15.
*/
public class DimenHolder extends com.mikepenz.materialize.holder.DimenHolder {
public DimenHolder() {
}
public static DimenHolder fromPixel(@Dimension(unit = PX) int pixel) {
DimenHolder dimenHolder = new DimenHolder();
dimenHolder.setPixel(pixel);
return dimenHolder;
}
public static DimenHolder fromDp(@Dimension(unit = DP) int dp) {
DimenHolder dimenHolder = new DimenHolder();
dimenHolder.setDp(dp);
return dimenHolder;
}
public static DimenHolder fromResource(@DimenRes int resource) {
DimenHolder dimenHolder = new DimenHolder();
dimenHolder.setResource(resource);
return dimenHolder;
}
}

View File

@ -1,165 +0,0 @@
package com.mikepenz.materialdrawer.holder;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import androidx.annotation.DrawableRes;
import androidx.appcompat.content.res.AppCompatResources;
import android.view.View;
import android.widget.ImageView;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.util.DrawerImageLoader;
import java.io.FileNotFoundException;
import java.io.InputStream;
/**
* Created by mikepenz on 13.07.15.
*/
public class ImageHolder extends com.mikepenz.materialize.holder.ImageHolder {
private IIcon mIIcon;
public ImageHolder(String url) {
super(url);
}
public ImageHolder(Uri uri) {
super(uri);
}
public ImageHolder(Drawable icon) {
super(icon);
}
public ImageHolder(Bitmap bitmap) {
super(bitmap);
}
public ImageHolder(@DrawableRes int iconRes) {
super(iconRes);
}
public ImageHolder(IIcon iicon) {
super((Bitmap) null);
this.mIIcon = iicon;
}
public IIcon getIIcon() {
return mIIcon;
}
public void setIIcon(IIcon mIIcon) {
this.mIIcon = mIIcon;
}
/**
* sets an existing image to the imageView
*
* @param imageView
* @param tag used to identify imageViews and define different placeholders
* @return true if an image was set
*/
@Override
public boolean applyTo(ImageView imageView, String tag) {
if (getUri() != null) {
boolean consumed = DrawerImageLoader.getInstance().setImage(imageView, getUri(), tag);
if (!consumed) {
imageView.setImageURI(getUri());
}
} else if (getIcon() != null) {
imageView.setImageDrawable(getIcon());
} else if (getBitmap() != null) {
imageView.setImageBitmap(getBitmap());
} else if (getIconRes() != -1) {
imageView.setImageResource(getIconRes());
} else if (mIIcon != null) {
imageView.setImageDrawable(new IconicsDrawable(imageView.getContext(), mIIcon).actionBar());
} else {
imageView.setImageBitmap(null);
return false;
}
return true;
}
/**
* this only handles Drawables
*
* @param ctx
* @param iconColor
* @param tint
* @return
*/
public Drawable decideIcon(Context ctx, int iconColor, boolean tint, int paddingDp) {
Drawable icon = getIcon();
if (mIIcon != null) {
icon = new IconicsDrawable(ctx, mIIcon).color(iconColor).sizeDp(24).paddingDp(paddingDp);
} else if (getIconRes() != -1) {
icon = AppCompatResources.getDrawable(ctx, getIconRes());
} else if (getUri() != null) {
try {
InputStream inputStream = ctx.getContentResolver().openInputStream(getUri());
icon = Drawable.createFromStream(inputStream, getUri().toString());
} catch (FileNotFoundException e) {
//no need to handle this
}
}
//if we got an icon AND we have auto tinting enabled AND it is no IIcon, tint it ;)
if (icon != null && tint && mIIcon == null) {
icon = icon.mutate();
icon.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
}
return icon;
}
/**
* a small static helper which catches nulls for us
*
* @param imageHolder
* @param ctx
* @param iconColor
* @param tint
* @return
*/
public static Drawable decideIcon(ImageHolder imageHolder, Context ctx, int iconColor, boolean tint, int paddingDp) {
if (imageHolder == null) {
return null;
} else {
return imageHolder.decideIcon(ctx, iconColor, tint, paddingDp);
}
}
/**
* decides which icon to apply or hide this view
*
* @param imageHolder
* @param imageView
* @param iconColor
* @param tint
* @param paddingDp
*/
public static void applyDecidedIconOrSetGone(ImageHolder imageHolder, ImageView imageView, int iconColor, boolean tint, int paddingDp) {
if (imageHolder != null && imageView != null) {
Drawable drawable = ImageHolder.decideIcon(imageHolder, imageView.getContext(), iconColor, tint, paddingDp);
if (drawable != null) {
imageView.setImageDrawable(drawable);
imageView.setVisibility(View.VISIBLE);
} else if (imageHolder.getBitmap() != null) {
imageView.setImageBitmap(imageHolder.getBitmap());
imageView.setVisibility(View.VISIBLE);
} else {
imageView.setVisibility(View.GONE);
}
} else if (imageView != null) {
imageView.setVisibility(View.GONE);
}
}
}

View File

@ -1,16 +0,0 @@
package com.mikepenz.materialdrawer.holder;
import androidx.annotation.StringRes;
/**
* Created by mikepenz on 13.07.15.
*/
public class StringHolder extends com.mikepenz.materialize.holder.StringHolder {
public StringHolder(CharSequence text) {
super(text);
}
public StringHolder(@StringRes int textRes) {
super(textRes);
}
}

View File

@ -1,145 +0,0 @@
package com.mikepenz.materialdrawer.icons;
import android.content.Context;
import android.graphics.Typeface;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.iconics.typeface.ITypeface;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
/**
* Created by mikepenz on 01.11.14.
*/
public class MaterialDrawerFont implements ITypeface {
private static final String TTF_FILE = "materialdrawerfont-font-v5.0.0.ttf";
private static Typeface typeface = null;
private static HashMap<String, Character> mChars;
@Override
public IIcon getIcon(String key) {
return Icon.valueOf(key);
}
@Override
public HashMap<String, Character> getCharacters() {
if (mChars == null) {
HashMap<String, Character> aChars = new HashMap<String, Character>();
for (Icon v : Icon.values()) {
aChars.put(v.name(), v.character);
}
mChars = aChars;
}
return mChars;
}
@Override
public String getMappingPrefix() {
return "mdf";
}
@Override
public String getFontName() {
return "MaterialDrawerFont";
}
@Override
public String getVersion() {
return "5.0.0";
}
@Override
public int getIconCount() {
return mChars.size();
}
@Override
public Collection<String> getIcons() {
Collection<String> icons = new LinkedList<String>();
for (Icon value : Icon.values()) {
icons.add(value.name());
}
return icons;
}
@Override
public String getAuthor() {
return "";
}
@Override
public String getUrl() {
return "";
}
@Override
public String getDescription() {
return "";
}
@Override
public String getLicense() {
return "";
}
@Override
public String getLicenseUrl() {
return "";
}
@Override
public Typeface getTypeface(Context context) {
if (typeface == null) {
try {
typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + TTF_FILE);
} catch (Exception e) {
return null;
}
}
return typeface;
}
public enum Icon implements IIcon {
mdf_arrow_drop_down('\ue5c5'),
mdf_arrow_drop_up('\ue5c7'),
mdf_expand_less('\ue5ce'),
mdf_expand_more('\ue5cf'),
mdf_person('\ue7fd');
char character;
Icon(char character) {
this.character = character;
}
public String getFormattedName() {
return "{" + name() + "}";
}
public char getCharacter() {
return character;
}
public String getName() {
return name();
}
// remember the typeface so we can use it later
private static ITypeface typeface;
public ITypeface getTypeface() {
if (typeface == null) {
typeface = new MaterialDrawerFont();
}
return typeface;
}
}
}

View File

@ -1,10 +0,0 @@
package com.mikepenz.materialdrawer.interfaces;
/**
* Created by mikepenz on 18.07.15.
*/
public interface ICrossfader {
void crossfade();
boolean isCrossfaded();
}

View File

@ -1,19 +0,0 @@
package com.mikepenz.materialdrawer.interfaces;
import android.widget.CompoundButton;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
/**
* Interface definition for a callback to be invoked when the checked state
* of a compound button changed.
*/
public interface OnCheckedChangeListener {
/**
* Called when the checked state of a compound button has changed.
*
* @param buttonView The compound button view whose state has changed.
* @param isChecked The new checked state of buttonView.
*/
void onCheckedChanged(IDrawerItem drawerItem, CompoundButton buttonView, boolean isChecked);
}

View File

@ -1,107 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import androidx.annotation.StringRes;
import android.view.View;
import android.widget.TextView;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.BadgeStyle;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.ColorfulBadgeable;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public abstract class AbstractBadgeableDrawerItem<Item extends AbstractBadgeableDrawerItem> extends BaseDescribeableDrawerItem<Item, AbstractBadgeableDrawerItem.ViewHolder> implements ColorfulBadgeable<Item> {
protected StringHolder mBadge;
protected BadgeStyle mBadgeStyle = new BadgeStyle();
@Override
public Item withBadge(StringHolder badge) {
this.mBadge = badge;
return (Item) this;
}
@Override
public Item withBadge(String badge) {
this.mBadge = new StringHolder(badge);
return (Item) this;
}
@Override
public Item withBadge(@StringRes int badgeRes) {
this.mBadge = new StringHolder(badgeRes);
return (Item) this;
}
@Override
public Item withBadgeStyle(BadgeStyle badgeStyle) {
this.mBadgeStyle = badgeStyle;
return (Item) this;
}
public StringHolder getBadge() {
return mBadge;
}
public BadgeStyle getBadgeStyle() {
return mBadgeStyle;
}
@Override
public int getType() {
return R.id.material_drawer_item_primary;/*"PRIMARY_ITEM"*/
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_primary;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//bind the basic view parts
bindViewHelper(viewHolder);
//set the text for the badge or hide
boolean badgeVisible = StringHolder.applyToOrHide(mBadge, viewHolder.badge);
//style the badge if it is visible
if (badgeVisible) {
mBadgeStyle.style(viewHolder.badge, getTextColorStateList(getColor(ctx), getSelectedTextColor(ctx)));
viewHolder.badgeContainer.setVisibility(View.VISIBLE);
} else {
viewHolder.badgeContainer.setVisibility(View.GONE);
}
//define the typeface for our textViews
if (getTypeface() != null) {
viewHolder.badge.setTypeface(getTypeface());
}
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends BaseViewHolder {
private View badgeContainer;
private TextView badge;
public ViewHolder(View view) {
super(view);
this.badgeContainer = view.findViewById(R.id.material_drawer_badge_container);
this.badge = (TextView) view.findViewById(R.id.material_drawer_badge);
}
}
}

View File

@ -1,449 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.OnPostBindViewListener;
import com.mikepenz.materialdrawer.model.interfaces.Selectable;
import com.mikepenz.materialdrawer.model.interfaces.Tagable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import androidx.annotation.CallSuper;
import androidx.recyclerview.widget.RecyclerView;
/**
* Created by mikepenz on 14.07.15.
*/
public abstract class AbstractDrawerItem<T, VH extends RecyclerView.ViewHolder> implements IDrawerItem<T, VH>, Selectable<T>, Tagable<T> {
protected boolean mExcludeFromMiniDrawer = false;
@Override
public boolean isExcludeFromMiniDrawer() {
return mExcludeFromMiniDrawer;
}
// the identifier for this item
protected long mIdentifier = -1;
/**
* set the identifier of this item
*
* @param identifier
* @return
*/
public T withIdentifier(long identifier) {
this.mIdentifier = identifier;
return (T) this;
}
/**
* returns the identifier of this item
* -1 is the default not set state
*
* @return
*/
@Override
public long getIdentifier() {
return mIdentifier;
}
// the tag for this item
protected Object mTag;
/**
* set the tag of this item
*
* @param object
* @return
*/
public T withTag(Object object) {
this.mTag = object;
return (T) this;
}
/**
* @return the tag of this item
*/
@Override
public Object getTag() {
return mTag;
}
// defines if this item is enabled
protected boolean mEnabled = true;
/**
* set if this item is enabled
*
* @param enabled true if this item is enabled
* @return
*/
public T withEnabled(boolean enabled) {
this.mEnabled = enabled;
return (T) this;
}
/**
* @return if this item is enabled
*/
@Override
public boolean isEnabled() {
return mEnabled;
}
// defines if the item is selected
protected boolean mSelected = false;
/**
* set if this item is selected
*
* @param selected true if this item is selected
* @return
*/
@Override
public T withSetSelected(boolean selected) {
this.mSelected = selected;
return (T) this;
}
/**
* @return if this item is selected
*/
@Override
public boolean isSelected() {
return mSelected;
}
// defines if this item is selectable
protected boolean mSelectable = true;
/**
* set if this item is selectable
*
* @param selectable true if this item is selectable
* @return
*/
@Override
public T withSelectable(boolean selectable) {
this.mSelectable = selectable;
return (T) this;
}
/**
* @return if this item is selectable
*/
@Override
public boolean isSelectable() {
return mSelectable;
}
// defines if the item's background' change should be animated when it is (de)selected
protected boolean mSelectedBackgroundAnimated = true;
/**
* set if this item is selectable
*
* @param selectedBackgroundAnimated true if this item's background should fade when it is (de) selected
* @return
*/
public T withSelectedBackgroundAnimated(boolean selectedBackgroundAnimated) {
this.mSelectedBackgroundAnimated = selectedBackgroundAnimated;
return (T) this;
}
/**
* @return if this item is selectable
*/
public boolean isSelectedBackgroundAnimated() {
return mSelectedBackgroundAnimated;
}
public Drawer.OnDrawerItemClickListener mOnDrawerItemClickListener = null;
public Drawer.OnDrawerItemClickListener getOnDrawerItemClickListener() {
return mOnDrawerItemClickListener;
}
/**
* this listener is called when an item is clicked in the drawer.
* WARNING: don't overwrite this in the Switch / Toggle drawerItems if you want the toggle / switch to be selected
* if the item is clicked and the item is not selectable.
*
* @param onDrawerItemClickListener
* @return
*/
public T withOnDrawerItemClickListener(Drawer.OnDrawerItemClickListener onDrawerItemClickListener) {
this.mOnDrawerItemClickListener = onDrawerItemClickListener;
return (T) this;
}
protected OnPostBindViewListener mOnPostBindViewListener = null;
public OnPostBindViewListener getOnPostBindViewListener() {
return mOnPostBindViewListener;
}
/**
* add this listener and hook in if you want to modify a drawerItems view without creating a custom drawer item
*
* @param onPostBindViewListener
* @return
*/
public T withPostOnBindViewListener(OnPostBindViewListener onPostBindViewListener) {
this.mOnPostBindViewListener = onPostBindViewListener;
return (T) this;
}
/**
* is called after bindView to allow some post creation setps
*
* @param drawerItem the drawerItem which is bound to the view
* @param view the currently view which will be bound
*/
public void onPostBindView(IDrawerItem drawerItem, View view) {
if (mOnPostBindViewListener != null) {
mOnPostBindViewListener.onBindView(drawerItem, view);
}
}
// the parent of this item
private IDrawerItem mParent;
/**
* @return the parent of this item
*/
@Override
public IDrawerItem getParent() {
return mParent;
}
/**
* the parent for this item
*
* @param parent it's parent
* @return this
*/
@Override
public IDrawerItem withParent(IDrawerItem parent) {
this.mParent = parent;
return this;
}
// the subItems to expand for this item
protected List<IDrawerItem> mSubItems;
/**
* a list of subItems
* **WARNING** Make sure the subItems provided already have identifiers
*
* @param subItems
* @return
*/
public T withSubItems(List<IDrawerItem> subItems) {
this.mSubItems = subItems;
for (IDrawerItem subItem : subItems) {
subItem.withParent(this);
}
return (T) this;
}
/**
* an array of subItems
* **WARNING** Make sure the subItems provided already have identifiers
*
* @param subItems
* @return
*/
public T withSubItems(IDrawerItem... subItems) {
if (mSubItems == null) {
mSubItems = new ArrayList<>();
}
for (IDrawerItem subItem : subItems) {
subItem.withParent(this);
}
Collections.addAll(mSubItems, subItems);
return (T) this;
}
/**
* @return the subItems for this item
*/
@Override
public List<IDrawerItem> getSubItems() {
return mSubItems;
}
//if the this item is currently expanded
private boolean mExpanded = false;
/**
* @param expanded defines if this item is now expanded or not
* @return this
*/
@Override
public T withIsExpanded(boolean expanded) {
mExpanded = expanded;
return (T) this;
}
/**
* @return if this item is currently expaneded
*/
@Override
public boolean isExpanded() {
return mExpanded;
}
/**
* overwrite this method and return true if the item should auto expand on click, false if you want to disable this
*
* @return true if this item should auto expand in the adapter
*/
@Override
public boolean isAutoExpanding() {
return true;
}
/**
* generates a view by the defined LayoutRes
*
* @param ctx
* @return
*/
@Override
public View generateView(Context ctx) {
VH viewHolder = getViewHolder(LayoutInflater.from(ctx).inflate(getLayoutRes(), null, false));
bindView(viewHolder, Collections.emptyList());
return viewHolder.itemView;
}
/**
* generates a view by the defined LayoutRes and pass the LayoutParams from the parent
*
* @param ctx
* @param parent
* @return
*/
@Override
public View generateView(Context ctx, ViewGroup parent) {
VH viewHolder = getViewHolder(LayoutInflater.from(ctx).inflate(getLayoutRes(), parent, false));
bindView(viewHolder, Collections.emptyList());
return viewHolder.itemView;
}
@CallSuper
@Override
public void bindView(VH holder, List<Object> payloads) {
holder.itemView.setTag(R.id.material_drawer_item, this);
}
/**
* called when the view is unbound
*
* @param holder
*/
@Override
public void unbindView(VH holder) {
holder.itemView.clearAnimation();
}
/**
* View got attached to the window
*
* @param holder
*/
@Override
public void attachToWindow(VH holder) {
}
/**
* View got detached from the window
*
* @param holder
*/
@Override
public void detachFromWindow(VH holder) {
}
/**
* is called when the ViewHolder is in a transient state. return true if you want to reuse
* that view anyways
*
* @param holder the viewHolder for the view which failed to recycle
* @return true if we want to recycle anyways (false - it get's destroyed)
*/
@Override
public boolean failedToRecycle(VH holder) {
return false;
}
/**
* This method returns the ViewHolder for our item, using the provided View.
*
* @param parent
* @return the ViewHolder for this Item
*/
@Override
public VH getViewHolder(ViewGroup parent) {
return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutRes(), parent, false));
}
/**
* This method returns the ViewHolder for our item, using the provided View.
*
* @param v
* @return the ViewHolder for this Item
*/
public abstract VH getViewHolder(View v);
/**
* If this item equals to the given identifier
*
* @param id
* @return
*/
@Override
public boolean equals(long id) {
return id == mIdentifier;
}
public boolean equals(int id) {
return id == mIdentifier;
}
/**
* If this item equals to the given object
*
* @param o
* @return
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AbstractDrawerItem<?, ?> that = (AbstractDrawerItem<?, ?>) o;
return mIdentifier == that.mIdentifier;
}
/**
* the hashCode implementation
*
* @return
*/
@Override
public int hashCode() {
return Long.valueOf(mIdentifier).hashCode();
}
}

View File

@ -1,126 +0,0 @@
package com.mikepenz.materialdrawer.model;
import androidx.annotation.LayoutRes;
import androidx.appcompat.widget.SwitchCompat;
import android.view.View;
import android.widget.CompoundButton;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.interfaces.OnCheckedChangeListener;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public abstract class AbstractSwitchableDrawerItem<Item extends AbstractSwitchableDrawerItem> extends BaseDescribeableDrawerItem<Item, AbstractSwitchableDrawerItem.ViewHolder> {
private boolean switchEnabled = true;
private boolean checked = false;
private OnCheckedChangeListener onCheckedChangeListener = null;
public Item withChecked(boolean checked) {
this.checked = checked;
return (Item) this;
}
public Item withSwitchEnabled(boolean switchEnabled) {
this.switchEnabled = switchEnabled;
return (Item) this;
}
public Item withOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) {
this.onCheckedChangeListener = onCheckedChangeListener;
return (Item) this;
}
public Item withCheckable(boolean checkable) {
return withSelectable(checkable);
}
public boolean isChecked() {
return checked;
}
public boolean isSwitchEnabled() {
return switchEnabled;
}
public OnCheckedChangeListener getOnCheckedChangeListener() {
return onCheckedChangeListener;
}
@Override
public int getType() {
return R.id.material_drawer_item_primary_switch;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_switch;
}
@Override
public void bindView(final ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
//bind the basic view parts
bindViewHelper(viewHolder);
//handle the switch
viewHolder.switchView.setOnCheckedChangeListener(null);
viewHolder.switchView.setChecked(checked);
viewHolder.switchView.setOnCheckedChangeListener(checkedChangeListener);
viewHolder.switchView.setEnabled(switchEnabled);
//add a onDrawerItemClickListener here to be able to check / uncheck if the drawerItem can't be selected
withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (!isSelectable()) {
checked = !checked;
viewHolder.switchView.setChecked(checked);
}
return false;
}
});
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends BaseViewHolder {
private SwitchCompat switchView;
private ViewHolder(View view) {
super(view);
this.switchView = (SwitchCompat) view.findViewById(R.id.material_drawer_switch);
}
}
private CompoundButton.OnCheckedChangeListener checkedChangeListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isEnabled()) {
checked = isChecked;
if (getOnCheckedChangeListener() != null) {
getOnCheckedChangeListener().onCheckedChanged(AbstractSwitchableDrawerItem.this, buttonView, isChecked);
}
} else {
buttonView.setOnCheckedChangeListener(null);
buttonView.setChecked(!isChecked);
buttonView.setOnCheckedChangeListener(checkedChangeListener);
}
}
};
}

View File

@ -1,133 +0,0 @@
package com.mikepenz.materialdrawer.model;
import androidx.annotation.LayoutRes;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ToggleButton;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.interfaces.OnCheckedChangeListener;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public class AbstractToggleableDrawerItem<Item extends AbstractToggleableDrawerItem> extends BaseDescribeableDrawerItem<Item, AbstractToggleableDrawerItem.ViewHolder> {
private boolean toggleEnabled = true;
private boolean checked = false;
private OnCheckedChangeListener onCheckedChangeListener = null;
public Item withChecked(boolean checked) {
this.checked = checked;
return (Item) this;
}
public Item withToggleEnabled(boolean toggleEnabled) {
this.toggleEnabled = toggleEnabled;
return (Item) this;
}
public Item withOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) {
this.onCheckedChangeListener = onCheckedChangeListener;
return (Item) this;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public boolean isToggleEnabled() {
return toggleEnabled;
}
public void setToggleEnabled(boolean toggleEnabled) {
this.toggleEnabled = toggleEnabled;
}
public OnCheckedChangeListener getOnCheckedChangeListener() {
return onCheckedChangeListener;
}
public void setOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) {
this.onCheckedChangeListener = onCheckedChangeListener;
}
@Override
public int getType() {
return R.id.material_drawer_item_primary_toggle;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_toggle;
}
@Override
public void bindView(final ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
//bind the basic view parts
bindViewHelper(viewHolder);
//handle the toggle
viewHolder.toggle.setOnCheckedChangeListener(null);
viewHolder.toggle.setChecked(checked);
viewHolder.toggle.setOnCheckedChangeListener(checkedChangeListener);
viewHolder.toggle.setEnabled(toggleEnabled);
//add a onDrawerItemClickListener here to be able to check / uncheck if the drawerItem can't be selected
withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (!isSelectable()) {
checked = !checked;
viewHolder.toggle.setChecked(checked);
}
return false;
}
});
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends BaseViewHolder {
private ToggleButton toggle;
private ViewHolder(View view) {
super(view);
this.toggle = (ToggleButton) view.findViewById(R.id.material_drawer_toggle);
}
}
private CompoundButton.OnCheckedChangeListener checkedChangeListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isEnabled()) {
checked = isChecked;
if (getOnCheckedChangeListener() != null) {
getOnCheckedChangeListener().onCheckedChanged(AbstractToggleableDrawerItem.this, buttonView, isChecked);
}
} else {
buttonView.setOnCheckedChangeListener(null);
buttonView.setChecked(!isChecked);
buttonView.setOnCheckedChangeListener(checkedChangeListener);
}
}
};
}

View File

@ -1,114 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.StringRes;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.themeDrawerItem;
/**
* Created by mikepenz on 03.02.15.
*/
public abstract class BaseDescribeableDrawerItem<T, VH extends BaseViewHolder> extends BaseDrawerItem<T, VH> {
private StringHolder description;
private ColorHolder descriptionTextColor;
@Override
public boolean isExcludeFromMiniDrawer() {
return this.excludeFromMiniDrawer;
}
public T withDescription(String description) {
this.description = new StringHolder(description);
return (T) this;
}
public T withDescription(@StringRes int descriptionRes) {
this.description = new StringHolder(descriptionRes);
return (T) this;
}
public T withDescriptionTextColor(@ColorInt int color) {
this.descriptionTextColor = ColorHolder.fromColor(color);
return (T) this;
}
public T withDescriptionTextColorRes(@ColorRes int colorRes) {
this.descriptionTextColor = ColorHolder.fromColorRes(colorRes);
return (T) this;
}
public StringHolder getDescription() {
return description;
}
public ColorHolder getDescriptionTextColor() {
return descriptionTextColor;
}
/**
* a helper method to have the logic for all secondaryDrawerItems only once
*
* @param viewHolder
*/
protected void bindViewHelper(BaseViewHolder viewHolder) {
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item selected if it is
viewHolder.itemView.setSelected(isSelected());
//set the item enabled if it is
viewHolder.itemView.setEnabled(isEnabled());
//get the correct color for the background
int selectedColor = getSelectedColor(ctx);
//get the correct color for the text
int color = getColor(ctx);
ColorStateList selectedTextColor = getTextColorStateList(color, getSelectedTextColor(ctx));
//get the correct color for the icon
int iconColor = getIconColor(ctx);
int selectedIconColor = getSelectedIconColor(ctx);
//set the background for the item
themeDrawerItem(ctx, viewHolder.view, selectedColor, isSelectedBackgroundAnimated());
//set the text for the name
StringHolder.applyTo(this.getName(), viewHolder.name);
//set the text for the description or hide
StringHolder.applyToOrHide(this.getDescription(), viewHolder.description);
//set the colors for textViews
viewHolder.name.setTextColor(selectedTextColor);
//set the description text color
ColorHolder.applyToOr(getDescriptionTextColor(), viewHolder.description, selectedTextColor);
//define the typeface for our textViews
if (getTypeface() != null) {
viewHolder.name.setTypeface(getTypeface());
viewHolder.description.setTypeface(getTypeface());
}
//get the drawables for our icon and set it
Drawable icon = ImageHolder.decideIcon(getIcon(), ctx, iconColor, isIconTinted(), 1);
if (icon != null) {
Drawable selectedIcon = ImageHolder.decideIcon(getSelectedIcon(), ctx, selectedIconColor, isIconTinted(), 1);
ImageHolder.applyMultiIconTo(icon, iconColor, selectedIcon, selectedIconColor, isIconTinted(), viewHolder.icon);
} else {
ImageHolder.applyDecidedIconOrSetGone(getIcon(), viewHolder.icon, iconColor, isIconTinted(), 1);
}
//for android API 17 --> Padding not applied via xml
DrawerUIUtils.setDrawerVerticalPadding(viewHolder.view, level);
}
}

View File

@ -1,356 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.Pair;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.Iconable;
import com.mikepenz.materialdrawer.model.interfaces.Nameable;
import com.mikepenz.materialdrawer.model.interfaces.Tagable;
import com.mikepenz.materialdrawer.model.interfaces.Typefaceable;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.getBooleanStyleable;
/**
* Created by mikepenz on 03.02.15.
*/
public abstract class BaseDrawerItem<T, VH extends RecyclerView.ViewHolder> extends AbstractDrawerItem<T, VH> implements Nameable<T>, Iconable<T>, Tagable<T>, Typefaceable<T> {
protected ImageHolder icon;
protected ImageHolder selectedIcon;
protected StringHolder name;
protected boolean iconTinted = false;
protected ColorHolder selectedColor;
protected ColorHolder textColor;
protected ColorHolder selectedTextColor;
protected ColorHolder disabledTextColor;
protected ColorHolder iconColor;
protected ColorHolder selectedIconColor;
protected ColorHolder disabledIconColor;
protected Typeface typeface = null;
protected Pair<Integer, ColorStateList> colorStateList;
protected int level = 1;
protected boolean excludeFromMiniDrawer = false;
public T withIcon(ImageHolder icon) {
this.icon = icon;
return (T) this;
}
public T withIcon(Drawable icon) {
this.icon = new ImageHolder(icon);
return (T) this;
}
public T withIcon(@DrawableRes int iconRes) {
this.icon = new ImageHolder(iconRes);
return (T) this;
}
public T withSelectedIcon(Drawable selectedIcon) {
this.selectedIcon = new ImageHolder(selectedIcon);
return (T) this;
}
public T withSelectedIcon(@DrawableRes int selectedIconRes) {
this.selectedIcon = new ImageHolder(selectedIconRes);
return (T) this;
}
public T withIcon(IIcon iicon) {
this.icon = new ImageHolder(iicon);
//if we are on api 21 or higher we use the IconicsDrawable for selection too and color it with the correct color
//else we use just the one drawable and enable tinting on press
if (Build.VERSION.SDK_INT >= 21) {
this.selectedIcon = new ImageHolder(iicon);
} else {
this.withIconTintingEnabled(true);
}
return (T) this;
}
public T withName(StringHolder name) {
this.name = name;
return (T) this;
}
public T withName(String name) {
this.name = new StringHolder(name);
return (T) this;
}
public T withName(@StringRes int nameRes) {
this.name = new StringHolder(nameRes);
return (T) this;
}
public T withSelectedColor(@ColorInt int selectedColor) {
this.selectedColor = ColorHolder.fromColor(selectedColor);
return (T) this;
}
public T withSelectedColorRes(@ColorRes int selectedColorRes) {
this.selectedColor = ColorHolder.fromColorRes(selectedColorRes);
return (T) this;
}
public T withTextColor(@ColorInt int textColor) {
this.textColor = ColorHolder.fromColor(textColor);
return (T) this;
}
public T withTextColorRes(@ColorRes int textColorRes) {
this.textColor = ColorHolder.fromColorRes(textColorRes);
return (T) this;
}
public T withSelectedTextColor(@ColorInt int selectedTextColor) {
this.selectedTextColor = ColorHolder.fromColor(selectedTextColor);
return (T) this;
}
public T withSelectedTextColorRes(@ColorRes int selectedColorRes) {
this.selectedTextColor = ColorHolder.fromColorRes(selectedColorRes);
return (T) this;
}
public T withDisabledTextColor(@ColorInt int disabledTextColor) {
this.disabledTextColor = ColorHolder.fromColor(disabledTextColor);
return (T) this;
}
public T withDisabledTextColorRes(@ColorRes int disabledTextColorRes) {
this.disabledTextColor = ColorHolder.fromColorRes(disabledTextColorRes);
return (T) this;
}
public T withIconColor(@ColorInt int iconColor) {
this.iconColor = ColorHolder.fromColor(iconColor);
return (T) this;
}
public T withIconColorRes(@ColorRes int iconColorRes) {
this.iconColor = ColorHolder.fromColorRes(iconColorRes);
return (T) this;
}
public T withSelectedIconColor(@ColorInt int selectedIconColor) {
this.selectedIconColor = ColorHolder.fromColor(selectedIconColor);
return (T) this;
}
public T withSelectedIconColorRes(@ColorRes int selectedColorRes) {
this.selectedIconColor = ColorHolder.fromColorRes(selectedColorRes);
return (T) this;
}
public T withDisabledIconColor(@ColorInt int disabledIconColor) {
this.disabledIconColor = ColorHolder.fromColor(disabledIconColor);
return (T) this;
}
public T withDisabledIconColorRes(@ColorRes int disabledIconColorRes) {
this.disabledIconColor = ColorHolder.fromColorRes(disabledIconColorRes);
return (T) this;
}
/**
* will tint the icon with the default (or set) colors
* (default and selected state)
*
* @param iconTintingEnabled
* @return
*/
public T withIconTintingEnabled(boolean iconTintingEnabled) {
this.iconTinted = iconTintingEnabled;
return (T) this;
}
@Deprecated
public T withIconTinted(boolean iconTinted) {
this.iconTinted = iconTinted;
return (T) this;
}
/**
* for backwards compatibility - withIconTinted..
*
* @param iconTinted
* @return
*/
@Deprecated
public T withTintSelectedIcon(boolean iconTinted) {
return withIconTintingEnabled(iconTinted);
}
public T withTypeface(Typeface typeface) {
this.typeface = typeface;
return (T) this;
}
public T withLevel(int level) {
this.level = level;
return (T) this;
}
public T withExcludeFromMiniDrawer(boolean excludeFromMiniDrawer) {
this.excludeFromMiniDrawer = excludeFromMiniDrawer;
return (T) this;
}
public ColorHolder getSelectedColor() {
return selectedColor;
}
public ColorHolder getTextColor() {
return textColor;
}
public ColorHolder getSelectedTextColor() {
return selectedTextColor;
}
public ColorHolder getDisabledTextColor() {
return disabledTextColor;
}
public boolean isIconTinted() {
return iconTinted;
}
public ImageHolder getIcon() {
return icon;
}
public ImageHolder getSelectedIcon() {
return selectedIcon;
}
public StringHolder getName() {
return name;
}
public ColorHolder getDisabledIconColor() {
return disabledIconColor;
}
public ColorHolder getSelectedIconColor() {
return selectedIconColor;
}
public ColorHolder getIconColor() {
return iconColor;
}
public Typeface getTypeface() {
return typeface;
}
public int getLevel() {
return level;
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedColor(Context ctx) {
if (getBooleanStyleable(ctx, R.styleable.MaterialDrawer_material_drawer_legacy_style, false)) {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected_legacy, R.color.material_drawer_selected_legacy);
} else {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected, R.color.material_drawer_selected);
}
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_primary_text, R.color.material_drawer_primary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedTextColor(Context ctx) {
return ColorHolder.color(getSelectedTextColor(), ctx, R.attr.material_drawer_selected_text, R.color.material_drawer_selected_text);
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
public int getIconColor(Context ctx) {
int iconColor;
if (this.isEnabled()) {
iconColor = ColorHolder.color(getIconColor(), ctx, R.attr.material_drawer_primary_icon, R.color.material_drawer_primary_icon);
} else {
iconColor = ColorHolder.color(getDisabledIconColor(), ctx, R.attr.material_drawer_hint_icon, R.color.material_drawer_hint_icon);
}
return iconColor;
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedIconColor(Context ctx) {
return ColorHolder.color(getSelectedIconColor(), ctx, R.attr.material_drawer_selected_text, R.color.material_drawer_selected_text);
}
/**
* helper to get the ColorStateList for the text and remembering it so we do not have to recreate it all the time
*
* @param color
* @param selectedTextColor
* @return
*/
protected ColorStateList getTextColorStateList(@ColorInt int color, @ColorInt int selectedTextColor) {
if (colorStateList == null || color + selectedTextColor != colorStateList.first) {
colorStateList = new Pair<>(color + selectedTextColor, DrawerUIUtils.getTextColorStateList(color, selectedTextColor));
}
return colorStateList.second;
}
}

View File

@ -1,25 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.materialdrawer.R;
import androidx.recyclerview.widget.RecyclerView;
public class BaseViewHolder extends RecyclerView.ViewHolder {
protected View view;
protected ImageView icon;
protected TextView name;
protected TextView description;
public BaseViewHolder(View view) {
super(view);
this.view = view;
this.icon = view.findViewById(R.id.material_drawer_icon);
this.name = view.findViewById(R.id.material_drawer_name);
this.description = view.findViewById(R.id.material_drawer_description);
}
}

View File

@ -1,149 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.DimenHolder;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public class ContainerDrawerItem extends AbstractDrawerItem<ContainerDrawerItem, ContainerDrawerItem.ViewHolder> {
private DimenHolder mHeight;
public ContainerDrawerItem withHeight(DimenHolder height) {
mHeight = height;
return this;
}
public DimenHolder getHeight() {
return mHeight;
}
private View mView;
public ContainerDrawerItem withView(View view) {
this.mView = view;
return this;
}
public View getView() {
return mView;
}
public enum Position {
TOP,
BOTTOM,
NONE;
}
private Position mViewPosition = Position.TOP;
public ContainerDrawerItem withViewPosition(Position position) {
this.mViewPosition = position;
return this;
}
private boolean mDivider = true;
public ContainerDrawerItem withDivider(boolean divider) {
this.mDivider = divider;
return this;
}
public Position getViewPosition() {
return mViewPosition;
}
@Override
public int getType() {
return R.id.material_drawer_item_container;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_container;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//define how the divider should look like
viewHolder.view.setEnabled(false);
//make sure our view is not used in another parent
if (mView.getParent() != null) {
((ViewGroup) mView.getParent()).removeView(mView);
}
//set the height
int height = ViewGroup.LayoutParams.WRAP_CONTENT;
if (mHeight != null) {
RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) viewHolder.view.getLayoutParams();
height = mHeight.asPixel(ctx);
lp.height = height;
viewHolder.view.setLayoutParams(lp);
}
//make sure the header view is empty
((ViewGroup) viewHolder.view).removeAllViews();
int dividerHeight = 0;
if (mDivider) {
dividerHeight = 1;
}
View divider = new View(ctx);
divider.setMinimumHeight(dividerHeight);
divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider));
LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) UIUtils.convertDpToPixel(dividerHeight, ctx));
LinearLayout.LayoutParams viewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mHeight != null ? height - (int) UIUtils.convertDpToPixel(dividerHeight, ctx) : height);
//depending on the position we add the view
if (mViewPosition == Position.TOP) {
((ViewGroup) viewHolder.view).addView(mView, viewParams);
dividerParams.bottomMargin = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_padding);
((ViewGroup) viewHolder.view).addView(divider, dividerParams);
} else if (mViewPosition == Position.BOTTOM) {
dividerParams.topMargin = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_padding);
((ViewGroup) viewHolder.view).addView(divider, dividerParams);
((ViewGroup) viewHolder.view).addView(mView, viewParams);
} else {
((ViewGroup) viewHolder.view).addView(mView, viewParams);
}
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private ViewHolder(View view) {
super(view);
this.view = view;
}
}
}

View File

@ -1,67 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public class DividerDrawerItem extends AbstractDrawerItem<DividerDrawerItem, DividerDrawerItem.ViewHolder> {
@Override
public int getType() {
return R.id.material_drawer_item_divider;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_divider;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//define how the divider should look like
viewHolder.view.setClickable(false);
viewHolder.view.setEnabled(false);
viewHolder.view.setMinimumHeight(1);
ViewCompat.setImportantForAccessibility(viewHolder.view,
ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
//set the color for the divider
viewHolder.divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider));
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private View divider;
private ViewHolder(View view) {
super(view);
this.view = view;
this.divider = view.findViewById(R.id.material_drawer_divider);
}
}
}

View File

@ -1,174 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.graphics.Color;
import androidx.annotation.LayoutRes;
import androidx.annotation.StringRes;
import androidx.core.view.ViewCompat;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.BadgeStyle;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.icons.MaterialDrawerFont;
import com.mikepenz.materialdrawer.model.interfaces.ColorfulBadgeable;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
* NOTE: The arrow will just animate (and rotate) on APIs higher than 11 as the ViewCompat will skip this on API 10
*/
public class ExpandableBadgeDrawerItem extends BaseDescribeableDrawerItem<ExpandableBadgeDrawerItem, ExpandableBadgeDrawerItem.ViewHolder>
implements ColorfulBadgeable<ExpandableBadgeDrawerItem> {
private Drawer.OnDrawerItemClickListener mOnDrawerItemClickListener;
protected ColorHolder arrowColor;
protected int arrowRotationAngleStart = 0;
protected int arrowRotationAngleEnd = 180;
protected StringHolder mBadge;
protected BadgeStyle mBadgeStyle = new BadgeStyle();
@Override
public int getType() {
return R.id.material_drawer_item_expandable_badge;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_expandable_badge;
}
@Override
public void bindView(ExpandableBadgeDrawerItem.ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//bind the basic view parts
bindViewHelper(viewHolder);
//set the text for the badge or hide
boolean badgeVisible = StringHolder.applyToOrHide(mBadge, viewHolder.badge);
//style the badge if it is visible
if (true) {
mBadgeStyle.style(viewHolder.badge, getTextColorStateList(getColor(ctx), getSelectedTextColor(ctx)));
viewHolder.badgeContainer.setVisibility(View.VISIBLE);
} else {
viewHolder.badgeContainer.setVisibility(View.GONE);
}
//define the typeface for our textViews
if (getTypeface() != null) {
viewHolder.badge.setTypeface(getTypeface());
}
//make sure all animations are stopped
if (viewHolder.arrow.getDrawable() instanceof IconicsDrawable) {
((IconicsDrawable) viewHolder.arrow.getDrawable()).color(this.arrowColor != null ? this.arrowColor.color(ctx) : getIconColor(ctx));
}
viewHolder.arrow.clearAnimation();
if (!isExpanded()) {
viewHolder.arrow.setRotation(this.arrowRotationAngleStart);
} else {
viewHolder.arrow.setRotation(this.arrowRotationAngleEnd);
}
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ExpandableBadgeDrawerItem withOnDrawerItemClickListener(Drawer.OnDrawerItemClickListener onDrawerItemClickListener) {
mOnDrawerItemClickListener = onDrawerItemClickListener;
return this;
}
@Override
public Drawer.OnDrawerItemClickListener getOnDrawerItemClickListener() {
return mOnArrowDrawerItemClickListener;
}
/**
* our internal onDrawerItemClickListener which will handle the arrow animation
*/
private Drawer.OnDrawerItemClickListener mOnArrowDrawerItemClickListener = new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (drawerItem instanceof AbstractDrawerItem && drawerItem.isEnabled()) {
if (((AbstractDrawerItem) drawerItem).getSubItems() != null) {
if (((AbstractDrawerItem) drawerItem).isExpanded()) {
ViewCompat.animate(view.findViewById(R.id.material_drawer_arrow)).rotation(ExpandableBadgeDrawerItem.this.arrowRotationAngleEnd).start();
} else {
ViewCompat.animate(view.findViewById(R.id.material_drawer_arrow))
.rotation(ExpandableBadgeDrawerItem.this.arrowRotationAngleStart)
.start();
}
}
}
return mOnDrawerItemClickListener != null && mOnDrawerItemClickListener.onItemClick(view, position, drawerItem);
}
};
@Override
public ExpandableBadgeDrawerItem withBadge(StringHolder badge) {
this.mBadge = badge;
return (ExpandableBadgeDrawerItem) this;
}
@Override
public ExpandableBadgeDrawerItem withBadge(String badge) {
this.mBadge = new StringHolder(badge);
return (ExpandableBadgeDrawerItem) this;
}
@Override
public ExpandableBadgeDrawerItem withBadge(@StringRes int badgeRes) {
this.mBadge = new StringHolder(badgeRes);
return (ExpandableBadgeDrawerItem) this;
}
@Override
public ExpandableBadgeDrawerItem withBadgeStyle(BadgeStyle badgeStyle) {
this.mBadgeStyle = badgeStyle;
return (ExpandableBadgeDrawerItem) this;
}
public StringHolder getBadge() {
return mBadge;
}
public BadgeStyle getBadgeStyle() {
return mBadgeStyle;
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends BaseViewHolder {
public ImageView arrow;
public View badgeContainer;
public TextView badge;
public ViewHolder(View view) {
super(view);
badgeContainer = view.findViewById(R.id.material_drawer_badge_container);
badge = view.findViewById(R.id.material_drawer_badge);
arrow = view.findViewById(R.id.material_drawer_arrow);
arrow.setImageDrawable(new IconicsDrawable(view.getContext(), MaterialDrawerFont.Icon.mdf_expand_more).sizeDp(16).paddingDp(2).color(Color.BLACK));
}
}
}

View File

@ -1,134 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.graphics.Color;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.LayoutRes;
import androidx.core.view.ViewCompat;
import android.view.View;
import android.widget.ImageView;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.icons.MaterialDrawerFont;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
* NOTE: The arrow will just animate (and rotate) on APIs higher than 11 as the ViewCompat will skip this on API 10
*/
public class ExpandableDrawerItem extends BaseDescribeableDrawerItem<ExpandableDrawerItem, ExpandableDrawerItem.ViewHolder> {
private Drawer.OnDrawerItemClickListener mOnDrawerItemClickListener;
protected ColorHolder arrowColor;
protected int arrowRotationAngleStart = 0;
protected int arrowRotationAngleEnd = 180;
public ExpandableDrawerItem withArrowColor(@ColorInt int arrowColor) {
this.arrowColor = ColorHolder.fromColor(arrowColor);
return this;
}
public ExpandableDrawerItem withArrowColorRes(@ColorRes int arrowColorRes) {
this.arrowColor = ColorHolder.fromColorRes(arrowColorRes);
return this;
}
public ExpandableDrawerItem withArrowRotationAngleStart(int angle) {
this.arrowRotationAngleStart = angle;
return this;
}
public ExpandableDrawerItem withArrowRotationAngleEnd(int angle) {
this.arrowRotationAngleEnd = angle;
return this;
}
@Override
public int getType() {
return R.id.material_drawer_item_expandable;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_expandable;
}
@Override
public ExpandableDrawerItem withOnDrawerItemClickListener(Drawer.OnDrawerItemClickListener onDrawerItemClickListener) {
mOnDrawerItemClickListener = onDrawerItemClickListener;
return this;
}
@Override
public Drawer.OnDrawerItemClickListener getOnDrawerItemClickListener() {
return mOnArrowDrawerItemClickListener;
}
/**
* our internal onDrawerItemClickListener which will handle the arrow animation
*/
private Drawer.OnDrawerItemClickListener mOnArrowDrawerItemClickListener = new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
if (drawerItem instanceof AbstractDrawerItem && drawerItem.isEnabled()) {
if (((AbstractDrawerItem) drawerItem).getSubItems() != null) {
if (((AbstractDrawerItem) drawerItem).isExpanded()) {
ViewCompat.animate(view.findViewById(R.id.material_drawer_arrow)).rotation(ExpandableDrawerItem.this.arrowRotationAngleEnd).start();
} else {
ViewCompat.animate(view.findViewById(R.id.material_drawer_arrow)).rotation(ExpandableDrawerItem.this.arrowRotationAngleStart).start();
}
}
}
return mOnDrawerItemClickListener != null && mOnDrawerItemClickListener.onItemClick(view, position, drawerItem);
}
};
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//bind the basic view parts
bindViewHelper(viewHolder);
//make sure all animations are stopped
if (viewHolder.arrow.getDrawable() instanceof IconicsDrawable) {
((IconicsDrawable) viewHolder.arrow.getDrawable()).color(this.arrowColor != null ? this.arrowColor.color(ctx) : getIconColor(ctx));
}
viewHolder.arrow.clearAnimation();
if (!isExpanded()) {
viewHolder.arrow.setRotation(this.arrowRotationAngleStart);
} else {
viewHolder.arrow.setRotation(this.arrowRotationAngleEnd);
}
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends BaseViewHolder {
public ImageView arrow;
public ViewHolder(View view) {
super(view);
arrow = view.findViewById(R.id.material_drawer_arrow);
arrow.setImageDrawable(new IconicsDrawable(view.getContext(), MaterialDrawerFont.Icon.mdf_expand_more).sizeDp(16).paddingDp(2).color(Color.BLACK));
}
}
}

View File

@ -1,193 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.BadgeStyle;
import com.mikepenz.materialdrawer.holder.DimenHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import java.util.List;
import androidx.annotation.DimenRes;
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.themeDrawerItem;
/**
* Created by mikepenz on 03.02.15.
*/
public class MiniDrawerItem extends BaseDrawerItem<MiniDrawerItem, MiniDrawerItem.ViewHolder> {
private StringHolder mBadge;
private BadgeStyle mBadgeStyle = new BadgeStyle();
private boolean mEnableSelectedBackground = false;
protected DimenHolder mCustomHeight;
public MiniDrawerItem() {
}
public MiniDrawerItem(PrimaryDrawerItem primaryDrawerItem) {
this.mIdentifier = primaryDrawerItem.mIdentifier;
this.mTag = primaryDrawerItem.mTag;
this.mBadge = primaryDrawerItem.mBadge;
this.mBadgeStyle = primaryDrawerItem.mBadgeStyle;
this.mEnabled = primaryDrawerItem.mEnabled;
this.mSelectable = primaryDrawerItem.mSelectable;
this.mSelected = primaryDrawerItem.mSelected;
this.icon = primaryDrawerItem.icon;
this.selectedIcon = primaryDrawerItem.selectedIcon;
this.iconTinted = primaryDrawerItem.iconTinted;
this.selectedColor = primaryDrawerItem.selectedColor;
this.iconColor = primaryDrawerItem.iconColor;
this.selectedIconColor = primaryDrawerItem.selectedIconColor;
this.disabledIconColor = primaryDrawerItem.disabledIconColor;
}
public MiniDrawerItem(SecondaryDrawerItem secondaryDrawerItem) {
this.mIdentifier = secondaryDrawerItem.mIdentifier;
this.mTag = secondaryDrawerItem.mTag;
this.mBadge = secondaryDrawerItem.mBadge;
this.mBadgeStyle = secondaryDrawerItem.mBadgeStyle;
this.mEnabled = secondaryDrawerItem.mEnabled;
this.mSelectable = secondaryDrawerItem.mSelectable;
this.mSelected = secondaryDrawerItem.mSelected;
this.icon = secondaryDrawerItem.icon;
this.selectedIcon = secondaryDrawerItem.selectedIcon;
this.iconTinted = secondaryDrawerItem.iconTinted;
this.selectedColor = secondaryDrawerItem.selectedColor;
this.iconColor = secondaryDrawerItem.iconColor;
this.selectedIconColor = secondaryDrawerItem.selectedIconColor;
this.disabledIconColor = secondaryDrawerItem.disabledIconColor;
}
public MiniDrawerItem withCustomHeightRes(@DimenRes int customHeightRes) {
this.mCustomHeight = DimenHolder.fromResource(customHeightRes);
return this;
}
public MiniDrawerItem withCustomHeightDp(int customHeightDp) {
this.mCustomHeight = DimenHolder.fromDp(customHeightDp);
return this;
}
public MiniDrawerItem withCustomHeightPx(int customHeightPx) {
this.mCustomHeight = DimenHolder.fromPixel(customHeightPx);
return this;
}
public MiniDrawerItem withCustomHeight(DimenHolder customHeight) {
this.mCustomHeight = customHeight;
return this;
}
public MiniDrawerItem withEnableSelectedBackground(boolean enableSelectedBackground) {
this.mEnableSelectedBackground = enableSelectedBackground;
return this;
}
@Override
public int getType() {
return R.id.material_drawer_item_mini;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_mini;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//set a different height for this item
if (mCustomHeight != null) {
RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) viewHolder.itemView.getLayoutParams();
lp.height = mCustomHeight.asPixel(ctx);
viewHolder.itemView.setLayoutParams(lp);
}
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item enabled if it is
viewHolder.itemView.setEnabled(isEnabled());
//set the item selected if it is
viewHolder.itemView.setSelected(isSelected());
//
viewHolder.itemView.setTag(this);
//get the correct color for the icon
int iconColor = getIconColor(ctx);
int selectedIconColor = getSelectedIconColor(ctx);
if (mEnableSelectedBackground) {
//get the correct color for the background
int selectedColor = getSelectedColor(ctx);
//set the background for the item
themeDrawerItem(ctx, viewHolder.view, selectedColor, isSelectedBackgroundAnimated());
}
//set the text for the badge or hide
boolean badgeVisible = StringHolder.applyToOrHide(mBadge, viewHolder.badge);
//style the badge if it is visible
if (badgeVisible) {
mBadgeStyle.style(viewHolder.badge);
}
//get the drawables for our icon and set it
Drawable icon = ImageHolder.decideIcon(getIcon(), ctx, iconColor, isIconTinted(), 1);
Drawable selectedIcon = ImageHolder.decideIcon(getSelectedIcon(), ctx, selectedIconColor, isIconTinted(), 1);
ImageHolder.applyMultiIconTo(icon, iconColor, selectedIcon, selectedIconColor, isIconTinted(), viewHolder.icon);
//for android API 17 --> Padding not applied via xml
int verticalPadding = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_padding);
int topBottomPadding = ctx.getResources().getDimensionPixelSize(R.dimen.material_mini_drawer_item_padding);
viewHolder.itemView.setPadding(verticalPadding, topBottomPadding, verticalPadding, topBottomPadding);
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private ImageView icon;
private TextView badge;
public ViewHolder(View view) {
super(view);
this.view = view;
this.icon = (ImageView) view.findViewById(R.id.material_drawer_icon);
this.badge = (TextView) view.findViewById(R.id.material_drawer_badge);
}
}
}

View File

@ -1,168 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.DimenHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public class MiniProfileDrawerItem extends AbstractDrawerItem<MiniProfileDrawerItem, MiniProfileDrawerItem.ViewHolder> implements IProfile<MiniProfileDrawerItem> {
protected ImageHolder icon;
protected DimenHolder customHeight;
public MiniProfileDrawerItem() {
withSelectable(false);
}
public MiniProfileDrawerItem(ProfileDrawerItem profile) {
this.icon = profile.icon;
this.mEnabled = profile.mEnabled;
withSelectable(false);
}
@Override
public MiniProfileDrawerItem withName(CharSequence name) {
return null;
}
@Override
public StringHolder getName() {
return null;
}
@Override
public MiniProfileDrawerItem withEmail(String email) {
return null;
}
@Override
public StringHolder getEmail() {
return null;
}
@Override
public MiniProfileDrawerItem withIcon(Drawable icon) {
this.icon = new ImageHolder(icon);
return this;
}
@Override
public MiniProfileDrawerItem withIcon(@DrawableRes int iconRes) {
this.icon = new ImageHolder(iconRes);
return this;
}
@Override
public MiniProfileDrawerItem withIcon(Bitmap iconBitmap) {
this.icon = new ImageHolder(iconBitmap);
return this;
}
@Override
public MiniProfileDrawerItem withIcon(String url) {
this.icon = new ImageHolder(url);
return this;
}
@Override
public MiniProfileDrawerItem withIcon(Uri uri) {
this.icon = new ImageHolder(uri);
return this;
}
@Override
public MiniProfileDrawerItem withIcon(IIcon icon) {
this.icon = new ImageHolder(icon);
return this;
}
public MiniProfileDrawerItem withCustomHeightRes(@DimenRes int customHeightRes) {
this.customHeight = DimenHolder.fromResource(customHeightRes);
return this;
}
public MiniProfileDrawerItem withCustomHeightDp(int customHeightDp) {
this.customHeight = DimenHolder.fromDp(customHeightDp);
return this;
}
public MiniProfileDrawerItem withCustomHeightPx(int customHeightPx) {
this.customHeight = DimenHolder.fromPixel(customHeightPx);
return this;
}
public MiniProfileDrawerItem withCustomHeight(DimenHolder customHeight) {
this.customHeight = customHeight;
return this;
}
@Override
public ImageHolder getIcon() {
return icon;
}
@Override
public int getType() {
return R.id.material_drawer_item_mini_profile;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_mini_profile;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
if (customHeight != null) {
RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) viewHolder.itemView.getLayoutParams();
lp.height = customHeight.asPixel(viewHolder.itemView.getContext());
viewHolder.itemView.setLayoutParams(lp);
}
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item enabled if it is
viewHolder.itemView.setEnabled(isEnabled());
//set the icon
ImageHolder.applyToOrSetInvisible(getIcon(), viewHolder.icon);
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private ImageView icon;
public ViewHolder(View view) {
super(view);
this.icon = (ImageView) view.findViewById(R.id.material_drawer_icon);
}
}
}

View File

@ -1,8 +0,0 @@
package com.mikepenz.materialdrawer.model;
/**
* Created by mikepenz on 03.02.15.
*/
public class PrimaryDrawerItem extends AbstractBadgeableDrawerItem<PrimaryDrawerItem> {
}

View File

@ -1,365 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.Pair;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;
import com.mikepenz.materialdrawer.model.interfaces.Tagable;
import com.mikepenz.materialdrawer.model.interfaces.Typefaceable;
import com.mikepenz.materialdrawer.util.DrawerImageLoader;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import java.util.List;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.getBooleanStyleable;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.themeDrawerItem;
/**
* Created by mikepenz on 03.02.15.
*/
public class ProfileDrawerItem extends AbstractDrawerItem<ProfileDrawerItem, ProfileDrawerItem.ViewHolder> implements IProfile<ProfileDrawerItem>, Tagable<ProfileDrawerItem>, Typefaceable<ProfileDrawerItem> {
protected boolean nameShown = false;
protected ImageHolder icon;
protected StringHolder name;
protected StringHolder email;
protected ColorHolder selectedColor;
protected ColorHolder textColor;
protected ColorHolder selectedTextColor;
protected ColorHolder disabledTextColor;
protected Typeface typeface = null;
@Override
public ProfileDrawerItem withIcon(Drawable icon) {
this.icon = new ImageHolder(icon);
return this;
}
@Override
public ProfileDrawerItem withIcon(@DrawableRes int iconRes) {
this.icon = new ImageHolder(iconRes);
return this;
}
@Override
public ProfileDrawerItem withIcon(Bitmap iconBitmap) {
this.icon = new ImageHolder(iconBitmap);
return this;
}
@Override
public ProfileDrawerItem withIcon(IIcon icon) {
this.icon = new ImageHolder(icon);
return this;
}
@Override
public ProfileDrawerItem withIcon(String url) {
this.icon = new ImageHolder(url);
return this;
}
@Override
public ProfileDrawerItem withIcon(Uri uri) {
this.icon = new ImageHolder(uri);
return this;
}
public ProfileDrawerItem withName(CharSequence name) {
this.name = new StringHolder(name);
return this;
}
public ProfileDrawerItem withName(@StringRes int nameRes) {
this.name = new StringHolder(nameRes);
return this;
}
public ProfileDrawerItem withEmail(String email) {
this.email = new StringHolder(email);
return this;
}
public ProfileDrawerItem withEmail(@StringRes int emailRes) {
this.email = new StringHolder(emailRes);
return this;
}
/**
* Whether to show the profile name in the account switcher.
*
* @param nameShown show name in switcher
* @return the {@link ProfileDrawerItem}
*/
public ProfileDrawerItem withNameShown(boolean nameShown) {
this.nameShown = nameShown;
return this;
}
public ProfileDrawerItem withSelectedColor(@ColorInt int selectedColor) {
this.selectedColor = ColorHolder.fromColor(selectedColor);
return this;
}
public ProfileDrawerItem withSelectedColorRes(@ColorRes int selectedColorRes) {
this.selectedColor = ColorHolder.fromColorRes(selectedColorRes);
return this;
}
public ProfileDrawerItem withTextColor(@ColorInt int textColor) {
this.textColor = ColorHolder.fromColor(textColor);
return this;
}
public ProfileDrawerItem withTextColorRes(@ColorRes int textColorRes) {
this.textColor = ColorHolder.fromColorRes(textColorRes);
return this;
}
public ProfileDrawerItem withSelectedTextColor(@ColorInt int selectedTextColor) {
this.selectedTextColor = ColorHolder.fromColor(selectedTextColor);
return this;
}
public ProfileDrawerItem withSelectedTextColorRes(@ColorRes int selectedColorRes) {
this.selectedTextColor = ColorHolder.fromColorRes(selectedColorRes);
return this;
}
public ProfileDrawerItem withDisabledTextColor(@ColorInt int disabledTextColor) {
this.disabledTextColor = ColorHolder.fromColor(disabledTextColor);
return this;
}
public ProfileDrawerItem withDisabledTextColorRes(@ColorRes int disabledTextColorRes) {
this.disabledTextColor = ColorHolder.fromColorRes(disabledTextColorRes);
return this;
}
public ProfileDrawerItem withTypeface(Typeface typeface) {
this.typeface = typeface;
return this;
}
public boolean isNameShown() {
return nameShown;
}
public ColorHolder getSelectedColor() {
return selectedColor;
}
public ColorHolder getTextColor() {
return textColor;
}
public ColorHolder getSelectedTextColor() {
return selectedTextColor;
}
public ColorHolder getDisabledTextColor() {
return disabledTextColor;
}
@Override
public Typeface getTypeface() {
return typeface;
}
public ImageHolder getIcon() {
return icon;
}
@Override
public StringHolder getName() {
return name;
}
public StringHolder getEmail() {
return email;
}
@Override
public int getType() {
return R.id.material_drawer_item_profile;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_profile;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item enabled if it is
viewHolder.itemView.setEnabled(isEnabled());
//set the item selected if it is
viewHolder.itemView.setSelected(isSelected());
//get the correct color for the background
int selectedColor = getSelectedColor(ctx);
//get the correct color for the text
int color = getColor(ctx);
int secondaryColor = getSecondaryColor(ctx);
int selectedTextColor = getSelectedTextColor(ctx);
//set the background for the item
themeDrawerItem(ctx, viewHolder.view, selectedColor, isSelectedBackgroundAnimated());
if (nameShown) {
viewHolder.name.setVisibility(View.VISIBLE);
StringHolder.applyTo(this.getName(), viewHolder.name);
} else {
viewHolder.name.setVisibility(View.GONE);
}
//the MaterialDrawer follows the Google Apps. those only show the e-mail
//within the profile switcher. The problem this causes some confusion for
//some developers. And if you only set the name, the item would be empty
//so here's a small fallback which will prevent this issue of empty items ;)
if (!nameShown && this.getEmail() == null && this.getName() != null) {
StringHolder.applyTo(this.getName(), viewHolder.email);
} else {
StringHolder.applyTo(this.getEmail(), viewHolder.email);
}
if (getTypeface() != null) {
viewHolder.name.setTypeface(getTypeface());
viewHolder.email.setTypeface(getTypeface());
}
if (nameShown) {
viewHolder.name.setTextColor(getTextColorStateList(color, selectedTextColor));
}
viewHolder.email.setTextColor(getTextColorStateList(secondaryColor, selectedTextColor));
//cancel previous started image loading processes
DrawerImageLoader.getInstance().cancelImage(viewHolder.profileIcon);
//set the icon
ImageHolder.applyToOrSetInvisible(getIcon(), viewHolder.profileIcon, DrawerImageLoader.Tags.PROFILE_DRAWER_ITEM.name());
//for android API 17 --> Padding not applied via xml
DrawerUIUtils.setDrawerVerticalPadding(viewHolder.view);
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private ImageView profileIcon;
private TextView name;
private TextView email;
private ViewHolder(View view) {
super(view);
this.view = view;
this.profileIcon = view.findViewById(R.id.material_drawer_profileIcon);
this.name = view.findViewById(R.id.material_drawer_name);
this.email = view.findViewById(R.id.material_drawer_email);
}
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedColor(Context ctx) {
if (getBooleanStyleable(ctx, R.styleable.MaterialDrawer_material_drawer_legacy_style, false)) {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected_legacy, R.color.material_drawer_selected_legacy);
} else {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected, R.color.material_drawer_selected);
}
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_primary_text, R.color.material_drawer_primary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
protected int getSecondaryColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedTextColor(Context ctx) {
return ColorHolder.color(getSelectedTextColor(), ctx, R.attr.material_drawer_selected_text, R.color.material_drawer_selected_text);
}
protected Pair<Integer, ColorStateList> colorStateList;
/**
* helper to get the ColorStateList for the text and remembering it so we do not have to recreate it all the time
*
* @param color
* @param selectedTextColor
* @return
*/
protected ColorStateList getTextColorStateList(@ColorInt int color, @ColorInt int selectedTextColor) {
if (colorStateList == null || color + selectedTextColor != colorStateList.first) {
colorStateList = new Pair<>(color + selectedTextColor, DrawerUIUtils.getTextColorStateList(color, selectedTextColor));
}
return colorStateList.second;
}
}

View File

@ -1,318 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;
import com.mikepenz.materialdrawer.model.interfaces.Tagable;
import com.mikepenz.materialdrawer.model.interfaces.Typefaceable;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.StringRes;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import static com.mikepenz.materialdrawer.util.DrawerUIUtils.getBooleanStyleable;
/**
* Created by mikepenz on 03.02.15.
*/
public class ProfileSettingDrawerItem extends AbstractDrawerItem<ProfileSettingDrawerItem, ProfileSettingDrawerItem.ViewHolder> implements IProfile<ProfileSettingDrawerItem>, Tagable<ProfileSettingDrawerItem>, Typefaceable<ProfileSettingDrawerItem> {
private ImageHolder icon;
private StringHolder name;
private StringHolder description;
private boolean iconTinted = false;
private ColorHolder selectedColor;
private ColorHolder textColor;
private ColorHolder iconColor;
private ColorHolder descriptionTextColor;
private Typeface typeface = null;
private boolean selectable = false;
@Override
public ProfileSettingDrawerItem withIcon(Drawable icon) {
this.icon = new ImageHolder(icon);
return this;
}
@Override
public ProfileSettingDrawerItem withIcon(@DrawableRes int iconRes) {
this.icon = new ImageHolder(iconRes);
return this;
}
@Override
public ProfileSettingDrawerItem withIcon(Bitmap icon) {
this.icon = new ImageHolder(icon);
return this;
}
@Override
public ProfileSettingDrawerItem withIcon(IIcon iicon) {
this.icon = new ImageHolder(iicon);
return this;
}
@Override
public ProfileSettingDrawerItem withIcon(String url) {
this.icon = new ImageHolder(url);
return this;
}
@Override
public ProfileSettingDrawerItem withIcon(Uri uri) {
this.icon = new ImageHolder(uri);
return this;
}
public ProfileSettingDrawerItem withName(CharSequence name) {
this.name = new StringHolder(name);
return this;
}
public ProfileSettingDrawerItem withName(@StringRes int nameRes) {
this.name = new StringHolder(nameRes);
return this;
}
public ProfileSettingDrawerItem withDescription(String description) {
this.description = new StringHolder(description);
return this;
}
public ProfileSettingDrawerItem withDescription(@StringRes int descriptionRes) {
this.description = new StringHolder(descriptionRes);
return this;
}
//NOTE we reuse the IProfile here to allow custom items within the AccountSwitcher. There is an alias method withDescription for this
public ProfileSettingDrawerItem withEmail(String email) {
this.description = new StringHolder(email);
return this;
}
public ProfileSettingDrawerItem withSelectedColor(@ColorInt int selectedColor) {
this.selectedColor = ColorHolder.fromColor(selectedColor);
return this;
}
public ProfileSettingDrawerItem withSelectedColorRes(@ColorRes int selectedColorRes) {
this.selectedColor = ColorHolder.fromColorRes(selectedColorRes);
return this;
}
public ProfileSettingDrawerItem withTextColor(@ColorInt int textColor) {
this.textColor = ColorHolder.fromColor(textColor);
return this;
}
public ProfileSettingDrawerItem withTextColorRes(@ColorRes int textColorRes) {
this.textColor = ColorHolder.fromColorRes(textColorRes);
return this;
}
public ProfileSettingDrawerItem withDescriptionTextColor(@ColorInt int descriptionColor) {
this.descriptionTextColor = ColorHolder.fromColor(descriptionColor);
return this;
}
public ProfileSettingDrawerItem withDescriptionTextColorRes(@ColorRes int descriptionColorRes) {
this.descriptionTextColor = ColorHolder.fromColorRes(descriptionColorRes);
return this;
}
public ProfileSettingDrawerItem withIconColor(@ColorInt int iconColor) {
this.iconColor = ColorHolder.fromColor(iconColor);
return this;
}
public ProfileSettingDrawerItem withIconColorRes(@ColorRes int iconColorRes) {
this.iconColor = ColorHolder.fromColorRes(iconColorRes);
return this;
}
public ProfileSettingDrawerItem withTypeface(Typeface typeface) {
this.typeface = typeface;
return this;
}
public ProfileSettingDrawerItem withIconTinted(boolean iconTinted) {
this.iconTinted = iconTinted;
return this;
}
public ColorHolder getSelectedColor() {
return selectedColor;
}
public ColorHolder getTextColor() {
return textColor;
}
public ColorHolder getDescriptionTextColor() {
return descriptionTextColor;
}
public ColorHolder getIconColor() {
return iconColor;
}
public ImageHolder getIcon() {
return icon;
}
public boolean isIconTinted() {
return iconTinted;
}
public void setIconTinted(boolean iconTinted) {
this.iconTinted = iconTinted;
}
@Override
public Typeface getTypeface() {
return typeface;
}
@Override
public StringHolder getName() {
return name;
}
public StringHolder getEmail() {
return description;
}
public StringHolder getDescription() {
return description;
}
public void setDescription(String description) {
this.description = new StringHolder(description);
}
@Override
public boolean isSelectable() {
return selectable;
}
public ProfileSettingDrawerItem withSelectable(boolean selectable) {
this.selectable = selectable;
return this;
}
@Override
public int getType() {
return R.id.material_drawer_item_profile_setting;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_profile_setting;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
//get the context
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item enabled if it is
viewHolder.itemView.setEnabled(isEnabled());
//set the item selected if it is
viewHolder.itemView.setSelected(isSelected());
//get the correct color for the background
int selectedColor = getSelectedColor(ctx);
//get the correct color for the text
int color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_primary_text, R.color.material_drawer_primary_text);
int iconColor = ColorHolder.color(getIconColor(), ctx, R.attr.material_drawer_primary_icon, R.color.material_drawer_primary_icon);
int descriptionColor = ColorHolder.color(getDescriptionTextColor(), ctx, R.attr.material_drawer_primary_text, R.color.material_drawer_primary_text);
ViewCompat.setBackground(viewHolder.view, UIUtils.getSelectableBackground(ctx, selectedColor, isSelectedBackgroundAnimated()));
StringHolder.applyTo(this.getName(), viewHolder.name);
viewHolder.name.setTextColor(color);
StringHolder.applyToOrHide(this.getDescription(), viewHolder.description);
viewHolder.description.setTextColor(descriptionColor);
if (getTypeface() != null) {
viewHolder.name.setTypeface(getTypeface());
viewHolder.description.setTypeface(getTypeface());
}
//set the correct icon
ImageHolder.applyDecidedIconOrSetGone(icon, viewHolder.icon, iconColor, isIconTinted(), 2);
//for android API 17 --> Padding not applied via xml
DrawerUIUtils.setDrawerVerticalPadding(viewHolder.view);
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
/**
* helper method to decide for the correct color
*
* @param ctx
* @return
*/
protected int getSelectedColor(Context ctx) {
if (getBooleanStyleable(ctx, R.styleable.MaterialDrawer_material_drawer_legacy_style, false)) {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected_legacy, R.color.material_drawer_selected_legacy);
} else {
return ColorHolder.color(getSelectedColor(), ctx, R.attr.material_drawer_selected, R.color.material_drawer_selected);
}
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private ImageView icon;
private TextView name;
private TextView description;
private ViewHolder(View view) {
super(view);
this.view = view;
this.icon = (ImageView) view.findViewById(R.id.material_drawer_icon);
this.name = (TextView) view.findViewById(R.id.material_drawer_name);
this.description = (TextView) view.findViewById(R.id.material_drawer_description);
}
}
}

View File

@ -1,42 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public class SecondaryDrawerItem extends AbstractBadgeableDrawerItem<SecondaryDrawerItem> {
@Override
public int getType() {
return R.id.material_drawer_item_secondary;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_secondary;
}
/**
* helper method to decide for the correct color
* OVERWRITE to get the correct secondary color
*
* @param ctx
* @return
*/
@Override
protected int getColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
}

View File

@ -1,42 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public class SecondarySwitchDrawerItem extends AbstractSwitchableDrawerItem<SecondarySwitchDrawerItem> {
@Override
public int getType() {
return R.id.material_drawer_item_secondary_switch;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_secondary_switch;
}
/**
* helper method to decide for the correct color
* OVERWRITE to get the correct secondary color
*
* @param ctx
* @return
*/
@Override
protected int getColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
}

View File

@ -1,42 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import androidx.annotation.LayoutRes;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public class SecondaryToggleDrawerItem extends AbstractToggleableDrawerItem<SecondaryToggleDrawerItem> {
@Override
public int getType() {
return R.id.material_drawer_item_secondary_toggle;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_secondary_toggle;
}
/**
* helper method to decide for the correct color
* OVERWRITE to get the correct secondary color
*
* @param ctx
* @return
*/
@Override
protected int getColor(Context ctx) {
int color;
if (this.isEnabled()) {
color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text);
} else {
color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
}
return color;
}
}

View File

@ -1,160 +0,0 @@
package com.mikepenz.materialdrawer.model;
import android.content.Context;
import android.graphics.Typeface;
import androidx.annotation.LayoutRes;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.interfaces.Nameable;
import com.mikepenz.materialdrawer.model.interfaces.Typefaceable;
import com.mikepenz.materialize.util.UIUtils;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public class SectionDrawerItem extends AbstractDrawerItem<SectionDrawerItem, SectionDrawerItem.ViewHolder> implements Nameable<SectionDrawerItem>, Typefaceable<SectionDrawerItem> {
private StringHolder name;
private boolean divider = true;
private ColorHolder textColor;
private Typeface typeface = null;
public SectionDrawerItem withName(StringHolder name) {
this.name = name;
return this;
}
public SectionDrawerItem withName(String name) {
this.name = new StringHolder(name);
return this;
}
public SectionDrawerItem withName(@StringRes int nameRes) {
this.name = new StringHolder(nameRes);
return this;
}
public SectionDrawerItem withDivider(boolean divider) {
this.divider = divider;
return this;
}
public SectionDrawerItem withTextColor(int textColor) {
this.textColor = ColorHolder.fromColor(textColor);
return this;
}
public SectionDrawerItem withTextColorRes(int textColorRes) {
this.textColor = ColorHolder.fromColorRes(textColorRes);
return this;
}
public SectionDrawerItem withTypeface(Typeface typeface) {
this.typeface = typeface;
return this;
}
public boolean hasDivider() {
return divider;
}
public ColorHolder getTextColor() {
return textColor;
}
public StringHolder getName() {
return name;
}
@Override
public boolean isEnabled() {
return false;
}
@Override
public boolean isSelected() {
return false;
}
@Override
public int getType() {
return R.id.material_drawer_item_section;
}
@Override
@LayoutRes
public int getLayoutRes() {
return R.layout.material_drawer_item_section;
}
@Override
public Typeface getTypeface() {
return typeface;
}
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//define this item to be not clickable nor enabled
viewHolder.view.setClickable(false);
viewHolder.view.setEnabled(false);
//define the text color
viewHolder.name.setTextColor(ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text));
//set the text for the name
StringHolder.applyTo(this.getName(), viewHolder.name);
//define the typeface for our textViews
if (getTypeface() != null) {
viewHolder.name.setTypeface(getTypeface());
}
//hide the divider if we do not need one
if (this.hasDivider()) {
viewHolder.divider.setVisibility(View.VISIBLE);
} else {
viewHolder.divider.setVisibility(View.GONE);
}
//set the color for the divider
viewHolder.divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(ctx, R.attr.material_drawer_divider, R.color.material_drawer_divider));
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private View view;
private View divider;
private TextView name;
private ViewHolder(View view) {
super(view);
this.view = view;
this.divider = view.findViewById(R.id.material_drawer_divider);
this.name = (TextView) view.findViewById(R.id.material_drawer_name);
}
}
}

View File

@ -1,8 +0,0 @@
package com.mikepenz.materialdrawer.model;
/**
* Created by mikepenz on 03.02.15.
*/
public class SwitchDrawerItem extends AbstractSwitchableDrawerItem<SwitchDrawerItem> {
}

View File

@ -1,8 +0,0 @@
package com.mikepenz.materialdrawer.model;
/**
* Created by mikepenz on 03.02.15.
*/
public class ToggleDrawerItem extends AbstractToggleableDrawerItem<ToggleDrawerItem> {
}

View File

@ -1,16 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import com.mikepenz.materialdrawer.holder.StringHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Badgeable<T> {
T withBadge(String badge);
T withBadge(int badgeRes);
T withBadge(StringHolder badgeRes);
StringHolder getBadge();
}

View File

@ -1,13 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import com.mikepenz.materialdrawer.holder.BadgeStyle;
/**
* Created by mikepenz on 03.02.15.
*/
public interface ColorfulBadgeable<T> extends Badgeable<T> {
T withBadgeStyle(BadgeStyle badgeStyle);
BadgeStyle getBadgeStyle();
}

View File

@ -1,48 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import com.mikepenz.fastadapter.IExpandable;
import com.mikepenz.fastadapter.IItem;
import com.mikepenz.fastadapter.ISubItem;
import java.util.List;
/**
* Created by mikepenz on 03.02.15.
*/
public interface IDrawerItem<T, VH extends RecyclerView.ViewHolder> extends IItem<T, VH>, IExpandable<T, IDrawerItem>, ISubItem<IDrawerItem, IDrawerItem> {
Object getTag();
boolean isEnabled();
boolean isSelected();
T withSetSelected(boolean selected);
boolean isSelectable();
boolean isExcludeFromMiniDrawer();
T withSelectable(boolean selectable);
int getType();
int getLayoutRes();
View generateView(Context ctx);
View generateView(Context ctx, ViewGroup parent);
VH getViewHolder(ViewGroup parent);
void unbindView(VH holder);
void bindView(VH holder, List<Object> payloads);
boolean equals(long id);
}

View File

@ -1,42 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import androidx.annotation.DrawableRes;
import com.mikepenz.fastadapter.IIdentifyable;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public interface IProfile<T> extends IIdentifyable<T> {
T withName(CharSequence name);
StringHolder getName();
T withEmail(String email);
StringHolder getEmail();
T withIcon(Drawable icon);
T withIcon(Bitmap bitmap);
T withIcon(@DrawableRes int iconRes);
T withIcon(String url);
T withIcon(Uri uri);
T withIcon(IIcon icon);
ImageHolder getIcon();
T withSelectable(boolean selectable);
boolean isSelectable();
}

View File

@ -1,19 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import android.graphics.drawable.Drawable;
import com.mikepenz.iconics.typeface.IIcon;
import com.mikepenz.materialdrawer.holder.ImageHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Iconable<T> {
T withIcon(Drawable icon);
T withIcon(IIcon iicon);
T withIcon(ImageHolder icon);
ImageHolder getIcon();
}

View File

@ -1,16 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import com.mikepenz.materialdrawer.holder.StringHolder;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Nameable<T> {
T withName(String name);
T withName(int nameRes);
T withName(StringHolder name);
StringHolder getName();
}

View File

@ -1,16 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import android.view.View;
/**
* Created by mikepenz on 21.08.15.
*/
public interface OnPostBindViewListener {
/**
* allows you to hook in the BindView method and modify the view after binding
*
* @param drawerItem the drawerItem used for this view
* @param view the view which will be set
*/
void onBindView(IDrawerItem drawerItem, View view);
}

View File

@ -1,10 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Selectable<T> {
T withSelectable(boolean selectable);
boolean isSelectable();
}

View File

@ -1,10 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Tagable<T> {
T withTag(Object tag);
Object getTag();
}

View File

@ -1,12 +0,0 @@
package com.mikepenz.materialdrawer.model.interfaces;
import android.graphics.Typeface;
/**
* Created by mikepenz on 03.02.15.
*/
public interface Typefaceable<T> {
T withTypeface(Typeface typeface);
Typeface getTypeface();
}

View File

@ -1,44 +0,0 @@
package com.mikepenz.materialdrawer.model.utils;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
import androidx.appcompat.content.res.AppCompatResources;
import android.util.StateSet;
import com.mikepenz.materialdrawer.holder.BadgeStyle;
import com.mikepenz.materialdrawer.holder.ColorHolder;
/**
* Created by mikepenz on 02.07.15.
*/
public class BadgeDrawableBuilder {
private BadgeStyle mStyle;
public BadgeDrawableBuilder(BadgeStyle style) {
this.mStyle = style;
}
public StateListDrawable build(Context ctx) {
StateListDrawable stateListDrawable = new StateListDrawable();
GradientDrawable normal = (GradientDrawable) AppCompatResources.getDrawable(ctx, mStyle.getGradientDrawable());
GradientDrawable selected = (GradientDrawable) normal.getConstantState().newDrawable().mutate();
ColorHolder.applyToOrTransparent(mStyle.getColor(), ctx, normal);
if (mStyle.getColorPressed() == null) {
ColorHolder.applyToOrTransparent(mStyle.getColor(), ctx, selected);
} else {
ColorHolder.applyToOrTransparent(mStyle.getColorPressed(), ctx, selected);
}
if (mStyle.getCorners() != null) {
normal.setCornerRadius(mStyle.getCorners().asPixel(ctx));
selected.setCornerRadius(mStyle.getCorners().asPixel(ctx));
}
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, selected);
stateListDrawable.addState(StateSet.WILD_CARD, normal);
return stateListDrawable;
}
}

View File

@ -1,34 +0,0 @@
package com.mikepenz.materialdrawer.util;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.Log;
import android.widget.ImageView;
public abstract class AbstractDrawerImageLoader implements DrawerImageLoader.IDrawerImageLoader {
@Override
public void set(ImageView imageView, Uri uri, Drawable placeholder) {
}
@Override
public void set(ImageView imageView, Uri uri, Drawable placeholder, String tag) {
//for backwards compatibility call the method without tag too
set(imageView, uri, placeholder);
//this won't do anything
Log.i("MaterialDrawer", "You have not specified a ImageLoader implementation through the DrawerImageLoader.init() method, or you are still overriding the deprecated method set(ImageView iv, Uri u, Drawable d) instead of set(ImageView iv, Uri u, Drawable d, String tag)");
}
@Override
public void cancel(ImageView imageView) {
}
@Override
public Drawable placeholder(Context ctx) {
return DrawerUIUtils.getPlaceHolder(ctx);
}
@Override
public Drawable placeholder(Context ctx, String tag) {
return placeholder(ctx);
}
}

View File

@ -1,94 +0,0 @@
package com.mikepenz.materialdrawer.util;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
/**
* Created by mikepenz on 24.03.15.
*/
public class DrawerImageLoader {
public enum Tags {
PROFILE,
PROFILE_DRAWER_ITEM,
ACCOUNT_HEADER
}
private static DrawerImageLoader SINGLETON = null;
private IDrawerImageLoader imageLoader;
private boolean mHandleAllUris = false;
private DrawerImageLoader(IDrawerImageLoader loaderImpl) {
imageLoader = loaderImpl;
}
public static DrawerImageLoader init(IDrawerImageLoader loaderImpl) {
SINGLETON = new DrawerImageLoader(loaderImpl);
return SINGLETON;
}
public static DrawerImageLoader getInstance() {
if (SINGLETON == null) {
SINGLETON = new DrawerImageLoader(new AbstractDrawerImageLoader() {
});
}
return SINGLETON;
}
public DrawerImageLoader withHandleAllUris(boolean handleAllUris) {
this.mHandleAllUris = handleAllUris;
return this;
}
/**
* @param imageView
* @param uri
* @param tag
* @return false if not consumed
*/
public boolean setImage(ImageView imageView, Uri uri, String tag) {
//if we do not handle all uris and are not http or https we keep the original behavior
if (mHandleAllUris || "http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
if (imageLoader != null) {
Drawable placeHolder = imageLoader.placeholder(imageView.getContext(), tag);
imageLoader.set(imageView, uri, placeHolder, tag);
}
return true;
}
return false;
}
public void cancelImage(ImageView imageView) {
if (imageLoader != null) {
imageLoader.cancel(imageView);
}
}
public IDrawerImageLoader getImageLoader() {
return imageLoader;
}
public void setImageLoader(IDrawerImageLoader imageLoader) {
this.imageLoader = imageLoader;
}
public interface IDrawerImageLoader {
@Deprecated
void set(ImageView imageView, Uri uri, Drawable placeholder);
void set(ImageView imageView, Uri uri, Drawable placeholder, String tag);
void cancel(ImageView imageView);
Drawable placeholder(Context ctx);
/**
* @param ctx
* @param tag current possible tags: "profile", "profileDrawerItem", "accountHeader"
* @return
*/
Drawable placeholder(Context ctx, String tag);
}
}

View File

@ -1,95 +0,0 @@
package com.mikepenz.materialdrawer.util;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialize.util.UIUtils;
import java.util.ArrayList;
import java.util.Collections;
/**
* Created by mikepenz on 27.03.15.
*/
public class DrawerItemViewHelper {
private Context mContext;
public DrawerItemViewHelper(Context context) {
this.mContext = context;
}
private ArrayList<IDrawerItem> mDrawerItems = new ArrayList<>();
public DrawerItemViewHelper withDrawerItems(ArrayList<IDrawerItem> drawerItems) {
this.mDrawerItems = drawerItems;
return this;
}
public DrawerItemViewHelper withDrawerItems(IDrawerItem... drawerItems) {
Collections.addAll(this.mDrawerItems, drawerItems);
return this;
}
private boolean mDivider = true;
public DrawerItemViewHelper withDivider(boolean divider) {
this.mDivider = divider;
return this;
}
private OnDrawerItemClickListener mOnDrawerItemClickListener = null;
public DrawerItemViewHelper withOnDrawerItemClickListener(OnDrawerItemClickListener onDrawerItemClickListener) {
mOnDrawerItemClickListener = onDrawerItemClickListener;
return this;
}
public View build() {
//create the container view
LinearLayout linearLayout = new LinearLayout(mContext);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
linearLayout.setOrientation(LinearLayout.VERTICAL);
//create the divider
if (mDivider) {
LinearLayout divider = new LinearLayout(mContext);
divider.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
divider.setMinimumHeight((int) UIUtils.convertDpToPixel(1, mContext));
divider.setOrientation(LinearLayout.VERTICAL);
divider.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mContext, R.attr.material_drawer_divider, R.color.material_drawer_divider));
linearLayout.addView(divider);
}
//add all drawer items
for (IDrawerItem drawerItem : mDrawerItems) {
View view = drawerItem.generateView(mContext);
view.setTag(drawerItem);
if (drawerItem.isEnabled()) {
view.setBackgroundResource(UIUtils.getSelectableBackgroundRes(mContext));
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnDrawerItemClickListener != null) {
mOnDrawerItemClickListener.onItemClick(v, (IDrawerItem) v.getTag(R.id.material_drawer_item));
}
}
});
}
linearLayout.addView(view);
}
return linearLayout;
}
public interface OnDrawerItemClickListener {
public void onItemClick(View view, IDrawerItem drawerItem);
}
}

View File

@ -1,242 +0,0 @@
package com.mikepenz.materialdrawer.util;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.StyleableRes;
import androidx.core.view.ViewCompat;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.icons.MaterialDrawerFont;
import com.mikepenz.materialize.util.UIUtils;
/**
* Created by mikepenz on 15.03.14.
*/
@SuppressLint("InlinedApi")
public class DrawerUIUtils {
/**
* Get the boolean value of a given styleable.
*
* @param ctx
* @param styleable
* @param def
* @return
*/
public static boolean getBooleanStyleable(Context ctx, @StyleableRes int styleable, boolean def) {
TypedArray ta = ctx.getTheme().obtainStyledAttributes(R.styleable.MaterialDrawer);
return ta.getBoolean(styleable, def);
}
/**
* Util method to theme the drawer item view's background (and foreground if possible)
*
* @param ctx the context to use
* @param view the view to theme
* @param selected_color the selected color to use
* @param animate true if we want to animate the StateListDrawable
*/
public static void themeDrawerItem(Context ctx, View view, int selected_color, boolean animate) {
boolean legacyStyle = getBooleanStyleable(ctx, R.styleable.MaterialDrawer_material_drawer_legacy_style, false);
Drawable selected;
Drawable unselected;
if (legacyStyle) {
// Material 1.0 styling
selected = new ColorDrawable(selected_color);
unselected = UIUtils.getSelectableBackground(ctx);
} else {
// Material 2.0 styling
int cornerRadius = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_item_corner_radius);
int paddingTopBottom = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_item_background_padding_top_bottom);
int paddingStartEnd = ctx.getResources().getDimensionPixelSize(R.dimen.material_drawer_item_background_padding_start_end);
// define normal selected background
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(selected_color);
gradientDrawable.setCornerRadius(cornerRadius);
selected = new InsetDrawable(gradientDrawable, paddingStartEnd, paddingTopBottom, paddingStartEnd, paddingTopBottom);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// define mask for ripple
GradientDrawable gradientMask = new GradientDrawable();
gradientMask.setColor(Color.BLACK);
gradientMask.setCornerRadius(cornerRadius);
Drawable mask = new InsetDrawable(gradientMask, paddingStartEnd, paddingTopBottom, paddingStartEnd, paddingTopBottom);
unselected = new RippleDrawable(new ColorStateList(new int[][]{new int[]{}}, new int[]{UIUtils.getThemeColor(ctx, R.attr.colorControlHighlight)}), null, mask);
} else {
// define touch drawable
GradientDrawable touchDrawable = new GradientDrawable();
touchDrawable.setColor(UIUtils.getThemeColor(ctx, R.attr.colorControlHighlight));
touchDrawable.setCornerRadius(cornerRadius);
Drawable touchInsetDrawable = new InsetDrawable(touchDrawable, paddingStartEnd, paddingTopBottom, paddingStartEnd, paddingTopBottom);
StateListDrawable unselectedStates = new StateListDrawable();
//if possible and wanted we enable animating across states
if (animate) {
int duration = ctx.getResources().getInteger(android.R.integer.config_shortAnimTime);
unselectedStates.setEnterFadeDuration(duration);
unselectedStates.setExitFadeDuration(duration);
}
unselectedStates.addState(new int[]{android.R.attr.state_pressed}, touchInsetDrawable);
unselectedStates.addState(new int[]{}, new ColorDrawable(Color.TRANSPARENT));
unselected = unselectedStates;
}
}
StateListDrawable states = new StateListDrawable();
//if possible and wanted we enable animating across states
if (animate) {
int duration = ctx.getResources().getInteger(android.R.integer.config_shortAnimTime);
states.setEnterFadeDuration(duration);
states.setExitFadeDuration(duration);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
states.addState(new int[]{android.R.attr.state_selected}, selected);
states.addState(new int[]{}, new ColorDrawable(Color.TRANSPARENT));
ViewCompat.setBackground(view, states);
view.setForeground(unselected);
} else {
states.addState(new int[]{android.R.attr.state_selected}, selected);
states.addState(new int[]{}, unselected);
ViewCompat.setBackground(view, states);
}
}
/**
* helper to create a colorStateList for the text
*
* @param text_color
* @param selected_text_color
* @return
*/
public static ColorStateList getTextColorStateList(int text_color, int selected_text_color) {
return new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_selected},
new int[]{}
},
new int[]{
selected_text_color,
text_color
}
);
}
/**
* helper to create a stateListDrawable for the icon
*
* @param icon
* @param selectedIcon
* @return
*/
public static StateListDrawable getIconStateList(Drawable icon, Drawable selectedIcon) {
StateListDrawable iconStateListDrawable = new StateListDrawable();
iconStateListDrawable.addState(new int[]{android.R.attr.state_selected}, selectedIcon);
iconStateListDrawable.addState(new int[]{}, icon);
return iconStateListDrawable;
}
/**
* helper to create a StateListDrawable for the drawer item background
*
* @param selected_color
* @return
*/
public static StateListDrawable getDrawerItemBackground(int selected_color) {
ColorDrawable clrActive = new ColorDrawable(selected_color);
StateListDrawable states = new StateListDrawable();
states.addState(new int[]{android.R.attr.state_selected}, clrActive);
return states;
}
/**
* helper to calculate the optimal drawer width
*
* @param context
* @return
*/
public static int getOptimalDrawerWidth(Context context) {
int possibleMinDrawerWidth = UIUtils.getScreenWidth(context) - UIUtils.getActionBarHeight(context);
int maxDrawerWidth = context.getResources().getDimensionPixelSize(R.dimen.material_drawer_width);
return Math.min(possibleMinDrawerWidth, maxDrawerWidth);
}
/**
* helper method to get a person placeHolder drawable
*
* @param ctx
* @return
*/
public static Drawable getPlaceHolder(Context ctx) {
return new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_person).colorRes(R.color.accent).backgroundColorRes(R.color.primary).sizeDp(56).paddingDp(16);
}
/**
* helper to set the vertical padding to the DrawerItems
* this is required because on API Level 17 the padding is ignored which is set via the XML
*
* @param v
*/
public static void setDrawerVerticalPadding(View v) {
int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding);
v.setPadding(verticalPadding, 0, verticalPadding, 0);
}
/**
* helper to set the vertical padding including the extra padding for deeper item hirachy level to the DrawerItems
* this is required because on API Level 17 the padding is ignored which is set via the XML
*
* @param v
* @param level
*/
public static void setDrawerVerticalPadding(View v, int level) {
int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
v.setPaddingRelative(verticalPadding * level, 0, verticalPadding, 0);
} else {
v.setPadding(verticalPadding * level, 0, verticalPadding, 0);
}
}
/**
* helper to check if the system bar is on the bottom of the screen
*
* @param ctx
* @return
*/
public static boolean isSystemBarOnBottom(Context ctx) {
WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics metrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(metrics);
Configuration cfg = ctx.getResources().getConfiguration();
boolean canMove = (metrics.widthPixels != metrics.heightPixels &&
cfg.smallestScreenWidthDp < 600);
return (!canMove || metrics.widthPixels < metrics.heightPixels);
}
}

View File

@ -1,103 +0,0 @@
/*
* Copyright 2015 Mike Penz All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mikepenz.materialdrawer.util;
import android.app.Activity;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager;
/**
* Created by mikepenz on 14.03.15.
* This class implements a hack to change the layout padding on bottom if the keyboard is shown
* to allow long lists with editTextViews
* Basic idea for this solution found here: http://stackoverflow.com/a/9108219/325479
* @deprecated Do not use this anymore, the MaterialDrawer uses the `fitsSystemWindows` now correctly so it should not be required. (it would only be required for cases with the fullscreen flag)
*/
@Deprecated
public class KeyboardUtil {
private View decorView;
private View contentView;
public KeyboardUtil(Activity act, View contentView) {
this.decorView = act.getWindow().getDecorView();
this.contentView = contentView;
//only required on newer android versions. it was working on API level 19
if (Build.VERSION.SDK_INT >= 19) {
decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
}
}
public void enable() {
if (Build.VERSION.SDK_INT >= 19) {
decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
}
}
public void disable() {
if (Build.VERSION.SDK_INT >= 19) {
decorView.getViewTreeObserver().removeOnGlobalLayoutListener(onGlobalLayoutListener);
}
}
//a small helper to allow showing the editText focus
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
Rect r = new Rect();
//r will be populated with the coordinates of your view that area still visible.
decorView.getWindowVisibleDisplayFrame(r);
//get screen height and calculate the difference with the useable area from the r
int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels;
int diff = height - r.bottom;
//if it could be a keyboard add the padding to the view
if (diff != 0) {
// if the use-able screen height differs from the total screen height we assume that it shows a keyboard now
//check if the padding is 0 (if yes set the padding for the keyboard)
if (contentView.getPaddingBottom() != diff) {
//set the padding of the contentView for the keyboard
contentView.setPadding(0, 0, 0, diff);
}
} else {
//check if the padding is != 0 (if yes reset the padding)
if (contentView.getPaddingBottom() != 0) {
//reset the padding of the contentView
contentView.setPadding(0, 0, 0, 0);
}
}
}
};
/**
* Helper to hide the keyboard
*
* @param act
*/
public static void hideKeyboard(Activity act) {
if (act != null && act.getCurrentFocus() != null) {
InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0);
}
}
}

View File

@ -1,51 +0,0 @@
package com.mikepenz.materialdrawer.util;
import android.annotation.SuppressLint;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
/**
* http://stackoverflow.com/questions/7979440/android-cloning-a-drawable-in-order-to-make-a-statelistdrawable-with-filters
* http://stackoverflow.com/users/2075875/malachiasz
*/
@SuppressLint("InlinedApi")
public class PressedEffectStateListDrawable extends StateListDrawable {
private int color;
private int selectionColor;
public PressedEffectStateListDrawable(Drawable drawable, int color, int selectionColor) {
super();
drawable = drawable.mutate();
addState(new int[]{android.R.attr.state_selected}, drawable);
addState(new int[]{}, drawable);
this.color = color;
this.selectionColor = selectionColor;
}
@Override
protected boolean onStateChange(int[] states) {
boolean isStatePressedInArray = false;
for (int state : states) {
if (state == android.R.attr.state_selected) {
isStatePressedInArray = true;
}
}
if (isStatePressedInArray) {
super.setColorFilter(selectionColor, PorterDuff.Mode.SRC_IN);
} else {
super.setColorFilter(color, PorterDuff.Mode.SRC_IN);
}
return super.onStateChange(states);
}
@Override
public boolean isStateful() {
return true;
}
}

View File

@ -1,349 +0,0 @@
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* The original is from Google you can find here:
* https://github.com/google/iosched/blob/master/android/src/main/java/com/google/samples/apps/iosched/ui/widget/BezelImageView.java
*
* Modified and improved with additional functionality by Mike Penz
*/
package com.mikepenz.materialdrawer.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.core.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.ImageView;
import com.mikepenz.materialdrawer.R;
import com.mikepenz.materialdrawer.util.DrawerImageLoader;
/**
* An {@link android.widget.ImageView} that draws its contents inside a mask and draws a border
* drawable on top. This is useful for applying a beveled look to image contents, but is also
* flexible enough for use with other desired aesthetics.
*/
public class BezelImageView extends AppCompatImageView {
private Paint mBlackPaint;
private Paint mMaskedPaint;
private Rect mBounds;
private RectF mBoundsF;
private Drawable mMaskDrawable;
private boolean mDrawCircularShadow = true;
private ColorMatrixColorFilter mDesaturateColorFilter;
private int mSelectorAlpha = 150;
private int mSelectorColor;
private ColorFilter mSelectorFilter;
private boolean mCacheValid = false;
private Bitmap mCacheBitmap;
private int mCachedWidth;
private int mCachedHeight;
private boolean isPressed = false;
private boolean isSelected;
public BezelImageView(Context context) {
this(context, null);
}
public BezelImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public BezelImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// Attribute initialization
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BezelImageView, defStyle, R.style.BezelImageView);
mMaskDrawable = a.getDrawable(R.styleable.BezelImageView_biv_maskDrawable);
if (mMaskDrawable != null) {
mMaskDrawable.setCallback(this);
}
mDrawCircularShadow = a.getBoolean(R.styleable.BezelImageView_biv_drawCircularShadow, true);
mSelectorColor = a.getColor(R.styleable.BezelImageView_biv_selectorOnPress, 0);
a.recycle();
// Other initialization
mBlackPaint = new Paint();
mBlackPaint.setColor(0xff000000);
mMaskedPaint = new Paint();
mMaskedPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
// Always want a cache allocated.
mCacheBitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
// Create a desaturate color filter for pressed state.
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
mDesaturateColorFilter = new ColorMatrixColorFilter(cm);
//create a selectorFilter if we already have a color
if (mSelectorColor != 0) {
this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP);
}
}
@Override
protected void onSizeChanged(int w, int h, int old_w, int old_h) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (mDrawCircularShadow) {
setOutlineProvider(new CustomOutline(w, h));
}
}
}
@TargetApi(21)
private class CustomOutline extends ViewOutlineProvider {
int width;
int height;
CustomOutline(int width, int height) {
this.width = width;
this.height = height;
}
@Override
public void getOutline(View view, Outline outline) {
outline.setOval(0, 0, width, height);
}
}
@Override
protected boolean setFrame(int l, int t, int r, int b) {
final boolean changed = super.setFrame(l, t, r, b);
mBounds = new Rect(0, 0, r - l, b - t);
mBoundsF = new RectF(mBounds);
if (mMaskDrawable != null) {
mMaskDrawable.setBounds(mBounds);
}
if (changed) {
mCacheValid = false;
}
return changed;
}
@Override
protected void onDraw(Canvas canvas) {
if (mBounds == null) {
return;
}
int width = mBounds.width();
int height = mBounds.height();
if (width == 0 || height == 0) {
return;
}
if (!mCacheValid || width != mCachedWidth || height != mCachedHeight || isSelected != isPressed) {
// Need to redraw the cache
if (width == mCachedWidth && height == mCachedHeight) {
// Have a correct-sized bitmap cache already allocated. Just erase it.
mCacheBitmap.eraseColor(0);
} else {
// Allocate a new bitmap with the correct dimensions.
mCacheBitmap.recycle();
//noinspection AndroidLintDrawAllocation
mCacheBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
mCachedWidth = width;
mCachedHeight = height;
}
Canvas cacheCanvas = new Canvas(mCacheBitmap);
if (mMaskDrawable != null) {
int sc = cacheCanvas.save();
mMaskDrawable.draw(cacheCanvas);
if (isSelected) {
if (mSelectorFilter != null) {
mMaskedPaint.setColorFilter(mSelectorFilter);
} else {
mMaskedPaint.setColorFilter(mDesaturateColorFilter);
}
} else {
mMaskedPaint.setColorFilter(null);
}
cacheCanvas.saveLayer(mBoundsF, mMaskedPaint, Canvas.ALL_SAVE_FLAG);
super.onDraw(cacheCanvas);
cacheCanvas.restoreToCount(sc);
} else if (isSelected) {
int sc = cacheCanvas.save();
cacheCanvas.drawRect(0, 0, mCachedWidth, mCachedHeight, mBlackPaint);
if (mSelectorFilter != null) {
mMaskedPaint.setColorFilter(mSelectorFilter);
} else {
mMaskedPaint.setColorFilter(mDesaturateColorFilter);
}
cacheCanvas.saveLayer(mBoundsF, mMaskedPaint, Canvas.ALL_SAVE_FLAG);
super.onDraw(cacheCanvas);
cacheCanvas.restoreToCount(sc);
} else {
super.onDraw(cacheCanvas);
}
}
// Draw from cache
canvas.drawBitmap(mCacheBitmap, mBounds.left, mBounds.top, null);
//remember the previous press state
isPressed = isPressed();
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
// Check for clickable state and do nothing if disabled
if (!this.isClickable()) {
this.isSelected = false;
return super.onTouchEvent(event);
}
// Set selected state based on Motion Event
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
this.isSelected = true;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_SCROLL:
case MotionEvent.ACTION_OUTSIDE:
case MotionEvent.ACTION_CANCEL:
this.isSelected = false;
break;
}
// Redraw image and return super type
this.invalidate();
return super.dispatchTouchEvent(event);
}
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (mMaskDrawable != null && mMaskDrawable.isStateful()) {
mMaskDrawable.setState(getDrawableState());
}
if (isDuplicateParentStateEnabled()) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
@Override
public void invalidateDrawable(Drawable who) {
if (who == mMaskDrawable) {
invalidate();
} else {
super.invalidateDrawable(who);
}
}
@Override
protected boolean verifyDrawable(Drawable who) {
return who == mMaskDrawable || super.verifyDrawable(who);
}
/**
* Sets the color of the selector to be draw over the
* CircularImageView. Be sure to provide some opacity.
*
* @param selectorColor The color (including alpha) to set for the selector overlay.
*/
public void setSelectorColor(int selectorColor) {
this.mSelectorColor = selectorColor;
this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP);
this.invalidate();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
}
@Override
public void setImageURI(Uri uri) {
if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
DrawerImageLoader.getInstance().setImage(this, uri, null);
} else {
super.setImageURI(uri);
}
}
private ColorMatrixColorFilter mTempDesaturateColorFilter;
private ColorFilter mTempSelectorFilter;
public void disableTouchFeedback(boolean disable) {
if (disable) {
mTempDesaturateColorFilter = this.mDesaturateColorFilter;
mTempSelectorFilter = this.mSelectorFilter;
this.mSelectorFilter = null;
this.mDesaturateColorFilter = null;
} else {
if (mTempDesaturateColorFilter != null) {
this.mDesaturateColorFilter = mTempDesaturateColorFilter;
}
if (mTempSelectorFilter != null) {
this.mSelectorFilter = mTempSelectorFilter;
}
}
}
}

View File

@ -1,20 +0,0 @@
<!--
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#000" />
</shape>

View File

@ -1,7 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#40000000"
android:startColor="@android:color/transparent" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

View File

@ -1,7 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:endColor="#40000000"
android:startColor="@android:color/transparent" />
</shape>

View File

@ -1,114 +0,0 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/material_drawer_account_header"
android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_account_header_height_compact"
android:clickable="true"
android:fitsSystemWindows="false"
android:focusable="true"
app:layout_dodgeInsetEdges="top">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/material_drawer_account_header_background"
android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_account_header_height_compact"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/material_drawer_statusbar_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="0dp" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_first"
android:layout_width="1dp"
android:layout_height="1dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_second"
android:layout_width="1dp"
android:layout_height="1dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_third"
android:layout_width="1dp"
android:layout_height="1dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_current"
android:layout_width="@dimen/material_drawer_account_header_compact"
android:layout_height="@dimen/material_drawer_account_header_compact"
android:layout_gravity="bottom"
android:layout_marginStart="@dimen/material_drawer_vertical_padding"
android:layout_marginLeft="@dimen/material_drawer_vertical_padding"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:lines="1"
android:maxLines="1"
android:paddingStart="@dimen/material_drawer_vertical_padding"
android:paddingLeft="@dimen/material_drawer_vertical_padding"
android:paddingEnd="@dimen/material_drawer_vertical_padding"
android:paddingRight="@dimen/material_drawer_vertical_padding"
android:textSize="@dimen/material_drawer_account_header_title"
app:layout_constraintBottom_toTopOf="@id/material_drawer_account_header_email"
app:layout_constraintEnd_toStartOf="@+id/material_drawer_account_header_text_switcher"
app:layout_constraintStart_toEndOf="@id/material_drawer_account_header_current"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline"
app:layout_constraintVertical_chainStyle="packed"
app:layout_goneMarginStart="0dp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:lines="1"
android:maxLines="1"
android:paddingStart="@dimen/material_drawer_vertical_padding"
android:paddingLeft="@dimen/material_drawer_vertical_padding"
android:paddingEnd="@dimen/material_drawer_vertical_padding"
android:paddingRight="@dimen/material_drawer_vertical_padding"
android:textSize="@dimen/material_drawer_account_header_subtext"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/material_drawer_account_header_text_switcher"
app:layout_constraintStart_toEndOf="@id/material_drawer_account_header_current"
app:layout_constraintTop_toBottomOf="@id/material_drawer_account_header_name"
app:layout_goneMarginStart="0dp" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/material_drawer_account_header_text_switcher"
android:layout_width="@dimen/material_drawer_account_header_dropdown"
android:layout_height="@dimen/material_drawer_account_header_dropdown"
android:layout_gravity="bottom"
android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
android:layout_marginRight="@dimen/material_drawer_vertical_padding"
android:layout_marginBottom="@dimen/material_drawer_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true" />

View File

@ -1,128 +0,0 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/material_drawer_account_header"
android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_account_header_height"
android:clickable="true">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/material_drawer_account_header_background"
android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_account_header_height"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/material_drawer_statusbar_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="0dp" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_current"
android:layout_width="@dimen/material_drawer_account_header_selected"
android:layout_height="@dimen/material_drawer_account_header_selected"
android:layout_marginStart="@dimen/material_drawer_vertical_padding"
android:layout_marginLeft="@dimen/material_drawer_vertical_padding"
android:layout_marginTop="@dimen/material_drawer_account_header_horizontal_top"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_first"
android:layout_width="@dimen/material_drawer_account_header_secondary"
android:layout_height="@dimen/material_drawer_account_header_secondary"
android:layout_marginTop="@dimen/material_drawer_account_header_horizontal_top"
android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
android:layout_marginRight="@dimen/material_drawer_vertical_padding"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_second"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_second"
android:layout_width="@dimen/material_drawer_account_header_secondary"
android:layout_height="@dimen/material_drawer_account_header_secondary"
android:layout_marginTop="@dimen/material_drawer_account_header_horizontal_top"
android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
android:layout_marginRight="@dimen/material_drawer_vertical_padding"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_third"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_third"
android:layout_width="@dimen/material_drawer_account_header_secondary"
android:layout_height="@dimen/material_drawer_account_header_secondary"
android:layout_marginTop="@dimen/material_drawer_account_header_horizontal_top"
android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
android:layout_marginRight="@dimen/material_drawer_vertical_padding"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/material_drawer_text_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_end="@dimen/material_drawer_account_header_dropdown_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/material_drawer_vertical_padding"
android:layout_marginLeft="@dimen/material_drawer_vertical_padding"
android:fontFamily="sans-serif-medium"
android:lines="1"
android:maxLines="1"
android:textSize="@dimen/material_drawer_account_header_title"
app:layout_constraintBottom_toTopOf="@id/material_drawer_account_header_email"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_text_switcher"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/material_drawer_text_guideline"
app:layout_constraintVertical_chainStyle="packed" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/material_drawer_vertical_padding"
android:layout_marginLeft="@dimen/material_drawer_vertical_padding"
android:layout_marginBottom="@dimen/material_drawer_padding"
android:fontFamily="sans-serif"
android:lines="1"
android:maxLines="1"
android:textSize="@dimen/material_drawer_account_header_subtext"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_text_switcher"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/material_drawer_account_header_name" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/material_drawer_account_header_text_switcher"
android:layout_width="@dimen/material_drawer_account_header_dropdown"
android:layout_height="@dimen/material_drawer_account_header_dropdown"
android:layout_marginEnd="@dimen/material_drawer_vertical_padding"
android:layout_marginRight="@dimen/material_drawer_vertical_padding"
android:layout_marginBottom="@dimen/material_drawer_account_header_dropdown_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/material_drawer_padding"
android:paddingBottom="@dimen/material_drawer_padding">
<View
android:id="@+id/material_drawer_divider"
android:layout_width="match_parent"
android:layout_height="1dp" />
</RelativeLayout>

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_item_primary"
android:orientation="horizontal"
android:paddingStart="@dimen/material_drawer_vertical_padding"
android:paddingLeft="@dimen/material_drawer_vertical_padding"
android:paddingEnd="@dimen/material_drawer_vertical_padding"
android:paddingRight="@dimen/material_drawer_vertical_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/material_drawer_icon"
android:layout_width="@dimen/material_drawer_item_primary_icon"
android:layout_height="@dimen/material_drawer_item_primary"
android:layout_gravity="center_vertical"
android:paddingStart="0dp"
android:paddingLeft="0dp"
android:paddingTop="@dimen/material_drawer_item_primary_icon_padding"
android:paddingEnd="@dimen/material_drawer_item_primary_icon_padding_right"
android:paddingRight="@dimen/material_drawer_item_primary_icon_padding_right"
android:paddingBottom="@dimen/material_drawer_item_primary_icon_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|start"
android:lines="1"
android:singleLine="true"
android:textDirection="anyRtl"
android:textSize="@dimen/material_drawer_item_primary_text"
app:layout_constraintBottom_toTopOf="@id/material_drawer_description"
app:layout_constraintEnd_toStartOf="@+id/material_drawer_arrow_container"
app:layout_constraintStart_toEndOf="@id/material_drawer_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Some drawer text" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:gravity="center_vertical|start"
android:lines="1"
android:singleLine="true"
android:textDirection="anyRtl"
android:textSize="@dimen/material_drawer_item_primary_description"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/material_drawer_arrow_container"
app:layout_constraintStart_toEndOf="@id/material_drawer_icon"
app:layout_constraintTop_toBottomOf="@id/material_drawer_name"
tools:text="Some drawer text" />
<LinearLayout
android:id="@+id/material_drawer_arrow_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingStart="@dimen/material_drawer_padding"
android:paddingLeft="@dimen/material_drawer_padding"
android:paddingEnd="0dp"
android:paddingRight="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/material_drawer_arrow"
android:layout_width="16dp"
android:layout_height="16dp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Some files were not shown because too many files have changed in this diff Show More