Merge branch 'develop' into feature/fga/dial_pad_tab

# Conflicts:
#	vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt
#	vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt
This commit is contained in:
ganfra 2021-06-10 15:37:24 +02:00
commit 880da9ecd5
882 changed files with 8214 additions and 6302 deletions

View File

@ -37,6 +37,7 @@
<w>threepid</w>
<w>unpublish</w>
<w>unwedging</w>
<w>vctr</w>
</words>
</dictionary>
</component>

View File

@ -44,6 +44,9 @@ Other changes:
- Add documentation on LoginWizard and RegistrationWizard (#3303)
- Setup towncrier tool (#3293)
Security:
- Element Android shares name of E2EE files with homeserver (#3387)
Changes in Element 1.1.7 (2021-05-12)
===================================================

View File

@ -26,7 +26,7 @@ To install the template (to be done only once):
To create a new screen:
- First create a new package in your code.
- Then right click on the package, and select `New/New Vector/RiotX Feature`.
- Then right click on the package, and select `New/New Vector/Element Feature`.
- Follow the Wizard, especially replace `Main` by something more relevant to your feature.
- Click on `Finish`.
- Remaining steps are described as TODO in the generated files, or will be pointed out by the compiler, or at runtime :)

View File

@ -55,7 +55,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation "androidx.recyclerview:recyclerview:1.2.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'com.google.android.material:material:1.3.0'
}

View File

@ -0,0 +1,85 @@
# Color migration
### Changes
- use colors defined in https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0
- remove unused resources and code (ex: PercentView)
- split some resource files into smaller file
- rework the theme files
- ensure material theme is used everywhere in the theme and in the layout
- add default style for some views in the theme (ex: Toolbar, etc.)
- add some debug screen in the debug menu, to test the themes and the button style
- rework the button style to use `materialThemeOverlay` attribute
- custom tint icon for menu management has been removed
- comment with `riotx` has been updated
### Main change for developers
- Read migration guide: https://github.com/vector-im/element-android/pull/3459/files#diff-f0e52729d5e4f6eccbcf72246807aa34ed19c4ef5625ca669df998cd1022874b
- Use MaterialAlertDialogBuilder instead of AlertDialog.Builder
- some Epoxy Item included a divider. This has been removed. Use a `dividerItem` or `bottomSheetDividerItem` Epoxy items to add a divider
- RecyclerView.configureWith now take a divider drawable instead of a divider color
### Remaining work
- Cleanup some vector drawables and ensure a tint is always used instead of hard coded color.
### Migration guide
Some colors and color attribute has been removed, here is the list and what has to be used now.
It can help Element Android forks maintainers to migrate their code.
- riotx_text_primary -> ?vctr_content_primary
- riotx_text_secondary -> ?vctr_content_secondary
- riotx_text_tertiary -> ?vctr_content_tertiary
- ?riotx_background -> ?android:colorBackground
- riotx_background_light -> element_background_light
- riotx_background_dark -> element_background_dark
- riotx_background_black -> element_background_black
- riotx_accent -> ?colorPrimary
- riotx_positive_accent -> ?colorPrimary
- riotx_accent_alpha25 -> color_primary_alpha25
- riotx_notice -> ?colorError
- riotx_destructive_accent -> ?colorError
- vector_error_color -> ?colorError
- vector_warning_color -> ?colorError
- riotx_bottom_sheet_background -> ?colorSurface
- riotx_alerter_background -> ?colorSurface
- riotx_username_1 -> element_name_01
- riotx_username_2 -> element_name_02
- riotx_username_3 -> element_name_03
- riotx_username_4 -> element_name_04
- riotx_username_5 -> element_name_05
- riotx_username_6 -> element_name_06
- riotx_username_7 -> element_name_07
- riotx_username_8 -> element_name_08
- riotx_avatar_fill_1 -> element_room_01
- riotx_avatar_fill_2 -> element_room_02
- riotx_avatar_fill_3 -> element_room_03
- white -> @android:color/white
- black -> @android:color/black or emoji_color
- riotx_list_header_background_color -> ?vctr_header_background
- riotx_header_panel_background -> ?vctr_header_background
- riotx_list_bottom_sheet_divider_color -> ?vctr_list_separator_on_surface
- riotx_list_divider_color -> ?vctr_list_separator
- list_divider_color -> ?vctr_list_separator
- riotx_header_panel_border_mobile -> ?vctr_list_separator
- riotx_bottom_nav_background_border_color -> ?vctr_list_separator
- riotx_header_panel_text_secondary -> ?vctr_content_primary
- link_color_light -> element_link_light
- link_color_dark -> element_link_dark
- riotx_toolbar_primary_text_color -> vctr_content_primary
- riotx_toolbar_secondary_text_color -> vctr_content_primary
- riot_primary_text_color -> vctr_content_primary
- riotx_android_secondary -> vctr_content_secondary

View File

@ -1,30 +1,39 @@
Element je nový typ aplikace pro výměnu zpráv a spolupráci, která:
Element je zabezpečený komunikátor a zároveň aplikace pro týmovou spolupráci, která je ideální pro skupinové chaty při práci na dálku. Tato chatovací aplikace využívá end-to-end šifrování a poskytuje výkonné videokonference, sdílení souborů a hlasové hovory.
1. Vám dá kontrolu nad ochranou vašeho soukromí
2. Umožní vám komunikovat s kýmkoli v síti Matrix a dokonce i mimo ni pomocí integrací s aplikacemi, jako je Slack
3. Ochrání vás před inzercí, dataminingem a uzavřenými zahradami
4. Zabezpečí vás end-to-end šifrováním s křížovým podpisem pro ověření ostatních
<b>Mezi funkce aplikace Element patří:</b>
- Pokročilé nástroje pro online komunikaci
- Plně šifrované zprávy umožňující bezpečnější firemní komunikaci i pro pracovníky na dálku
- Decentralizovaný chat založený na open source frameworku Matrix
- Bezpečné sdílení souborů se šifrovanými daty při správě projektů
- Videochaty s funkcí Voice over IP a sdílením obrazovky
- Snadná integrace s oblíbenými nástroji pro online spolupráci, nástroji pro správu projektů, službami VoIP a dalšími aplikacemi pro týmovou komunikaci
Element je zcela odlišný od ostatních aplikací pro zasílání zpráv a spolupráci, protože je decentralizovaný a otevřený.
Element se zcela liší od ostatních aplikací pro zasílání zpráv a spolupráci. Funguje na platformě Matrix, otevřené síti pro bezpečné zasílání zpráv a decentralizovanou komunikaci. Umožňuje vlastní hostování, aby uživatelé měli maximální vlastnictví a kontrolu nad svými daty a zprávami.
Element vám umožňuje použít vlastní domovský server - nebo si vybrat hostitele - abyste měli soukromí, vlastnictví a kontrolu nad svými daty a konverzacemi. Poskytuje vám přístup k otevřené síti; takže nejste zaseknuti jen při konverzaci s ostatními uživateli Elementu. A je velmi bezpečný.
<b>Soukromí a šifrované zprávy</b>
Element vás chrání před nežádoucími reklamami, vytěžováním dat a tzv. walled gardens. Zabezpečuje také všechna vaše data, video a hlasovou komunikaci jeden na jednoho prostřednictvím šifrování end-to-end a křížového ověřování zařízení.
Element je toho všeho schopen, protože pracuje na Matrixu - standardu otevřené, decentralizované komunikace.
Element vám dává kontrolu nad vaším soukromím a zároveň vám umožňuje bezpečně komunikovat s kýmkoli v síti Matrix nebo s dalšími nástroji pro firemní spolupráci díky integraci s aplikacemi, jako je Slack.
Element vám dává kontrolu nad tím, že si můžete vybrat, kdo bude hostovat vaše konverzace. Z aplikace Element si můžete vybrat hostování různými způsoby:
<b>Element lze hostovat samostatně</b>
Abyste měli větší kontrolu nad svými citlivými daty a konverzacemi, může být Element hostován na vlastním hardwaru nebo si můžete vybrat libovolného hostitele založeného na systému Matrix - standardu pro decentralizovanou komunikaci s otevřeným zdrojovým kódem. Element vám poskytuje soukromí, soulad se zásadami bezpečnosti a flexibilitu integrace.
1. Získejte zdarma účet na veřejném serveru matrix.org hostovaném vývojáři Matrixu, nebo si vyberte z tisíců veřejných serverů hostovaných dobrovolníky
2. Hostujte svůj účet spuštěním serveru na svém vlastním hardwaru
3. Zaregistrujte si účet na vlastním serveru jednoduchým přihlášením k hostitelské platformě Element Matrix Services
<b>Vlastněte svá data</b>
Sami rozhodujete, kde budou vaše data a zprávy uloženy. Bez rizika vytěžování dat nebo přístupu třetích stran.
<b>Proč zvolit Element?</b>
Element vám dává kontrolu různými způsoby:
1. Získejte bezplatný účet na veřejném serveru matrix.org, který hostují vývojáři Matrixu, nebo si vyberte z tisíců veřejných serverů hostovaných dobrovolníky.
2. Vlastní hostování účtu spuštěním serveru na vlastní IT infrastruktuře.
3. Zaregistrujte si účet na vlastním serveru tak, že si jednoduše předplatíte hostingovou platformu Element Matrix Services.
<b>VLASTNĚTE SVÁ DATA</b>: Vy rozhodnete, kde svá data a zprávy ponecháte. Vlastníte je a jsou pod vaší kontrolou, ne nějaký MEGACORP, který těží vaše data nebo poskytuje přístup třetím stranám.
<b>Otevřené zasílání zpráv a spolupráce</b>
Můžete chatovat s kýmkoli v síti Matrix, ať už používá aplikaci Element, jinou aplikaci podporující protokol Matrix nebo dokonce i když používá jinou aplikaci pro zasílání zpráv.
<b>ZPRÁVY A SPOLUPRÁCE</b>: Můžete chatovat s kýmkoli v síti Matrix, ať už používá Element nebo jinou aplikaci, a to i v případě, že používají jiný systém zasílání zpráv, jako je Slack, IRC nebo XMPP.
<b>Superbezpečné</b>
Skutečné end-to-end šifrování (zprávy mohou dešifrovat pouze účastníci konverzace) a křížové ověřování zařízení.
<b>MAXIMÁLNĚ BEZPEČNÉ</b>: Skutečné šifrování typu end-to-end (pouze ti v konverzaci mohou dešifrovat zprávy) a křížové podepisování k ověření zařízení účastníků konverzace.
<b>Kompletní komunikace a integrace</b>
Zprávy, hlasové a videohovory, sdílení souborů, sdílení obrazovky a celá řada integrací, botů a widgetů. Vytvářejte místnosti, komunity, zůstaňte v kontaktu a spolupracujte.
<b>KOMPLETNÍ KOMUNIKACE</b>: Zprávy, hlasové hovory a videohovory, sdílení souborů, sdílení obrazovky a celá řada integrací, robotů a widgetů. Budujte místnosti, komunity, zůstaňte v kontaktu a spolupracujte.
<b>KDEKOLIV JSTE</b>: Zůstaňte v kontaktu, ať jste kdekoli, s plně synchronizovanou historií zpráv na všech vašich zařízeních a na webu na adrese https://app.element.io.
<b>Navažte tam, kde jste skončili</b>
Zůstaňte v kontaktu, ať jste kdekoli, díky plně synchronizované historii zpráv ve všech zařízeních a na webu https://app.element.io

View File

@ -0,0 +1,2 @@
Hauptänderungen in dieser Version: Mit Spaces kannst du deine Räume gruppieren (Beta). Videos können vor dem Senden komprimiert werden.
Die vollständige Änderungsliste gibt es hier: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -1,9 +1,9 @@
Element ist einerseits ein sicherer Messenger, andererseits ideal geeignet für die produktive Zusammenarbeit mit dem Team im Homeoffice. Mit eingebauter Ende-zu-Ende-Verschlüsselung ermöglicht Element umfangreiche und sichere Videokonferenzen, das Teilen von Dateien sowie Sprachanrufe.
Element ist ein sicherer Messenger und ideal für die produktive Zusammenarbeit mit Ihrem Team im Homeoffice. Mit eingebauter Ende-zu-Ende-Verschlüsselung ermöglicht Element auch umfangreiche und sichere Videokonferenzen, das Teilen von Dateien, Sprachanrufe und vieles mehr.
<b>Element bietet folgende Funktionen:</b>
- Fortschrittliche Werkzeuge für die Online-Kommunikation
- Vollständig verschlüsselte Nachrichten, um eine sichere Kommunikation innerhalb und außerhalb von Unternehmen zu ermöglichen
- Dezentralisierte Chats, basierend auf dem quelloffenen Matrix-Framework
- Dezentralisierte Chats, basierend auf dem quelloffenen Matrix-Protokoll
- Sichere und kontrollierte Dateifreigabe durch verschlüsselte Daten beim Verwalten von Projekten
- Videochats mit VoIP und Bildschirmübertragung
- Einfache Einbindung in Ihre bevorzugten Online-Kollaborations- und Projektverwaltungswerkzeuge, VoIP-Dienste und andere Kommunikationsapps für Ihr Team
@ -11,29 +11,29 @@ Element ist einerseits ein sicherer Messenger, andererseits ideal geeignet für
Element unterscheidet sich grundlegend von anderen Kommunikations- und Kollaborationsapps. Es läuft auf Matrix, einem offenen Netzwerk für sichere und dezentralisierte Kommunikation. Es erlaubt Nutzern ihre eigene Infrastruktur zu betreiben und gibt ihnen damit vollständige Kontrolle und Besitz über ihre eigenen Daten und Nachrichten.
<b>Privatsphäre/Datenschutz und verschlüsselte Kommunikation</b>
Element schützt Sie vor unerwünschter Werbung, dem Datenschürfen und abgeschlossenen Plattformen. Auch schützt es all Ihre Daten, Ihre Video- und Sprachkommunikation unter vier Augen, durch Ende-zu-Ende-Verschlüsselung und durch das Quersignieren von Geräten zur Verifizierung.
Element schützt Sie vor unerwünschter Werbung, dem Datensammeln und geschlossenen Plattformen. Auch schützt es all Ihre Daten, Ihre Video- und Sprachkommunikation mittels Ende-zu-Ende-Verschlüsselung und durch das Quersignieren von Geräten zur Verifizierung.
Element gibt Ihnen die Kontrolle über Ihre Privatsphäre und ermöglicht es Ihnen zugleich, mit jedem im Matrix-Netzwerk sicher zu kommunizieren - oder auch auf anderen geschäftlichen Kollaborationswerkzeugen, zum Beispiel durch das Einbinden von Apps wie Slack.
Element gibt Ihnen volle Kontrolle über Ihre Privatsphäre und ermöglicht es Ihnen zugleich, mit jedem im Matrix-Netzwerk sicher zu kommunizieren - oder auch auf anderen geschäftlichen Kollaborationswerkzeugen, zum Beispiel durch das Einbinden von Apps wie Slack.
<b>Element kann man selber betreiben</b>
Um mehr Kontrolle über Ihre sensiblen Daten und Konversationen zu ermöglichen, kann man Element selbst betreiben, oder Sie wählen irgendeinen Matrix-basierten Dienst - der Standard für quelloffene, dezentralisierte Kommunikation. Element gibt Ihnen Privatsphäre, Sicherheitskonformität und Flexibilität für Integrationen.
<b>Besitzen Sie Ihre Daten</b>
Sie entscheiden, wo Sie Ihre Daten und Nachrichten aufbewahren - ohne das Datenschürfen oder den Zugriff Dritter zu riskieren.
Sie entscheiden, wo Sie Ihre Daten und Nachrichten aufbewahren - ohne das Datensammeln oder den Zugriff Dritter zu riskieren.
Element gibt Ihnen auf verschiedene Arten die Kontrolle:
1. Kostenlos auf dem öffentlichen matrix.org-Server registrieren, der von den Matrix-Entwicklern gehostet wird, oder wählen Sie aus Tausenden von öffentlichen Servern, die von Freiwilligen betrieben werden
2. Ein Konto auf einem eigenen Server in der eigenen IT-Infrastruktur betreiben
3. Einen Konto auf einem maßgeschneiderten Server erstellen, zum Beispiel durch ein Abonnement der Element Matrix Services (kurz EMS)
Element gibt Ihnen auf verschiedene Arten Kontrolle:
1. Sie können sich kostenlos auf dem öffentlichen matrix.org-Server registrieren, der von den Matrix-Entwicklern gehostet wird, oder einen von Tausenden öffentlichen Servern, die von Freiwilligen betrieben werden, auswählen
2. Sie haben die Möglichkeit, ein Konto auf einem eigenen Server in der eigenen IT-Infrastruktur betreiben
3. Außerdem können Sie durch ein Abonnement der Element Matrix Services ein Konto auf einem für Sie maßgeschneiderten Server erstellen
<b>Offene Kommunikation und Zusammenarbeit</b>
Sie können mit jedem im Matrix-Netzwerk chatten, egal ob ihr Kontakt Element, eine andere Matrix-App oder sogar eine völlig andere Anwendung nutzt.
<b>Super sicher</b>
Echte Ende-zu-Ende-Verschlüsselung (nur die Personen in der Unterhaltung können die Nachrichten entschüsseln), sowie die Quersignierung von Geräten zur Verifizierung.
Durch Ende-zu-Ende-Verschlüsselung können nur die Personen, die in der Unterhaltung sind, die Nachrichten lesen. Außerdem stellt die Verifizierung mittels Quersignierung sicher, dass Sie wirklich mit dem Chatten, mit dem Sie glauben - und niemand Anderem.
<b>Vollständige Kommunikation und Integration</b>
Kurznachrichten, Sprach- und Videoanrufe, Dateifreigaben, Bildschirmübertragungen und eine ganze Reihe an Integrationen, Bots and Widgets. Schaffen Sie Räume, Communities, bleiben Sie auf dem Laufenden und erledigen Sie Sachen.
Kurznachrichten, Sprach- und Videoanrufe, Dateifreigaben, Bildschirmübertragungen und einer Menge an Integrationen, Bots und Widgets. Schaffen Sie Räume und Communities, bleiben Sie auf dem Laufenden und erledigen Sie Sachen.
<b>Da Weitermachen, wo Sie aufgehört haben</b>
Bleiben Sie in Kontakt, egal wo Sie sind, mit vollständig synchronisiertem Nachrichtenverlauf quer über all Ihre Geräte und im Netz auf https://app.element.io

View File

@ -0,0 +1,2 @@
Põhilised muudatused selles versioonis: beeta-versioon kogukonnakeskustest ja videofailide pakkimine enne üleslaadimist.
Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -1,2 +1,2 @@
Főbb változtatások ebben a verzióban: URL előnézet, új emoji billentyűzet, új szoba beállitási lehetőségek, és hó karácsonyra!
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.12
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.13

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: Szoba jogosultságok szerkesztése, automatikus sötét/világos téma és sok hibajavítás.
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.14

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: Közösségi hálózatos bejelentkezés támogatása
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.15

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: Közösségi hálózatos bejelentkezés
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.15 and https://github.com/vector-im/element-android/releases/tag/v1.0.16

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: Hibajavítás!
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.17

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: VoIP (hang és videóhívás közvetlen beszélgetésekben) fejlesztés és hibajavítás
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.0

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: sebesség javítás és hibajavítás
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.1

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: sebesség javítás és hibajavítás
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.2

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: sebesség javítás és hibajavítás
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.3

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: sebesség javítás és hibajavítás
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.4

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: javítás az 1.1.4 verzióhoz
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.5

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: javítás az 1.1.5 verzióhoz
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.6

View File

@ -0,0 +1,2 @@
Fő változás ebben a verzióban: béta állapotú Tér támogatás. Videó tömörítés küldés előtt.
Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -1,30 +1,40 @@
Az Element egy új üzenetküldő, és csapatmunka alkalmazás, amivel
Element egy biztonságos üzenetküldő és csapatmunka támogató alkalmazás ami ideális távoli munkavégzés közben csoportos csevegéshez. Az alkalmazás végpontok közötti titkosítást használ videó konferenciához, fájl megosztáshoz és videó hivásokhoz.
1. A te kezedben van az irányítás a saját adataid fölött, hogy megőrizhesd a magánszférádat
2. Akárkivel beszélgethetsz a Matrix hálózatban, sőt még azon kívül is, például olyan alkalmazások integrálásával, mint a Slack
3. Megvédheted magad a hirdetésektől, adatbányászattól, és a nagy cégek megoldásaiba való bezártságtól
4. Biztonságosan beszélgethetsz, a végpontok közötti titkosításnak köszönhetően, az eszközök megbízhatóságát az eszköz-közti hitelesítéssel garantálva
<b>Element tulajdonságai:</b>
- Fejlett online kommunikációs eszköz
- Teljesen titkosított üzenetküldés biztonságos céges kommunikációt kínál még a távdolgozóknak is
- Elosztott csevegés a Matrix nyílt forráskódú keretrendszer felhasználásával
- Bizontságos fájl megosztás titkosítottan projektek kezeléséhez
- Videó hívás VoIP-pal és képernyőmegosztással
- Könnyen integrálható a kedvenc online kollaborációs eszközöddel, projekt menedzsment eszközzel, VoIP szolgáltatással vagy más csoport üzenetküldő alkalmazással
Az Element teljesen más, mint a többi üzenetküldő és csapatmunka alkalmazás, mert nyílt forráskódú, és decentralizált (nem központilag irányított).
Element teljesen más mint a többi üzenetküldő alkalmazás. Matrixot használ, egy nyílt hálózatot a decentralizált biztonságos kommunikációhoz. Lehetőséget ad saját szerver üzemeltetésére ami maximális tulajdont és kontrollt biztosít az adatok fölött.
Az Element lehetővé teszi, hogy saját szervert futtass - vagy válassz egy szolgáltatót - így te birtoklod az adataidat, ezáltal megőrizve a magánszférád és a biztonságod. Egy nyitott hálózathoz ad hozzáférést, így nem csak a többi Element felhasználóval tudsz beszélgetni, hanem másokkal is. Ráadásul nagyon biztonságos.
<b>Magánélet védelme és titkosított üzenetküldés</b>
Element megóv a kéretlen hirdetésektől, adatbányászattól és a különböző szigetszerű megoldásoktól. Minden adatot biztonságba helyez, egy az egybe videó és hang kommunikáció végpontok között titkosítva ahol az eszközök hitelesítve vannak.
Az Element-tel azért válik mindez lehetővé, mert a Matrix hálózatra épül - egy nyílt, decentralizált kommunikációs szabványra.
Element a kezedbe adja az adatvédelmi irányítást miközben bárkivel kommunikálhatsz a Matrix hálózatban vagy más üzleti kollaborációs eszközzel ami integrálva van, mint amilyen a Slack.
Az Element a te kezedbe adja az irányítást azáltal, hogy eldöntheted, ki tárolja a beszélgetéseidet. Az Element alkalmazásból több féle szolgáltatót is választhatsz:
<b>Element futtatható saját szerveren</b>
1. Regisztrálhatsz ingyen egy fiókot a matrix.org nyilvános szerveren, amit a Matrix fejlesztői üzemeltetnek, vagy választhatsz a több ezer, ingyenes szerver közül, amit önkéntesek üzemeltetnek
2. A saját számítógépeden is futtathatsz szervert
3. Előfizethetsz egy saját szerverre az Element Matrix Szolgáltatások platformon
Azért, hogy az érzékeny adatok és beszélgetések minnél inkább az irányításod alatt lehessen az Elementet saját magadnak üzemeltetheted vagy választhatsz bármely Matrixon alapuló - szabványos nyílt forráskódú és decentralizált kommunikáció - szoláltató közül. Element adatvédelmet, biztonságot és rugalmas integrációkat biztosít.
<b>Miért jó az Element-et választani?</b>
<b>A te adatod a tiéd</b>
Te döntöd el, hogy hol tárolod az adataidat és üzeneteidet. Adatbányászat vagy harmadik fél hozzáférésének kockázata nélkül.
<b>ADATAID MEGVÉDÉSE</b>: Eldöntheted, hol tárold az adataid és üzeneteid. A te tulajdonodban van, nem valami megacégnél, ami bányássza az adataid, vagy továbbadja másoknak.
Element többféle képpen adja vissza az irányítást:
1. Szerezz egy ingyenes hozzáférést a matrix.org nyilvános szerverre amit a Matrix fejlesztők üzemeltetnek vagy válassz a több ezer önkéntesek által üzemeltetett nyilvános szerverből
2. Üzemeltess szerver magadnak a saját infrastruktúrádon
3. Iratkozz fel egy egyedi szerverre az Element Matrix Services platformon
<b>NYÍLT BESZÉLGETÉS, ÉS CSAPATMUNKA</b>: Akárkivel cseveghetsz a Matrix hálózatban, akár az Element-et használják, akár valamilyen másik Matrix alkalmazást, de még akkor is, ha egy másik csevegő hálózatot használnak, olyat, mint például a Slack, IRC, vagy az XMPP.
<b>Nyílt üzenetküldés és kollaboráció</b>
Bárkivel beszélgethetsz a Matrix hálózaton, akár az Elementet használja akár egy másik Matrix alkalmazást használ vagy akár egy eltérő üzenetküldőt.
<b>SZUPER-BIZTONSÁGOS</b>: Valódi, végpontok közötti titkosítás (csak a beszélgetés résztvevői tudják elolvasni az üzeneteket), és eszköz-közti hitelesítés, hogy ellenőrizhesd a résztvevők eszközeit.
<b>Fantasztikusan biztonságos</b>
Igazi végpontok között titkosítás (csak a beszélgetésben résztvevők tudják visszafejteni) és hitelesítés eszközök közötti aláírásokkal.
<b>TELJES KOMMUNIKÁCIÓ</b>: Üzenetküldés, hang- és videóhívások, fájlmegosztás, képernyőmegosztás, és egy rakás integráció, bot, és widget. Hozz létre szobákat, közösségeket, maradj elérhető, és végezzétek el a feladatokat.
<b>Teljes kommunikáció és integráció</b>
Üzenetküldés, hang és videóhívás, fájl megosztás, képernyő megosztás és egy csomó integráció, botok és kisalkalmazások. Építs szobákat, közösségeket, maradj kapcsolatban és végezz el dolgokat.
<b>AKÁRHOL, AHOL CSAK SZÜKSÉG VAN RÁ</b>: Akárhol is vagy, maradj elérhető, a teljes mértékben szinkronizált beszélgetésekkel az összes eszközödön, és a weben a https://app.element.io oldalon.
<b>Vedd fel a fonalat</b>
Maradj kapcsolatban bárhol minden eszközödön a szinkronizált üzenetekkel és a weben a https://app.element.io oldallal

View File

@ -1 +1 @@
Biztonságos, decentralizált chat és VoIP. Tartsd az adataid biztonságban.
Csoportos üzenetküldő - titkosított üzenetek, videó hívások

View File

@ -1 +1 @@
Element (régebben Riot.im)
Element - Biztonságos üzenetküldő

View File

@ -0,0 +1,2 @@
Modifiche principali in questa versione: supporto beta per gli Spazi. Compressione video prima dell'invio.
Cronologia completa: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -0,0 +1,2 @@
Huvudsakliga ändringar i den här versionen: betastöd för utrymmen. Komprimera video innan den skickas.
Full ändringslogg: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -0,0 +1,2 @@
Основні зміни в цій версії: бета-підтримка Spaces. Стиснення відео перед надсиланням.
Повний журнал змін: https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -1,30 +1,39 @@
Element — це застосунок для спілкування та співпраці нового типу, який:
Element — це і безпечний месенджер, і застосунок для співпраці команди, який ідеально підходить для групових бесід під час віддаленої роботи. Цей застосунок для спілкування застосовує наскрізне шифрування для забезпечення відеоконференцій, обміну файлами та голосових викликів.
1. Надає вам повний контроль за своєю конфіденційністю
2. Дозволяє спілкування з будь-ким у мережі Matrix та поза нею, інтегруючись із такими застосунками, як Slack
3. Убезпечує вас від реклами, збору даних та штучних обмежень
4. Захищає ваше спілкування наскрізним шифруванням із перехресним підписуванням для звірення інших осіб
<b>Можливості Element включають:</b>
- Розширені засоби спілкування в Інтернеті
- Повністю зашифровані повідомлення для надання можливості безпечнішого корпоративного спілкування, навіть для віддалених працівників
- Децентралізований чат на основі відкритого коду Matrix
- Безпечний обмін файлами із зашифрованими даними для керування проєктами
- Відеочати з передачею голосу через IP та показом екрану іншим
- Проста інтеграція з вашими улюбленими інструментами для онлайн-співпраці, інструментами керування проєктами, послугами VoIP та іншими застосунками обміну повідомленнями для команд
Element ґрунтовно відрізняється від інших застосунків для спілкування та співпраці тому що він є децентралізованим та відкритоджерельним.
Element цілковито відрізняється від інших застосунків обміну повідомленнями та спільної роботи. Він працює на Matrix, відкритій мережі для безпечного обміну повідомленнями та децентралізованого зв'язку. Це дозволяє самостійне розгортання, щоб надати користувачам якнайбільше володіння та контролю над їх даними та повідомленнями.
Element дозволяє вам розміщувати сервер в себе або обирати будь-якого з надавачів послуг, таким чином забезпечуючи вам конфіденційність і можливість володіти власними даними й бесідами та контролювати їх. Він надає вам доступ до відкритої мережі, тож ви не є обмеженими спілкуванням виключно з користувачами Element. І він є дуже надійним та безпечним.
<b>Приватність та обмін зашифрованими повідомленнями</b>
Element захищає вас від небажаної реклами, збору даних та обмежень. Він також захищає всі ваші дані, відео та голосовий зв'язок віч-на-віч за допомогою наскрізного шифрування та взаємного підписування пристроїв.
Element здатен забезпечити усе це завдяки тому, що він заснований на протоколі Matrix — стандарті для відкритого та децентралізованого спілкування.
Element дає вам можливість контролювати вашу приватність, одночасно дозволяючи вам безпечно спілкуватися з будь-ким у мережі Matrix або через інші інструменти ділової співпраці, інтегрувавшись із такими програмами, як Slack.
Element надає вам повний контроль, дозволяючи обирати з-поміж надавачів послуг, що обслуговують сервери з вашими бесідами. Ви вільні обрати будь-який спосіб розміщення прямо з застосунку Element:
<b>Element можна розгортати самостійно</b>
Щоб забезпечити більше контролю над вашими приватними даними та розмовами, Element можна самостійно розміщувати або ви можете вибрати будь-який вузол на основі Matrix — стандарт для децентралізованого спілкування з відкритим кодом. Element надає вам приватність, відповідність безпеці та гнучкість інтеграції.
1. Отримати безкоштовний обліковий запис на загальнодоступному сервері matrix.org, який обслуговують розробники Matrix, чи на одному з тисяч публічних серверів, які обслуговують волонтери
2. Розмістити свій обліковий запис на власному сервері
3. Зареєструватись на індивідуальному сервері, просто підписавшись на послуги платформи Element Matrix Services
<b>Ваші дані</b>
Ви вирішуєте, де зберігати свої дані та повідомлення. Без ризику видобутку даних або стороннього доступу.
<b>Чому я маю обрати Element?</b>
Element надає такі можливості на вибір:
1. Отримайте безплатний обліковий запис на загальнодоступному сервері matrix.org, розміщеному розробниками Matrix, або виберіть серед тисяч загальнодоступних серверів, розміщених волонтерами
2. Самостійно розмістіть свій обліковий запис, запустивши сервер на власній ІТ-інфраструктурі
3. Зареєструйте обліковий запис на власному сервері, просто підписавшись на хостинг-платформу Element Matrix Services
<b>ВОЛОДІЙТЕ ВАШИМИ ДАНИМИ</b>: Ви вирішуєте де тримати ваші дані та повідомлення. Саме ви володієте ними та контролюєте їх, а не якась Мегакорпорація, що збирає ваші дані та надає стороннім особам доступ до них.
<b>Відкриті обмін повідомленнями та співпраця</b>
Ви можете спілкуватися з усіма у мережі Matrix, незалежно від того, чи користуються вони Element, іншим застосунком Matrix або навіть якщо іншим застосунком для обміну повідомленнями.
<b>ВІДКРИТІ ОБМІН ПОВІДОМЛЕННЯМИ ТА СПІВПРАЦЯ</b>: Ви можете балакати з будь-ким у мережі Matrix, хоч вони користуються Element, хоч іншим застосунком для Matrix, і навіть якщо вони користуються іншою системою обміну повідомленнями на кшталт Slack, IRC чи XMPP.
<b>Надбезпечний</b>
Справжнє наскрізне шифрування (лише учасники бесіди можуть розшифровувати повідомлення) та взаємне підписування пристроїв.
<b>НАДБЕЗПЕЧНІСТЬ</b>: Справжнє наскрізне шифрування (лише ваші співрозмовники здатні дешифровувати повідомлення) та перехресне підписування для звірення пристроїв інших учасників бесіди.
<b>Повноцінні спілкування та інтеграція</b>
Обмін повідомленнями, голосові та відеовиклики, обмін файлами, спільний доступ до екрана та ціла купа інтеграцій, ботів та віджетів. Створюйте кімнати, спільноти, залишайтеся на зв’язку та виконуйте завдання.
<b>ДОВЕРШЕНИЙ ЗВʼЯЗОК</b>: Повідомлення, голосові та відеодзвінки, обмін файлами, розподіл екрану та ціла купа інтеграцій, ботів та знадобів. Створюйте кімнати й спільноти, залишайтесь на зв'язку та завершуйте свої справи.
<b>ДЕ Б ВИ НЕ БУЛИ</b>: Залишайтесь на зв'язку де б ви не були, разом з синхронізовною історією листувань на усіх ваших пристроях та в Інтернеті на https://app.element.io.
<b>Продовжуйте, де зупинилися</b>
Залишайтеся на зв'язку, де б ви не знаходились, з повністю синхронізованою історією повідомлень на всіх своїх пристроях та в Інтернеті за адресою https://app.element.io

View File

@ -0,0 +1,2 @@
此版本中的主要更新:改进性能和错误修复!
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.2

View File

@ -0,0 +1,2 @@
此版本中的主要更新:改进性能和修复错误!
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.3

View File

@ -0,0 +1,2 @@
此版本中的主要更新:改进性能和修复错误!
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.4

View File

@ -0,0 +1,2 @@
此版本中的主要更新1.1.4 的热修复
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.5

View File

@ -0,0 +1,2 @@
此版本中的主要更新1.1.5 的热修复
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.6

View File

@ -0,0 +1,2 @@
此版本中的主要更新:对「空间」的测试版支持。发送前压缩视频。
完整的更新记录https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -1,30 +1,39 @@
Element 是一种新型的通讯与协作应用:
Element 不仅是安全的通讯软件,同时也是生产力团队协作应用,非常适合在远端工作时进行群组聊天。此聊天应用使用了端到端加密来提供强大的视频会议、文件分享与语音通话功能。
1. 使您可以掌控您的隐私
2. 使您与 Matrix 网络中的任何人交流,甚至可以通过集成功能与如 Slack 之类的其他应用通讯
3. 保护您免受广告,大数据挖掘和封闭服务的侵害
4. 通过端到端加密保证安全,通过交叉签名验证其他人
<b>Element 的功能包含了:</b>
- 进阶的线上通讯工具
- 完全加密的信息,即使对于远端工作者来说,也可以有更安全的公司通讯
- 以 Matrix 开放源码框架为基础的去中心化的聊天
- 在管理项目时通过加密资料安全地分享文件
- 包含了 VoIP 与画面分享的视频聊天
- 与你最喜欢的协作工具、项目管理工具、VoIP 服务与其他团队信息应用轻松整合
Element 与其他通讯与协作应用完全不同,因为它是去中心化且开源的。
Element 与其他信息传递与协作应用完全不同。它在 Matrix一个用于安全传递讯息与去中心化通讯的开放网络上运行。其可以自建让使用者对他们的资料和信息拥有最大的所有权与控制权
Element 允许您自托管——或者选择托管商——因此,您能拥有数据和会话的隐私权,所有权和控制权。它允许您访问开放网络;因此,您可以与 Element 用户以外的人交流。并且它非常安全。
<b>隐私与加密信息传递</b>
Element 保护你不受不想要的广告、信息泄露与围城侵扰。其也通过端到端加密与交叉签章装置验证保护了你所有的资料,并提供一对一视频以及语音通讯。
Element 之所以可以做到这些,是因为它在 Matrix 上运行——开放,去中心化通讯的标准
Element 通过与其他商业协作工具,如 Slack 等应用整合,让你可以在控制你的隐私的同时,也可以与 Matrix 网络上的任何人安全地通讯
通过让您选择由谁来托管您的会话Element 让您掌控一切。在 Element 应用中,您可以选择不同的托管方式:
<b>Element 可以自建</b>
为了可以完整控制你的敏感资料与对话Element 可以自建,你也可以选择任何以 Matrix 为基础的服务提供商开放源码、去中心化的通讯标准。Element 为你提供隐私、安全合规与整合灵活性。
1. 在由 Matrix 开发者托管的 matrix.org 公共服务器上获取免费帐户,或从志愿者托管的上千个公共服务器中选择
2. 在您自己的硬件上运行服务器,自托管您的会话
3. 通过订阅 Element Matrix Services 托管平台,简单地在自定义服务器上注册账户
<b>拥有你的资料</b>
你可以决定将你的资料与信息储存在何处。没有信息泄露或被第三方爬取的风险。
<b>为什么选择 Element</b>
Element 透过不同的方式让你掌控一切:
1. 在 Matrix 开发者架设的 matrix.org 公开服务器上取得免费帐号,或是从数千个由志愿者架设的公开服务器中选择
2. 在你自己的 IT 基础架构上的服务器自行托管你的帐号
3. 只要订阅 Element Matrix Services 托管平台就可以在自定义的服务器上注册帐号
<b>掌控您的数据</b>:您来决定存放您的数据和消息的位置。拥有并控制它的是您,而不是挖掘您的数据或与第三方分享的巨型企业。
<b>开放信息传递与协作</b>
你可以与 Matrix 网络上的任何人聊天,不论他们是使用 Element、其他 Matrix 应用或其他通讯应用。
<b>开放通讯与协作</b>:您可以与 Matrix 网络中的任何人聊天,不论他们使用 Element 还是其他 Matrix 应用,甚至/即使他们在使用不同的通讯系统,例如 SlackIRC 或 XMPP。
<b>超级安全</b>
真正的端到端加密(仅有那些在对话中的可以解密讯息)以及交叉签章装置验证。
<b>超级安全</b>:支持真正的端到端加密(仅有会话中的人可以解密消息),还有能够验证会话参与方的设备的交叉签名。
<b>完整的通讯与整合</b>
信息传递、语音与视频通话、文件分享、画面分享与超多的整合、机器人与挂件。建构聊天室、社群、保持联络并完成工作。
<b>完善的通讯方式</b>:消息,语音和视频通话,文件共享,屏幕共享和大量集成功能,机器人和小挂件。建立房间与社区,保持联系并完成工作。
<b>随时随地</b>:消息历史可在您的全部设备和 https://app.element.io 网页端之间完全同步,无论您在哪里,都可以保持联系。
<b>从上次离开的地方开始</b>
无论你身在何处,都可以透过在你所有设备与网页 https://app.element.io 间完全同步的信息历史保持联络

View File

@ -0,0 +1,2 @@
此版本中的主要變動:對「空間」的測試版支援。傳送前壓縮影片。
完整的變更紀錄https://github.com/vector-im/element-android/releases/tag/v1.1.7

View File

@ -24,7 +24,7 @@ import kotlinx.coroutines.rx2.rxSingle
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
@ -35,6 +35,7 @@ import org.matrix.android.sdk.api.session.group.model.GroupSummary
import org.matrix.android.sdk.api.session.identity.ThreePid
import org.matrix.android.sdk.api.session.pushers.Pusher
import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -177,10 +178,17 @@ class RxSession(private val session: Session) {
}
}
fun liveUserAccountData(types: Set<String>): Observable<List<AccountDataEvent>> {
return session.userAccountDataService().getLiveAccountDataEvents(types).asObservable()
fun liveUserAccountData(types: Set<String>): Observable<List<UserAccountDataEvent>> {
return session.accountDataService().getLiveUserAccountDataEvents(types).asObservable()
.startWithCallable {
session.userAccountDataService().getAccountDataEvents(types)
session.accountDataService().getUserAccountDataEvents(types)
}
}
fun liveRoomAccountData(types: Set<String>): Observable<List<RoomAccountDataEvent>> {
return session.accountDataService().getLiveRoomAccountDataEvents(types).asObservable()
.startWithCallable {
session.accountDataService().getRoomAccountDataEvents(types)
}
}
@ -201,7 +209,7 @@ class RxSession(private val session: Session) {
}
fun liveSecretSynchronisationInfo(): Observable<SecretsSynchronisationInfo> {
return Observable.combineLatest<List<AccountDataEvent>, Optional<MXCrossSigningInfo>, Optional<PrivateKeysInfo>, SecretsSynchronisationInfo>(
return Observable.combineLatest<List<UserAccountDataEvent>, Optional<MXCrossSigningInfo>, Optional<PrivateKeysInfo>, SecretsSynchronisationInfo>(
liveUserAccountData(setOf(MASTER_KEY_SSSS_NAME, USER_SIGNING_KEY_SSSS_NAME, SELF_SIGNING_KEY_SSSS_NAME, KEYBACKUP_SECRET_SSSS_NAME)),
liveCrossSigningInfo(session.myUserId),
liveCrossSigningPrivateKeys(),

View File

@ -33,7 +33,7 @@ import org.matrix.android.sdk.common.TestConstants
import org.matrix.android.sdk.internal.crypto.SSSS_ALGORITHM_AES_HMAC_SHA2
import org.matrix.android.sdk.internal.crypto.crosssigning.toBase64NoPadding
import org.matrix.android.sdk.internal.crypto.secrets.DefaultSharedSecretStorageService
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@ -73,12 +73,12 @@ class QuadSTests : InstrumentedTest {
// Assert Account data is updated
val accountDataLock = CountDownLatch(1)
var accountData: AccountDataEvent? = null
var accountData: UserAccountDataEvent? = null
val liveAccountData = runBlocking(Dispatchers.Main) {
aliceSession.userAccountDataService().getLiveAccountDataEvent("${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID")
aliceSession.accountDataService().getLiveUserAccountDataEvent("${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID")
}
val accountDataObserver = Observer<Optional<AccountDataEvent>?> { t ->
val accountDataObserver = Observer<Optional<UserAccountDataEvent>?> { t ->
if (t?.getOrNull()?.type == "${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID") {
accountData = t.getOrNull()
accountDataLock.countDown()
@ -100,13 +100,13 @@ class QuadSTests : InstrumentedTest {
quadS.setDefaultKey(TEST_KEY_ID)
}
var defaultKeyAccountData: AccountDataEvent? = null
var defaultKeyAccountData: UserAccountDataEvent? = null
val defaultDataLock = CountDownLatch(1)
val liveDefAccountData = runBlocking(Dispatchers.Main) {
aliceSession.userAccountDataService().getLiveAccountDataEvent(DefaultSharedSecretStorageService.DEFAULT_KEY_ID)
aliceSession.accountDataService().getLiveUserAccountDataEvent(DefaultSharedSecretStorageService.DEFAULT_KEY_ID)
}
val accountDefDataObserver = Observer<Optional<AccountDataEvent>?> { t ->
val accountDefDataObserver = Observer<Optional<UserAccountDataEvent>?> { t ->
if (t?.getOrNull()?.type == DefaultSharedSecretStorageService.DEFAULT_KEY_ID) {
defaultKeyAccountData = t.getOrNull()!!
defaultDataLock.countDown()
@ -206,7 +206,7 @@ class QuadSTests : InstrumentedTest {
)
}
val accountDataEvent = aliceSession.userAccountDataService().getAccountDataEvent("my.secret")
val accountDataEvent = aliceSession.accountDataService().getUserAccountDataEvent("my.secret")
val encryptedContent = accountDataEvent?.content?.get("encrypted") as? Map<*, *>
assertEquals("Content should contains two encryptions", 2, encryptedContent?.keys?.size ?: 0)
@ -275,14 +275,14 @@ class QuadSTests : InstrumentedTest {
mTestHelper.signOutAndClose(aliceSession)
}
private fun assertAccountData(session: Session, type: String): AccountDataEvent {
private fun assertAccountData(session: Session, type: String): UserAccountDataEvent {
val accountDataLock = CountDownLatch(1)
var accountData: AccountDataEvent? = null
var accountData: UserAccountDataEvent? = null
val liveAccountData = runBlocking(Dispatchers.Main) {
session.userAccountDataService().getLiveAccountDataEvent(type)
session.accountDataService().getLiveUserAccountDataEvent(type)
}
val accountDataObserver = Observer<Optional<AccountDataEvent>?> { t ->
val accountDataObserver = Observer<Optional<UserAccountDataEvent>?> { t ->
if (t?.getOrNull()?.type == type) {
accountData = t.getOrNull()
accountDataLock.countDown()

View File

@ -24,7 +24,7 @@ import org.matrix.android.sdk.api.failure.GlobalError
import org.matrix.android.sdk.api.federation.FederationService
import org.matrix.android.sdk.api.pushrules.PushRuleService
import org.matrix.android.sdk.api.session.account.AccountService
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService
import org.matrix.android.sdk.api.session.cache.CacheService
import org.matrix.android.sdk.api.session.call.CallSignalingService
import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker
@ -239,9 +239,9 @@ interface Session :
fun openIdService(): OpenIdService
/**
* Returns the user account data service associated with the session
* Returns the account data service associated with the session
*/
fun userAccountDataService(): AccountDataService
fun accountDataService(): SessionAccountDataService
/**
* Add a listener to the session.

View File

@ -0,0 +1,66 @@
/*
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* 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 org.matrix.android.sdk.api.session.accountdata
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.api.util.Optional
/**
* This service is attached globally to the session.
*/
interface SessionAccountDataService {
/**
* Retrieve the account data with the provided type or null if not found
*/
fun getUserAccountDataEvent(type: String): UserAccountDataEvent?
/**
* Observe the account data with the provided type
*/
fun getLiveUserAccountDataEvent(type: String): LiveData<Optional<UserAccountDataEvent>>
/**
* Retrieve the account data with the provided types. The return list can have a different size that
* the size of the types set, because some AccountData may not exist.
* If an empty set is provided, all the AccountData are retrieved
*/
fun getUserAccountDataEvents(types: Set<String>): List<UserAccountDataEvent>
/**
* Observe the account data with the provided types. If an empty set is provided, all the AccountData are observed
*/
fun getLiveUserAccountDataEvents(types: Set<String>): LiveData<List<UserAccountDataEvent>>
/**
* Retrieve the room account data with the provided types. The return list can have a different size that
* the size of the types set, because some AccountData may not exist.
* If an empty set is provided, all the room AccountData are retrieved
*/
fun getRoomAccountDataEvents(types: Set<String>): List<RoomAccountDataEvent>
/**
* Observe the room account data with the provided types. If an empty set is provided, AccountData of every room are observed
*/
fun getLiveRoomAccountDataEvents(types: Set<String>): LiveData<List<RoomAccountDataEvent>>
/**
* Update the account data with the provided type and the provided account data content
*/
suspend fun updateUserAccountData(type: String, content: Content)
}

View File

@ -22,10 +22,10 @@ import org.matrix.android.sdk.api.session.events.model.Content
/**
* This is a simplified Event with just a type and a content.
* Currently used types are defined in [UserAccountDataTypes].
* Currently used types are defined in [UserAccountDataTypes]
*/
@JsonClass(generateAdapter = true)
data class AccountDataEvent(
data class UserAccountDataEvent(
@Json(name = "type") val type: String,
@Json(name = "content") val content: Content
)

View File

@ -42,7 +42,6 @@ import org.matrix.android.sdk.internal.crypto.model.event.RoomKeyWithHeldContent
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo
import org.matrix.android.sdk.internal.crypto.model.rest.DevicesListResponse
import org.matrix.android.sdk.internal.crypto.model.rest.RoomKeyRequestBody
import kotlin.jvm.Throws
interface CryptoService {
@ -82,9 +81,11 @@ interface CryptoService {
fun getDeviceTrackingStatus(userId: String): Int
fun importRoomKeys(roomKeysAsArray: ByteArray, password: String, progressListener: ProgressListener?, callback: MatrixCallback<ImportRoomKeysResult>)
suspend fun importRoomKeys(roomKeysAsArray: ByteArray,
password: String,
progressListener: ProgressListener?): ImportRoomKeysResult
fun exportRoomKeys(password: String, callback: MatrixCallback<ByteArray>)
suspend fun exportRoomKeys(password: String): ByteArray
fun setRoomBlacklistUnverifiedDevices(roomId: String)

View File

@ -35,7 +35,7 @@ interface IdentityService {
/**
* Check if the identity server is valid
* See https://matrix.org/docs/spec/identity_service/latest#status-check
* RiotX SDK only supports identity server API v2
* Matrix Android SDK2 only supports identity server API v2
*/
suspend fun isValidIdentityServer(url: String)

View File

@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.session.room
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService
import org.matrix.android.sdk.api.session.room.alias.AliasService
import org.matrix.android.sdk.api.session.room.call.RoomCallService
import org.matrix.android.sdk.api.session.room.crypto.RoomCryptoService
@ -57,7 +57,7 @@ interface Room :
RelationService,
RoomCryptoService,
RoomPushRuleService,
AccountDataService {
RoomAccountDataService {
/**
* The roomId of this room

View File

@ -0,0 +1,29 @@
/*
* Copyright 2020 The Matrix.org Foundation C.I.C.
*
* 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 org.matrix.android.sdk.api.session.room.accountdata
import org.matrix.android.sdk.api.session.events.model.Content
/**
* This is a simplified Event with just a roomId, a type and a content.
* Currently used types are defined in [RoomAccountDataTypes].
*/
data class RoomAccountDataEvent(
val roomId: String,
val type: String,
val content: Content
)

View File

@ -14,37 +14,37 @@
* limitations under the License.
*/
package org.matrix.android.sdk.api.session.accountdata
package org.matrix.android.sdk.api.session.room.accountdata
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.util.Optional
/**
* This service can be attached globally to the session so it represents user data or attached to a single room.
* This service is attached to a single room.
*/
interface AccountDataService {
interface RoomAccountDataService {
/**
* Retrieve the account data with the provided type or null if not found
*/
fun getAccountDataEvent(type: String): AccountDataEvent?
fun getAccountDataEvent(type: String): RoomAccountDataEvent?
/**
* Observe the account data with the provided type
*/
fun getLiveAccountDataEvent(type: String): LiveData<Optional<AccountDataEvent>>
fun getLiveAccountDataEvent(type: String): LiveData<Optional<RoomAccountDataEvent>>
/**
* Retrieve the account data with the provided types. The return list can have a different size that
* the size of the types set, because some AccountData may not exist.
* If an empty set is provided, all the AccountData are retrieved
*/
fun getAccountDataEvents(types: Set<String>): List<AccountDataEvent>
fun getAccountDataEvents(types: Set<String>): List<RoomAccountDataEvent>
/**
* Observe the account data with the provided types. If an empty set is provided, all the AccountData are observed
*/
fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<AccountDataEvent>>
fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<RoomAccountDataEvent>>
/**
* Update the account data with the provided type and the provided account data content

View File

@ -388,7 +388,7 @@ internal class DefaultCryptoService @Inject constructor(
cryptoStore.close()
}
// Aways enabled on RiotX
// Always enabled on Matrix Android SDK2
override fun isCryptoEnabled() = true
/**
@ -928,14 +928,10 @@ internal class DefaultCryptoService @Inject constructor(
* Export the crypto keys
*
* @param password the password
* @param callback the exported keys
* @return the exported keys
*/
override fun exportRoomKeys(password: String, callback: MatrixCallback<ByteArray>) {
cryptoCoroutineScope.launch(coroutineDispatchers.main) {
runCatching {
exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT)
}.foldToCallback(callback)
}
override suspend fun exportRoomKeys(password: String): ByteArray {
return exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT)
}
/**
@ -963,15 +959,12 @@ internal class DefaultCryptoService @Inject constructor(
* @param roomKeysAsArray the room keys as array.
* @param password the password
* @param progressListener the progress listener
* @param callback the asynchronous callback.
* @return the result ImportRoomKeysResult
*/
override fun importRoomKeys(roomKeysAsArray: ByteArray,
override suspend fun importRoomKeys(roomKeysAsArray: ByteArray,
password: String,
progressListener: ProgressListener?,
callback: MatrixCallback<ImportRoomKeysResult>) {
cryptoCoroutineScope.launch(coroutineDispatchers.main) {
runCatching {
withContext(coroutineDispatchers.crypto) {
progressListener: ProgressListener?): ImportRoomKeysResult {
return withContext(coroutineDispatchers.crypto) {
Timber.v("## CRYPTO | importRoomKeys starts")
val t0 = System.currentTimeMillis()
@ -998,8 +991,6 @@ internal class DefaultCryptoService @Inject constructor(
progressListener = progressListener
)
}
}.foldToCallback(callback)
}
}
/**

View File

@ -155,7 +155,7 @@ internal class MXMegolmDecryption(private val userId: String,
withHeldInfo.code?.value ?: "",
withHeldInfo.reason)
} else {
// This is un-used in riotX SDK, not sure if needed
// This is un-used in Matrix Android SDK2, not sure if needed
// addEventToPendingList(event, timeline)
if (requestKeysOnFail) {
requestKeysForEvent(event, false)

View File

@ -18,7 +18,7 @@ package org.matrix.android.sdk.internal.crypto.secrets
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.listeners.ProgressListener
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService
import org.matrix.android.sdk.api.session.events.model.toContent
import org.matrix.android.sdk.api.session.securestorage.EncryptedSecretContent
import org.matrix.android.sdk.api.session.securestorage.IntegrityResult
@ -56,7 +56,7 @@ import kotlin.experimental.and
internal class DefaultSharedSecretStorageService @Inject constructor(
@UserId private val userId: String,
private val accountDataService: AccountDataService,
private val accountDataService: SessionAccountDataService,
private val outgoingGossipingRequestManager: OutgoingGossipingRequestManager,
private val coroutineDispatchers: MatrixCoroutineDispatchers,
private val cryptoCoroutineScope: CoroutineScope
@ -84,7 +84,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
)
} ?: storageKeyContent
accountDataService.updateAccountData("$KEY_ID_BASE.$keyId", signedContent.toContent())
accountDataService.updateUserAccountData("$KEY_ID_BASE.$keyId", signedContent.toContent())
SsssKeyCreationInfo(
keyId = keyId,
content = storageKeyContent,
@ -113,7 +113,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
)
} ?: storageKeyContent
accountDataService.updateAccountData(
accountDataService.updateUserAccountData(
"$KEY_ID_BASE.$keyId",
signedContent.toContent()
)
@ -127,11 +127,11 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
override fun hasKey(keyId: String): Boolean {
return accountDataService.getAccountDataEvent("$KEY_ID_BASE.$keyId") != null
return accountDataService.getUserAccountDataEvent("$KEY_ID_BASE.$keyId") != null
}
override fun getKey(keyId: String): KeyInfoResult {
val accountData = accountDataService.getAccountDataEvent("$KEY_ID_BASE.$keyId")
val accountData = accountDataService.getUserAccountDataEvent("$KEY_ID_BASE.$keyId")
?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(keyId))
return SecretStorageKeyContent.fromJson(accountData.content)?.let {
KeyInfoResult.Success(
@ -143,14 +143,14 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
override suspend fun setDefaultKey(keyId: String) {
val existingKey = getKey(keyId)
if (existingKey is KeyInfoResult.Success) {
accountDataService.updateAccountData(DEFAULT_KEY_ID, mapOf("key" to keyId))
accountDataService.updateUserAccountData(DEFAULT_KEY_ID, mapOf("key" to keyId))
} else {
throw SharedSecretStorageError.UnknownKey(keyId)
}
}
override fun getDefaultKey(): KeyInfoResult {
val accountData = accountDataService.getAccountDataEvent(DEFAULT_KEY_ID)
val accountData = accountDataService.getUserAccountDataEvent(DEFAULT_KEY_ID)
?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(DEFAULT_KEY_ID))
val keyId = accountData.content["key"] as? String
?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(DEFAULT_KEY_ID))
@ -178,7 +178,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
}
accountDataService.updateAccountData(
accountDataService.updateUserAccountData(
type = name,
content = mapOf("encrypted" to encryptedContents)
)
@ -288,7 +288,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
override fun getAlgorithmsForSecret(name: String): List<KeyInfoResult> {
val accountData = accountDataService.getAccountDataEvent(name)
val accountData = accountDataService.getUserAccountDataEvent(name)
?: return listOf(KeyInfoResult.Error(SharedSecretStorageError.UnknownSecret(name)))
val encryptedContent = accountData.content[ENCRYPTED] as? Map<*, *>
?: return listOf(KeyInfoResult.Error(SharedSecretStorageError.SecretNotEncrypted(name)))
@ -303,7 +303,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
override suspend fun getSecret(name: String, keyId: String?, secretKey: SsssKeySpec): String {
val accountData = accountDataService.getAccountDataEvent(name) ?: throw SharedSecretStorageError.UnknownSecret(name)
val accountData = accountDataService.getUserAccountDataEvent(name) ?: throw SharedSecretStorageError.UnknownSecret(name)
val encryptedContent = accountData.content[ENCRYPTED] as? Map<*, *> ?: throw SharedSecretStorageError.SecretNotEncrypted(name)
val key = keyId?.let { getKey(it) } as? KeyInfoResult.Success ?: getDefaultKey() as? KeyInfoResult.Success
?: throw SharedSecretStorageError.UnknownKey(name)
@ -368,7 +368,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
secretNames.forEach { secretName ->
val secretEvent = accountDataService.getAccountDataEvent(secretName)
val secretEvent = accountDataService.getUserAccountDataEvent(secretName)
?: return IntegrityResult.Error(SharedSecretStorageError.UnknownSecret(secretName))
if ((secretEvent.content["encrypted"] as? Map<*, *>)?.get(keyInfo.id) == null) {
return IntegrityResult.Error(SharedSecretStorageError.SecretNotEncryptedWithKey(secretName, keyInfo.id))

View File

@ -17,7 +17,8 @@
package org.matrix.android.sdk.internal.database.mapper
import com.squareup.moshi.Moshi
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.api.util.JSON_DICT_PARAMETERIZED_TYPE
import org.matrix.android.sdk.internal.database.model.RoomAccountDataEntity
import org.matrix.android.sdk.internal.database.model.UserAccountDataEntity
@ -27,15 +28,16 @@ internal class AccountDataMapper @Inject constructor(moshi: Moshi) {
private val adapter = moshi.adapter<Map<String, Any>>(JSON_DICT_PARAMETERIZED_TYPE)
fun map(entity: UserAccountDataEntity): AccountDataEvent {
return AccountDataEvent(
fun map(entity: UserAccountDataEntity): UserAccountDataEvent {
return UserAccountDataEvent(
type = entity.type ?: "",
content = entity.contentStr?.let { adapter.fromJson(it) }.orEmpty()
)
}
fun map(entity: RoomAccountDataEntity): AccountDataEvent {
return AccountDataEvent(
fun map(roomId: String, entity: RoomAccountDataEntity): RoomAccountDataEvent {
return RoomAccountDataEvent(
roomId = roomId,
type = entity.type ?: "",
content = entity.contentStr?.let { adapter.fromJson(it) }.orEmpty()
)

View File

@ -153,7 +153,7 @@ internal class DefaultLegacySessionImporter @Inject constructor(
}
private fun importCryptoDb(legacyConfig: LegacyHomeServerConnectionConfig) {
// Here we migrate the DB, we copy the crypto DB to the location specific to RiotX, and we encrypt it.
// Here we migrate the DB, we copy the crypto DB to the location specific to Matrix SDK2, and we encrypt it.
val userMd5 = legacyConfig.credentials.userId.md5()
val sessionId = legacyConfig.credentials.let { (if (it.deviceId.isNullOrBlank()) it.userId else "${it.userId}|${it.deviceId}").md5() }
@ -177,12 +177,12 @@ internal class DefaultLegacySessionImporter @Inject constructor(
Timber.d("Migration: copy DB to encrypted DB")
Realm.getInstance(realmConfiguration).use {
// Move the DB to the new location, handled by RiotX
// Move the DB to the new location, handled by Matrix SDK2
it.writeEncryptedCopyTo(File(newLocation, realmConfiguration.realmFileName), realmKeysUtils.getRealmEncryptionKey(keyAlias))
}
}
// Delete all the files created by Riot Android which will not be used anymore by RiotX
// Delete all the files created by Riot Android which will not be used anymore by Element
private fun clearFileSystem(legacyConfig: LegacyHomeServerConnectionConfig) {
val cryptoFolder = legacyConfig.credentials.userId.md5()

View File

@ -36,7 +36,7 @@ internal class UserAgentHolder @Inject constructor(private val context: Context,
/**
* Create an user agent with the application version.
* Ex: RiotX/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0)
* Ex: Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0)
*
* @param flavorDescription the flavor description
*/

View File

@ -29,7 +29,7 @@ import org.matrix.android.sdk.api.pushrules.PushRuleService
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import org.matrix.android.sdk.api.session.account.AccountService
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService
import org.matrix.android.sdk.api.session.cache.CacheService
import org.matrix.android.sdk.api.session.call.CallSignalingService
import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker
@ -74,7 +74,6 @@ import org.matrix.android.sdk.internal.session.identity.DefaultIdentityService
import org.matrix.android.sdk.internal.session.sync.SyncTokenStore
import org.matrix.android.sdk.internal.session.sync.job.SyncThread
import org.matrix.android.sdk.internal.session.sync.job.SyncWorker
import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataService
import org.matrix.android.sdk.internal.util.createUIHandler
import timber.log.Timber
import javax.inject.Inject
@ -118,7 +117,7 @@ internal class DefaultSession @Inject constructor(
private val contentDownloadStateTracker: ContentDownloadStateTracker,
private val initialSyncProgressService: Lazy<InitialSyncProgressService>,
private val homeServerCapabilitiesService: Lazy<HomeServerCapabilitiesService>,
private val accountDataService: Lazy<UserAccountDataService>,
private val accountDataService: Lazy<SessionAccountDataService>,
private val _sharedSecretStorageService: Lazy<SharedSecretStorageService>,
private val accountService: Lazy<AccountService>,
private val eventService: Lazy<EventService>,
@ -293,7 +292,7 @@ internal class DefaultSession @Inject constructor(
override fun openIdService(): OpenIdService = openIdService.get()
override fun userAccountDataService(): AccountDataService = accountDataService.get()
override fun accountDataService(): SessionAccountDataService = accountDataService.get()
override fun getOkHttpClient(): OkHttpClient {
return unauthenticatedWithCertificateOkHttpClient.get()

View File

@ -34,7 +34,7 @@ import org.matrix.android.sdk.api.auth.data.sessionId
import org.matrix.android.sdk.api.crypto.MXCryptoConfig
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService
import org.matrix.android.sdk.api.session.events.EventService
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilitiesService
import org.matrix.android.sdk.api.session.initsync.InitialSyncProgressService
@ -93,7 +93,7 @@ import org.matrix.android.sdk.internal.session.room.send.queue.EventSenderProces
import org.matrix.android.sdk.internal.session.room.tombstone.RoomTombstoneEventProcessor
import org.matrix.android.sdk.internal.session.securestorage.DefaultSecureStorageService
import org.matrix.android.sdk.internal.session.typing.DefaultTypingUsersTracker
import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataService
import org.matrix.android.sdk.internal.session.user.accountdata.DefaultSessionAccountDataService
import org.matrix.android.sdk.internal.session.widgets.DefaultWidgetURLFormatter
import org.matrix.android.sdk.internal.util.md5
import retrofit2.Retrofit
@ -364,7 +364,7 @@ internal abstract class SessionModule {
abstract fun bindHomeServerCapabilitiesService(service: DefaultHomeServerCapabilitiesService): HomeServerCapabilitiesService
@Binds
abstract fun bindAccountDataService(service: UserAccountDataService): AccountDataService
abstract fun bindSessionAccountDataService(service: DefaultSessionAccountDataService): SessionAccountDataService
@Binds
abstract fun bindEventService(service: DefaultEventService): EventService

View File

@ -33,7 +33,7 @@ import org.matrix.android.sdk.internal.extensions.observeNotNull
import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import org.matrix.android.sdk.internal.session.SessionScope
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataDataSource
import org.matrix.android.sdk.internal.session.user.accountdata.UpdateUserAccountDataTask
import org.matrix.android.sdk.internal.session.widgets.helper.WidgetFactory
@ -240,7 +240,7 @@ internal class IntegrationManager @Inject constructor(matrixConfiguration: Matri
)
}
private fun AccountDataEvent.asIntegrationManagerWidgetContent(): WidgetContent? {
private fun UserAccountDataEvent.asIntegrationManagerWidgetContent(): WidgetContent? {
return extractWidgetSequence(widgetFactory)
.filter {
WidgetType.IntegrationManager == it.type

View File

@ -17,10 +17,10 @@
package org.matrix.android.sdk.internal.session.room
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.crypto.CryptoService
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService
import org.matrix.android.sdk.api.session.room.alias.AliasService
import org.matrix.android.sdk.api.session.room.call.RoomCallService
import org.matrix.android.sdk.api.session.room.members.MembershipService
@ -42,7 +42,6 @@ import org.matrix.android.sdk.api.session.space.Space
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.internal.session.permalinks.ViaParameterFinder
import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataService
import org.matrix.android.sdk.internal.session.room.state.SendStateTask
import org.matrix.android.sdk.internal.session.room.summary.RoomSummaryDataSource
import org.matrix.android.sdk.internal.session.search.SearchTask
@ -86,7 +85,7 @@ internal class DefaultRoom(override val roomId: String,
RelationService by relationService,
MembershipService by roomMembersService,
RoomPushRuleService by roomPushRuleService,
AccountDataService by roomAccountDataService {
RoomAccountDataService by roomAccountDataService {
override fun getRoomSummaryLive(): LiveData<Optional<RoomSummary>> {
return roomSummaryDataSource.getRoomSummaryLive(roomId)

View File

@ -19,8 +19,8 @@ package org.matrix.android.sdk.internal.session.room
import org.matrix.android.sdk.api.session.crypto.CryptoService
import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.internal.session.SessionScope
import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataService
import org.matrix.android.sdk.internal.session.permalinks.ViaParameterFinder
import org.matrix.android.sdk.internal.session.room.accountdata.DefaultRoomAccountDataService
import org.matrix.android.sdk.internal.session.room.alias.DefaultAliasService
import org.matrix.android.sdk.internal.session.room.call.DefaultRoomCallService
import org.matrix.android.sdk.internal.session.room.draft.DefaultDraftService
@ -61,7 +61,7 @@ internal class DefaultRoomFactory @Inject constructor(private val cryptoService:
private val relationServiceFactory: DefaultRelationService.Factory,
private val membershipServiceFactory: DefaultMembershipService.Factory,
private val roomPushRuleServiceFactory: DefaultRoomPushRuleService.Factory,
private val roomAccountDataServiceFactory: RoomAccountDataService.Factory,
private val roomAccountDataServiceFactory: DefaultRoomAccountDataService.Factory,
private val sendStateTask: SendStateTask,
private val viaParameterFinder: ViaParameterFinder,
private val searchTask: SearchTask) :

View File

@ -20,34 +20,34 @@ import androidx.lifecycle.LiveData
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService
import org.matrix.android.sdk.api.util.Optional
internal class RoomAccountDataService @AssistedInject constructor(@Assisted private val roomId: String,
internal class DefaultRoomAccountDataService @AssistedInject constructor(@Assisted private val roomId: String,
private val dataSource: RoomAccountDataDataSource,
private val updateRoomAccountDataTask: UpdateRoomAccountDataTask
) : AccountDataService {
) : RoomAccountDataService {
@AssistedFactory
interface Factory {
fun create(roomId: String): RoomAccountDataService
fun create(roomId: String): DefaultRoomAccountDataService
}
override fun getAccountDataEvent(type: String): AccountDataEvent? {
override fun getAccountDataEvent(type: String): RoomAccountDataEvent? {
return dataSource.getAccountDataEvent(roomId, type)
}
override fun getLiveAccountDataEvent(type: String): LiveData<Optional<AccountDataEvent>> {
override fun getLiveAccountDataEvent(type: String): LiveData<Optional<RoomAccountDataEvent>> {
return dataSource.getLiveAccountDataEvent(roomId, type)
}
override fun getAccountDataEvents(types: Set<String>): List<AccountDataEvent> {
override fun getAccountDataEvents(types: Set<String>): List<RoomAccountDataEvent> {
return dataSource.getAccountDataEvents(roomId, types)
}
override fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<AccountDataEvent>> {
override fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<RoomAccountDataEvent>> {
return dataSource.getLiveAccountDataEvents(roomId, types)
}

View File

@ -20,14 +20,16 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.Transformations
import com.zhuinden.monarchy.Monarchy
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import io.realm.Realm
import io.realm.RealmQuery
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.api.util.toOptional
import org.matrix.android.sdk.internal.database.RealmSessionProvider
import org.matrix.android.sdk.internal.database.mapper.AccountDataMapper
import org.matrix.android.sdk.internal.database.model.RoomAccountDataEntityFields
import org.matrix.android.sdk.internal.database.model.RoomEntity
import org.matrix.android.sdk.internal.database.query.where
import org.matrix.android.sdk.internal.database.model.RoomEntityFields
import org.matrix.android.sdk.internal.di.SessionDatabase
import javax.inject.Inject
@ -35,43 +37,62 @@ internal class RoomAccountDataDataSource @Inject constructor(@SessionDatabase pr
private val realmSessionProvider: RealmSessionProvider,
private val accountDataMapper: AccountDataMapper) {
fun getAccountDataEvent(roomId: String, type: String): AccountDataEvent? {
fun getAccountDataEvent(roomId: String, type: String): RoomAccountDataEvent? {
return getAccountDataEvents(roomId, setOf(type)).firstOrNull()
}
fun getLiveAccountDataEvent(roomId: String, type: String): LiveData<Optional<AccountDataEvent>> {
fun getLiveAccountDataEvent(roomId: String, type: String): LiveData<Optional<RoomAccountDataEvent>> {
return Transformations.map(getLiveAccountDataEvents(roomId, setOf(type))) {
it.firstOrNull()?.toOptional()
}
}
fun getAccountDataEvents(roomId: String, types: Set<String>): List<AccountDataEvent> {
/**
* @param roomId the roomId to search for account data event. If null will check in every room.
* @param types the types to filter. If empty will return all account data event in given room (or every room if roomId is null)
*
*/
fun getAccountDataEvents(roomId: String?, types: Set<String>): List<RoomAccountDataEvent> {
return realmSessionProvider.withRealm { realm ->
val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return@withRealm emptyList()
val roomEntity = buildRoomQuery(realm, roomId, types).findFirst() ?: return@withRealm emptyList()
roomEntity.accountDataEvents(types)
}
}
fun getLiveAccountDataEvents(roomId: String, types: Set<String>): LiveData<List<AccountDataEvent>> {
val liveRoomEntity = monarchy.findAllManagedWithChanges { RoomEntity.where(it, roomId) }
val resultLiveData = MediatorLiveData<List<AccountDataEvent>>()
resultLiveData.addSource(liveRoomEntity) {
val roomEntity = it.realmResults.firstOrNull()
if (roomEntity == null) {
resultLiveData.postValue(emptyList())
} else {
val mappedResult = roomEntity.accountDataEvents(types)
resultLiveData.postValue(mappedResult)
/**
* @param roomId the roomId to search for account data event. If null will check in every room.
* @param types the types to filter. If empty will return all account data event in the given room (or every room if roomId is null).
*
*/
fun getLiveAccountDataEvents(roomId: String?, types: Set<String>): LiveData<List<RoomAccountDataEvent>> {
val liveRoomEntity = monarchy.findAllManagedWithChanges {
buildRoomQuery(it, roomId, types)
}
val resultLiveData = MediatorLiveData<List<RoomAccountDataEvent>>()
resultLiveData.addSource(liveRoomEntity) { changeSet ->
val mappedResult = changeSet.realmResults.flatMap { it.accountDataEvents(types) }
resultLiveData.postValue(mappedResult)
}
return resultLiveData
}
private fun RoomEntity.accountDataEvents(types: Set<String>): List<AccountDataEvent> {
private fun buildRoomQuery(realm: Realm, roomId: String?, types: Set<String>): RealmQuery<RoomEntity> {
val query = realm.where(RoomEntity::class.java)
if (roomId != null) {
query.equalTo(RoomEntityFields.ROOM_ID, roomId)
}
query.isNotEmpty(RoomEntityFields.ACCOUNT_DATA.`$`)
if (types.isNotEmpty()) {
query.`in`(RoomEntityFields.ACCOUNT_DATA.TYPE, types.toTypedArray())
}
return query
}
private fun RoomEntity.accountDataEvents(types: Set<String>): List<RoomAccountDataEvent> {
val query = accountData.where()
if (types.isNotEmpty()) {
query.`in`(RoomAccountDataEntityFields.TYPE, types.toTypedArray())
}
return query.findAll().map { accountDataMapper.map(it) }
return query.findAll().map { accountDataMapper.map(roomId, it) }
}
}

View File

@ -24,7 +24,6 @@ import io.realm.RealmQuery
import io.realm.RealmResults
import io.realm.Sort
import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.NoOpMatrixCallback
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.events.model.EventType
@ -168,9 +167,7 @@ internal class DefaultTimeline(
timelineEvents.addChangeListener(eventsChangeListener)
handleInitialLoad()
loadRoomMembersTask
.configureWith(LoadRoomMembersTask.Params(roomId)) {
this.callback = NoOpMatrixCallback()
}
.configureWith(LoadRoomMembersTask.Params(roomId))
.executeBy(taskExecutor)
// Ensure ReadReceipt from init sync are loaded

View File

@ -18,13 +18,13 @@ package org.matrix.android.sdk.internal.session.room.typing
import android.os.SystemClock
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
import dagger.assisted.AssistedFactory
import org.matrix.android.sdk.api.MatrixCallback
import dagger.assisted.AssistedInject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.session.room.typing.TypingService
import org.matrix.android.sdk.api.util.Cancelable
import org.matrix.android.sdk.internal.task.TaskExecutor
import org.matrix.android.sdk.internal.task.configureWith
import timber.log.Timber
/**
@ -35,7 +35,6 @@ import timber.log.Timber
*/
internal class DefaultTypingService @AssistedInject constructor(
@Assisted private val roomId: String,
private val taskExecutor: TaskExecutor,
private val sendTypingTask: SendTypingTask
) : TypingService {
@ -44,8 +43,8 @@ internal class DefaultTypingService @AssistedInject constructor(
fun create(roomId: String): DefaultTypingService
}
private var currentTask: Cancelable? = null
private var currentAutoStopTask: Cancelable? = null
private val coroutineScope = CoroutineScope(Job())
private var currentTask: Job? = null
// What the homeserver knows
private var userIsTyping = false
@ -53,26 +52,24 @@ internal class DefaultTypingService @AssistedInject constructor(
// Last time the user is typing event has been sent
private var lastRequestTimestamp: Long = 0
/**
* Notify to the server that the user is typing and schedule the auto typing off
*/
override fun userIsTyping() {
scheduleAutoStop()
val now = SystemClock.elapsedRealtime()
currentTask?.cancel()
currentTask = coroutineScope.launch {
if (userIsTyping && now < lastRequestTimestamp + MIN_DELAY_BETWEEN_TWO_USER_IS_TYPING_REQUESTS_MILLIS) {
Timber.d("Typing: Skip start request")
return
}
} else {
Timber.d("Typing: Send start request")
userIsTyping = true
lastRequestTimestamp = now
currentTask?.cancel()
val params = SendTypingTask.Params(roomId, true)
currentTask = sendTypingTask
.configureWith(params)
.executeBy(taskExecutor)
sendRequest(true)
}
delay(MIN_DELAY_TO_SEND_STOP_TYPING_REQUEST_WHEN_NO_USER_ACTIVITY_MILLIS)
Timber.d("Typing: auto stop")
sendRequest(false)
}
}
override fun userStopsTyping() {
@ -82,36 +79,23 @@ internal class DefaultTypingService @AssistedInject constructor(
}
Timber.d("Typing: Send stop request")
userIsTyping = false
lastRequestTimestamp = 0
currentAutoStopTask?.cancel()
currentTask?.cancel()
val params = SendTypingTask.Params(roomId, false)
currentTask = sendTypingTask
.configureWith(params)
.executeBy(taskExecutor)
currentTask = coroutineScope.launch {
sendRequest(false)
}
}
private fun scheduleAutoStop() {
Timber.d("Typing: Schedule auto stop")
currentAutoStopTask?.cancel()
val params = SendTypingTask.Params(
roomId,
false,
delay = MIN_DELAY_TO_SEND_STOP_TYPING_REQUEST_WHEN_NO_USER_ACTIVITY_MILLIS)
currentAutoStopTask = sendTypingTask
.configureWith(params) {
callback = object : MatrixCallback<Unit> {
override fun onSuccess(data: Unit) {
userIsTyping = false
private suspend fun sendRequest(isTyping: Boolean) {
try {
sendTypingTask.execute(SendTypingTask.Params(roomId, isTyping))
userIsTyping = isTyping
} catch (failure: Throwable) {
// Ignore network error, etc...
Timber.w(failure, "Unable to send typing request")
}
}
}
.executeBy(taskExecutor)
}
companion object {
private const val MIN_DELAY_BETWEEN_TWO_USER_IS_TYPING_REQUESTS_MILLIS = 10_000L

View File

@ -17,11 +17,10 @@
package org.matrix.android.sdk.internal.session.room.typing
import org.matrix.android.sdk.internal.di.UserId
import org.matrix.android.sdk.internal.network.GlobalErrorReceiver
import org.matrix.android.sdk.internal.network.executeRequest
import org.matrix.android.sdk.internal.session.room.RoomAPI
import org.matrix.android.sdk.internal.task.Task
import kotlinx.coroutines.delay
import org.matrix.android.sdk.internal.network.GlobalErrorReceiver
import javax.inject.Inject
internal interface SendTypingTask : Task<SendTypingTask.Params, Unit> {
@ -29,9 +28,7 @@ internal interface SendTypingTask : Task<SendTypingTask.Params, Unit> {
data class Params(
val roomId: String,
val isTyping: Boolean,
val typingTimeoutMillis: Int? = 30_000,
// Optional delay before sending the request to the homeserver
val delay: Long? = null
val typingTimeoutMillis: Int? = 30_000
)
}
@ -42,8 +39,6 @@ internal class DefaultSendTypingTask @Inject constructor(
) : SendTypingTask {
override suspend fun execute(params: SendTypingTask.Params) {
delay(params.delay ?: -1)
executeRequest(globalErrorReceiver) {
roomAPI.sendTypingState(
params.roomId,

View File

@ -23,7 +23,7 @@ import io.realm.kotlin.where
import org.matrix.android.sdk.api.pushrules.RuleScope
import org.matrix.android.sdk.api.pushrules.RuleSetKey
import org.matrix.android.sdk.api.pushrules.rest.GetPushRulesResponse
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.events.model.toModel
@ -113,7 +113,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
}
}
private fun handlePushRules(realm: Realm, event: AccountDataEvent) {
private fun handlePushRules(realm: Realm, event: UserAccountDataEvent) {
val pushRules = event.content.toModel<GetPushRulesResponse>() ?: return
realm.where(PushRulesEntity::class.java)
.findAll()
@ -155,7 +155,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
realm.insertOrUpdate(underrides)
}
private fun handleDirectChatRooms(realm: Realm, event: AccountDataEvent) {
private fun handleDirectChatRooms(realm: Realm, event: UserAccountDataEvent) {
val content = event.content.toModel<DirectMessagesContent>() ?: return
content.forEach { (userId, roomIds) ->
roomIds.forEach { roomId ->
@ -181,7 +181,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
}
}
private fun handleIgnoredUsers(realm: Realm, event: AccountDataEvent) {
private fun handleIgnoredUsers(realm: Realm, event: UserAccountDataEvent) {
val userIds = event.content.toModel<IgnoredUsersContent>()?.ignoredUsers?.keys ?: return
realm.where(IgnoredUserEntity::class.java)
.findAll()
@ -191,7 +191,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
// TODO If not initial sync, we should execute a init sync
}
private fun handleBreadcrumbs(realm: Realm, event: AccountDataEvent) {
private fun handleBreadcrumbs(realm: Realm, event: UserAccountDataEvent) {
val recentRoomIds = event.content.toModel<BreadcrumbsContent>()?.recentRoomIds ?: return
val entity = BreadcrumbsEntity.getOrCreate(realm)

View File

@ -18,9 +18,9 @@ package org.matrix.android.sdk.internal.session.sync.model.accountdata
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
@JsonClass(generateAdapter = true)
internal data class UserAccountDataSync(
@Json(name = "events") val list: List<AccountDataEvent> = emptyList()
@Json(name = "events") val list: List<UserAccountDataEvent> = emptyList()
)

View File

@ -56,7 +56,6 @@ internal class RoomSyncAccountDataHandler @Inject constructor(private val roomTa
private fun handleGeneric(roomEntity: RoomEntity, content: JsonDict?, eventType: String) {
val existing = roomEntity.accountData.where().equalTo(RoomAccountDataEntityFields.TYPE, eventType).findFirst()
if (existing != null) {
// Update current value
existing.contentStr = ContentMapper.map(content)
} else {
val roomAccountData = RoomAccountDataEntity(

View File

@ -18,42 +18,53 @@ package org.matrix.android.sdk.internal.session.user.accountdata
import androidx.lifecycle.LiveData
import com.zhuinden.monarchy.Monarchy
import org.matrix.android.sdk.api.session.accountdata.AccountDataService
import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.internal.di.SessionDatabase
import org.matrix.android.sdk.internal.session.sync.UserAccountDataSyncHandler
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent
import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataDataSource
import org.matrix.android.sdk.internal.task.TaskExecutor
import org.matrix.android.sdk.internal.task.configureWith
import org.matrix.android.sdk.internal.util.awaitCallback
import javax.inject.Inject
internal class UserAccountDataService @Inject constructor(
internal class DefaultSessionAccountDataService @Inject constructor(
@SessionDatabase private val monarchy: Monarchy,
private val updateUserAccountDataTask: UpdateUserAccountDataTask,
private val userAccountDataSyncHandler: UserAccountDataSyncHandler,
private val accountDataDataSource: UserAccountDataDataSource,
private val userAccountDataDataSource: UserAccountDataDataSource,
private val roomAccountDataDataSource: RoomAccountDataDataSource,
private val taskExecutor: TaskExecutor
) : AccountDataService {
) : SessionAccountDataService {
override fun getAccountDataEvent(type: String): AccountDataEvent? {
return accountDataDataSource.getAccountDataEvent(type)
override fun getUserAccountDataEvent(type: String): UserAccountDataEvent? {
return userAccountDataDataSource.getAccountDataEvent(type)
}
override fun getLiveAccountDataEvent(type: String): LiveData<Optional<AccountDataEvent>> {
return accountDataDataSource.getLiveAccountDataEvent(type)
override fun getLiveUserAccountDataEvent(type: String): LiveData<Optional<UserAccountDataEvent>> {
return userAccountDataDataSource.getLiveAccountDataEvent(type)
}
override fun getAccountDataEvents(types: Set<String>): List<AccountDataEvent> {
return accountDataDataSource.getAccountDataEvents(types)
override fun getUserAccountDataEvents(types: Set<String>): List<UserAccountDataEvent> {
return userAccountDataDataSource.getAccountDataEvents(types)
}
override fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<AccountDataEvent>> {
return accountDataDataSource.getLiveAccountDataEvents(types)
override fun getLiveUserAccountDataEvents(types: Set<String>): LiveData<List<UserAccountDataEvent>> {
return userAccountDataDataSource.getLiveAccountDataEvents(types)
}
override suspend fun updateAccountData(type: String, content: Content) {
override fun getRoomAccountDataEvents(types: Set<String>): List<RoomAccountDataEvent> {
return roomAccountDataDataSource.getAccountDataEvents(null, types)
}
override fun getLiveRoomAccountDataEvents(types: Set<String>): LiveData<List<RoomAccountDataEvent>> {
return roomAccountDataDataSource.getLiveAccountDataEvents(null, types)
}
override suspend fun updateUserAccountData(type: String, content: Content) {
val params = UpdateUserAccountDataTask.AnyParams(type = type, any = content)
awaitCallback<Unit> { callback ->
updateUserAccountDataTask.configureWith(params) {

View File

@ -21,7 +21,7 @@ import androidx.lifecycle.Transformations
import com.zhuinden.monarchy.Monarchy
import io.realm.Realm
import io.realm.RealmQuery
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.util.Optional
import org.matrix.android.sdk.api.util.toOptional
import org.matrix.android.sdk.internal.database.RealmSessionProvider
@ -35,23 +35,23 @@ internal class UserAccountDataDataSource @Inject constructor(@SessionDatabase pr
private val realmSessionProvider: RealmSessionProvider,
private val accountDataMapper: AccountDataMapper) {
fun getAccountDataEvent(type: String): AccountDataEvent? {
fun getAccountDataEvent(type: String): UserAccountDataEvent? {
return getAccountDataEvents(setOf(type)).firstOrNull()
}
fun getLiveAccountDataEvent(type: String): LiveData<Optional<AccountDataEvent>> {
fun getLiveAccountDataEvent(type: String): LiveData<Optional<UserAccountDataEvent>> {
return Transformations.map(getLiveAccountDataEvents(setOf(type))) {
it.firstOrNull()?.toOptional()
}
}
fun getAccountDataEvents(types: Set<String>): List<AccountDataEvent> {
fun getAccountDataEvents(types: Set<String>): List<UserAccountDataEvent> {
return realmSessionProvider.withRealm {
accountDataEventsQuery(it, types).findAll().map(accountDataMapper::map)
}
}
fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<AccountDataEvent>> {
fun getLiveAccountDataEvents(types: Set<String>): LiveData<List<UserAccountDataEvent>> {
return monarchy.findAllMappedWithChanges(
{ accountDataEventsQuery(it, types) },
accountDataMapper::map

View File

@ -23,7 +23,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.Transformations
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.events.model.Event
@ -47,7 +47,7 @@ import javax.inject.Inject
@SessionScope
internal class WidgetManager @Inject constructor(private val integrationManager: IntegrationManager,
private val accountDataDataSource: UserAccountDataDataSource,
private val userAccountDataDataSource: UserAccountDataDataSource,
private val stateEventDataSource: StateEventDataSource,
private val createWidgetTask: CreateWidgetTask,
private val widgetFactory: WidgetFactory,
@ -136,7 +136,7 @@ internal class WidgetManager @Inject constructor(private val integrationManager:
widgetTypes: Set<String>? = null,
excludedTypes: Set<String>? = null
): LiveData<List<Widget>> {
val widgetsAccountData = accountDataDataSource.getLiveAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS)
val widgetsAccountData = userAccountDataDataSource.getLiveAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS)
return Transformations.map(widgetsAccountData) {
it.getOrNull()?.mapToWidgets(widgetTypes, excludedTypes).orEmpty()
}
@ -146,11 +146,11 @@ internal class WidgetManager @Inject constructor(private val integrationManager:
widgetTypes: Set<String>? = null,
excludedTypes: Set<String>? = null
): List<Widget> {
val widgetsAccountData = accountDataDataSource.getAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) ?: return emptyList()
val widgetsAccountData = userAccountDataDataSource.getAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) ?: return emptyList()
return widgetsAccountData.mapToWidgets(widgetTypes, excludedTypes)
}
private fun AccountDataEvent.mapToWidgets(widgetTypes: Set<String>? = null,
private fun UserAccountDataEvent.mapToWidgets(widgetTypes: Set<String>? = null,
excludedTypes: Set<String>? = null): List<Widget> {
return extractWidgetSequence(widgetFactory)
.filter {

View File

@ -19,10 +19,10 @@ package org.matrix.android.sdk.internal.session.widgets.helper
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.util.JsonDict
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
import org.matrix.android.sdk.api.session.widgets.model.Widget
internal fun AccountDataEvent.extractWidgetSequence(widgetFactory: WidgetFactory): Sequence<Widget> {
internal fun UserAccountDataEvent.extractWidgetSequence(widgetFactory: WidgetFactory): Sequence<Widget> {
return content.asSequence()
.mapNotNull {
@Suppress("UNCHECKED_CAST")

View File

@ -0,0 +1 @@
Migrate DefaultTypingService, KeysImporter and KeysExporter to coroutines

View File

@ -0,0 +1 @@
Update Message Composer design

View File

@ -0,0 +1 @@
Cleanup Epoxy items, and debounce all the clicks

View File

@ -0,0 +1,2 @@
Migrate to new colors and cleanup the style and theme
Ref: https://material.io/blog/migrate-android-material-components

1
newsfragment/3467.misc Normal file
View File

@ -0,0 +1 @@
VoIP: Change hold direction to send-only.

View File

@ -0,0 +1 @@
Splits SessionAccountDataService and RoomAccountDataService and offers to query RoomAccountDataEvent at the session level.

View File

@ -136,8 +136,9 @@ android\.R\.id\.home===2
### Kotlin conversion tools introduce this, but is can be replace by trim()
trim \{ it \<\= \' \' \}
### Use AlertDialog form v7 compat lib
### Use MaterialAlertDialogBuilder
android\.app\.AlertDialog
androidx\.appcompat\.app\.AlertDialog===4
### Put the operator at the beginning of next line
&&$

View File

@ -84,3 +84,22 @@ layout_constraintLeft_
### Use androidx.recyclerview.widget.RecyclerView because EpoxyRecyclerViews add behavior we do not want to
<com\.airbnb\.epoxy\.EpoxyRecyclerView
### Use Button instead of MaterialButton, the inflater will automatically inflate MaterialButton.
<com\.google\.android\.material\.button\.MaterialButton
<androidx\.appcompat\.widget\.AppCompatButton
### Use CheckBox instead of MaterialCheckBox, the inflater will automatically inflate MaterialCheckBox.
<com\.google\.android\.material\.checkbox\.MaterialCheckBox
### Use RadioButton instead of MaterialRadioButton, the inflater will automatically inflate Material Views.
<com\.google\.android\.material\.radiobutton\.MaterialRadioButton
### Use com.google.android.material.switchmaterial.SwitchMaterial instead of Switch, the inflater will not automatically inflate Material Views for Switch.
<Switch
### Use colorSecondary
colorAccent
### Use MaterialCardView
<androidx\.cardview\.widget\.CardView

View File

@ -320,13 +320,13 @@ dependencies {
implementation project(":diff-match-patch")
implementation project(":multipicker")
implementation project(":attachment-viewer")
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
implementation "androidx.recyclerview:recyclerview:1.2.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation "androidx.fragment:fragment-ktx:$fragment_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
@ -396,7 +396,7 @@ dependencies {
implementation 'androidx.browser:browser:1.3.0'
// Passphrase strength helper
implementation 'com.nulab-inc:zxcvbn:1.5.0'
implementation 'com.nulab-inc:zxcvbn:1.5.2'
//Alerter
implementation 'com.tapadoo.android:alerter:7.0.1'

View File

@ -6,11 +6,26 @@
<activity android:name=".features.debug.TestLinkifyActivity" />
<activity android:name=".features.debug.sas.DebugSasEmojiActivity" />
<activity
android:name=".features.debug.DebugMaterialThemeLightActivity"
android:name=".features.debug.DebugMaterialThemeLightDefaultActivity"
android:theme="@style/VectorMaterialThemeDebugLight" />
<activity
android:name=".features.debug.DebugMaterialThemeDarkActivity"
android:name=".features.debug.DebugMaterialThemeLightTestActivity"
android:theme="@style/VectorMaterialThemeDebugLight.Test" />
<activity
android:name=".features.debug.DebugMaterialThemeLightVectorActivity"
android:theme="@style/AppTheme.Light" />
<activity
android:name=".features.debug.DebugMaterialThemeDarkDefaultActivity"
android:theme="@style/VectorMaterialThemeDebugDark" />
<activity
android:name=".features.debug.DebugMaterialThemeDarkTestActivity"
android:theme="@style/VectorMaterialThemeDebugDark.Test" />
<activity
android:name=".features.debug.DebugMaterialThemeDarkVectorActivity"
android:theme="@style/AppTheme.Dark" />
<activity
android:name=".features.debug.DebugVectorButtonStylesActivity"
android:theme="@style/AppTheme.Light" />
</application>
</manifest>

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2021 New Vector Ltd
*
* 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 im.vector.app.features.debug
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import im.vector.app.databinding.ActivityTestMaterialThemeBinding
class DebugBottomSheet : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
// Reuse tha Activity layout
val binding = ActivityTestMaterialThemeBinding.inflate(inflater, container, false)
return binding.root
}
}

View File

@ -18,9 +18,8 @@ package im.vector.app.features.debug
import android.os.Bundle
import android.view.Menu
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
import im.vector.app.R
import im.vector.app.core.utils.toast
@ -45,7 +44,8 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() {
}
views.debugShowDialog.setOnClickListener {
AlertDialog.Builder(this)
MaterialAlertDialogBuilder(this)
.setTitle("Dialog title")
.setMessage("Dialog content")
.setIcon(R.drawable.ic_settings_x)
.setPositiveButton("Positive", null)
@ -55,7 +55,7 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() {
}
views.debugShowBottomSheet.setOnClickListener {
BottomSheetDialogFragment().show(supportFragmentManager, "TAG")
DebugBottomSheet().show(supportFragmentManager, "TAG")
}
}

View File

@ -0,0 +1,19 @@
/*
* Copyright 2019 New Vector Ltd
*
* 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 im.vector.app.features.debug
class DebugMaterialThemeDarkDefaultActivity : DebugMaterialThemeActivity()

View File

@ -16,4 +16,4 @@
package im.vector.app.features.debug
class DebugMaterialThemeDarkActivity : DebugMaterialThemeActivity()
class DebugMaterialThemeDarkTestActivity : DebugMaterialThemeActivity()

View File

@ -0,0 +1,19 @@
/*
* Copyright 2019 New Vector Ltd
*
* 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 im.vector.app.features.debug
class DebugMaterialThemeDarkVectorActivity : DebugMaterialThemeActivity()

View File

@ -0,0 +1,19 @@
/*
* Copyright 2019 New Vector Ltd
*
* 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 im.vector.app.features.debug
class DebugMaterialThemeLightDefaultActivity : DebugMaterialThemeActivity()

View File

@ -16,4 +16,4 @@
package im.vector.app.features.debug
class DebugMaterialThemeLightActivity : DebugMaterialThemeActivity()
class DebugMaterialThemeLightTestActivity : DebugMaterialThemeActivity()

View File

@ -0,0 +1,19 @@
/*
* Copyright 2019 New Vector Ltd
*
* 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 im.vector.app.features.debug
class DebugMaterialThemeLightVectorActivity : DebugMaterialThemeActivity()

View File

@ -71,10 +71,29 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
private fun setupViews() {
views.debugTestTextViewLink.setOnClickListener { testTextViewLink() }
views.debugOpenButtonStyles.setOnClickListener {
startActivity(Intent(this, DebugVectorButtonStylesActivity::class.java))
}
views.debugShowSasEmoji.setOnClickListener { showSasEmoji() }
views.debugTestNotification.setOnClickListener { testNotification() }
views.debugTestMaterialThemeLight.setOnClickListener { testMaterialThemeLight() }
views.debugTestMaterialThemeDark.setOnClickListener { testMaterialThemeDark() }
views.debugTestMaterialThemeLightDefault.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeLightDefaultActivity::class.java))
}
views.debugTestMaterialThemeLightTest.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeLightTestActivity::class.java))
}
views.debugTestMaterialThemeLightVector.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeLightVectorActivity::class.java))
}
views.debugTestMaterialThemeDarkDefault.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeDarkDefaultActivity::class.java))
}
views.debugTestMaterialThemeDarkTest.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeDarkTestActivity::class.java))
}
views.debugTestMaterialThemeDarkVector.setOnClickListener {
startActivity(Intent(this, DebugMaterialThemeDarkVectorActivity::class.java))
}
views.debugTestCrash.setOnClickListener { testCrash() }
views.debugScanQrCode.setOnClickListener { scanQRCode() }
}
@ -174,14 +193,6 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
)
}
private fun testMaterialThemeLight() {
startActivity(Intent(this, DebugMaterialThemeLightActivity::class.java))
}
private fun testMaterialThemeDark() {
startActivity(Intent(this, DebugMaterialThemeDarkActivity::class.java))
}
private fun testCrash() {
throw RuntimeException("Application crashed from user demand")
}

View File

@ -0,0 +1,24 @@
/*
* Copyright 2021 New Vector Ltd
*
* 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 im.vector.app.features.debug
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityDebugButtonStylesBinding
class DebugVectorButtonStylesActivity : VectorBaseActivity<ActivityDebugButtonStylesBinding>() {
override fun getBinding() = ActivityDebugButtonStylesBinding.inflate(layoutInflater)
}

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".features.debug.DebugVectorButtonStylesActivity"
tools:ignore="HardcodedText">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<Button
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Default" />
<Button
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Default disabled" />
<Button
style="@style/VectorButtonStyleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text" />
<Button
style="@style/VectorButtonStyleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Text disabled" />
<Button
style="@style/VectorButtonStyle.Positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Positive" />
<Button
style="@style/VectorButtonStyle.Positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Positive disabled" />
<Button
style="@style/VectorButtonStyle.Destructive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Destructive" />
<Button
style="@style/VectorButtonStyle.Destructive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Destructive disabled" />
<Button
style="@style/VectorButtonStyleUnelevated.Bot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bot" />
<Button
style="@style/VectorButtonStyleUnelevated.Bot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Bot disabled" />
<Button
style="@style/VectorButtonStyleOutlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Outline" />
<Button
style="@style/VectorButtonStyleOutlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Outline disabled" />
<Button
style="@style/VectorButtonStyleOutlined.Poll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Poll " />
<Button
style="@style/VectorButtonStyleOutlined.Poll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Poll disabled" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/palette_azure"
android:orientation="vertical"
android:padding="8dp">
<Button
style="@style/AlerterButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Alerter" />
<Button
style="@style/AlerterButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Alerter disabled" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -20,51 +20,106 @@
android:padding="@dimen/layout_horizontal_margin"
android:showDividers="middle">
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debug_test_text_view_link"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test linkification" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debug_test_notification"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Notification" />
<com.google.android.material.button.MaterialButton
android:id="@+id/debug_test_material_theme_light"
style="@style/VectorButtonStyle"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Material theme Light" />
android:text="Light theme" />
<com.google.android.material.button.MaterialButton
android:id="@+id/debug_test_material_theme_dark"
style="@style/VectorButtonStyle"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/debug_test_material_theme_light_default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Material theme Dark" />
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Default" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debug_test_material_theme_light_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Test" />
<Button
android:id="@+id/debug_test_material_theme_light_vector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Vector" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dark theme" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/debug_test_material_theme_dark_default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Default" />
<Button
android:id="@+id/debug_test_material_theme_dark_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Test" />
<Button
android:id="@+id/debug_test_material_theme_dark_vector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Vector" />
</LinearLayout>
<Button
android:id="@+id/debug_open_button_styles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="See button styles" />
<Button
android:id="@+id/debug_show_sas_emoji"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Display all SAS emoji" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debug_test_crash"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Crash the app" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debug_scan_qr_code"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scan QR-code" />

View File

@ -5,7 +5,6 @@
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".features.debug.DebugMaterialThemeActivity"
tools:ignore="HardcodedText">
@ -28,6 +27,229 @@
app:subtitle="Toolbar Subtitle"
app:title="Toolbar Title" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:divider="@drawable/linear_divider"
android:showDividers="middle">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#FFFFFF"
android:divider="@drawable/linear_divider"
android:orientation="vertical"
android:padding="8dp"
android:showDividers="middle">
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorPrimary"
android:text="colorPrimary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorPrimaryVariant"
android:text="colorPrimaryVariant" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorOnPrimary"
android:text="colorOnPrimary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorSecondary"
android:text="colorSecondary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorSecondaryVariant"
android:text="colorSecondaryVariant" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorOnSecondary"
android:text="colorOnSecondary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorError"
android:text="colorError" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorOnError"
android:text="colorOnError" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorSurface"
android:text="colorSurface" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorOnSurface"
android:text="colorOnSurface" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:colorBackground"
android:text="android:colorBackground" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorOnBackground"
android:text="colorOnBackground" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?colorAccent"
android:text="colorAccent" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:statusBarColor"
android:text="android:statusBarColor" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:navigationBarColor"
android:text="android:navigationBarColor" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:textColorPrimary"
android:text="android:textColorPrimary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:textColorSecondary"
android:text="android:textColorSecondary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:textColorTertiary"
android:text="android:textColorTertiary" />
<TextView
style="@style/DebugTextColorDemo.White"
android:background="?android:textColorLink"
android:text="android:textColorLink" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#000000"
android:divider="@drawable/linear_divider"
android:dividerPadding="8dp"
android:orientation="vertical"
android:padding="8dp"
android:showDividers="middle">
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorPrimary"
android:text="colorPrimary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorPrimaryVariant"
android:text="colorPrimaryVariant" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorOnPrimary"
android:text="colorOnPrimary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorSecondary"
android:text="colorSecondary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorSecondaryVariant"
android:text="colorSecondaryVariant" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorOnSecondary"
android:text="colorOnSecondary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorError"
android:text="colorError" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorOnError"
android:text="colorOnError" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorSurface"
android:text="colorSurface" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorOnSurface"
android:text="colorOnSurface" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:colorBackground"
android:text="android:colorBackground" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorOnBackground"
android:text="colorOnBackground" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?colorAccent"
android:text="colorAccent" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:statusBarColor"
android:text="android:statusBarColor" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:navigationBarColor"
android:text="android:navigationBarColor" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:textColorPrimary"
android:text="android:textColorPrimary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:textColorSecondary"
android:text="android:textColorSecondary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:textColorTertiary"
android:text="android:textColorTertiary" />
<TextView
style="@style/DebugTextColorDemo.Black"
android:background="?android:textColorLink"
android:text="android:textColorLink" />
</LinearLayout>
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
@ -81,60 +303,105 @@
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Buttons" />
<com.google.android.material.button.MaterialButton
<Button
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Material Button Classic"
android:text="Classic"
app:icon="@drawable/ic_settings_x" />
<com.google.android.material.button.MaterialButton
<Button
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Classic Disabled"
app:icon="@drawable/ic_settings_x" />
<Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Material Button OutlinedButton"
android:text="OutlinedButton"
app:icon="@drawable/ic_settings_x" />
<com.google.android.material.button.MaterialButton
<Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="OutlinedButton Disabled"
app:icon="@drawable/ic_settings_x" />
<Button
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Material Button TextButton"
android:text="TextButton"
app:icon="@drawable/ic_settings_x" />
<com.google.android.material.button.MaterialButton
<Button
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="TextButton Disabled"
app:icon="@drawable/ic_settings_x" />
<Button
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Material Button UnelevatedButton"
android:text="UnelevatedButton"
app:icon="@drawable/ic_settings_x" />
<com.google.android.material.button.MaterialButton
<Button
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="UnelevatedButton Disabled"
app:icon="@drawable/ic_settings_x" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Actions" />
<Button
android:id="@+id/debugShowSnackbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Show Snackbar" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debugShowToast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Show Toast" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debugShowDialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Show Dialog" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/debugShowBottomSheet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Show Bottom Sheet" />
<com.google.android.material.checkbox.MaterialCheckBox
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Material CheckBox" />
@ -146,7 +413,8 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
@ -159,9 +427,16 @@
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="16dp"
android:importantForAccessibility="no"
android:src="@drawable/ic_settings_x" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/home_bottom_navigation" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -8,8 +8,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"

View File

@ -24,7 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@color/black"
android:textColor="@color/emoji_color"
android:textSize="22sp"
tools:text="🔧" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -38,4 +38,4 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -7,6 +7,10 @@
<style name="VectorMaterialThemeDebugLight" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Keep all default value -->
</style>
<style name="VectorMaterialThemeDebugLight.Test">
<item name="colorPrimary">#7F7F00</item>
<item name="colorPrimaryVariant">#00FF00</item>
<item name="colorOnPrimary">#0000FF</item>
@ -24,14 +28,17 @@
<item name="android:colorBackground">#FF7777</item>
<item name="colorOnBackground">#077700</item>
<!-- TODO is it still required? -->
<item name="colorAccent">#03b381</item>
<item name="android:statusBarColor">#1188FF</item>
<item name="android:navigationBarColor">#FF8811</item>
<item name="android:textColorLink">#000FFF</item>
</style>
<style name="VectorMaterialThemeDebugDark" parent="Theme.MaterialComponents.NoActionBar">
<!-- Keep all default value -->
</style>
<style name="VectorMaterialThemeDebugDark.Test">
<item name="colorPrimary">#7F7F00</item>
<item name="colorPrimaryVariant">#00FF00</item>
<item name="colorOnPrimary">#0000FF</item>
@ -49,11 +56,26 @@
<item name="android:colorBackground">#FF7777</item>
<item name="colorOnBackground">#077700</item>
<!-- TODO is it still required? -->
<item name="colorAccent">#03b381</item>
<item name="android:statusBarColor">#1188FF</item>
<item name="android:navigationBarColor">#FF8811</item>
<item name="android:textColorLink">#000FFF</item>
</style>
<style name="DebugTextColorDemo">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:padding">4dp</item>
<item name="android:gravity">center</item>
<item name="android:textSize">16sp</item>
</style>
<style name="DebugTextColorDemo.White">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="DebugTextColorDemo.Black">
<item name="android:textColor">#000000</item>
</style>
</resources>

View File

@ -1,222 +0,0 @@
/*
* Copyright 2020 New Vector Ltd
*
* 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 im.vector.app.core.animations.behavior
import android.animation.ArgbEvaluator
import android.content.Context
import android.graphics.drawable.ColorDrawable
import android.util.AttributeSet
import android.view.View
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.withStyledAttributes
import im.vector.app.R
import kotlin.math.abs
private const val UNSPECIFIED_INT = Integer.MAX_VALUE
private val UNSPECIFIED_FLOAT = Float.MAX_VALUE
private const val DEPEND_TYPE_HEIGHT = 0
private const val DEPEND_TYPE_WIDTH = 1
private const val DEPEND_TYPE_X = 2
private const val DEPEND_TYPE_Y = 3
class PercentViewBehavior<V : View>(context: Context, attrs: AttributeSet) : CoordinatorLayout.Behavior<V>(context, attrs) {
private var dependType: Int = 0
private var dependViewId: Int = 0
private var dependTarget: Int = 0
private var dependStartX: Int = 0
private var dependStartY: Int = 0
private var dependStartWidth: Int = 0
private var dependStartHeight: Int = 0
private var startX: Int = 0
private var startY: Int = 0
private var startWidth: Int = 0
private var startHeight: Int = 0
private var startBackgroundColor: Int = 0
private var startAlpha: Float = 0f
private var startRotateX: Float = 0f
private var startRotateY: Float = 0f
private var targetX: Int = 0
private var targetY: Int = 0
private var targetWidth: Int = 0
private var targetHeight: Int = 0
private var targetBackgroundColor: Int = 0
private var targetAlpha: Float = 0f
private var targetRotateX: Float = 0f
private var targetRotateY: Float = 0f
/**
* Is the values prepared to be use
*/
private var isPrepared: Boolean = false
init {
context.withStyledAttributes(attrs, R.styleable.PercentViewBehavior) {
dependViewId = getResourceId(R.styleable.PercentViewBehavior_behavior_dependsOn, 0)
dependType = getInt(R.styleable.PercentViewBehavior_behavior_dependType, DEPEND_TYPE_WIDTH)
dependTarget = getDimensionPixelOffset(R.styleable.PercentViewBehavior_behavior_dependTarget, UNSPECIFIED_INT)
targetX = getDimensionPixelOffset(R.styleable.PercentViewBehavior_behavior_targetX, UNSPECIFIED_INT)
targetY = getDimensionPixelOffset(R.styleable.PercentViewBehavior_behavior_targetY, UNSPECIFIED_INT)
targetWidth = getDimensionPixelOffset(R.styleable.PercentViewBehavior_behavior_targetWidth, UNSPECIFIED_INT)
targetHeight = getDimensionPixelOffset(R.styleable.PercentViewBehavior_behavior_targetHeight, UNSPECIFIED_INT)
targetBackgroundColor = getColor(R.styleable.PercentViewBehavior_behavior_targetBackgroundColor, UNSPECIFIED_INT)
targetAlpha = getFloat(R.styleable.PercentViewBehavior_behavior_targetAlpha, UNSPECIFIED_FLOAT)
targetRotateX = getFloat(R.styleable.PercentViewBehavior_behavior_targetRotateX, UNSPECIFIED_FLOAT)
targetRotateY = getFloat(R.styleable.PercentViewBehavior_behavior_targetRotateY, UNSPECIFIED_FLOAT)
}
}
private fun prepare(parent: CoordinatorLayout, child: View, dependency: View) {
dependStartX = dependency.x.toInt()
dependStartY = dependency.y.toInt()
dependStartWidth = dependency.width
dependStartHeight = dependency.height
startX = child.x.toInt()
startY = child.y.toInt()
startWidth = child.width
startHeight = child.height
startAlpha = child.alpha
startRotateX = child.rotationX
startRotateY = child.rotationY
// only set the start background color when the background is color drawable
val background = child.background
if (background is ColorDrawable) {
startBackgroundColor = background.color
}
// if parent fitsSystemWindows is true, add status bar height to target y if specified
if (parent.fitsSystemWindows && targetY != UNSPECIFIED_INT) {
var result = 0
val resources = parent.context.resources
val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
if (resourceId > 0) {
result = resources.getDimensionPixelSize(resourceId)
}
targetY += result
}
isPrepared = true
}
override fun layoutDependsOn(parent: CoordinatorLayout, child: V, dependency: View): Boolean {
return dependency.id == dependViewId
}
override fun onDependentViewChanged(parent: CoordinatorLayout, child: V, dependency: View): Boolean {
// first time, prepare values before continue
if (!isPrepared) {
prepare(parent, child, dependency)
}
updateView(child, dependency)
return false
}
override fun onLayoutChild(parent: CoordinatorLayout, child: V, layoutDirection: Int): Boolean {
val bool = super.onLayoutChild(parent, child, layoutDirection)
if (isPrepared) {
updateView(child, parent.getDependencies(child)[0])
}
return bool
}
/**
* Update the child view from the dependency states
*
* @param child child view
* @param dependency dependency view
*/
private fun updateView(child: V, dependency: View) {
var percent = 0f
var start = 0f
var current = 0f
var end = UNSPECIFIED_INT.toFloat()
when (dependType) {
DEPEND_TYPE_WIDTH -> {
start = dependStartWidth.toFloat()
current = dependency.width.toFloat()
end = dependTarget.toFloat()
}
DEPEND_TYPE_HEIGHT -> {
start = dependStartHeight.toFloat()
current = dependency.height.toFloat()
end = dependTarget.toFloat()
}
DEPEND_TYPE_X -> {
start = dependStartX.toFloat()
current = dependency.x
end = dependTarget.toFloat()
}
DEPEND_TYPE_Y -> {
start = dependStartY.toFloat()
current = dependency.y
end = dependTarget.toFloat()
}
}
// need to define target value according to the depend type, if not then skip
if (end != UNSPECIFIED_INT.toFloat()) {
percent = abs(current - start) / abs(end - start)
}
updateViewWithPercent(child, if (percent > 1f) 1f else percent)
}
private fun updateViewWithPercent(child: View, percent: Float) {
var newX = if (targetX == UNSPECIFIED_INT) 0f else (targetX - startX) * percent
var newY = if (targetY == UNSPECIFIED_INT) 0f else (targetY - startY) * percent
// set scale
if (targetWidth != UNSPECIFIED_INT) {
val newWidth = startWidth + (targetWidth - startWidth) * percent
child.scaleX = newWidth / startWidth
newX -= (startWidth - newWidth) / 2
}
if (targetHeight != UNSPECIFIED_INT) {
val newHeight = startHeight + (targetHeight - startHeight) * percent
child.scaleY = newHeight / startHeight
newY -= (startHeight - newHeight) / 2
}
// set new position
child.translationX = newX
child.translationY = newY
// set alpha
if (targetAlpha != UNSPECIFIED_FLOAT) {
child.alpha = startAlpha + (targetAlpha - startAlpha) * percent
}
// set background color
if (targetBackgroundColor != UNSPECIFIED_INT && startBackgroundColor != 0) {
val evaluator = ArgbEvaluator()
val color = evaluator.evaluate(percent, startBackgroundColor, targetBackgroundColor) as Int
child.setBackgroundColor(color)
}
// set rotation
if (targetRotateX != UNSPECIFIED_FLOAT) {
child.rotationX = startRotateX + (targetRotateX - startRotateX) * percent
}
if (targetRotateY != UNSPECIFIED_FLOAT) {
child.rotationY = startRotateY + (targetRotateY - startRotateY) * percent
}
child.requestLayout()
}
}

View File

@ -32,6 +32,7 @@ import im.vector.app.features.call.conference.VectorJitsiActivity
import im.vector.app.features.call.transfer.CallTransferActivity
import im.vector.app.features.createdirect.CreateDirectRoomActivity
import im.vector.app.features.crypto.keysbackup.settings.KeysBackupManageActivity
import im.vector.app.features.crypto.keysbackup.setup.KeysBackupSetupActivity
import im.vector.app.features.crypto.quads.SharedSecureStorageActivity
import im.vector.app.features.crypto.recover.BootstrapBottomSheet
import im.vector.app.features.crypto.verification.VerificationBottomSheet
@ -138,6 +139,7 @@ interface ScreenComponent {
fun inject(activity: LinkHandlerActivity)
fun inject(activity: MainActivity)
fun inject(activity: RoomDirectoryActivity)
fun inject(activity: KeysBackupSetupActivity)
fun inject(activity: BugReportActivity)
fun inject(activity: FilteredRoomsActivity)
fun inject(activity: CreateRoomActivity)

View File

@ -18,8 +18,8 @@ package im.vector.app.core.dialogs
import android.app.Activity
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.R
import im.vector.app.databinding.DialogConfirmationWithReasonBinding
@ -46,7 +46,7 @@ object ConfirmationDialogBuilder {
views.dialogReasonInput.setHint(reasonHintRes)
}
AlertDialog.Builder(activity)
MaterialAlertDialogBuilder(activity)
.setTitle(titleRes)
.setView(layout)
.setPositiveButton(positiveRes) { _, _ ->

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