Skip to content

Update translations from Weblate #1279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
fe70507
github: Elevate permisisons to allow creating branches and PRs.
alexmv Dec 20, 2024
0e7cd86
github: Add steps to update generated code as well.
alexmv Dec 20, 2024
7dff110
DO NOT MERGE: Run on this PR.
alexmv Jan 8, 2025
d252d37
changelog: Describe changes since 0.0.24
gnprice Jan 13, 2025
4128600
version: Bump version to 0.0.25
gnprice Jan 13, 2025
d4342ed
autocomplete test: Add extra pump for new delay in upstream RawAutoco…
victorsanni Dec 20, 2024
3011ffe
content [nfc]: Add a bit of dartdoc on parser
gnprice Jan 10, 2025
0acb165
content [nfc]: Split parseMath into parseInlineMath vs parseMathBlock
gnprice Jan 10, 2025
887fb64
content [nfc]: Move static _parseMath out from parser class
gnprice Jan 10, 2025
4a74017
content [nfc]: Split out _ZulipInlineContentParser class
gnprice Jan 10, 2025
f9246e5
content [nfc]: Encapsulate parsing math nodes a bit more
gnprice Jan 10, 2025
00aa35a
content [nfc]: Factor out consumeImageNodes in block-content parse loops
gnprice Jan 10, 2025
e15276b
api [nfc]: Reorder NetworkException to before sibling classes
gnprice Dec 19, 2024
b71839e
api [nfc]: Add HttpException as base-class home for httpStatus field
gnprice Dec 20, 2024
cc25c05
store [nfc]: Use HttpException to simplify error cases
gnprice Dec 20, 2024
dab5162
api: Explicitly ignore topics on DMs
gnprice Jan 8, 2025
99dd8b2
autocomplete: Simplify updating input on topic autocomplete
gnprice Jan 8, 2025
5b77e51
compose [nfc]: Abstract out ComposeTopicController.setTopic
gnprice Jan 8, 2025
2d1c34f
test [nfc]: Centralize a helper eg.unreadChannelMsgs
gnprice Jan 8, 2025
dfcc304
api [nfc]: Introduce TopicName extension type
gnprice Jan 8, 2025
5f9b36c
test [nfc]: Add an "eg.t" helper to make a TopicName; use it
gnprice Jan 8, 2025
059bc10
test [nfc]: Add a helper eg.topicNarrow; use it
gnprice Jan 8, 2025
c562bd7
test [nfc]: Accept TopicName when constructing example move events
gnprice Jan 8, 2025
16fe35b
test [nfc]: Explicitly convert various other topics to TopicName
gnprice Jan 8, 2025
8ee887b
test [nfc]: Leave a few topics as explicit strings
gnprice Jan 8, 2025
e93e409
api [nfc]: Use TopicName in initial-snapshot types
gnprice Jan 8, 2025
ea8ef27
api [nfc]: Use TopicName in event types
gnprice Jan 8, 2025
ba94faa
api [nfc]: Use TopicName in one remaining result type
gnprice Jan 8, 2025
e6720d1
api [nfc]: Use TopicName type in decoding message edit history
gnprice Jan 8, 2025
011fdd1
api [nfc]: Use TopicName type in an API-interpreting static method
gnprice Jan 8, 2025
8a55a06
api [nfc]: Use TopicName in notification types
gnprice Jan 8, 2025
cd67a7e
model [nfc]: Use TopicName type across our model code
gnprice Jan 8, 2025
fb3117b
api [nfc]: Use TopicName type in ApiNarrow
gnprice Jan 8, 2025
fe5a2d5
api [nfc]: Use TopicName type across request parameters
gnprice Jan 8, 2025
02386d6
api [nfc]: Introduce TopicName.apiName, and use for making API requests
gnprice Jan 8, 2025
23dcfd6
api [nfc]: Use TopicName.apiName for constructing narrow links
gnprice Jan 8, 2025
f74d23a
api [nfc]: Use TopicName.apiName for identifying resolve/unresolve moves
gnprice Jan 8, 2025
2531686
notif [nfc]: Use TopicName.apiName for encoding NotificationOpenPayload
gnprice Jan 8, 2025
54d9d5b
api [nfc]: Factor out TopicName.canonicalize
gnprice Jan 8, 2025
ec4cdd0
notif: Case-fold topics for grouping conversations
gnprice Jan 15, 2025
7ac657e
api [nfc]: Introduce TopicName.displayName, and use where needed
gnprice Jan 8, 2025
1579511
api [nfc]: Seal the TopicName migration by making non-transparent
gnprice Jan 8, 2025
b8109de
autocomplete test: Add extra pump in new test for new RawAutocomplete…
chrisbobbe Jan 17, 2025
e3d70b0
deps: Upgrade Flutter to 3.28.0-2.0.pre.38699
rajveermalviya Jan 13, 2025
8b1b733
deps: Upgrade pigeon to 22.7.2
rajveermalviya Jan 9, 2025
e826bdd
notif: Use null-safe generics in Pigeon
rajveermalviya Jan 17, 2025
81e65bf
notif [nfc]: Cut a redundant "it.let"
gnprice Jan 22, 2025
b567955
deps: Upgrade firebase_core, firebase_messaging to latest
rajveermalviya Jan 13, 2025
22ebe58
deps: Upgrade packages within constraints (tools/upgrade pub)
rajveermalviya Jan 13, 2025
427b48b
deps: Upgrade packages to latest, namely device_info_plus, mime, flut…
rajveermalviya Jan 13, 2025
6bc3a14
inbox [nfc]: Factor out a data class so things are clearly labeled
chrisbobbe Dec 5, 2024
7b00bdd
inbox [nfc]: Pass new data class to topic-item widget
chrisbobbe Dec 5, 2024
6293492
msglist [nfc]: Flag wrinkle in MessageListPageState.composeBoxController
chrisbobbe Dec 5, 2024
9fd6811
msglist [nfc]: Add MessageListView to MessageListPageState
chrisbobbe Dec 5, 2024
c9c281f
api [nfc]: Move resolved-topic-prefix constant onto TopicName
chrisbobbe Dec 5, 2024
b7b31db
api: Implement TopicName.isSameAs(other) and .unresolve()
chrisbobbe Jan 17, 2025
61fb6eb
api [nfc]: Comment on why to keep an existing implementation
chrisbobbe Jan 16, 2025
196290e
action_sheet [nfc]: Dartdoc ActionSheetMenuItemButton
chrisbobbe Dec 6, 2024
6c1d157
api: Add updateMessage route
chrisbobbe Dec 10, 2024
c424206
msglist [nfc]: Make MessageListTheme.{light,dark} static final fields
chrisbobbe Jan 13, 2025
d63c6af
emoji_reaction [nfc]: Make EmojiReactionTheme.{light,dark} static finals
chrisbobbe Jan 13, 2025
cda0925
compose [nfc]: Add a TODO(#1238)
chrisbobbe Dec 30, 2024
180868e
compose [nfc]: Comment on max-topic-length check about cutting off short
chrisbobbe Dec 30, 2024
a395907
compose test [nfc]: Give enterTopic a dartdoc
chrisbobbe Dec 30, 2024
4304706
compose_box test [nfc]: Make a enterContent helper
chrisbobbe Jan 22, 2025
9dc69b2
test [nfc]: Factor out `checkNoErrorDialog` helper
chrisbobbe Dec 30, 2024
25cf030
compose test: Test topic- and content-max-length validation errors
chrisbobbe Dec 30, 2024
353ff9e
compose: Enforce max topic/content length by code points, following API
chrisbobbe Dec 30, 2024
3fafb97
subscription_list: Sort leading emoji first in channel names
lakshya1goel Jan 23, 2025
1e7e1e1
test_app: Assert the store has an Account for the passed `accountId`
chrisbobbe Dec 11, 2024
e718deb
app_bar [nfc]: Centralize _getEffectiveCenterTitle in our wrapper
chrisbobbe Dec 11, 2024
909c4f2
msglist [nfc]: Remove no-op Center widget in _MessageListPageState
chrisbobbe Nov 1, 2024
cc02303
msglist [nfc]: Comment more about another inset, for completeness
chrisbobbe Jan 18, 2025
c57de59
msglist [nfc]: Update a SafeArea comment to mention scroll-to-bottom …
chrisbobbe Jan 18, 2025
851d23c
ci: Add setup script for running in Flutter "customer testing"
gnprice Jan 23, 2025
e423a68
home test [nfc]: Extract helpers to be shared
PIG208 Jan 24, 2025
f6a55c6
home: Stop assuming account existence from loading page
PIG208 Dec 30, 2024
67e9054
deps: Upgrade Flutter to 3.29.0-1.0.pre.105
PIG208 Jan 24, 2025
a4461b6
Revert "ci: Remove --depth=1000 in doing Flutter clone, to be added b…
PIG208 Jan 24, 2025
0209a6a
action_sheet test: Make the app-bar topic-row finder more precise
chrisbobbe Dec 13, 2024
b94d7a6
action_sheet test [nfc]: Make checkButtons helper for showTopicAction…
chrisbobbe Dec 13, 2024
182bb43
action_sheet test [nfc]: Add new '{topic,message} action sheet' groups
chrisbobbe Dec 14, 2024
45210f0
action_sheet test: Make some show-from-inbox setup optional in a `pre…
chrisbobbe Jan 23, 2025
69825a0
action_sheet test [nfc]: Parameterize a `prepare` by channel and topic
chrisbobbe Jan 23, 2025
089e4e6
action_sheet test [nfc]: Pull out `someMessage` variable
chrisbobbe Jan 23, 2025
bd03d51
action_sheet test [nfc]: Add zulipFeatureLevel param to a `prepare`
chrisbobbe Dec 14, 2024
6ff94a7
action_sheet test [nfc]: Add subscription-related params to a `prepare`
chrisbobbe Dec 14, 2024
1e5a359
action_sheet test [nfc]: Add `visibilityPolicy` to a `prepare`
chrisbobbe Dec 14, 2024
e2b2176
action_sheet test: Use eg.otherUser for a sender in setupToTopicActio…
chrisbobbe Dec 14, 2024
6ed284c
action_sheet test [nfc]: Pull out a `prepare` function and reuse
chrisbobbe Dec 14, 2024
d71bc87
action_sheet test [nfc]: Simplify some setup by using someChannel
chrisbobbe Jan 23, 2025
7c5c4a3
action_sheet test [nfc]: Pull out showFromInbox helper
chrisbobbe Dec 14, 2024
47fe852
action_sheet test [nfc]: Pull out showFromAppBar helper
chrisbobbe Dec 14, 2024
11af890
action_sheet test: Cut assumption of topic recipient header in topic …
chrisbobbe Jan 16, 2025
10502fd
action_sheet test [nfc]: Pull out showFromRecipientHeader helper
chrisbobbe Jan 16, 2025
13707b6
test [nfc]: Comment on where to find topic-action-sheet tests
chrisbobbe Jan 23, 2025
0631096
action_sheet test: Move some logic out of checkButtons helper
chrisbobbe Jan 23, 2025
4ae28f4
action_sheet test [nfc]: Have showFromAppBar take `messages`, not `me…
chrisbobbe Jan 23, 2025
5d7cae6
msglist [nfc]: Move _containsDifferentChannels to StreamMessageRecipi…
lakshya1goel Jan 24, 2025
4760829
msglist: In single-conversation view, make recipient headers not tapp…
lakshya1goel Jan 29, 2025
02a2910
i18n [nfc]: Add doc on GlobalLocalizations.zulipLocalizations
gnprice Jan 30, 2025
6dfaf94
store test: Check for data consistency when adding account
PIG208 Jan 21, 2025
2ffb0e7
store: Add realmMandatoryTopics realm setting
PIG208 Jan 21, 2025
bbc28c5
compose test [nfc]: Remove unused prepareComposeBox param
PIG208 Jan 21, 2025
0f9ce5b
compose test [nfc]: Rename param from user to otherUsers
PIG208 Jan 27, 2025
2589ecd
compose: Respect realm setting for mandatory topics
PIG208 Jan 21, 2025
96b8c23
api: Add `realmWildcardMentionPolicy` to `InitialSnapshot`
sm-sayedi Dec 3, 2024
079871d
store: Add `realmWildcardMentionPolicy` to `PerAccountStore`
sm-sayedi Dec 3, 2024
3311e0e
icons: Add "three_person.svg" icon for wildcard mentions
sm-sayedi Dec 6, 2024
6501a23
autocomplete test: Make `setupToComposeInput` accept `narrow` param
sm-sayedi Dec 6, 2024
417a072
autocomplete [nfc]: Move down `MentionAutocompleteView.computeResults`
sm-sayedi Dec 3, 2024
e41487b
autocomplete: Support @-wildcard in user-mention autocomplete
sm-sayedi Dec 3, 2024
95626da
compose: Make compose-box border more prominent in dark mode
lakshya1goel Feb 1, 2025
9016ab6
display [nfc]: Mention issue for notification channel name's i18n TODO
PIG208 Jan 15, 2025
2926e9e
i18n [nfc]: Mention issue for translating styled strings
PIG208 Jan 15, 2025
989cce4
app: Translate the "about" page button on popup menu
PIG208 Dec 12, 2024
081a585
inbox: Make header titles localizable
PIG208 Dec 12, 2024
b3f94d8
profile: Translate strings on _ProfileErrorPage
PIG208 Dec 12, 2024
4e6dc29
msglist: Localize message list title for "DMs with yourself"
PIG208 Dec 12, 2024
0ae137a
i18n: Sweep for non-localized '(unknown user)' strings
PIG208 Dec 12, 2024
6f2402b
i18n: Sweep for non-localized '(unknown channel)' strings
PIG208 Dec 12, 2024
b2541b6
lightbox: Translate video position slider semantic labels
PIG208 Jan 8, 2025
08836f3
msglist: Mostly translate remaining strings on message list page
PIG208 Jan 8, 2025
c093471
content: Translate error dialog for _launchUrl
PIG208 Jan 8, 2025
362dbce
emoji: Translate "You" string for reactions added by self
PIG208 Jan 8, 2025
da7d091
compose: Translate "(loading message {messageId})"
PIG208 Jan 15, 2025
a80d1b0
poll: Translate voter names wrapped in parentheses
PIG208 Jan 15, 2025
4ba6993
android build: Allow Gradle to use more memory
PIG208 Feb 4, 2025
fdc669e
notif [nfc]: Note a todo-i18n for display names of notif sound files
gnprice Feb 5, 2025
5a7f189
lightbox [nfc]: Note todo-i18n on video durations
gnprice Feb 5, 2025
4081462
i18n [nfc]: Standardize a todo-i18n comment, from "intl"
gnprice Feb 5, 2025
10e0cb3
i18n [nfc]: Standardize more todo-i18n comments, from free-form
gnprice Feb 5, 2025
971113d
android build: Allow Gradle to use even more memory, 4 GiB
PIG208 Feb 5, 2025
a4c0d9d
sticky_header: Add example app
gnprice Jan 24, 2025
895f481
sticky_header test [nfc]: Cut a commented-out debug print
gnprice Jan 30, 2024
f2646ce
sticky_header [nfc]: Add comments about child sliver
gnprice Jan 31, 2025
f530c9e
sticky_header [nfc]: Add comments on _headerEndBound conditions
gnprice Jan 25, 2025
b281324
sticky_header [nfc]: Cut redundant assert on header size
gnprice Jan 25, 2025
74f65d4
sticky_header: Use cacheExtent from child
gnprice Jan 27, 2025
7d5dfd9
sticky_header [nfc]: Add asserts from studying possible child geometr…
gnprice Jan 25, 2025
1f78d26
sticky_header: Handle scrollOffsetCorrection
gnprice Jan 28, 2025
865baa0
sticky_header [nfc]: Skip hitTestExtent, further using simplifying as…
gnprice Jan 25, 2025
eedcb7d
sticky_header [nfc]: Explicitly use single "childExtent"
gnprice Jan 25, 2025
5f9aad5
sticky_header example: Add a double-sliver example
gnprice Jan 24, 2025
d173185
sticky_header: Fix _findChildAtEnd when viewport partly consumed already
gnprice Jan 18, 2024
4ff15e9
sticky_header: Avoid header at sliver/sliver boundary
gnprice Jan 26, 2024
fd05287
icons: Add resolve/unresolve-topic icons, from Figma
chrisbobbe Dec 5, 2024
567d968
action_sheet: Add and use PageRoot
chrisbobbe Jan 29, 2025
6a27b90
action_sheet: Implement resolve/unresolve in topic action sheet
chrisbobbe Dec 5, 2024
8ac6bde
msglist: Fix DM header color lerp bug.
E-m-i-n-e-n-c-e Jan 30, 2025
07d1e66
changelog: Describe changes since 0.0.25
gnprice Feb 7, 2025
4975e27
version: Bump version to 0.0.26
gnprice Feb 7, 2025
24bfac3
doc: Before release, update translations
gnprice Feb 8, 2025
6d5762c
l10n: Update translations from Weblate
gnprice Feb 8, 2025
404c5f2
i18n [nfc]: Explain why we skip translating licenses
PIG208 Feb 5, 2025
1ebdf8c
about_zulip: Translate unknown app version placeholder
PIG208 Feb 6, 2025
ead5b41
app: Translate (well, transliterate) app title
PIG208 Feb 6, 2025
f98b931
compose: Translate message for a filename with size
PIG208 Feb 6, 2025
71f484d
i18n [nfc]: Improve errorFilesTooLarge example for listMessage
PIG208 Feb 6, 2025
b17134d
login [nfc]: Shorten string for server URL input label
PIG208 Feb 6, 2025
eef1a3e
login [nfc]: Document need for "server URL" hint value to be reserved
gnprice Feb 8, 2025
e091c5e
notif test: Clean up `TestPlatformDispatcher.defaultRouteNameTestValue`
rajveermalviya Jan 2, 2025
bf227a8
app: Query initial-account-id while handling initial routes
rajveermalviya Jan 27, 2025
6ba38d9
app [nfc]: Reorder _ZulipAppState methods
rajveermalviya Feb 7, 2025
e9c04e3
app: Pull out `_handleGenerateInitialRoutes`
rajveermalviya Jan 2, 2025
05868e0
page [nfc]: Add interface to get account ID for most of our routes
gnprice Jan 30, 2025
c3573c9
notif: Use associated account as initial account, if opened from back…
rajveermalviya Dec 30, 2024
71b85d3
notif: Query account by realm URL origin, not full URL
rajveermalviya Jan 28, 2025
2b20010
doc: Add libdrm troubleshooting entry
gnprice Jan 24, 2025
1b50708
l10n: Update translations from Weblate.
weblate Feb 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ jobs:
distribution: temurin

- name: Clone Flutter SDK
# TODO(#1204) reinstate shallow clone with --depth=1000 and its corresponding comment here
# We can't do a depth-1 clone, because we need the most recent tag
# so that Flutter knows its version and sees the constraint in our
# pubspec is satisfied. It's uncommon for flutter/flutter to go
# more than 100 commits between tags. Fetch 1000 for good measure.
run: |
git clone -b main https://github.com/flutter/flutter ~/flutter
git clone --depth=1000 -b main https://github.com/flutter/flutter ~/flutter
TZ=UTC git --git-dir ~/flutter/.git log -1 --format='%h | %ci | %s' --date=iso8601-local
echo ~/flutter/bin >> "$GITHUB_PATH"

Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
name: Update translations from Weblate
permissions:
contents: write
pull-requests: write
on:
pull_request:
schedule:
- cron: "0 10 * * 1"
workflow_dispatch:

jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch and merge from Weblate
# The commit message is generated in Weblate; see https://hosted.weblate.org/addon/17163/
run: |
git checkout -b main
git log --oneline --graph --all -n5
git remote add weblate https://hosted.weblate.org/git/zulip/zulip-flutter/
git fetch weblate
git merge --ff-only weblate/main
GIT_COMMITTER_NAME="Hosted Weblate" GIT_COMMITTER_EMAIL="[email protected]" \
git cherry-pick weblate/main ^HEAD

- name: Clone Flutter SDK
# TODO(#1204) reinstate shallow clone with --depth=1000 and its corresponding comment here
run: |
git clone -b main https://github.com/flutter/flutter ~/flutter
TZ=UTC git --git-dir ~/flutter/.git log -1 --format='%h | %ci | %s' --date=iso8601-local
echo ~/flutter/bin >> "$GITHUB_PATH"

# The Flutter tool assumes the tip of tree is "origin/master"
# (or "upstream/master"):
# https://github.com/flutter/flutter/issues/160626
# TODO(upstream): make workaround unneeded
git --git-dir ~/flutter/.git update-ref refs/remotes/origin/master origin/main

- name: Update generated code
run: |
mkdir -p build
tools/check l10n --fix
git add lib/generated/l10n/
GIT_COMMITTER_NAME="Hosted Weblate" GIT_COMMITTER_EMAIL="[email protected]" \
git commit --amend -C HEAD

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: update-translations/weblate
delete-branch: true
title: Update translations from Weblate
base: ${{ github.head_ref }}
156 changes: 74 additions & 82 deletions android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v20.0.2), do not edit directly.
// Autogenerated from Pigeon (v22.7.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

