Differential D10951 Diff 28510 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.MaterialActivity; | 36 | import org.kde.kdeconnect.UserInterface.MainActivity; | ||
37 | import org.kde.kdeconnect.UserInterface.PluginSettingsActivity; | 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 | ||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 167 | if (instances.size() == 1) { // single instance of RemoteKeyboardPlugin -> access its settings | |||
169 | if (plugin != null) { | 169 | if (plugin != null) { | ||
170 | Intent intent = new Intent(this, PluginSettingsActivity.class); | 170 | Intent intent = new Intent(this, PluginSettingsActivity.class); | ||
171 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 171 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
172 | intent.putExtra("plugin_display_name", plugin.getDisplayName()); | 172 | intent.putExtra("plugin_display_name", plugin.getDisplayName()); | ||
173 | intent.putExtra("plugin_key", plugin.getPluginKey()); | 173 | intent.putExtra("plugin_key", plugin.getPluginKey()); | ||
174 | startActivity(intent); | 174 | startActivity(intent); | ||
175 | } | 175 | } | ||
176 | } else { // != 1 instance of plugin -> show main activity view | 176 | } else { // != 1 instance of plugin -> show main activity view | ||
177 | Intent intent = new Intent(this, MaterialActivity.class); | 177 | Intent intent = new Intent(this, MainActivity.class); | ||
178 | intent.putExtra("forceOverview", true); | 178 | intent.putExtra("forceOverview", true); | ||
179 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 179 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
180 | startActivity(intent); | 180 | startActivity(intent); | ||
181 | if (instances.size() < 1) | 181 | if (instances.size() < 1) | ||
182 | Toast.makeText(this, R.string.remotekeyboard_not_connected, Toast.LENGTH_SHORT).show(); | 182 | Toast.makeText(this, R.string.remotekeyboard_not_connected, Toast.LENGTH_SHORT).show(); | ||
183 | else // instances.size() > 1 | 183 | else // instances.size() > 1 | ||
184 | Toast.makeText(this, R.string.remotekeyboard_multiple_connections, Toast.LENGTH_SHORT).show(); | 184 | Toast.makeText(this, R.string.remotekeyboard_multiple_connections, Toast.LENGTH_SHORT).show(); | ||
185 | } | 185 | } | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |