Remove dependency on javafx
This commit is contained in:
parent
ff5b6b8101
commit
182a9a9b89
17
.idea/deploymentTargetDropDown.xml
Normal file
17
.idea/deploymentTargetDropDown.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="$USER_HOME$/.android/avd/Pixel_5_API_30.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-05-02T17:02:45.674283Z" />
|
||||
</component>
|
||||
</project>
|
@ -27,8 +27,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javafx.util.Pair;
|
||||
|
||||
import it.danieleverducci.ojo.R;
|
||||
import it.danieleverducci.ojo.Settings;
|
||||
import it.danieleverducci.ojo.databinding.FragmentSurveillanceBinding;
|
||||
@ -155,7 +153,7 @@ public class SurveillanceFragment extends Fragment {
|
||||
Settings settings = Settings.fromDisk(getContext());
|
||||
List<Camera> cc = settings.getCameras();
|
||||
|
||||
Pair<Integer, Integer> gridSize = calcGridDimensionsBasedOnNumberOfElements(cc.size());
|
||||
int[] gridSize = calcGridDimensionsBasedOnNumberOfElements(cc.size());
|
||||
int camIdx = 0;
|
||||
for (int r = 0; r < gridSize[0]; r++) {
|
||||
// Create row and add to row container
|
||||
@ -247,7 +245,7 @@ public class SurveillanceFragment extends Fragment {
|
||||
* Es: to display 7 elements is needed a 9-element grid, with 3 elements per side (a 3x3 grid)
|
||||
* @param elements
|
||||
*/
|
||||
private Pair<Integer, Integer> calcGridDimensionsBasedOnNumberOfElements(int elements) {
|
||||
private int[] calcGridDimensionsBasedOnNumberOfElements(int elements) {
|
||||
int rows = 1;
|
||||
int cols = 1;
|
||||
while (rows * cols < elements) {
|
||||
@ -255,7 +253,8 @@ public class SurveillanceFragment extends Fragment {
|
||||
if (rows * cols >= elements) break;
|
||||
rows += 1;
|
||||
}
|
||||
return new Pair<Integer, Integer>(rows, cols);
|
||||
int[] dimensions = {rows, cols};
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user