Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/UserInterface/DeviceFragment.java
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 99 | public View onCreateView(LayoutInflater inflater, ViewGroup container, | |||
---|---|---|---|---|---|
105 | if (deviceId != null) { | 105 | if (deviceId != null) { | ||
106 | mDeviceId = deviceId; | 106 | mDeviceId = deviceId; | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | setHasOptionsMenu(true); | 109 | setHasOptionsMenu(true); | ||
110 | 110 | | |||
111 | //Log.e("DeviceFragment", "device: " + deviceId); | 111 | //Log.e("DeviceFragment", "device: " + deviceId); | ||
112 | 112 | | |||
113 | BackgroundService.RunCommand(mActivity, new BackgroundService.InstanceCallback() { | 113 | BackgroundService.RunCommand(mActivity, service -> { | ||
114 | @Override | | |||
115 | public void onServiceStart(BackgroundService service) { | | |||
116 | device = service.getDevice(mDeviceId); | 114 | device = service.getDevice(mDeviceId); | ||
117 | if (device == null) { | 115 | if (device == null) { | ||
118 | Log.e("DeviceFragment", "Trying to display a device fragment but the device is not present"); | 116 | Log.e("DeviceFragment", "Trying to display a device fragment but the device is not present"); | ||
119 | mActivity.onDeviceSelected(null); | 117 | mActivity.onDeviceSelected(null); | ||
120 | return; | 118 | return; | ||
121 | } | 119 | } | ||
122 | 120 | | |||
123 | mActivity.getSupportActionBar().setTitle(device.getName()); | 121 | mActivity.getSupportActionBar().setTitle(device.getName()); | ||
124 | 122 | | |||
125 | device.addPairingCallback(pairingCallback); | 123 | device.addPairingCallback(pairingCallback); | ||
126 | device.addPluginsChangedListener(pluginsChangedListener); | 124 | device.addPluginsChangedListener(pluginsChangedListener); | ||
127 | 125 | | |||
128 | refreshUI(); | 126 | refreshUI(); | ||
129 | 127 | | |||
130 | } | | |||
131 | }); | 128 | }); | ||
132 | 129 | | |||
133 | final Button pairButton = (Button) rootView.findViewById(R.id.pair_button); | 130 | final Button pairButton = (Button) rootView.findViewById(R.id.pair_button); | ||
134 | pairButton.setOnClickListener(new View.OnClickListener() { | 131 | pairButton.setOnClickListener(view -> { | ||
135 | @Override | | |||
136 | public void onClick(View view) { | | |||
137 | pairButton.setVisibility(View.GONE); | 132 | pairButton.setVisibility(View.GONE); | ||
138 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(""); | 133 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(""); | ||
139 | rootView.findViewById(R.id.pair_progress).setVisibility(View.VISIBLE); | 134 | rootView.findViewById(R.id.pair_progress).setVisibility(View.VISIBLE); | ||
140 | BackgroundService.RunCommand(mActivity, new BackgroundService.InstanceCallback() { | 135 | BackgroundService.RunCommand(mActivity, service -> { | ||
141 | @Override | | |||
142 | public void onServiceStart(BackgroundService service) { | | |||
143 | device = service.getDevice(deviceId); | 136 | device = service.getDevice(deviceId); | ||
144 | if (device == null) return; | 137 | if (device == null) return; | ||
145 | device.requestPairing(); | 138 | device.requestPairing(); | ||
146 | } | | |||
147 | }); | 139 | }); | ||
148 | } | | |||
149 | }); | 140 | }); | ||
150 | 141 | | |||
151 | rootView.findViewById(R.id.accept_button).setOnClickListener(new View.OnClickListener() { | 142 | rootView.findViewById(R.id.accept_button).setOnClickListener(view -> BackgroundService.RunCommand(mActivity, service -> { | ||
152 | @Override | | |||
153 | public void onClick(View view) { | | |||
154 | BackgroundService.RunCommand(mActivity, new BackgroundService.InstanceCallback() { | | |||
155 | @Override | | |||
156 | public void onServiceStart(BackgroundService service) { | | |||
157 | if (device != null) { | 143 | if (device != null) { | ||
158 | device.acceptPairing(); | 144 | device.acceptPairing(); | ||
159 | rootView.findViewById(R.id.pairing_buttons).setVisibility(View.GONE); | 145 | rootView.findViewById(R.id.pairing_buttons).setVisibility(View.GONE); | ||
160 | } | 146 | } | ||
161 | } | 147 | })); | ||
162 | }); | | |||
163 | } | | |||
164 | }); | | |||
165 | 148 | | |||
166 | rootView.findViewById(R.id.reject_button).setOnClickListener(new View.OnClickListener() { | 149 | rootView.findViewById(R.id.reject_button).setOnClickListener(view -> BackgroundService.RunCommand(mActivity, service -> { | ||
167 | @Override | | |||
168 | public void onClick(View view) { | | |||
169 | BackgroundService.RunCommand(mActivity, new BackgroundService.InstanceCallback() { | | |||
170 | @Override | | |||
171 | public void onServiceStart(BackgroundService service) { | | |||
172 | if (device != null) { | 150 | if (device != null) { | ||
173 | //Remove listener so buttons don't show for a while before changing the view | 151 | //Remove listener so buttons don't show for a while before changing the view | ||
174 | device.removePluginsChangedListener(pluginsChangedListener); | 152 | device.removePluginsChangedListener(pluginsChangedListener); | ||
175 | device.removePairingCallback(pairingCallback); | 153 | device.removePairingCallback(pairingCallback); | ||
176 | device.rejectPairing(); | 154 | device.rejectPairing(); | ||
177 | } | 155 | } | ||
178 | mActivity.onDeviceSelected(null); | 156 | mActivity.onDeviceSelected(null); | ||
179 | } | 157 | })); | ||
180 | }); | | |||
181 | } | | |||
182 | }); | | |||
183 | 158 | | |||
184 | return rootView; | 159 | return rootView; | ||
185 | } | 160 | } | ||
186 | 161 | | |||
187 | final Device.PluginsChangedListener pluginsChangedListener = new Device.PluginsChangedListener() { | 162 | final Device.PluginsChangedListener pluginsChangedListener = device -> refreshUI(); | ||
188 | @Override | | |||
189 | public void onPluginsChanged(final Device device) { | | |||
190 | refreshUI(); | | |||
191 | } | | |||
192 | }; | | |||
193 | 163 | | |||
194 | @Override | 164 | @Override | ||
195 | public void onDestroyView() { | 165 | public void onDestroyView() { | ||
196 | BackgroundService.RunCommand(mActivity, new BackgroundService.InstanceCallback() { | 166 | BackgroundService.RunCommand(mActivity, service -> { | ||
197 | @Override | | |||
198 | public void onServiceStart(BackgroundService service) { | | |||
199 | Device device = service.getDevice(mDeviceId); | 167 | Device device = service.getDevice(mDeviceId); | ||
200 | if (device == null) return; | 168 | if (device == null) return; | ||
201 | device.removePluginsChangedListener(pluginsChangedListener); | 169 | device.removePluginsChangedListener(pluginsChangedListener); | ||
202 | device.removePairingCallback(pairingCallback); | 170 | device.removePairingCallback(pairingCallback); | ||
203 | } | | |||
204 | }); | 171 | }); | ||
205 | super.onDestroyView(); | 172 | super.onDestroyView(); | ||
206 | } | 173 | } | ||
207 | 174 | | |||
208 | @Override | 175 | @Override | ||
209 | public void onPrepareOptionsMenu(Menu menu) { | 176 | public void onPrepareOptionsMenu(Menu menu) { | ||
210 | 177 | | |||
211 | //Log.e("DeviceFragment", "onPrepareOptionsMenu"); | 178 | //Log.e("DeviceFragment", "onPrepareOptionsMenu"); | ||
212 | 179 | | |||
213 | super.onPrepareOptionsMenu(menu); | 180 | super.onPrepareOptionsMenu(menu); | ||
214 | menu.clear(); | 181 | menu.clear(); | ||
215 | 182 | | |||
216 | if (device == null) { | 183 | if (device == null) { | ||
217 | return; | 184 | return; | ||
218 | } | 185 | } | ||
219 | 186 | | |||
220 | //Plugins button list | 187 | //Plugins button list | ||
221 | final Collection<Plugin> plugins = device.getLoadedPlugins().values(); | 188 | final Collection<Plugin> plugins = device.getLoadedPlugins().values(); | ||
222 | for (final Plugin p : plugins) { | 189 | for (final Plugin p : plugins) { | ||
223 | if (!p.displayInContextMenu()) { | 190 | if (!p.displayInContextMenu()) { | ||
224 | continue; | 191 | continue; | ||
225 | } | 192 | } | ||
226 | menu.add(p.getActionName()).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 193 | menu.add(p.getActionName()).setOnMenuItemClickListener(item -> { | ||
227 | @Override | | |||
228 | public boolean onMenuItemClick(MenuItem item) { | | |||
229 | p.startMainActivity(mActivity); | 194 | p.startMainActivity(mActivity); | ||
230 | return true; | 195 | return true; | ||
231 | } | | |||
232 | }); | 196 | }); | ||
233 | } | 197 | } | ||
234 | 198 | | |||
235 | menu.add(R.string.device_menu_plugins).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 199 | menu.add(R.string.device_menu_plugins).setOnMenuItemClickListener(menuItem -> { | ||
236 | @Override | | |||
237 | public boolean onMenuItemClick(MenuItem menuItem) { | | |||
238 | Intent intent = new Intent(mActivity, SettingsActivity.class); | 200 | Intent intent = new Intent(mActivity, SettingsActivity.class); | ||
239 | intent.putExtra("deviceId", mDeviceId); | 201 | intent.putExtra("deviceId", mDeviceId); | ||
240 | startActivity(intent); | 202 | startActivity(intent); | ||
241 | return true; | 203 | return true; | ||
242 | } | | |||
243 | }); | 204 | }); | ||
244 | 205 | | |||
245 | if (device.isReachable()) { | 206 | if (device.isReachable()) { | ||
246 | 207 | | |||
247 | menu.add(R.string.encryption_info_title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 208 | menu.add(R.string.encryption_info_title).setOnMenuItemClickListener(menuItem -> { | ||
248 | @Override | | |||
249 | public boolean onMenuItemClick(MenuItem menuItem) { | | |||
250 | Context context = mActivity; | 209 | Context context = mActivity; | ||
251 | AlertDialog.Builder builder = new AlertDialog.Builder(context); | 210 | AlertDialog.Builder builder = new AlertDialog.Builder(context); | ||
252 | builder.setTitle(context.getResources().getString(R.string.encryption_info_title)); | 211 | builder.setTitle(context.getResources().getString(R.string.encryption_info_title)); | ||
253 | builder.setPositiveButton(context.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() { | 212 | builder.setPositiveButton(context.getResources().getString(R.string.ok), (dialog, id) -> dialog.dismiss()); | ||
254 | public void onClick(DialogInterface dialog, int id) { | | |||
255 | dialog.dismiss(); | | |||
256 | } | | |||
257 | }); | | |||
258 | 213 | | |||
259 | if (device.certificate == null) { | 214 | if (device.certificate == null) { | ||
260 | builder.setMessage(R.string.encryption_info_msg_no_ssl); | 215 | builder.setMessage(R.string.encryption_info_msg_no_ssl); | ||
261 | } else { | 216 | } else { | ||
262 | builder.setMessage(context.getResources().getString(R.string.my_device_fingerprint) + "\n" + SslHelper.getCertificateHash(SslHelper.certificate) + "\n\n" | 217 | builder.setMessage(context.getResources().getString(R.string.my_device_fingerprint) + "\n" + SslHelper.getCertificateHash(SslHelper.certificate) + "\n\n" | ||
263 | + context.getResources().getString(R.string.remote_device_fingerprint) + "\n" + SslHelper.getCertificateHash(device.certificate)); | 218 | + context.getResources().getString(R.string.remote_device_fingerprint) + "\n" + SslHelper.getCertificateHash(device.certificate)); | ||
264 | } | 219 | } | ||
265 | builder.create().show(); | 220 | builder.create().show(); | ||
266 | return true; | 221 | return true; | ||
267 | } | | |||
268 | }); | 222 | }); | ||
269 | } | 223 | } | ||
270 | 224 | | |||
271 | if (device.isPaired()) { | 225 | if (device.isPaired()) { | ||
272 | 226 | | |||
273 | menu.add(R.string.device_menu_unpair).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 227 | menu.add(R.string.device_menu_unpair).setOnMenuItemClickListener(menuItem -> { | ||
274 | @Override | | |||
275 | public boolean onMenuItemClick(MenuItem menuItem) { | | |||
276 | //Remove listener so buttons don't show for a while before changing the view | 228 | //Remove listener so buttons don't show for a while before changing the view | ||
277 | device.removePluginsChangedListener(pluginsChangedListener); | 229 | device.removePluginsChangedListener(pluginsChangedListener); | ||
278 | device.removePairingCallback(pairingCallback); | 230 | device.removePairingCallback(pairingCallback); | ||
279 | device.unpair(); | 231 | device.unpair(); | ||
280 | mActivity.onDeviceSelected(null); | 232 | mActivity.onDeviceSelected(null); | ||
281 | return true; | 233 | return true; | ||
282 | } | | |||
283 | }); | 234 | }); | ||
284 | } | 235 | } | ||
285 | 236 | | |||
286 | } | 237 | } | ||
287 | 238 | | |||
288 | @Override | 239 | @Override | ||
289 | public void onResume() { | 240 | public void onResume() { | ||
290 | super.onResume(); | 241 | super.onResume(); | ||
291 | 242 | | |||
292 | getView().setFocusableInTouchMode(true); | 243 | getView().setFocusableInTouchMode(true); | ||
293 | getView().requestFocus(); | 244 | getView().requestFocus(); | ||
294 | getView().setOnKeyListener(new View.OnKeyListener() { | 245 | getView().setOnKeyListener((v, keyCode, event) -> { | ||
295 | @Override | | |||
296 | public boolean onKey(View v, int keyCode, KeyEvent event) { | | |||
297 | if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) { | 246 | if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) { | ||
298 | boolean fromDeviceList = getArguments().getBoolean(ARG_FROM_DEVICE_LIST, false); | 247 | boolean fromDeviceList = getArguments().getBoolean(ARG_FROM_DEVICE_LIST, false); | ||
299 | // Handle back button so we go to the list of devices in case we came from there | 248 | // Handle back button so we go to the list of devices in case we came from there | ||
300 | if (fromDeviceList) { | 249 | if (fromDeviceList) { | ||
301 | mActivity.onDeviceSelected(null); | 250 | mActivity.onDeviceSelected(null); | ||
302 | return true; | 251 | return true; | ||
303 | } | 252 | } | ||
304 | } | 253 | } | ||
305 | return false; | 254 | return false; | ||
306 | } | | |||
307 | }); | 255 | }); | ||
308 | } | 256 | } | ||
309 | 257 | | |||
310 | void refreshUI() { | 258 | void refreshUI() { | ||
311 | //Log.e("DeviceFragment", "refreshUI"); | 259 | //Log.e("DeviceFragment", "refreshUI"); | ||
312 | 260 | | |||
313 | if (device == null || rootView == null) { | 261 | if (device == null || rootView == null) { | ||
314 | return; | 262 | return; | ||
Show All 27 Lines | 289 | try { | |||
342 | pluginListItems = new ArrayList<>(); | 290 | pluginListItems = new ArrayList<>(); | ||
343 | 291 | | |||
344 | //Plugins button list | 292 | //Plugins button list | ||
345 | final Collection<Plugin> plugins = device.getLoadedPlugins().values(); | 293 | final Collection<Plugin> plugins = device.getLoadedPlugins().values(); | ||
346 | for (final Plugin p : plugins) { | 294 | for (final Plugin p : plugins) { | ||
347 | if (!p.hasMainActivity()) continue; | 295 | if (!p.hasMainActivity()) continue; | ||
348 | if (p.displayInContextMenu()) continue; | 296 | if (p.displayInContextMenu()) continue; | ||
349 | 297 | | |||
350 | pluginListItems.add(new PluginItem(p, new View.OnClickListener() { | 298 | pluginListItems.add(new PluginItem(p, v -> p.startMainActivity(mActivity))); | ||
351 | @Override | | |||
352 | public void onClick(View v) { | | |||
353 | p.startMainActivity(mActivity); | | |||
354 | } | | |||
355 | })); | | |||
356 | } | 299 | } | ||
357 | 300 | | |||
358 | createPluginsList(device.getFailedPlugins(), R.string.plugins_failed_to_load, new PluginClickListener() { | 301 | createPluginsList(device.getFailedPlugins(), R.string.plugins_failed_to_load, new PluginClickListener() { | ||
359 | @Override | 302 | @Override | ||
360 | void action() { | 303 | void action() { | ||
361 | plugin.getErrorDialog(mActivity).show(); | 304 | plugin.getErrorDialog(mActivity).show(); | ||
362 | } | 305 | } | ||
363 | }); | 306 | }); | ||
Show All 39 Lines | 340 | final Device.PairingCallback pairingCallback = new Device.PairingCallback() { | |||
403 | 346 | | |||
404 | @Override | 347 | @Override | ||
405 | public void pairingSuccessful() { | 348 | public void pairingSuccessful() { | ||
406 | refreshUI(); | 349 | refreshUI(); | ||
407 | } | 350 | } | ||
408 | 351 | | |||
409 | @Override | 352 | @Override | ||
410 | public void pairingFailed(final String error) { | 353 | public void pairingFailed(final String error) { | ||
411 | mActivity.runOnUiThread(new Runnable() { | 354 | mActivity.runOnUiThread(() -> { | ||
412 | @Override | | |||
413 | public void run() { | | |||
414 | if (rootView == null) return; | 355 | if (rootView == null) return; | ||
415 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(error); | 356 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(error); | ||
416 | rootView.findViewById(R.id.pair_progress).setVisibility(View.GONE); | 357 | rootView.findViewById(R.id.pair_progress).setVisibility(View.GONE); | ||
417 | rootView.findViewById(R.id.pair_button).setVisibility(View.VISIBLE); | 358 | rootView.findViewById(R.id.pair_button).setVisibility(View.VISIBLE); | ||
418 | rootView.findViewById(R.id.pair_request).setVisibility(View.GONE); | 359 | rootView.findViewById(R.id.pair_request).setVisibility(View.GONE); | ||
419 | refreshUI(); | 360 | refreshUI(); | ||
420 | } | | |||
421 | }); | 361 | }); | ||
422 | } | 362 | } | ||
423 | 363 | | |||
424 | @Override | 364 | @Override | ||
425 | public void unpaired() { | 365 | public void unpaired() { | ||
426 | mActivity.runOnUiThread(new Runnable() { | 366 | mActivity.runOnUiThread(() -> { | ||
427 | @Override | | |||
428 | public void run() { | | |||
429 | if (rootView == null) return; | 367 | if (rootView == null) return; | ||
430 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(R.string.device_not_paired); | 368 | ((TextView) rootView.findViewById(R.id.pair_message)).setText(R.string.device_not_paired); | ||
431 | rootView.findViewById(R.id.pair_progress).setVisibility(View.GONE); | 369 | rootView.findViewById(R.id.pair_progress).setVisibility(View.GONE); | ||
432 | rootView.findViewById(R.id.pair_button).setVisibility(View.VISIBLE); | 370 | rootView.findViewById(R.id.pair_button).setVisibility(View.VISIBLE); | ||
433 | rootView.findViewById(R.id.pair_request).setVisibility(View.GONE); | 371 | rootView.findViewById(R.id.pair_request).setVisibility(View.GONE); | ||
434 | refreshUI(); | 372 | refreshUI(); | ||
435 | } | | |||
436 | }); | 373 | }); | ||
437 | } | 374 | } | ||
438 | 375 | | |||
439 | }; | 376 | }; | ||
440 | 377 | | |||
441 | public static void acceptPairing(final String devId, final MainActivity activity) { | 378 | public static void acceptPairing(final String devId, final MainActivity activity) { | ||
442 | final DeviceFragment frag = new DeviceFragment(devId, activity); | 379 | final DeviceFragment frag = new DeviceFragment(devId, activity); | ||
443 | BackgroundService.RunCommand(activity, new BackgroundService.InstanceCallback() { | 380 | BackgroundService.RunCommand(activity, service -> { | ||
444 | public void onServiceStart(BackgroundService service) { | | |||
445 | Device dev = service.getDevice(devId); | 381 | Device dev = service.getDevice(devId); | ||
446 | if (dev == null) { | 382 | if (dev == null) { | ||
447 | Log.w("rejectPairing", "Device no longer exists: " + devId); | 383 | Log.w("rejectPairing", "Device no longer exists: " + devId); | ||
448 | return; | 384 | return; | ||
449 | } | 385 | } | ||
450 | activity.getSupportActionBar().setTitle(dev.getName()); | 386 | activity.getSupportActionBar().setTitle(dev.getName()); | ||
451 | 387 | | |||
452 | dev.addPairingCallback(frag.pairingCallback); | 388 | dev.addPairingCallback(frag.pairingCallback); | ||
453 | dev.addPluginsChangedListener(frag.pluginsChangedListener); | 389 | dev.addPluginsChangedListener(frag.pluginsChangedListener); | ||
454 | 390 | | |||
455 | frag.device = dev; | 391 | frag.device = dev; | ||
456 | frag.device.acceptPairing(); | 392 | frag.device.acceptPairing(); | ||
457 | 393 | | |||
458 | frag.refreshUI(); | 394 | frag.refreshUI(); | ||
459 | 395 | | |||
460 | } | | |||
461 | }); | 396 | }); | ||
462 | } | 397 | } | ||
463 | 398 | | |||
464 | public static void rejectPairing(final String devId, final MainActivity activity) { | 399 | public static void rejectPairing(final String devId, final MainActivity activity) { | ||
465 | final DeviceFragment frag = new DeviceFragment(devId, activity); | 400 | final DeviceFragment frag = new DeviceFragment(devId, activity); | ||
466 | BackgroundService.RunCommand(activity, new BackgroundService.InstanceCallback() { | 401 | BackgroundService.RunCommand(activity, service -> { | ||
467 | public void onServiceStart(BackgroundService service) { | | |||
468 | Device dev = service.getDevice(devId); | 402 | Device dev = service.getDevice(devId); | ||
469 | if (dev == null) { | 403 | if (dev == null) { | ||
470 | Log.w("rejectPairing", "Device no longer exists: " + devId); | 404 | Log.w("rejectPairing", "Device no longer exists: " + devId); | ||
471 | return; | 405 | return; | ||
472 | } | 406 | } | ||
473 | activity.getSupportActionBar().setTitle(dev.getName()); | 407 | activity.getSupportActionBar().setTitle(dev.getName()); | ||
474 | 408 | | |||
475 | dev.addPairingCallback(frag.pairingCallback); | 409 | dev.addPairingCallback(frag.pairingCallback); | ||
476 | dev.addPluginsChangedListener(frag.pluginsChangedListener); | 410 | dev.addPluginsChangedListener(frag.pluginsChangedListener); | ||
477 | 411 | | |||
478 | frag.device = dev; | 412 | frag.device = dev; | ||
479 | 413 | | |||
480 | //Remove listener so buttons don't show for a while before changing the view | 414 | //Remove listener so buttons don't show for a while before changing the view | ||
481 | frag.device.removePluginsChangedListener(frag.pluginsChangedListener); | 415 | frag.device.removePluginsChangedListener(frag.pluginsChangedListener); | ||
482 | frag.device.removePairingCallback(frag.pairingCallback); | 416 | frag.device.removePairingCallback(frag.pairingCallback); | ||
483 | frag.device.rejectPairing(); | 417 | frag.device.rejectPairing(); | ||
484 | activity.onDeviceSelected(null); | 418 | activity.onDeviceSelected(null); | ||
485 | 419 | | |||
486 | frag.refreshUI(); | 420 | frag.refreshUI(); | ||
487 | } | | |||
488 | }); | 421 | }); | ||
489 | } | 422 | } | ||
490 | 423 | | |||
491 | void createPluginsList(ConcurrentHashMap<String, Plugin> plugins, int headerText, PluginClickListener onClickListener) { | 424 | void createPluginsList(ConcurrentHashMap<String, Plugin> plugins, int headerText, PluginClickListener onClickListener) { | ||
492 | if (!plugins.isEmpty()) { | 425 | if (!plugins.isEmpty()) { | ||
493 | 426 | | |||
494 | TextView header = new TextView(mActivity); | 427 | TextView header = new TextView(mActivity); | ||
495 | header.setPadding( | 428 | header.setPadding( | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |