2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-01 06:35:09 +00:00

Compare commits

..

8 Commits

Author SHA1 Message Date
Albert Vaca Cintora
26aef16bbc Fix compatibility with API 20 2023-04-13 12:12:51 +02:00
Albert Vaca Cintora
abd4d02096 Merge branch 'master' into kdeconnect-android-drawer_responsive 2023-04-13 11:52:58 +02:00
Dmitry Yudin
dbd184eb2e "continue" cleanups 2023-04-12 01:26:00 +02:00
Dmitry Yudin
851fb58712 Replace StubTextPlugin.kt with PluginItem.kt 2023-04-12 01:12:50 +02:00
Dmitry Yudin
b7b9a3ad66 Merge remote-tracking branch 'origin/drawer_responsive' into drawer_responsive
# Conflicts:
#	src/org/kde/kdeconnect/UserInterface/MainActivity.java
2023-04-08 16:03:14 +02:00
Dmitry Yudin
27bbbc2bf9 MainActivity.java 2023-04-08 16:02:46 +02:00
Dmitry Yudin
f70dc84ef2 MainActivity.java 2023-04-08 16:01:50 +02:00
Dmitry Yudin
6e9cbfb030 Main activity responsive layout 2023-04-07 00:05:05 +02:00
11 changed files with 38 additions and 39 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

BIN
.idea/icon.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.kde.kdeconnect_tp"
android:versionCode="12401"
android:versionName="1.24.1">
android:versionCode="12400"
android:versionName="1.24.0">
<supports-screens
android:anyDensity="true"

View File