Expand All @@ -7,7 +7,9 @@ package com.zulip.flutter
import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
Expand Down Expand Up @@ -64,17 +66,16 @@ data class NotificationChannel (
val lightsEnabled: Boolean? = null,
val soundUrl: String? = null,
val vibrationPattern: LongArray? = null

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): NotificationChannel {
val id = __pigeon_list[0] as String
val importance = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long }
val name = __pigeon_list[2] as String?
val lightsEnabled = __pigeon_list[3] as Boolean?
val soundUrl = __pigeon_list[4] as String?
val vibrationPattern = __pigeon_list[5] as LongArray?
fun fromList(pigeonVar_list: List<Any?>): NotificationChannel {
val id = pigeonVar_list[0] as String
val importance = pigeonVar_list[1] as Long
val name = pigeonVar_list[2] as String?
val lightsEnabled = pigeonVar_list[3] as Boolean?
val soundUrl = pigeonVar_list[4] as String?
val vibrationPattern = pigeonVar_list[5] as LongArray?
return NotificationChannel(id, importance, name, lightsEnabled, soundUrl, vibrationPattern)
}
}
Expand Down Expand Up @@ -104,14 +105,13 @@ data class AndroidIntent (
val dataUrl: String,
/** A combination of flags from [IntentFlag]. */
val flags: Long

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): AndroidIntent {
val action = __pigeon_list[0] as String
val dataUrl = __pigeon_list[1] as String
val flags = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long }
fun fromList(pigeonVar_list: List<Any?>): AndroidIntent {
val action = pigeonVar_list[0] as String
val dataUrl = pigeonVar_list[1] as String
val flags = pigeonVar_list[2] as Long
return AndroidIntent(action, dataUrl, flags)
}
}
Expand Down Expand Up @@ -139,14 +139,13 @@ data class PendingIntent (
* with `Intent`; see Android docs for `PendingIntent.getActivity`.
*/
val flags: Long

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): PendingIntent {
val requestCode = __pigeon_list[0].let { num -> if (num is Int) num.toLong() else num as Long }
val intent = __pigeon_list[1] as AndroidIntent
val flags = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long }
fun fromList(pigeonVar_list: List<Any?>): PendingIntent {
val requestCode = pigeonVar_list[0] as Long
val intent = pigeonVar_list[1] as AndroidIntent
val flags = pigeonVar_list[2] as Long
return PendingIntent(requestCode, intent, flags)
}
}
Expand All @@ -168,12 +167,11 @@ data class PendingIntent (
*/
data class InboxStyle (
val summaryText: String

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): InboxStyle {
val summaryText = __pigeon_list[0] as String
fun fromList(pigeonVar_list: List<Any?>): InboxStyle {
val summaryText = pigeonVar_list[0] as String
return InboxStyle(summaryText)
}
}
Expand Down Expand Up @@ -205,14 +203,13 @@ data class Person (
val iconBitmap: ByteArray? = null,
val key: String,
val name: String

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): Person {
val iconBitmap = __pigeon_list[0] as ByteArray?
val key = __pigeon_list[1] as String
val name = __pigeon_list[2] as String
fun fromList(pigeonVar_list: List<Any?>): Person {
val iconBitmap = pigeonVar_list[0] as ByteArray?
val key = pigeonVar_list[1] as String
val name = pigeonVar_list[2] as String
return Person(iconBitmap, key, name)
}
}
Expand All @@ -236,14 +233,13 @@ data class MessagingStyleMessage (
val text: String,
val timestampMs: Long,
val person: Person

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): MessagingStyleMessage {
val text = __pigeon_list[0] as String
val timestampMs = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long }
val person = __pigeon_list[2] as Person
fun fromList(pigeonVar_list: List<Any?>): MessagingStyleMessage {
val text = pigeonVar_list[0] as String
val timestampMs = pigeonVar_list[1] as Long
val person = pigeonVar_list[2] as Person
return MessagingStyleMessage(text, timestampMs, person)
}
}
Expand All @@ -266,17 +262,16 @@ data class MessagingStyleMessage (
data class MessagingStyle (
val user: Person,
val conversationTitle: String? = null,
val messages: List<MessagingStyleMessage?>,
val messages: List<MessagingStyleMessage>,
val isGroupConversation: Boolean

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): MessagingStyle {
val user = __pigeon_list[0] as Person
val conversationTitle = __pigeon_list[1] as String?
val messages = __pigeon_list[2] as List<MessagingStyleMessage?>
val isGroupConversation = __pigeon_list[3] as Boolean
fun fromList(pigeonVar_list: List<Any?>): MessagingStyle {
val user = pigeonVar_list[0] as Person
val conversationTitle = pigeonVar_list[1] as String?
val messages = pigeonVar_list[2] as List<MessagingStyleMessage>
val isGroupConversation = pigeonVar_list[3] as Boolean
return MessagingStyle(user, conversationTitle, messages, isGroupConversation)
}
}
Expand All @@ -299,14 +294,13 @@ data class MessagingStyle (
*/
data class Notification (
val group: String,
val extras: Map<String?, String?>

) {
val extras: Map<String, String>
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): Notification {
val group = __pigeon_list[0] as String
val extras = __pigeon_list[1] as Map<String?, String?>
fun fromList(pigeonVar_list: List<Any?>): Notification {
val group = pigeonVar_list[0] as String
val extras = pigeonVar_list[1] as Map<String, String>
return Notification(group, extras)
}
}
Expand All @@ -329,14 +323,13 @@ data class StatusBarNotification (
val id: Long,
val tag: String,
val notification: Notification

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): StatusBarNotification {
val id = __pigeon_list[0].let { num -> if (num is Int) num.toLong() else num as Long }
val tag = __pigeon_list[1] as String
val notification = __pigeon_list[2] as Notification
fun fromList(pigeonVar_list: List<Any?>): StatusBarNotification {
val id = pigeonVar_list[0] as Long
val tag = pigeonVar_list[1] as String
val notification = pigeonVar_list[2] as Notification
return StatusBarNotification(id, tag, notification)
}
}
Expand Down Expand Up @@ -370,14 +363,13 @@ data class StoredNotificationSound (
val isOwned: Boolean,
/** A `content://…` URL pointing to the sound file. */
val contentUrl: String

) {
)
{
companion object {
@Suppress("LocalVariableName")
fun fromList(__pigeon_list: List<Any?>): StoredNotificationSound {
val fileName = __pigeon_list[0] as String
val isOwned = __pigeon_list[1] as Boolean
val contentUrl = __pigeon_list[2] as String
fun fromList(pigeonVar_list: List<Any?>): StoredNotificationSound {
val fileName = pigeonVar_list[0] as String
val isOwned = pigeonVar_list[1] as Boolean
val contentUrl = pigeonVar_list[2] as String
return StoredNotificationSound(fileName, isOwned, contentUrl)
}
}
Expand All @@ -389,7 +381,7 @@ data class StoredNotificationSound (
)
}
}
private object NotificationsPigeonCodec : StandardMessageCodec() {
private open class NotificationsPigeonCodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
return when (type) {
129.toByte() -> {
Expand Down Expand Up @@ -561,7 +553,7 @@ interface AndroidNotificationHostApi {
* https://developer.android.com/reference/kotlin/android/app/NotificationManager.html#notify
* https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder
*/
fun notify(tag: String?, id: Long, autoCancel: Boolean?, channelId: String, color: Long?, contentIntent: PendingIntent?, contentText: String?, contentTitle: String?, extras: Map<String?, String?>?, groupKey: String?, inboxStyle: InboxStyle?, isGroupSummary: Boolean?, messagingStyle: MessagingStyle?, number: Long?, smallIconResourceName: String?)
fun notify(tag: String?, id: Long, autoCancel: Boolean?, channelId: String, color: Long?, contentIntent: PendingIntent?, contentText: String?, contentTitle: String?, extras: Map<String, String>?, groupKey: String?, inboxStyle: InboxStyle?, isGroupSummary: Boolean?, messagingStyle: MessagingStyle?, number: Long?, smallIconResourceName: String?)
/**
* Wraps `androidx.core.app.NotificationManagerCompat.getActiveNotifications`,
* combined with `androidx.core.app.NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification`.
Expand Down Expand Up @@ -597,7 +589,7 @@ interface AndroidNotificationHostApi {
companion object {
/** The codec used by AndroidNotificationHostApi. */
val codec: MessageCodec<Any?> by lazy {
NotificationsPigeonCodec
NotificationsPigeonCodec()
}
/** Sets up an instance of `AndroidNotificationHostApi` to handle messages through the `binaryMessenger`. */
@JvmOverloads
Expand Down Expand Up @@ -693,19 +685,19 @@ interface AndroidNotificationHostApi {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val tagArg = args[0] as String?
val idArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long }
val idArg = args[1] as Long
val autoCancelArg = args[2] as Boolean?
val channelIdArg = args[3] as String
val colorArg = args[4].let { num -> if (num is Int) num.toLong() else num as Long? }
val colorArg = args[4] as Long?
val contentIntentArg = args[5] as PendingIntent?
val contentTextArg = args[6] as String?
val contentTitleArg = args[7] as String?
val extrasArg = args[8] as Map<String?, String?>?
val extrasArg = args[8] as Map<String, String>?
val groupKeyArg = args[9] as String?
val inboxStyleArg = args[10] as InboxStyle?
val isGroupSummaryArg = args[11] as Boolean?
val messagingStyleArg = args[12] as MessagingStyle?
val numberArg = args[13].let { num -> if (num is Int) num.toLong() else num as Long? }
val numberArg = args[13] as Long?
val smallIconResourceNameArg = args[14] as String?
val wrapped: List<Any?> = try {
api.notify(tagArg, idArg, autoCancelArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, groupKeyArg, inboxStyleArg, isGroupSummaryArg, messagingStyleArg, numberArg, smallIconResourceNameArg)
Expand Down Expand Up @@ -759,7 +751,7 @@ interface AndroidNotificationHostApi {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val tagArg = args[0] as String?
val idArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long }
val idArg = args[1] as Long
val wrapped: List<Any?> = try {
api.cancel(tagArg, idArg)
listOf(null)
Expand Down
Loading