entfernung des alert dialogs und des auswalbuttons für den plot

This commit is contained in:
m_broelemann 2021-01-08 02:46:39 +01:00
parent f6a3b0b044
commit 1fad23cce3
2 changed files with 0 additions and 43 deletions

View File

@ -36,8 +36,6 @@ public class PlotFragment extends Fragment {
private List<String> bufferedDevices;
/** Line Chart View that is displayed **/
private GraphView graphView;
/** List of all the devices with buffers. **/
private List<String> 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;
}

View File

@ -11,13 +11,4 @@
android:id="@+id/graph"/>
android:layout_height="match_parent"/>
<Button
android:id="@+id/button_alert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="chose devices"
android:layout_gravity="top|end"
android:layout_margin="4dp"
android:textSize="15dp"
android:background="@color/red"/>
</FrameLayout>