Differential D17859 Diff 48788 src/org/kde/kdeconnect/Plugins/RemoteKeyboardPlugin/RemoteKeyboardService.java
Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Plugins/RemoteKeyboardPlugin/RemoteKeyboardService.java
Show All 27 Lines | |||||
28 | import android.inputmethodservice.KeyboardView.OnKeyboardActionListener; | 28 | import android.inputmethodservice.KeyboardView.OnKeyboardActionListener; | ||
29 | import android.os.Handler; | 29 | import android.os.Handler; | ||
30 | import android.util.Log; | 30 | import android.util.Log; | ||
31 | import android.view.View; | 31 | import android.view.View; | ||
32 | import android.view.inputmethod.EditorInfo; | 32 | import android.view.inputmethod.EditorInfo; | ||
33 | import android.view.inputmethod.InputMethodManager; | 33 | import android.view.inputmethod.InputMethodManager; | ||
34 | import android.widget.Toast; | 34 | import android.widget.Toast; | ||
35 | 35 | | |||
36 | import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity; | ||||
36 | import org.kde.kdeconnect.UserInterface.MainActivity; | 37 | import org.kde.kdeconnect.UserInterface.MainActivity; | ||
37 | import org.kde.kdeconnect.UserInterface.PluginSettingsActivity; | | |||
38 | import org.kde.kdeconnect_tp.R; | 38 | import org.kde.kdeconnect_tp.R; | ||
39 | 39 | | |||
40 | import java.util.ArrayList; | 40 | import java.util.ArrayList; | ||
41 | import java.util.List; | 41 | import java.util.List; | ||
42 | 42 | | |||
43 | public class RemoteKeyboardService | 43 | public class RemoteKeyboardService | ||
44 | extends InputMethodService | 44 | extends InputMethodService | ||
45 | implements OnKeyboardActionListener { | 45 | implements OnKeyboardActionListener { | ||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Line(s) | 155 | case 0: { // "hide keyboard" | |||
157 | break; | 157 | break; | ||
158 | } | 158 | } | ||
159 | case 1: { // "settings" | 159 | case 1: { // "settings" | ||
160 | ArrayList<RemoteKeyboardPlugin> instances = RemoteKeyboardPlugin.acquireInstances(); | 160 | ArrayList<RemoteKeyboardPlugin> instances = RemoteKeyboardPlugin.acquireInstances(); | ||
161 | try { | 161 | try { | ||
162 | if (instances.size() == 1) { // single instance of RemoteKeyboardPlugin -> access its settings | 162 | if (instances.size() == 1) { // single instance of RemoteKeyboardPlugin -> access its settings | ||
163 | RemoteKeyboardPlugin plugin = instances.get(0); | 163 | RemoteKeyboardPlugin plugin = instances.get(0); | ||
164 | if (plugin != null) { | 164 | if (plugin != null) { | ||
165 | Intent intent = new Intent(this, PluginSettingsActivity.class); | 165 | Intent intent = new Intent(this, DeviceSettingsActivity.class); | ||
166 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 166 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
167 | intent.putExtra("plugin_display_name", plugin.getDisplayName()); | 167 | intent.putExtra(DeviceSettingsActivity.EXTRA_DEVICE_ID, plugin.getDeviceId()); | ||
168 | intent.putExtra("plugin_key", plugin.getPluginKey()); | 168 | intent.putExtra(DeviceSettingsActivity.EXTRA_PLUGIN_KEY, plugin.getPluginKey()); | ||
169 | startActivity(intent); | 169 | startActivity(intent); | ||
170 | } | 170 | } | ||
171 | } else { // != 1 instance of plugin -> show main activity view | 171 | } else { // != 1 instance of plugin -> show main activity view | ||
172 | Intent intent = new Intent(this, MainActivity.class); | 172 | Intent intent = new Intent(this, MainActivity.class); | ||
173 | intent.putExtra("forceOverview", true); | 173 | intent.putExtra("forceOverview", true); | ||
174 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 174 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
175 | startActivity(intent); | 175 | startActivity(intent); | ||
176 | if (instances.size() < 1) | 176 | if (instances.size() < 1) | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |