2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 13:17:43 +00:00

49 Commits

Author SHA1 Message Date
Albert Vaca Cintora
c0a41034fa
Port device list items to Kotlin 2025-05-26 18:57:24 +02:00
Albert Vaca Cintora
5bc41367ed
Homegenize devices look in device lists 2025-05-26 18:57:24 +02:00
Vala Zadeh
63a849b80a Extend offline URL sharing behavior
## Summary

Previously, URLs shared to offline targets via the ShareActivity were
delivered to them once they became online. This change extends this
behavior to direct share targets.

## Test Plan

Test 1

* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC unreachable, e.g., close the KDE app on it.
* On the phone, open Chrome and share a couple of webpages to KDE's PC's direct share target.
* Open the KDE app on the PC.
* Observe that the webpages are opened on PC.

Test 2

* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC unreachable, e.g., close the KDE app on it.
* On the phone, share a file to KDE's PC's direct share target.
* Open the KDE app on the PC.
* Observe that the file is sent to PC.

Test 3

* Make sure two PC devices are already paired with the phone. Let's say the name of these devices are "PC1" and "PC2".
* Make PC1 and PC2 unreachable, e.g., close the KDE app on them.
* On the phone, open Chrome and share a couple of webpages to KDE's PC1's direct share target.
* Open the KDE app on the PC2.
* Observe that the webpages are NOT opened on PC2.
* Open the KDE app on the PC1.
* Observe that the webpages are opened on PC1.

Test 4

* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC reachable, e.g., have the KDE app open on it.
* Try to share a URL from the phone to the KDE's PC's direct share target.
* Observe that the URL opens instantly on the PC.
2025-04-13 00:20:04 +00:00
Albert Vaca Cintora
fd51ec7c14
Fix linter warnings 2025-04-05 00:44:08 +02:00
Mash Kyrielight
ae24cd6ca8 Fix insets for android 15
Apps are edge-to-edge by default on devices running Android 15
https://developer.android.com/develop/ui/views/layout/edge-to-edge

Fix: https://bugs.kde.org/show_bug.cgi?id=495999
2024-12-31 18:00:39 +00:00
Midori Kochiya
96ecd620cf Add support for Direct Share targets
As described in https://developer.android.com/training/sharing/direct-share-targets.

This makes connected devices with `SharePlugin` enabled show
up in Android's Sharesheet and can be directly shared to.
2024-06-11 14:01:03 +00:00
Vala Zadeh
80106ccb81 Add option to cache URLs shared to unreachable devices 2024-04-16 07:10:42 +00:00
Albert Vaca Cintora
ae23413971 Refactor BackgroundService
Added a new KdeConnect Application class that holds the Devices now, while
BackgroundService "only" takes care of the LinkProviders.

Since KdeConnect subclasses Application we have the guarantee that it will
exist as long as our process does, so we can use it as a singleton. This
removes the "BackgroundService.RunCommand" hack (which sent an Intent that
would awake BackgroundService in case it wasn't running already and then
call our code in a callback). This saves lots of round trips between the
system and us and makes things simpler (and stack traces useful) by making
the code sequential.

We already had an Application subclass that I moved to a new helper, which
now the KdeConnect class initializes together with all the other helpers.
2023-05-24 19:28:02 +02:00
Dmitry Yudin
ef902348bb More Material3 styling
Apply Material3 to dialogs, image buttons, switches and preferences.
Merge the landscape and portrait layouts for the MPRIS controls.
Move setting theme to application start instead of applying to every activity.
2023-04-01 21:33:03 +00:00
Albert Vaca Cintora
7670810155 Code review fixes 2023-03-29 16:32:40 +00:00
Albert Vaca Cintora
66a649313c Consolidate network listeners in BackgroundService
* Remove usage of deprecated WiFi ConnectivityManager
* Only listen for non-cellular network changes (where we can find devices)
* Do not listen for network changes also from PairingFragment
2023-03-29 16:32:40 +00:00
Albert Vaca Cintora
7bf2a40180 Rename updateComputerList -> updateDeviceList 2023-03-22 18:17:31 +01:00
Wojciech Matuszewski
70d70dcb33 Use a common thread pool instead of creating new threads manually
## Summary

