Differential D10911 Diff 28493 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 First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 43 | public class RemoteKeyboardService | |||
---|---|---|---|---|---|
57 | public boolean active = false; | 57 | public boolean active = false; | ||
58 | 58 | | |||
59 | /** | 59 | /** | ||
60 | * Whether this InputMethod is currently visible. | 60 | * Whether this InputMethod is currently visible. | ||
61 | */ | 61 | */ | ||
62 | public boolean visible = false; | 62 | public boolean visible = false; | ||
63 | 63 | | |||
64 | KeyboardView inputView = null; | 64 | KeyboardView inputView = null; | ||
65 | private final int StatusKeyIdx = 3; | | |||
66 | private final int connectedIcon = R.drawable.ic_phonelink_white_36dp; | | |||
67 | private final int disconnectedIcon = R.drawable.ic_phonelink_off_white_36dp; | | |||
68 | 65 | | |||
69 | Handler handler; | 66 | Handler handler; | ||
70 | 67 | | |||
71 | void updateInputView() { | 68 | void updateInputView() { | ||
72 | if (inputView == null) | 69 | if (inputView == null) | ||
73 | return; | 70 | return; | ||
74 | Keyboard currentKeyboard = inputView.getKeyboard(); | 71 | Keyboard currentKeyboard = inputView.getKeyboard(); | ||
75 | List<Keyboard.Key> keys = currentKeyboard.getKeys(); | 72 | List<Keyboard.Key> keys = currentKeyboard.getKeys(); | ||
76 | boolean connected = RemoteKeyboardPlugin.isConnected(); | 73 | boolean connected = RemoteKeyboardPlugin.isConnected(); | ||
77 | // Log.d("RemoteKeyboardService", "Updating keyboard connection icon, connected=" + connected); | 74 | // Log.d("RemoteKeyboardService", "Updating keyboard connection icon, connected=" + connected); | ||
78 | keys.get(StatusKeyIdx).icon = getResources().getDrawable(connected ? connectedIcon : disconnectedIcon); | 75 | int disconnectedIcon = R.drawable.ic_phonelink_off_white_36dp; | ||
79 | inputView.invalidateKey(StatusKeyIdx); | 76 | int connectedIcon = R.drawable.ic_phonelink_white_36dp; | ||
77 | int statusKeyIdx = 3; | ||||
78 | keys.get(statusKeyIdx).icon = getResources().getDrawable(connected ? connectedIcon : disconnectedIcon); | ||||
79 | inputView.invalidateKey(statusKeyIdx); | ||||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | @Override | 82 | @Override | ||
83 | public void onCreate() { | 83 | public void onCreate() { | ||
84 | super.onCreate(); | 84 | super.onCreate(); | ||
85 | active = false; | 85 | active = false; | ||
86 | visible = false; | 86 | visible = false; | ||
87 | instance = this; | 87 | instance = this; | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |