2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 12:47:43 +00:00

64 Commits

Author SHA1 Message Date
Dmitry Yudin
9e5c9ca11a Migrate MainActivity to Kotlin
And replace deprecated onBackPressed with OnBackPressedCallback(s)
2023-04-20 13:54:27 +02:00
Dmitry Yudin
8aeefded7c Main activity responsive layout 2023-04-13 17:56:13 +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
Dmitry Yudin
0ed11d2036 Show enabled plugins as cards 2023-03-29 18:22:27 +00:00
Albert Vaca Cintora
cbc0749997 Do not use the ANDROID_ID as device ID
Since Android 8, this ID is stable across reinstalls of the app. This
causes other devices that already were paired with us to find a cert
mismatch and refuse to communicate with us after a reinstall or data wipe.
2023-03-29 17:09:21 +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
cef68db2a6 Make linter happy: keep nullable/nonnull annotations 2023-03-06 00:01:47 +01:00
Albert Vaca Cintora
3cf48ffd14 Add missing calls to super.onRequestPermissionsResult 2023-03-04 16:00:23 +01:00
Albert Vaca Cintora
adbf78afdb Fix typo 2023-03-04 15:59:55 +01:00
Thore Goebel
8e43ef421b Capture back press in Settings and About
The Settings and About fragments are arguably one logical layer below the PairingFragment (which feels like the "main screen").
Capture the back press and return to the PairingFragment.

Fixes https://bugs.kde.org/show_bug.cgi?id=442716.

Notes:
- In a DeviceFragment back-pressing continues to close the app, as before. Judging from the fact that the app persists the last selected device to the shared prefs, I assume this is a intentional.
- I also thought about storing from where the Settings/About were opened (e.g. from a specific DeviceFragment) and returning there. However this would be a much larger change with arguable user benefit. After all, from the PairingFragment it's just a single click to your device.
2022-04-21 00:54:42 +00:00
Albert Vaca Cintora
6cf0ef79b2 Small tweaks suggested by static code analyzer 2022-01-24 01:56:10 +01:00
Maxim Leshchenko
049cb6d6a6 Add a desktop-like about app page
Show version, authors and useful links
2021-08-21 13:11:55 +00: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
Anjani Kumar
69b3154b69 SharePlugin: Configure receiving directory in plugin permission mechanism
BUG: 422330
2020-09-26 06:12:47 +00:00
Isira Seneviratne
d22967f475 Use ArrayUtils.contains(). 2020-07-26 21:50:10 +00:00
Isira Seneviratne
54335ac755 Use view binding in MainActivity. 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
Isira Seneviratne
acd96b86e5 Replace add circle PNGs with a vector drawable. 2020-07-09 14:35:10 +00:00
Anjani Kumar
c318d60916 New way to support dark theme to improve integration with system 2020-05-11 23:07:25 +00:00
Daniel Tang
4291473106
Use material design settings icon 2020-04-27 22:37:16 -04:00
Anjani Kumar
34c80314ed This reverts commit 0fc5d0907827451092afed17fb04dc1b3417e316. 2020-04-21 15:15:49 +05:30
Albert Vaca Cintora
0fc5d09078 Revert send clipboard on Android X
This reverts 3 commits:

"Clipboard Plugin: Added support to send clipboard to multiple devices on Android 10 and later."
b92271105a5317c24e945e25a935875b0cf3cc2a

"Excluded ClipboardFloatingActivity from App recents Screen"
ee1562050c6517acffd312fbc00a2715a28ccdde

"Make Clipboard plugin work in Android X"
b81d3a82e5a71757388fffb4a3b3486aea74d1aa
2020-04-16 23:55:22 +02:00
Anjani Kumar
b81d3a82e5 Make Clipboard plugin work in Android X
## Summary

Fixes #5

