Skip to content

Commit

Permalink
Code reformat
Browse files Browse the repository at this point in the history
Code reformat
  • Loading branch information
galadril committed Jun 8, 2017
1 parent 2357a3a commit 1c4902b
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ public class LocationInfo {

private boolean isSceneOrGroup = false;

public LocationInfo(int id, String name, LatLng latLng, int radius) {
this.name = name;
this.latLng = latLng;
this.id = id;
this.radius = radius;
}

public boolean isSceneOrGroup() {
return isSceneOrGroup;
}

public void setSceneOrGroup(boolean sceneOrGroup) {
isSceneOrGroup = sceneOrGroup;
}
public LocationInfo(int id, String name, LatLng latLng, int radius) {
this.name = name;
this.latLng = latLng;
this.id = id;
this.radius = radius;
}

public String getName() {
if (UsefulBits.isEmpty(name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public boolean isSceneOrGroup() {
public void setSceneOrGroup(boolean sceneOrGroup) {
isSceneOrGroup = sceneOrGroup;
}

public String getId() {
return id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public boolean isSceneOrGroup() {
public void setSceneOrGroup(boolean sceneOrGroup) {
isSceneOrGroup = sceneOrGroup;
}

public String getId() {
return id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ private void showSwitchesDialog(
final ArrayList<DevicesInfo> switches) {

final ArrayList<DevicesInfo> supportedSwitches = new ArrayList<>();
for(DevicesInfo d : switches){
if(DeviceUtils.isAutomatedToggableDevice(d))
for (DevicesInfo d : switches) {
if (DeviceUtils.isAutomatedToggableDevice(d))
supportedSwitches.add(d);
}

Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/nl/hnogames/domoticz/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) {
jsonAction = DomoticzValues.Device.Switch.Action.OFF;
break;
}
}
else
{
} else {
jsonUrl = DomoticzValues.Json.Url.Set.SCENES;
if (inputJSONAction < 0) {
if (!mDevicesInfo.getStatusBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ private void showSwitchesDialog(
ArrayList<DevicesInfo> switches) {

final ArrayList<DevicesInfo> supportedSwitches = new ArrayList<>();
for(DevicesInfo d : switches){
if(DeviceUtils.isAutomatedToggableDevice(d))
for (DevicesInfo d : switches) {
if (DeviceUtils.isAutomatedToggableDevice(d))
supportedSwitches.add(d);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ private void showSwitchesDialog(
final ArrayList<DevicesInfo> switches) {

final ArrayList<DevicesInfo> supportedSwitches = new ArrayList<>();
for(DevicesInfo d : switches){
if(DeviceUtils.isAutomatedToggableDevice(d))
for (DevicesInfo d : switches) {
if (DeviceUtils.isAutomatedToggableDevice(d))
supportedSwitches.add(d);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ private void handleSwitch(final int idx, final String password, final int inputJ

domoticz.getDevice(new DevicesReceiver() {
@Override
public void onReceiveDevices(ArrayList<DevicesInfo> mDevicesInfo) {}
public void onReceiveDevices(ArrayList<DevicesInfo> mDevicesInfo) {
}

@Override
public void onReceiveDevice(DevicesInfo mDevicesInfo) {
Expand Down Expand Up @@ -168,9 +169,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) {
jsonAction = DomoticzValues.Device.Switch.Action.OFF;
break;
}
}
else
{
} else {
jsonUrl = DomoticzValues.Json.Url.Set.SCENES;
if (inputJSONAction < 0) {
if (!mDevicesInfo.getStatusBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) {
jsonAction = DomoticzValues.Device.Switch.Action.OFF;
break;
}
}
else
{
} else {
jsonUrl = DomoticzValues.Json.Url.Set.SCENES;
if (inputJSONAction < 0) {
if (!mDevicesInfo.getStatusBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ private void showSwitchesDialog(
final ArrayList<DevicesInfo> switches) {

final ArrayList<DevicesInfo> supportedSwitches = new ArrayList<>();
for(DevicesInfo d : switches){
if(DeviceUtils.isAutomatedToggableDevice(d))
for (DevicesInfo d : switches) {
if (DeviceUtils.isAutomatedToggableDevice(d))
supportedSwitches.add(d);
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
public class DeviceUtils {

//Check is a Domoticz Device is toggable by NFC, Geofences or QRCodes
public static boolean isAutomatedToggableDevice(DevicesInfo mDeviceInfo){
if(mDeviceInfo.equals(null))
public static boolean isAutomatedToggableDevice(DevicesInfo mDeviceInfo) {
if (mDeviceInfo.equals(null))
return false;
if (mDeviceInfo.getSwitchTypeVal() == 0 &&
(mDeviceInfo.getSwitchType() == null)) {
Expand Down

0 comments on commit 1c4902b

Please sign in to comment.