From 1fad23cce3365536842841933519fe1a6241dcd3 Mon Sep 17 00:00:00 2001 From: m_broelemann Date: Fri, 8 Jan 2021 02:46:39 +0100 Subject: [PATCH] =?UTF-8?q?entfernung=20des=20alert=20dialogs=20und=20des?= =?UTF-8?q?=20auswalbuttons=20f=C3=BCr=20den=20plot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/aped/ui/plots/PlotFragment.java | 34 ------------------- .../app/src/main/res/layout/fragment_plot.xml | 9 ----- 2 files changed, 43 deletions(-) diff --git a/APED/app/src/main/java/com/example/aped/ui/plots/PlotFragment.java b/APED/app/src/main/java/com/example/aped/ui/plots/PlotFragment.java index e36cd73..16f726b 100644 --- a/APED/app/src/main/java/com/example/aped/ui/plots/PlotFragment.java +++ b/APED/app/src/main/java/com/example/aped/ui/plots/PlotFragment.java @@ -36,8 +36,6 @@ public class PlotFragment extends Fragment { private List bufferedDevices; /** Line Chart View that is displayed **/ private GraphView graphView; - /** List of all the devices with buffers. **/ - private List bufferedDevicesSelected; /** maximum value on X axis. **/ private int maxX = 0; @@ -62,38 +60,6 @@ public class PlotFragment extends Fragment { getBufferedValues(mainActivity.getDelivery(), mainActivity.getXml()); mainActivity.getConfigurationHandler().setCurrentView(R.id.nav_plots); - Button buttonChoseDevice = view.findViewById(R.id.button_alert); - buttonChoseDevice.setOnClickListener(new View.OnClickListener() { - - @Override - public void onClick(final View v) { - bufferedDevicesSelected = new ArrayList<>(); - MaterialAlertDialogBuilder alertDialogBuilder = new MaterialAlertDialogBuilder(mainActivity); - alertDialogBuilder.setTitle("Choose your devices"); - alertDialogBuilder.setMultiChoiceItems(bufferedDevices.toArray(new String[bufferedDevices.size()]), null, new DialogInterface.OnMultiChoiceClickListener() { - @Override - public void onClick(final DialogInterface dialog, final int which, final boolean isChecked) { - if (isChecked) { - bufferedDevicesSelected.add(bufferedDevices.get(which)); - } else if (bufferedDevices.contains(bufferedDevices.get(which))) { - bufferedDevicesSelected.remove(bufferedDevices.get(which)); - } - } - }); - alertDialogBuilder.setPositiveButton("display", new DialogInterface.OnClickListener() { - @Override - public void onClick(final DialogInterface dialog, final int which) { - String data = ""; - for (String item:bufferedDevicesSelected) { - data = data + " " + item; - } - Toast.makeText(mainActivity, data, Toast.LENGTH_SHORT).show(); - } - }); - alertDialogBuilder.create(); - alertDialogBuilder.show(); - } - }); return view; } diff --git a/APED/app/src/main/res/layout/fragment_plot.xml b/APED/app/src/main/res/layout/fragment_plot.xml index 3cb85a9..5a466a8 100644 --- a/APED/app/src/main/res/layout/fragment_plot.xml +++ b/APED/app/src/main/res/layout/fragment_plot.xml @@ -11,13 +11,4 @@ android:id="@+id/graph"/> android:layout_height="match_parent"/> -