Small fixes

This commit is contained in:
Victor Shcherb 2014-06-02 00:07:12 +02:00
parent ba1ca526ec
commit f4a5448e6b
3 changed files with 9 additions and 8 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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,12 +192,13 @@ 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)) {
connectDeviceImpl(d); if(d.isEnabled()) {
connectDeviceImpl(d);
}
} }
storage.save(); storage.save();
} }