2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 22:25:08 +00:00

Better device controls

## Summary

This contains some minor code quality improvements in
`RunCommandControlsProviderService`, as well as the following feature changes:

* If the device for a Device Control is reachable, clicking on the secondary
  space of the control will launch RunCommandActivity. If the device isn't
  reachable, we launch the MainActivity like usual.
* Pixel 7 and other modern Google devices can now show KDE Connect commands
  in the 'Home' quick access tile (you still have to 'add app')

## Test Plan

0. Make sure your Android OS supports Device Controls (Android 11+)
1. Choose a paired device to work with
2. Place at least one command in the Run Command list
3. Enable the command in the Device Controls screen
4. Test what happens when you click on the secondary space of the control
This commit is contained in:
Philip Cohn-Cort
2023-10-23 21:58:08 +00:00
parent 184eab4552
commit 548b636f32
12 changed files with 227 additions and 101 deletions

View File

@@ -43,7 +43,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
app:layout_anchorGravity="bottom|end" />
<TextView
android:id="@+id/add_comand_explanation"
android:id="@+id/add_command_explanation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"

View File

@@ -8,14 +8,14 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
<com.google.android.material.appbar.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="@string/kde_connect"/>
tools:title="@string/kde_connect"/>
</com.google.android.material.appbar.AppBarLayout>

View File

@@ -16,13 +16,14 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
tools:ignore="RtlSymmetry">
<LinearLayout
android:id="@+id/runcommandWidgetTitleHeader"
android:id="@+id/widget_title_wrapper"
android:background="@color/on_secondary"
android:gravity="center_vertical|start"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/widget_title_icon"
android:padding="8dip"
android:paddingEnd="6dip"
android:layout_width="wrap_content"
@@ -33,7 +34,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
tools:ignore="UseAppTint"/> <!-- can't use app:tint in RemoteView -->
<TextView
android:id="@+id/runcommandWidgetTitle"
android:id="@+id/widget_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
@@ -45,7 +46,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
</LinearLayout>
<ListView
android:id="@+id/run_commands_list"
android:id="@+id/widget_command_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
@@ -53,7 +54,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted
android:orientation="vertical" />
<TextView
android:id="@+id/not_reachable_message"
android:id="@+id/widget_error_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawablePadding="8dip"