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.
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.
* 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
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.
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)
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
## 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.

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

I think this is one of the best workarounds available to make this awesome plugin work.
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.
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
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
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
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
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
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
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