Spawning new threads in Java is costly. This MR aims to use a common thread pool instead.

I've replaced all cases where a new thread is started just to perform a task in the background. This does not include cases where a reference to the newly created thread is kept as a part of application logic – this is probably a problem in itself, but it exceeds the scope of this quick optimization. ;) 

There was a couple of cases where a new thread was spawned just to sleep for a while an then change the state on a View on the main thread. I've replaced those with posting those deferred tasks to the View's message queue.

## Test Plan

Everything should work the same as it has before, just a bit faster and easier on the memory.
2022-10-31 20:59:17 +00:00
Albert Vaca Cintora
f747639304 Fix warning about resource IDs becoming non-final soon 2022-01-22 12:03:53 +01:00
Maxim Leshchenko
8ddb28c001 Small redesign
Changes:
1. In the menu, the design of the selected item was changed, the icon of the current device was added and the image was removed
2. Changed the accent color to orange
3. Separators have been removed from almost all lists
4. The design of the selected item was changed in the menu, the icon of the current device was added and the image was removed
4. Changed the color of the toolbar to white or black (depending on the theme)
2021-03-07 10:55:47 +00:00
Nicolas Fella
b3b74f25f4 Convert license headers to SPDX 2020-08-17 16:17:20 +02:00
Isira Seneviratne
3207e4b0eb Use view binding in ShareActivity. 2020-07-24 10:50:15 +00:00
Anjani Kumar
8e09936692 Set user preferred theme when activities are created
BUG: 422473
2020-07-16 06:28:33 +00:00
Anjani Kumar
c318d60916 New way to support dark theme to improve integration with system 2020-05-11 23:07:25 +00:00
Albert Vaca
47c2483d53 Remove gui counters logic
It had bugs and was never used. I've left in the Discovery Mode logic
because we might want to expose that somehow like GSConnect does.
2019-06-27 10:48:33 -04:00
Albert Vaca
37657388c6 Uppercasing some stuff 2019-03-20 22:14:27 +01:00
Erik Duisters
f2e505b8af Allow shares from desktop to be canceled
Summary:
Allow in progress file transfers to be canceled

BUG: 349956

{F6373048}

{F6373050}

{F6373051}

Test Plan:
Send a large file from desktop to android
Press cancel in the progress notification

Result: the file transfer is cancelled and the cancelled file is deleted from storage

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16491
2019-03-08 19:08:29 +01:00
Erik Duisters
f684fbe8ef Migrate from android support libraries to androidx
Summary: Use the new AndroidX libraries instead of the legacy support libraries

Test Plan: Apply patch and verify everything works as before

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: shubham, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17818
2018-12-27 16:43:34 +01:00
Nicolas Fella
a136d29ff7 Use runWithPlugin helper in SharePlugin
Summary: Depends on D16472

Test Plan:
Share file via app
Share file from external app
Share file via direct Share

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16473
2018-10-29 15:08:45 +01:00
Nicolas Fella
9650660e4a Remove unneeded casts 2018-10-26 23:59:20 +02:00
Nicolas Fella
abd45cfc06 Remove unneeded files
Restores the look we wanted since D12290
2018-10-24 12:43:12 +02:00
Nicolas Fella
5183516c55 Cleanup imports 2018-09-29 20:45:53 +02:00
Nicolas Fella
d83091faf8 Give clearer names
Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect, apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12217
2018-07-27 07:46:34 +02:00
Nicolas Fella
9bf5a9c489 Fix SharePlugin devices list
Summary: D12212 broke the devices list in the SharePlugin. No devices was shown even when there were devices available.

Test Plan: Open up share devices list with 0/1 devices available

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12334
2018-05-11 21:18:58 +02:00
Nicolas Fella
e712c69e15 Use lambdas where possible
Summary: Let Android Studio replace anonymous types with lambdas. No manual code change.

Test Plan: Compile and superficial behaviour test

Reviewers: #kde_connect, philipc