@@ -4,7 +4,7 @@ import com.android.build.gradle.api.ApplicationVariant
import com.github.jk1.license.render.TextReportRenderer
buildscript {
ext.kotlin_version = '1.8.10'
ext.kotlin_version = '1.8.0'
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
@@ -136,19 +136,19 @@ ext {
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.0'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.1'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.jakewharton:disklrucache:2.0.2' //For caching album art bitmaps

View File

@@ -209,7 +209,7 @@ public class SslHelper {
trustManagerFactory.init(keyStore);
// Setup custom trust manager if device not trusted
SSLContext tlsContext = SSLContext.getInstance("TLS");
SSLContext tlsContext = SSLContext.getInstance("TLSv1"); //Newer TLS versions are only supported on API 16+
if (isDeviceTrusted) {
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), RandomHelper.secureRandom);
} else {

View File

@@ -151,7 +151,6 @@ public class FindMyPhonePlugin extends Plugin {
.setFullScreenIntent(pendingIntent, true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setAutoCancel(true)
.setOngoing(true)
.setContentTitle(context.getString(R.string.findmyphone_found));
notification.setGroup("BackgroundService");

View File

@@ -61,8 +61,8 @@ class DeviceFragment : Fragment() {
*
* Used to start and retry pairing.
*/
private var pairingBinding: ViewPairRequestBinding? = null
private fun requirePairingBinding() = pairingBinding ?: throw IllegalStateException("binding is not set")
private var binding: ViewPairRequestBinding? = null
private fun requireBinding() = binding ?: throw IllegalStateException("binding is not set")
/**
* Cannot-communicate ViewBinding.
@@ -94,7 +94,7 @@ class DeviceFragment : Fragment() {
val deviceBinding = deviceBinding ?: return null
// Inner binding for the layout shown when we're not paired yet...
pairingBinding = deviceBinding.pairRequest
binding = deviceBinding.pairRequest
// ...and for when pairing doesn't (or can't) work
errorBinding = deviceBinding.pairError
@@ -102,8 +102,8 @@ class DeviceFragment : Fragment() {
device = it.getDevice(deviceId)
}
requirePairingBinding().pairButton.setOnClickListener {
with(requirePairingBinding()) {
requireBinding().pairButton.setOnClickListener {
with(requireBinding()) {
pairButton.visibility = View.GONE
pairMessage.text = null
pairVerification.visibility = View.VISIBLE
@@ -112,13 +112,13 @@ class DeviceFragment : Fragment() {
}
device?.requestPairing()
}
requirePairingBinding().acceptButton.setOnClickListener {
requireBinding().acceptButton.setOnClickListener {
device?.apply {
acceptPairing()
requirePairingBinding().pairingButtons.visibility = View.GONE
requireBinding().pairingButtons.visibility = View.GONE
}
}
requirePairingBinding().rejectButton.setOnClickListener {
requireBinding().rejectButton.setOnClickListener {
device?.apply {
//Remove listener so buttons don't show for a while before changing the view
removePluginsChangedListener(pluginsChangedListener)
@@ -155,7 +155,7 @@ class DeviceFragment : Fragment() {
device.removePairingCallback(pairingCallback)
}
super.onDestroyView()
pairingBinding = null
binding = null
errorBinding = null
deviceBinding = null
}
@@ -243,36 +243,28 @@ class DeviceFragment : Fragment() {
mActivity?.runOnUiThread(object : Runnable {
override fun run() {
if (device.isPairRequestedByPeer) {
with (requirePairingBinding()) {
pairMessage.setText(R.string.pair_requested)
pairVerification.visibility = View.VISIBLE
pairVerification.text = SslHelper.getVerificationKey(SslHelper.certificate, device.certificate)
pairingButtons.visibility = View.VISIBLE
pairProgress.visibility = View.GONE
pairButton.visibility = View.GONE
pairRequestButtons.visibility = View.VISIBLE
}
with (requireDeviceBinding()) {
permissionsList.visibility = View.GONE
pluginsList.visibility = View.GONE
}
requireBinding().pairMessage.setText(R.string.pair_requested)
requireBinding().pairVerification.visibility = View.VISIBLE
requireBinding().pairVerification.text =
SslHelper.getVerificationKey(SslHelper.certificate, device.certificate)
requireBinding().pairingButtons.visibility = View.VISIBLE
requireBinding().pairProgress.visibility = View.GONE
requireBinding().pairButton.visibility = View.GONE
requireBinding().pairRequestButtons.visibility = View.VISIBLE
} else {
val paired = device.isPaired
val reachable = device.isReachable
requirePairingBinding().pairingButtons.visibility = if (paired) View.GONE else View.VISIBLE
requireBinding().pairingButtons.visibility = if (paired) View.GONE else View.VISIBLE
if (paired && !reachable) {
requireErrorBinding().errorMessageContainer.visibility = View.VISIBLE
requireErrorBinding().notReachableMessage.visibility = View.VISIBLE
requireDeviceBinding().permissionsList.visibility = View.GONE
requireDeviceBinding().pluginsList.visibility = View.GONE
} else if (paired) {
} else {
requireErrorBinding().errorMessageContainer.visibility = View.GONE
requireErrorBinding().notReachableMessage.visibility = View.GONE
requireDeviceBinding().permissionsList.visibility = View.VISIBLE
requireDeviceBinding().pluginsList.visibility = View.VISIBLE
} else {
requireDeviceBinding().permissionsList.visibility = View.GONE
requireDeviceBinding().pluginsList.visibility = View.GONE
}
try {
if (paired && reachable) {
@@ -340,7 +332,7 @@ class DeviceFragment : Fragment() {
override fun pairingFailed(error: String) {
mActivity?.runOnUiThread {
with(requirePairingBinding()) {
with(requireBinding()) {
pairMessage.text = error
pairVerification.text = null
pairVerification.visibility = View.GONE
@@ -354,7 +346,7 @@ class DeviceFragment : Fragment() {
override fun unpaired() {
mActivity?.runOnUiThread {
with(requirePairingBinding()) {
with(requireBinding()) {
pairMessage.setText(R.string.device_not_paired)
pairVerification.visibility = View.GONE
pairProgress.visibility = View.GONE