Skip to content

Commit 680530f

Browse files
author
davidgraeff
committed
Add shortcuts. Refactor classes into packages, Add screenshots to Readme. Add group tab (todo)
1 parent 1a8b3a5 commit 680530f

Some content is hidden

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

42 files changed

+1174
-692
lines changed

AndroidManifest.xml

Lines changed: 92 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,93 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="oly.netpowerctrl"
4-
android:versionCode="1"
5-
android:versionName="1.0" >
6-
7-
<uses-sdk android:minSdkVersion="8"
8-
android:targetSdkVersion="17" />
9-
10-
<uses-permission android:name="android.permission.INTERNET"/>
11-
12-
<application
13-
android:icon="@drawable/netpowerctrl"
14-
android:label="@string/app_name" android:allowBackup="true">
15-
<activity
16-
android:name=".NetpowerctrlActivity"
17-
android:label="@string/app_name"
18-
android:configChanges="keyboardHidden|orientation|screenSize"
19-
android:theme="@style/Theme.CustomLightTheme">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
22-
<category android:name="android.intent.category.LAUNCHER" />
23-
</intent-filter>
24-
</activity>
25-
26-
<activity
27-
android:name=".DevicePreferences"
28-
android:configChanges="keyboardHidden|orientation|screenSize">
29-
</activity>
30-
31-
<activity
32-
android:name=".Preferences"
33-
android:configChanges="keyboardHidden|orientation|screenSize">
34-
</activity>
35-
36-
<activity
37-
android:name=".OutletConfig"
38-
android:configChanges="keyboardHidden|orientation|screenSize"
39-
android:windowSoftInputMode="adjustPan"> <!-- needed for focusable EditText inside ListView -->
40-
</activity>
41-
42-
<activity
43-
android:name=".DeviceControlActivity"
44-
android:configChanges="keyboardHidden|orientation|screenSize"
45-
android:theme="@style/Theme.CustomLightTheme">
46-
</activity>
47-
48-
<activity android:name=".WidgetConfig">
49-
<intent-filter>
50-
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
51-
</intent-filter>
52-
</activity>
53-
54-
<receiver
55-
android:icon="@drawable/netpowerctrl"
56-
android:label="@string/app_name"
57-
android:name=".DeviceWidgetProvider" >
58-
<intent-filter >
59-
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
60-
</intent-filter>
61-
62-
<meta-data
63-
android:name="android.appwidget.provider"
64-
android:resource="@xml/appwidget_provider" />
65-
</receiver>
66-
67-
<service
68-
android:label="@string/app_name"
69-
android:icon="@drawable/netpowerctrl"
70-
android:name=".NetpowerctrlService"
71-
android:permission="android.permission.INTERNET">
72-
</service>
73-
74-
</application>
75-
76-
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="oly.netpowerctrl"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk android:minSdkVersion="14"
8+
android:targetSdkVersion="17" />
9+
10+
<uses-permission android:name="android.permission.INTERNET"/>
11+
12+
<application
13+
android:icon="@drawable/netpowerctrl"
14+
android:label="@string/app_name" android:allowBackup="true">
15+
<activity
16+
android:name="oly.netpowerctrl.main.NetpowerctrlActivity"
17+
android:label="@string/app_name"
18+
android:configChanges="keyboardHidden|orientation|screenSize"
19+
android:theme="@style/Theme.CustomLightTheme">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
26+
<activity
27+
android:name="oly.netpowerctrl.preferences.DevicePreferencesActivity"
28+
android:configChanges="keyboardHidden|orientation|screenSize">
29+
</activity>
30+
31+
<activity android:name="oly.netpowerctrl.preferences.PreferencesActivity"
32+
android:configChanges="keyboardHidden|orientation|screenSize">
33+
</activity>
34+
35+
<activity
36+
android:name="oly.netpowerctrl.outletconfig.OutletConfig"
37+
android:configChanges="keyboardHidden|orientation|screenSize"
38+
android:windowSoftInputMode="adjustPan"> <!-- needed for focusable EditText inside ListView -->
39+
</activity>
40+
41+
<activity
42+
android:name="oly.netpowerctrl.main.DeviceControlActivity"
43+
android:configChanges="keyboardHidden|orientation|screenSize"
44+
android:theme="@style/Theme.CustomLightTheme">
45+
</activity>
46+
47+
<activity
48+
android:name="oly.netpowerctrl.service.ShortcutExecutionActivity"
49+
android:label="@string/app_name"
50+
android:icon="@drawable/netpowerctrl"
51+
android:exported="true">
52+
</activity>
53+
54+
<activity android:name="oly.netpowerctrl.service.WidgetConfig">
55+
<intent-filter>
56+
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
57+
</intent-filter>
58+
</activity>
59+
60+
<activity
61+
android:icon="@drawable/netpowerctrl"
62+
android:label="@string/app_name"
63+
android:name="oly.netpowerctrl.service.ShortcutCreatorActivity">
64+
<intent-filter>
65+
<action android:name="android.intent.action.CREATE_SHORTCUT" />
66+
<category android:name="android.intent.category.DEFAULT" />
67+
</intent-filter>
68+
</activity>
69+
70+
<receiver
71+
android:icon="@drawable/netpowerctrl"
72+
android:label="@string/app_name"
73+
android:name="oly.netpowerctrl.service.DeviceWidgetProvider" >
74+
<intent-filter >
75+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
76+
</intent-filter>
77+
78+
<meta-data
79+
android:name="android.appwidget.provider"
80+
android:resource="@xml/appwidget_provider" />
81+
</receiver>
82+
83+
<service
84+
android:label="@string/app_name"
85+
android:icon="@drawable/netpowerctrl"
86+
android:name="oly.netpowerctrl.service.NetpowerctrlService"
87+
android:permission="android.permission.INTERNET">
88+
</service>
89+
90+
</application>
91+
92+
7793
</manifest>

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# netpowerctrl
2-
netpowerctrl is an Android App for controlling **ANEL NET-PwrCtrl's** (http://www.anel-elektronik.de)
2+
netpowerctrl is an Android App for controlling ANEL NET-PwrCtrl's (http://www.anel-elektronik.de)
33
switchable network outlets.
44