Reviewed By: #kde_connect, philipc

Subscribers: philipc, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12229
2018-05-09 14:03:08 +02:00
Philip Cohn-Cort
a1f1693d0b Add a dark theme
Summary:
BUG: 375376

This revision adds dark mode support to the app ( T7044 ). It does so by injecting
theme information into each activity, and making sure that all Views
define their colors by reference to theme attributes.

In order to make this work, all of the buttons with images (like the list
of available devices) now are tinted according to the theme.

While all versions of android support the theme, only devices running
Android ICS or higher will have a toggle button in the drawer.

Test Plan: Open all the screens, both with and without the dark theme on.

Reviewers: #kde_connect, mtijink, #vdg, nicolasfella

Reviewed By: #kde_connect, mtijink, nicolasfella

Subscribers: apol, ngraham, nicolasfella, mtijink

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D11694
2018-04-23 18:35:43 +02:00
Nicolas Fella
bc330018e1 Rename list layout
Summary: Give it a proper name

Reviewers: #kde_connect, mtijink

Reviewed By: #kde_connect, mtijink

Subscribers: mtijink, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12289
2018-04-17 20:50:23 +02:00
Nicolas Fella
fa5a37c472 Apply coding style to whole project
Summary: Sorry for the huge diff, but all I did was applying Android Studio's 'Reformat Code' to all files. If everyone does that before submitting a patch we can keep it clean easily.

Test Plan: Compiles

Reviewers: #kde_connect, mtijink

Reviewed By: #kde_connect, mtijink

Subscribers: mtijink, sredman, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D10905
2018-03-03 16:09:52 +01:00
Nicolas Fella
49021b87af Remove unused imports
Reviewers: #kde_connect, mtijink

Reviewed By: #kde_connect, mtijink

Subscribers: #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D10948
2018-03-03 15:50:40 +01:00
Nicolas Fella
bea90521c5 Direct Share
Summary:
Support Android 6 direct share.
BUG:362266
BackgroundService is a SIngleton now. This should only be used if strictly necessary.

Test Plan: Pick a random app with a share button, look for device entries in Sharing options (might not be there because other sharing options have higher priority)

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6743
2017-07-29 11:33:45 +02:00
Zixing Liu
bf230509b8 Add swipe to refresh to device pairing activity
This makes it more conform to material design standard

REVIEW: 129980
2017-03-18 02:16:00 +01:00
Richard Wagler
e2e40863f8 Implement saving to SD card using SAF 2016-12-11 14:01:46 +01:00
Albert Vaca
226869e200 Fixed shared urls and text having the wrong package type 2016-06-17 09:43:23 +02:00
Albert Vaca
d253fcfd0b Refactor capabilities together with Aleix
He is committing a similar patch to kdeconnect-kde
2016-05-31 17:19:39 +02:00
Albert Vaca
24561b58f9 The discovery now should be enabled while navigating the app UI 2015-09-09 12:34:42 -07:00
Albert Vaca
a9b4a6bdea Removed printfs and coding style stuff 2015-09-09 12:30:13 -07:00
Albert Vaca
92e4fa864a Removed old UI 2015-09-07 02:16:23 -07:00
Albert Vaca
79f55d7ac2 Share Plugin now adds a "send file" item in the device plugins list. 2015-09-07 02:16:23 -07:00
Albert Vaca
c535637b45 Fixed PairingFragment and MaterialAct stealing the callback from each other 2015-09-07 02:16:23 -07:00
Albert Vaca
a15b06cdc7 Minor fixes (mostly cosmetic) as per Android Lint analysis 2015-08-10 00:26:58 -07:00
Albert Vaca
5b694a3b3e Fixed Android 4.1 crash 2015-06-14 02:59:14 -07:00
Albert Vaca
9cf9f43118 Fixes some potential null pointer exceptions reported by Coverity 2015-04-04 14:29:20 -07:00
Albert Vaca
b7faa97292 Handle closing some resources that we were missing to close 2015-04-04 14:29:11 -07:00
Albert Vaca
86261bd105 Lint fixes 2015-02-01 12:31:42 -08:00