Commit Graph

131 Commits

Author SHA1 Message Date
adbenitez d868aa913b Merge remote-tracking branch 'upstream/master' 2022-08-19 23:57:46 -04:00
bjoern 853000f8dc option to add webxdc apps to home screen (#2353)
* add 'Add to Home Screen' menus for webxdc apps

* make adding shortcut basically work

* avoid starting webxdc from foreign accounts

* recreate back stack, if possible

according to
https://developer.android.com/training/notify-user/navigation :
"When you start an activity from a notification,
you must preserve the user's expected navigation experience.
Tapping Back should take the user
back through the app's normal work flow to the Home screen [...]"

same seems to be true for shortcuts using the same class for constructing
the back stack.

the back stack is reconstructed for API 26 (Oreo, 2017) or newer,
for oder API `requestPinShortcut()`
only uses the top-level activity for the shortcut.
working around that is probably possible, but would be quite some effort in an
already complicated area and would result in bugs that are not so easy to see.

also, on these old androids, users are probably used to the no-back-stack
behaviour.

* show a warning if app was deleted

* add 'Add to Home Screen' also to gallery

beside chat- and webxdc-activity,
this is the third place where the webxdc is listed.

as adding may result in dialogs from the launcher,
we allow the option only for a single selected webxdc,
as otherwise a series of dialogs would pop up.

* show 'Done' toast short, this is what we are doing at all the other places when showing 'Done'
2022-08-15 11:30:14 +02:00
adbenitez 03e40491c9 Merge remote-tracking branch 'upstream/master' 2022-05-17 21:12:48 -04:00
B. Petersen a0332f0c4e empty default WebViewActivity title
if not set to empty, it defaults to "Delta Chat",
which results in a short flickering on opening WebViews that set the title
in an async way.
(all WebViewActivity set a "nice" title, so the default is never shown anyway)
2022-05-17 11:15:58 +02:00
adbenitez fafbd94012 Merge remote-tracking branch 'upstream/master' 2022-03-27 11:44:22 -04:00
Hocuri de9100f8e1 fix stuff 2022-03-26 13:01:26 +01:00
adbenitez 4ccc164b86 Merge remote-tracking branch 'upstream/master' 2022-01-18 14:43:40 -05:00
bjoern 9e70aa7cad webxdc (#2174)
* add new w30 APIs

* create the webview,
disable internet access,
inject deltachat.js

* connect deltachat to the webview

* promisify api

* use msgActionButton to start the w30 apps

* cleanup

- create observers in onCreate() to avoid memory leak,
- derive from WebViewActivity to easier deal with particularities
  and to saves >100 loc
- reorder some methods to reflect lifetimes

* make it more clear, which uri-part is 'domain' and which one is 'path'

* unify logging

* it is 'statusUpdate' not 'stateUpdate'; not sure if promise is needed at the end, we can readd that as needed, simple code for now

* use core implementation for status updates

* disable debugging enabled by default, streamline code

* use same name for InternalJSApi for both, js and java

* getStatusUpdates() always return an array

* call JSON.stringify() on payload

* fix typo, fix equal operator

* use shorter function names in js land

* adapt to new zipped w30 format

* load any file from w30 archives

* add fallback if getMimeTypeFromExtension() fails

* rename w30 to webxdc

* add selfName()

* return selfAddr() if selfName() is empty

* rename deltachat.js to webxdc.js

* observer correct event

* rename getBlobFromArchive() to getWebxdcBlob()

* show webxdc app name in title bar

* swap payload and descr in sendUpdate() (adapt to new core api)

* allow user-defined-texts for webxdc apps, make room for icon+name

* show webxdc icon and name in chats

* render webxdc drafts accordingly

* allow configuring drafts

* do not destroy webxdc-message to be sent out by removing it via setDraft(null)

* fix crash when replying to webxdc messages

* add webxdc messages to profile's document tab

* hide 'search menu' for webxdc apps

* show app summary beside app icon

* remove outdated comment

* add precautious WebView restrictions

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationActivity.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Webxdc requires at least Android 5 Lollipop

see https://github.com/deltachat/deltachat-android/pull/2174#discussion_r785436874

* recognize .xdc files on android10

based on @Hocuri's findings in #2188

Co-authored-by: Simon Laux <mobile.info@simonlaux.de>
Co-authored-by: adbenitez <asieldbenitez@gmail.com>
Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>
Co-authored-by: Hocuri <hocuri@gmx.de>
2022-01-18 10:52:09 +01:00
adbenitez 1fad77671c Merge remote-tracking branch 'upstream/master' 2021-11-10 13:58:14 -05:00
cyBerta 18c3306832 Merge pull request #2088 from deltachat/provider-app-support
provider app support
2021-11-10 14:54:01 +01:00
adbenitez 952f82f1a3 Merge remote-tracking branch 'upstream/master' 2021-11-07 14:20:21 -05:00
bjoern 18ee751485 fix backups for android10 (#2122)
- Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
  was not writable for android10 (older and newer androids are okay)

- the import selectMediaType() showed up,
  however never did show the exported file on android10 (also here, older and newer androids are okay)

re-adding the flag `android:requestLegacyExternalStorage="true"` that was removed in #2087
fixed both problems, at least in the emulator.

seems as if the flag is still respected when running on sdk29 even when targeting sdk30;
when running on sdk30, however, the flag is ignored.

at least the following doc does not say that the flag is needless in sdk30:
https://developer.android.com/reference/android/R.attr#requestLegacyExternalStorage
2021-11-07 13:33:49 +01:00
adbenitez 995b88d620 Merge remote-tracking branch 'upstream/master' 2021-11-04 15:18:12 -04:00
cyberta f5d6112f07 initial IPCAddAccountService implementation: receive messages from other apps 2021-11-04 12:51:21 +01:00
Hocuri f34ef4db13 Target SDK/API 30 (#2087)
* Target SDK 30

* Pull changes from Signal

* Bugfix, make photo view rail be shown again

* Fix capturing images using an external camera

* Make backups work. Unfortunately, I did this by copying the backup file to the private storage first.

* Fix: Show the correct folder name when exporting attachment

Before, after exporting an attachment, on newer Android versions (and
maybe also on older ones) the toast always said
`File exported to "media"`.

* Update src/org/thoughtcrime/securesms/WelcomeActivity.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

Co-authored-by: bjoern <r10s@b44t.com>
Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>
2021-11-04 12:23:17 +01:00
adbenitez 90e64b4e56 Merge remote-tracking branch 'upstream/master' 2021-10-13 15:37:01 -04:00
Hocuri d8913cf17e Adapt to new direct share api (#1852)
Fix #1777
2021-10-13 17:33:55 +02:00
adbenitez 6df617948f Merge remote-tracking branch 'upstream/master' 2021-07-08 23:34:27 -04:00
Hocuri b3fea81bed Implement a basic connectivity view
The non-squashed original commits are available at 243bd3a56:

* First, quick and dirty version

* Basic HTML connectivity view

* Codestyle, automatically refresh

* Make it accessible from the settings

* Improve usability

I did some user-testing with my family, these are the results:
- Added an emoji to the html page (red dot for not connected, and so on)
- Adapted error messages for SMTP:
  "Not started" -> "(You did not try to send a message recently)"
  "🟢 Connected" -> "🟢 Your last message was sent successfully"
- "Not connected" is misleading, because they think that this means that there is no internet connection.
  But "Not connected" can have other causes, like, a not responding server or a changed-but-not-updated-in-DC password

  Possible solutions:
  - "Not connected" -> "Not connected with gmx.de" (or whatever comes after the '@' in configured_addr). The problem: some people have an own domain for their emails, but no own servers. "Not connected with <your domain>" and might make them think that the problem is that DC tries to connect to the server <your domain>, while the server is hosted at Strato.com.
  - We can ask the system whether there currently is network and then show another error message. The problem: Sometimes the system is wrong.

* Remove error_network

* Remove server_response string

* Move `getConnectivitySummary()` to `DcHelper`

* Implement the changes we agreed on

* Remove string error_no_network

* small fixes
2021-07-08 22:50:22 +02:00
adbenitez 610dc4fd6a Merge remote-tracking branch 'upstream/master' 2021-07-02 14:26:13 -04:00
adbenitez 27df7fa943 add more case variations 2021-06-29 22:39:21 +02:00
adbenitez a267cdd151 handle URLs starting with OPENPGP4FPR: 2021-06-29 22:39:21 +02:00
adbenitez 9ddefb8649 handle http intents 2021-04-09 22:21:53 -04:00
adbenitez 4813f385f4 Merge remote-tracking branch 'upstream/master' 2021-03-16 13:22:39 -04:00
Hocuri 4c0d03772d Better profile and group picture selection by using attachment selector (#1837)
fix #1836

AvatarSelector is mostly copied from AttachmentTypeSelector. I first started to make it a subclass, but there were so many functions that had to be changed that I decided against it (esp. also the constructor, so I would have had to create another constructor to allow AvatarSelector to bypass the "normal" constructor). Could still be done though, of course.

I think (hope joy) that the commits are clear enough that this can be reviewed commit-by-commit. In the first commit, commenting out code means "Moved somewhere else"

I found it easier to look at the first commit using gitk than GitHub as GitHub doesn't show it as copied from AttachmentTypeSelector but as a new file. (of course you can also just review normally, going throug it file-by-file :)

* Don't show remove button if there is no image yet

* Remove unnecessary animation that just made things look worse

* Delete now-unused ClearProfileAvatarActivity

* For groups, also use the attachment-chooser-dialog

* Remove confirmation dialog for removing avatar (The user has to confirm anyway, and this was not correctly translated)
2021-03-16 11:58:44 +01:00
adbenitez c9e5d216f0 Merge remote-tracking branch 'upstream/master' 2021-01-31 02:32:52 -05:00
bjoern 8d9c02dd7a add option to view full (html) message (#1763)
* add get-mime-original apis

* remove unused control

* add 'Show full message' buttons

* split reusable WebViewActivity from LocalHelpActivity

* add FullMsgActivity

* load html via AsyncTask

* adapt to changed api

* handle mailto:-links in WebView

* block loading remote images by default, add user setting always/once/never

* do not hide 'Once' button in always-mode, playing around a day with hidden 'Once' that looks more like a bug :)

* wording: as 'Always' affects all messages, it is better to speak of multiple senders

* wording: use 'Load remote images'

this makes it easier for the user to find the option
if one sees, images are missing in the document.

* wording: shorten text.

* wording: change 'may' to 'can'. 'may' sounds a bit as if someone allows this.

* Don't use AsyncTask

* check 'once' if appropriate

* use lite-colored checkbox-emoji in dark-theme

* add comment about missing error logging

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-01-28 22:53:15 +01:00
adbenitez 2ce2dd0630 Merge branch 'lite' 2020-12-13 13:10:14 -05:00
Hocuri 438a3aaa43 Handle sendto intents with ShareActivity, not NewConversationActivity 2020-12-09 23:53:10 +01:00
adbenitez ba8c905106 update manifest and build.gradle 2020-12-06 08:27:18 -05:00
adbenitez f862822059 Merge branch 'deltachat' 2020-09-15 13:40:25 -04:00
B. Petersen d056b039f0 remove windowSoftInputMode="stateHidden" from profile
according to https://developer.android.com/guide/topics/manifest/activity-element,
it hides the keyboard when creating the activity, but does nothing when navigating back
(as in https://github.com/deltachat/deltachat-android/issues/1606 )

removing the flag closes the keyboard for both directions,
which seems to be the standard behavior and works just well here.

(came over that when checking why the other place where single_line_input was
used (video instance input) works without problems)
2020-09-11 15:02:10 +02:00
adbenitez 1947badb7f Merge branch 'deltachat' 2020-09-08 00:36:22 -04:00
cyberta ce8f4a58d2 reuse signals generic foreground service for import export 2020-09-03 17:30:52 +02:00
cyberta 9b25bce3b2 requestLegacyExternalStorage until DC supports scoped storage (must be before targeting API 30) 2020-08-13 15:04:07 +02:00
cyberta 3c0a88227d update location background activity permissions 2020-08-13 14:11:14 +02:00
cyberta 005f707658 ask for install permission if on an attached apk was tapped (Android API 26+), fixes #1492 2020-07-28 10:53:52 +02:00
B. Petersen 2caaa1e097 manually remove summary-notification; this is needed when we cancel the other notifications from within the app 2020-06-15 18:01:59 +02:00
adbenitez 53ea6231db target sdk 28, update changelog and app version 2020-08-16 14:42:37 -04:00
adbenitez d0cd7a227c add stickers selector part 1 2020-08-16 14:14:40 -04:00
adbenitez ad7b4de92d Merge remote-tracking branch 'upstream/master' into deltalab 2020-08-16 12:24:41 -04:00
adbenitez 7982b667ad Merge branch 'master' into deltalab 2020-07-30 18:38:55 -04:00
adbenitez 6e36e08c4d port to fork (first official commit) 2020-06-17 19:22:09 -04:00
B. Petersen 39bc508a31 remove unused search xml files 2020-04-04 14:09:53 +02:00
B. Petersen 86de9be115 add basic help-search controls 2020-04-04 02:00:56 +02:00
B. Petersen a7212daf40 add registration-qr-scan activity 2020-02-10 14:11:12 +01:00
B. Petersen 0f64d4e9c5 remove unused InviteActivity, it was disabled 9 months ago in #790 2020-01-17 14:08:22 +01:00
B. Petersen afc1f99788 add basic local-help-activity, adapt menus and add a demo-file 2020-01-10 22:58:47 +01:00
Hocuri 268722c0be It compiles ;-) 2020-01-03 00:20:18 +01:00
Hocuri b090232702 Move to qrScanActivity 2020-01-03 00:20:18 +01:00