Skip to content

Commit abe39df

Browse files
author
David Gräff
committed
rename files: Interfaces have ...Interfaces suffix. If an Interface has callback character it is named onXYZ without interface suffix. Unused files are removed. App store feature image added. Added new method to PluginInterface: "EditDeviceInterface openEditDevice(Device device)". New device and edit device fragments are now fully independent of the anel plugin.
1 parent dc9de22 commit abe39df

File tree

126 files changed

+1708
-6046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1708
-6046
lines changed

.idea/workspace.xml

Lines changed: 524 additions & 610 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
defaultConfig {
1717
minSdkVersion 14
1818
targetSdkVersion 20
19-
versionCode 83
20-
versionName "5.7.2"
19+
versionCode 84
20+
versionName "5.8"
2121
applicationId appID
2222
testApplicationId "oly.netpowerctrl.tests"
2323
testInstrumentationRunner "android.test.InstrumentationTestRunner"

app/src/lint-result.xml

Lines changed: 0 additions & 4591 deletions
This file was deleted.

app/src/main/java/oly/netpowerctrl/anel/AnelCreateDevice.java renamed to app/src/main/java/oly/netpowerctrl/anel/AnelEditDevice.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,22 @@
1010
import oly.netpowerctrl.device_ports.DevicePort;
1111
import oly.netpowerctrl.devices.Device;
1212
import oly.netpowerctrl.devices.DeviceCollection;
13+
import oly.netpowerctrl.devices.EditDeviceInterface;
14+
import oly.netpowerctrl.devices.onCreateDeviceResult;
1315
import oly.netpowerctrl.listen_service.PluginInterface;
14-
import oly.netpowerctrl.network.DeviceObserverResult;
1516
import oly.netpowerctrl.network.DeviceQuery;
17+
import oly.netpowerctrl.network.onDeviceObserverResult;
1618

1719
/**
1820
* Created by david on 20.08.14.
1921
*/
20-
public class AnelCreateDevice implements DeviceObserverResult, onCollectionUpdated<DeviceCollection, Device> {
21-
public final Device device;
22-
public AnelCreateDeviceResult listener = null;
22+
public class AnelEditDevice implements onDeviceObserverResult, onCollectionUpdated<DeviceCollection, Device>, EditDeviceInterface {
2323
TestStates test_state = TestStates.TEST_INIT;
24+
private Device device;
25+
private onCreateDeviceResult listener = null;
2426
private DeviceQuery deviceQuery;
2527

26-
public AnelCreateDevice(Device di) {
27-
assert di != null;
28-
device = di;
29-
}
30-
31-
public AnelCreateDevice(String defaultDeviceName, Device di) {
28+
public AnelEditDevice(String defaultDeviceName, Device di) {
3229
if (di == null) {
3330
device = new Device(AnelUDPDeviceDiscoveryThread.anelPlugin.getPluginID());
3431
device.DeviceName = defaultDeviceName;
@@ -40,6 +37,7 @@ public AnelCreateDevice(String defaultDeviceName, Device di) {
4037
device = di;
4138
}
4239

40+
@Override
4341
public boolean wakeupPlugin(Context context) {
4442
PluginInterface pluginInterface = device.getPluginInterface();
4543
if (pluginInterface != null) {
@@ -85,6 +83,10 @@ public boolean isTesting() {
8583
return test_state != TestStates.TEST_INIT && test_state != TestStates.TEST_OK;
8684
}
8785

86+
public boolean isTestOK() {
87+
return test_state == TestStates.TEST_OK;
88+
}
89+
8890
@Override
8991
public boolean updated(DeviceCollection deviceCollection, Device updated_device, ObserverUpdateActions action) {
9092
if (!updated_device.equalsByUniqueID(device))
@@ -135,11 +137,19 @@ public void run() {
135137
return true;
136138
}
137139

138-
enum TestStates {TEST_INIT, TEST_REACHABLE, TEST_ACCESS, TEST_OK}
140+
@Override
141+
public Device getDevice() {
142+
return device;
143+
}
139144

140-
public interface AnelCreateDeviceResult {
141-
void testFinished(boolean success);
145+
@Override
146+
public void setDevice(Device di) {
147+
assert di != null;
148+
device = di;
149+
}
142150

143-
void testDeviceNotReachable();
151+
@Override
152+
public void setResultListener(onCreateDeviceResult createDeviceResult) {
153+
listener = createDeviceResult;
144154
}
145155
}

app/src/main/java/oly/netpowerctrl/anel/AnelEditDeviceFragmentDialog.java

Lines changed: 0 additions & 228 deletions
This file was deleted.

0 commit comments

Comments
 (0)