Small fixes
This commit is contained in:
parent
ba1ca526ec
commit
f4a5448e6b
3 changed files with 9 additions and 8 deletions
|
@ -1,13 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical" >
|
android:layout_gravity="center_vertical" >
|
||||||
|
|
||||||
<Switch
|
<Switch
|
||||||
android:id="@+id/check_item"
|
android:id="@+id/check_item"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical" >
|
android:layout_gravity="center_vertical" >
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/check_item"
|
android:id="@+id/check_item"
|
||||||
android:text="@string/osmo_connect_menu"
|
android:text="@string/osmo_connect_menu"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="3dp"
|
android:layout_marginLeft="3dp"
|
||||||
android:layout_marginRight="3dp"
|
android:layout_marginRight="3dp"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
|
|
|
@ -123,12 +123,12 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disconnectDevice(OsMoDevice model) {
|
public void disconnectDevice(OsMoDevice model) {
|
||||||
|
model.enabled = false;
|
||||||
disconnectImpl(model);
|
disconnectImpl(model);
|
||||||
storage.save();
|
storage.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disconnectImpl(OsMoDevice model) {
|
private void disconnectImpl(OsMoDevice model) {
|
||||||
model.enabled = false;
|
|
||||||
model.active = false;
|
model.active = false;
|
||||||
tracker.stopTrackingId(model);
|
tracker.stopTrackingId(model);
|
||||||
}
|
}
|
||||||
|
@ -192,13 +192,14 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener {
|
||||||
} else if(command.equalsIgnoreCase("GROUP_CONNECT")) {
|
} else if(command.equalsIgnoreCase("GROUP_CONNECT")) {
|
||||||
group = storage.getGroup(gid);
|
group = storage.getGroup(gid);
|
||||||
if(group != null) {
|
if(group != null) {
|
||||||
group.users.clear();
|
|
||||||
mergeGroup(group, obj, true);
|
mergeGroup(group, obj, true);
|
||||||
group.active = true;
|
group.active = true;
|
||||||
// connect to all devices in group
|
// connect to enabled devices in group
|
||||||
for(OsMoDevice d : group.getGroupUsers(null)) {
|
for(OsMoDevice d : group.getGroupUsers(null)) {
|
||||||
|
if(d.isEnabled()) {
|
||||||
connectDeviceImpl(d);
|
connectDeviceImpl(d);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
storage.save();
|
storage.save();
|
||||||
}
|
}
|
||||||
processed = true;
|
processed = true;
|
||||||
|
|
Loading…
Reference in a new issue