55
You can find a ready to install apk at [github Releases](https://github.com/davidgraeff/netpowerctrl-sf-mirror/releases).
66
For bugs and feature requests please use [github Issues](https://github.com/davidgraeff/netpowerctrl-sf-mirror/issues).
77

88
This is an (extended) github mirror of http://sourceforge.net/projects/netpowerctrl/.
99

10+
![Picture of devices](doc/devices.png)
11+
![Picture of outlets](doc/outlets.png)
12+
1013
## Features
1114
* Devices are detected automatically on the network if they are configured for UDP communication.
1215
Default send port 1077 / receive port 1075 (can be configured). Please be aware
@@ -17,6 +20,9 @@ This is an (extended) github mirror of http://sourceforge.net/projects/netpowerc
1720

1821
Features, you can find on this repository only:
1922
* Overview of all outlets for all configured devices.
23+
* Create switch-groups to switch multiple outlets at once.
24+
* Use Shortcuts for toggling/switching on/off of individual outlets
25+
on your homescreen (or via automation apps like Tasker/Llama).
2026

2127
## Building
2228
To compile, you need the [Android SDK](http://developer.android.com/sdk).

doc/devices.png

100 KB
Loading

doc/outlets.png

189 KB
Loading

res/layout/device_list_item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
android:layout_width="wrap_content"
4545
android:layout_height="wrap_content"
4646
android:background="@android:drawable/list_selector_background"
47-
android:contentDescription="@string/edit_device"
47+
android:contentDescription="@string/configure_device"
4848
android:padding="5dp"
4949
android:src="@drawable/ic_menu_edit" />
5050

res/layout/main.xml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,27 @@
2525
android:layout_width="fill_parent"
2626
android:layout_height="fill_parent">
2727

28-
<ScrollView
29-
android:id="@+id/lvAllOutlets"
30-
android:layout_width="fill_parent"
31-
android:layout_height="fill_parent"
32-
android:layout_marginLeft="10dp"
33-
android:layout_marginRight="10dp" >
34-
35-
<LinearLayout
36-
android:id="@+id/llAllOutlets"
37-
android:layout_width="fill_parent"
38-
android:layout_height="wrap_content"
39-
android:orientation="vertical" >
40-
</LinearLayout>
41-
</ScrollView>
42-
4328
<ListView
44-
android:id="@+id/lvConfiguredDevices"
29+
android:id="@+id/lvGroups"
4530
android:layout_width="fill_parent"
4631
android:layout_height="wrap_content"
47-
android:divider="#80808080"
48-
android:dividerHeight="1dp" >
49-
</ListView>
32+
android:divider="@android:color/transparent"
33+
android:dividerHeight="10.0sp">
34+
</ListView>
5035

5136
<ListView
52-
android:id="@+id/lvDiscoveredDevices"
37+
android:id="@+id/lvAllOutlets"
5338
android:layout_width="fill_parent"
54-
android:layout_height="wrap_content"
39+
android:layout_height="wrap_content">
40+
</ListView>
41+
42+
<ListView
43+
android:id="@+id/lvDevices"
44+
android:layout_width="fill_parent"
45+
android:layout_height="wrap_content"
5546
android:divider="#80808080"
5647
android:dividerHeight="1dp" >
57-
</ListView>
58-
48+
</ListView>
5949
</FrameLayout>
6050
</LinearLayout>
6151

res/layout/outlet_config_item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
android:layout_width="wrap_content"
3434
android:layout_height="wrap_content"
3535
android:background="@android:drawable/list_selector_background"
36-
android:contentDescription="@string/edit_device"
36+
android:contentDescription="@string/configure_device"
3737
android:padding="5dp"
3838
android:src="@drawable/ic_menu_delete" />
3939

res/layout/outlet_list_item.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="wrap_content"
5+
android:baselineAligned="true"
6+
android:gravity="center_vertical"
7+
android:orientation="horizontal"
8+
android:paddingLeft="16dip"
9+
android:paddingRight="12dip" >
10+
11+
<TextView
12+
android:id="@+id/outlet_list_item"
13+
android:layout_width="0dip"
14+
android:layout_height="wrap_content"
15+
android:layout_weight="0.48"
16+
android:layout_marginBottom="5dp"
17+
android:layout_marginTop="5dp"
18+
android:text="" />
19+
20+
</LinearLayout>

res/layout/outlet_list_switch.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="wrap_content"
5+
android:baselineAligned="true"
6+
android:gravity="center_vertical"
7+
android:orientation="horizontal"
8+
android:paddingLeft="16dip"
9+
android:paddingRight="12dip" >
10+
11+
<Switch
12+
android:id="@+id/outlet_list_switch"
13+
android:layout_width="0dip"
14+
android:layout_height="wrap_content"
15+
android:layout_weight="0.48"
16+
android:layout_marginBottom="5dp"
17+
android:layout_marginTop="5dp"
18+
android:text="" />
19+
20+
</LinearLayout>

res/menu/configured_device_menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3-
<item android:id="@+id/menu_edit_device" android:title="@string/edit_device"></item>
3+
<item android:id="@+id/menu_configure_device" android:title="@string/configure_device"></item>
44
<item android:id="@+id/menu_copy_device" android:title="@string/copy_device"></item>
55
<item android:id="@+id/menu_delete_device" android:title="@string/delete_device"></item>
66
</menu>

res/menu/discovered_device_menu.xml

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

res/menu/unconfigured_device_menu.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3+
<item android:id="@+id/menu_add_device" android:title="@string/menu_add_device"></item>
4+
</menu>

res/values-de/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<string name="configured_devices">Konfigurierte Geräte</string>
66
<string name="discovered_devices">Erkannte Geräte</string>
77

8-
<string name="edit_device">Bearbeiten</string>
8+
<string name="configure_device">Bearbeiten</string>
99
<string name="copy_device">Kopieren</string>
1010
<string name="delete_device">Löschen</string>
1111
<string name="delete_all_devices">Alle löschen</string>
@@ -70,4 +70,6 @@
7070

7171
<string name="choose_widget_device">Bitte wählen Sie ein Gerät für dieses Widget</string>
7272
<string name="all_outlets">Steckdosen</string>
73+
<string name="groups">Gruppen</string>
74+
<string name="devices">Geräte</string>
7375
</resources>

res/values/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<string name="configured_devices">Configured Devices</string>
66
<string name="discovered_devices">Discovered Devices</string>
77

8-
<string name="edit_device">Edit Device</string>
8+
<string name="configure_device">Edit Device</string>
99
<string name="copy_device">Copy Device</string>
1010
<string name="delete_device">Delete Device</string>
1111
<string name="delete_all_devices">Delete all devices</string>
@@ -72,4 +72,6 @@
7272

7373
<string name="choose_widget_device">Please choose a device for this widget</string>
7474
<string name="all_outlets">Outlets</string>
75+
<string name="groups">Groups</string>
76+
<string name="devices">Devices</string>
7577
</resources>

res/xml/appwidget_provider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
android:minHeight="48dp"
66
android:minWidth="48dp"
77
android:updatePeriodMillis="86400000"
8-
android:configure="oly.netpowerctrl.WidgetConfig">
8+
android:configure="oly.netpowerctrl.service.WidgetConfig">
99
</appwidget-provider>

0 commit comments

Comments
 (0)