BUG: 417419](https://bugs.kde.org/show_bug.cgi?id=417419)

This patch introduces a workaround to access the restricted clipboard in Android X.
Clipboard synchronisation in KDE Connect was one of the killer features before Android X. An action button is added in the persistent foreground notification **Send Clipboard** which adds the ability to send the clipboard using a small workaround. Clipboard Synchronisation works as usual in lower Android Versions.

This is a very convenient workaround for sending clipboard quickly as it does not requires to open the app. Floating Activity is quite handy for quick actions.

## Details of the workaround

### ClipboardFloatingActivity

* This activity is only executed in Android X.
* This is transparent, accesses the clipboard when in focus.
* Sends a `NetworkPacket` containing *text* and *timestamp*.
* When the packet has been sent, it pops up a toast with a success message.
* Automatically closes after the showing the Toast.

### Reverted changes for Android X.

* Changes done in commits 54be4a1a997e14516353f5104ef1619f98ba99ec and 9f3b75b7483fe79527d635ad10a2bb7cf6496d8c have been reverted.
* These changes are not required anymore as the workaround for clipboard sync works.

The action button in the notification for **Send Clipboard** is not added in the lower versions of Android. **It is only added in Android X**.

**Two way sync is working in Android X with this patch. Sync works normally in lower Android versions.**

## Test Plan

### Before:

Clipboard from PC to Phones were synchronised but Clipboard of phones didn't get synchronised with the PC.

### After:

The action button is up in Android X while using other apps.

![Screenshot_20200227-150435_Chrome](/uploads/201960e1577321c8a77c9945bd2b5e76/Screenshot_20200227-150435_Chrome.png)

After clicking the button, a cute Toast appears with the message *Clipboard sent*

![Screenshot_20200228-233701_Chrome](/uploads/8da58b1006b95ce82c7cec2c91f32878/Screenshot_20200228-233701_Chrome.png)

I think this is one of the best workarounds available to make this awesome plugin work.
2020-03-12 03:56:37 +00:00
Albert Vaca Cintora
9f3b75b748 Notify Android 10 users that clipboard won't work 2020-01-14 23:02:38 +01:00
Albert Vaca Cintora
432294c64c Broacast when we open the app but ratelimit broadcasts
Reviewed-by: Aleix Pol
2019-10-25 21:22:10 +02:00
Albert Vaca Cintora
ea72327abe Merge branch 'albertvaka/human-name-lib' 2019-07-20 13:38:07 +02: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
4ea7618828 Use a library to get the human-friendly device name
We had a list of names before, but it was outdated. Using a library gives
us an up-to-date list plus a fallback that fetches the name from the
internet if not in the list.
2019-06-27 10:12:51 -04:00
Nicolas Fella
e882bebe4e Simplify switch 2019-04-20 22:38:44 +02:00
Nicolas Fella
d1565702cc Simplify switch 2019-04-20 22:37:06 +02:00
Nicolas Fella
8e60359496 Fix warning when overriding methods with nonnull annotations 2019-04-20 00:01:20 +02:00
Nicolas Fella
30e9375106 Weaken access modifier 2019-02-28 15:47:11 +01:00
Albert Vaca Cintora
6250b67985 Notifications plugin now shows as "without permission" instead of "failed"
Removed the concept of "failed" plugins
2019-02-12 13:21:59 +01:00
Erik Duisters
f4c80dd839 Use an EditTextPreference for changing the device name instead of an AlertDialog 2019-01-29 09:26:42 +00:00
Erik Duisters
8e93e3253f Use androidx version of AlertDialog
Summary:
Use androidx version of AlertDialog to get properly styled AlertDialog buttons
Use PreferenceManager context to style Device Name AlertDialog

|{F6551907}|{F6551908}|
|Before|After|

Test Plan: Apply patch and verify that AlertDialogs have properly styled buttons

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D18298
2019-01-17 17:20:46 +01:00
Erik Duisters
4173338974 Make tapping on a pair notification work again
Summary:
The Simplify pairing from notification patch D16518 broke the functionality that
tapping on the notification provided

This patch makes tapping on the pairing notification work again as expected

Test Plan:
Before applying this patch initiate a pairing from kde
On android tap on the notification (not the action buttons) and notice that nothing happens

Apply the path and repeat the above test. Now the DeviceFragment should be displayed allowing
the the pairing to be accepted or rejected

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17886
2019-01-06 13:11:27 +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
Erik Duisters
87ec4f2078 Fix some lint warnings
Summary: Fix a number of lint warnings

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17452
2018-12-09 18:53:32 +01:00
Erik Duisters
2402b11608 Incorporate more Material Design components
Summary:
Add CoordinatorLayout and AppBarLayout to activity_main.xml to support
more material design features (eg. FAB moves out of the way when a Snackbar is displayed)

Test Plan: Apply patch and confirm that the app looks the same as allways

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17451
2018-12-09 18:51:12 +01:00
Erik Duisters
3a189d1af4 Do not create a new content fragment on orientation change
Summary:
When an orientation change occurs the fragment manager will automatically
re-create the content fragment for us.

Test Plan:
Set the content fragment to DeviceFragment and change orientation
Result: DeviceFragment is shown for the correct device and the correct navigation view menu item is checked

Set the content fragment to PairingFragment and change orientation
Result: PairingFragment is shown for the correct device and the "Pair new device" navigation view menu item is checked

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17409
2018-12-08 14:14:18 +01:00
Erik Duisters
9f498f8127 Use butterknife for view binding
Summary: Use butterknife for view binding

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17411
2018-12-08 14:12:14 +01:00
Erik Duisters
96a1edfb76 Fix lint warning: Avoid non-default constructors in fragments
Summary: It is common practice to use a static newInstance to create new fragment instances instead of using non-default constructors

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17390
2018-12-06 20:29:07 +01:00
Erik Duisters
b54b69032f Simplify pairing from notification
Summary: When a pairing is accepted or rejected through notification actions a new DeviceFragment was created but this fragment was never actually attached to the fragment manager so not displayed to the user.

Test Plan:
Request a pairing from the desktop and Accept or Reject the pairing on Android using the notification Action buttons

When you accept the pairing the DeviceFragment should be shown for the device, the action bar title should be set to the devices name and the device should be selected in the NavigationView

When you reject the pairing the PairingFragment should be shown

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16518
2018-10-30 12:42:38 +01:00
Nicolas Fella
b53f2d11bd Remove old way of device renaming 2018-10-27 01:04:34 +02:00
Nicolas Fella
e1096f5bc8 Make final where possible 2018-10-27 00:01:30 +02:00
Nicolas Fella
a49a145d69 Only use required access modifiers 2018-10-26 23:59:20 +02:00
Nicolas Fella
3a8cb14c19 Remove unneeded imports 2018-10-26 23:12:31 +02:00
Nicolas Fella
42f06d4b51 Remove assert. They don't do anything 2018-10-26 22:55:06 +02:00
Albert Vaca
3e5f9bb964 Merge branch 'pie'
# Conflicts:
#	res/values/strings.xml
#	src/org/kde/kdeconnect/UserInterface/MainActivity.java
2018-10-25 21:06:18 +02:00