From 6e9cbfb0300afc023bedce5e53992f31042dbb86 Mon Sep 17 00:00:00 2001 From: Dmitry Yudin Date: Fri, 7 Apr 2023 00:05:05 +0200 Subject: [PATCH] Main activity responsive layout --- .idea/.gitignore | 8 + .idea/icon.png | Bin 0 -> 4266 bytes build.gradle | 2 +- res/layout-w820dp/activity_main.xml | 30 ++ res/layout/activity_device.xml | 81 ++-- res/layout/activity_main.xml | 55 +-- res/layout/list_item_plugin_header.xml | 14 +- res/layout/list_plugin_entry.xml | 5 +- res/layout/view_pair_request.xml | 29 +- res/values-land/consts.xml | 5 - .../consts.xml | 0 res/values/consts.xml | 3 - .../RemoteKeyboardService.java | 2 +- .../kde/kdeconnect/Plugins/StubTextPlugin.kt | 15 + .../SystemVolumeProvider.kt | 8 +- .../UserInterface/About/AboutData.kt | 8 +- .../UserInterface/DeviceFragment.kt | 88 ++-- .../UserInterface/List/PluginAdapter.kt | 55 +++ .../UserInterface/MainActivity.java | 424 ------------------ .../kdeconnect/UserInterface/MainActivity.kt | 376 ++++++++++++++++ 20 files changed, 636 insertions(+), 572 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/icon.png create mode 100644 res/layout-w820dp/activity_main.xml rename res/{values-w820dp => values-w600dp}/consts.xml (100%) create mode 100644 src/org/kde/kdeconnect/Plugins/StubTextPlugin.kt create mode 100644 src/org/kde/kdeconnect/UserInterface/List/PluginAdapter.kt delete mode 100644 src/org/kde/kdeconnect/UserInterface/MainActivity.java create mode 100644 src/org/kde/kdeconnect/UserInterface/MainActivity.kt diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -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 diff --git a/.idea/icon.png b/.idea/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c74b4c11a300a32c05536d813496840a13bb9ec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7x!av)@X{lYXiOm7n(Z0CnXsVJXRIM zghAIBg#-i;z+-R4Kha$|cSKnL5*pOP0IE3p8`kRIj{QF^kO|-b literal 0 HcmV?d00001 diff --git a/build.gradle b/build.gradle index 64e732b8..50ab691d 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ import com.android.build.gradle.api.ApplicationVariant import com.github.jk1.license.render.TextReportRenderer buildscript { - ext.kotlin_version = '1.8.0' + ext.kotlin_version = '1.8.10' dependencies { classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/res/layout-w820dp/activity_main.xml b/res/layout-w820dp/activity_main.xml new file mode 100644 index 00000000..59cc39b5 --- /dev/null +++ b/res/layout-w820dp/activity_main.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/res/layout/activity_device.xml b/res/layout/activity_device.xml index 97e04aaf..10290a18 100644 --- a/res/layout/activity_device.xml +++ b/res/layout/activity_device.xml @@ -1,44 +1,51 @@ - + android:layout_height="match_parent"> - - + - - + - - + + - - \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/activity_main.xml b/res/layout/activity_main.xml index fc23d86b..6502e5ab 100644 --- a/res/layout/activity_main.xml +++ b/res/layout/activity_main.xml @@ -1,32 +1,37 @@ - - - + android:layout_height="match_parent"> - - - + android:fitsSystemWindows="true"> - + - + - + + + + + + + + \ No newline at end of file diff --git a/res/layout/list_item_plugin_header.xml b/res/layout/list_item_plugin_header.xml index 95025c0c..ac9aa48e 100644 --- a/res/layout/list_item_plugin_header.xml +++ b/res/layout/list_item_plugin_header.xml @@ -1,9 +1,11 @@ + android:maxWidth="400dp" + android:layout_height="wrap_content" + android:background="?selectableItemBackground" + android:paddingHorizontal="@dimen/activity_horizontal_margin" + android:paddingVertical="@dimen/activity_vertical_margin" + tools:background="@android:color/darker_gray" + tools:text="@tools:sample/lorem"/> diff --git a/res/layout/list_plugin_entry.xml b/res/layout/list_plugin_entry.xml index 37ac4b9b..ec50633c 100644 --- a/res/layout/list_plugin_entry.xml +++ b/res/layout/list_plugin_entry.xml @@ -2,8 +2,9 @@ @@ -17,7 +18,7 @@ android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="vertical"> - -