Skip to content

Commit 2be118a

Browse files
author
davidgraeff
committed
Make Lint happy; Add copy of strings for english local; Change about dialog content; Add packages; Add group name support
1 parent 822d134 commit 2be118a

38 files changed

+936
-429
lines changed

AndroidManifest.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="oly.netpowerctrl"
4-
android:versionCode="1"
5-
android:versionName="1.0" >
4+
android:versionCode="3"
5+
android:versionName="1.2" >
66

77
<uses-sdk android:minSdkVersion="14"
88
android:targetSdkVersion="17" />
@@ -39,7 +39,7 @@
3939
</activity>
4040

4141
<activity
42-
android:name="oly.netpowerctrl.main.DeviceControlActivity"
42+
android:name="oly.netpowerctrl.devicecontrol.DeviceControlActivity"
4343
android:configChanges="keyboardHidden|orientation|screenSize"
4444
android:theme="@style/Theme.CustomLightTheme">
4545
</activity>
@@ -51,7 +51,7 @@
5151
android:exported="true">
5252
</activity>
5353

54-
<activity android:name="oly.netpowerctrl.service.WidgetConfig">
54+
<activity android:name="oly.netpowerctrl.widget.WidgetConfig">
5555
<intent-filter>
5656
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
5757
</intent-filter>
@@ -70,7 +70,7 @@
7070
<receiver
7171
android:icon="@drawable/netpowerctrl"
7272
android:label="@string/app_name"
73-
android:name="oly.netpowerctrl.service.DeviceWidgetProvider" >
73+
android:name="oly.netpowerctrl.widget.DeviceWidgetProvider" >
7474
<intent-filter >
7575
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
7676
</intent-filter>

res/layout/about.xml

+14-8
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,25 @@
1919
android:layout_width="fill_parent"
2020
android:layout_height="wrap_content"
2121
android:layout_gravity="center"
22-
android:gravity="center" />
22+
android:gravity="center"
23+
android:linksClickable="true"
24+
android:autoLink="web"/>
2325

2426
</TableRow>
2527

2628
<TableRow>
27-
<TextView
28-
android:id="@+id/tvAboutCopyright"
29+
<Button
30+
android:id="@+id/tvAboutStore"
31+
android:layout_width="fill_parent"
32+
android:layout_height="wrap_content"
33+
android:layout_span="2" />
34+
</TableRow>
35+
<TableRow>
36+
<Button
37+
android:id="@+id/tvAboutSource"
2938
android:layout_width="fill_parent"
3039
android:layout_height="wrap_content"
31-
android:textSize="10dip"
32-
android:textStyle="italic"
33-
android:layout_span="2"
34-
android:layout_margin="8dip"
35-
android:textColor="#cccccc" />
40+
android:layout_span="2" />
3641
</TableRow>
42+
3743
</TableLayout>

res/layout/device_list_item.xml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
android:paddingRight="12dip" >
1010

1111
<LinearLayout
12-
xmlns:android="http://schemas.android.com/apk/res/android"
1312
android:layout_width="0dp"
1413
android:layout_height="wrap_content"
1514
android:layout_marginBottom="5dp"

res/layout/group_list_item.xml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
<LinearLayout
12+
android:layout_width="0dp"
13+
android:layout_height="wrap_content"
14+
android:layout_marginBottom="5dp"
15+
android:layout_marginTop="5dp"
16+
android:layout_weight="1"
17+
android:orientation="vertical" >
18+
19+
<TextView
20+
android:id="@+id/group_list_name"
21+
android:layout_width="fill_parent"
22+
android:layout_height="wrap_content"
23+
android:textSize="16sp"
24+
android:textStyle="bold" />
25+
26+
<TextView
27+
android:id="@+id/group_list_details"
28+
android:layout_width="fill_parent"
29+
android:layout_height="wrap_content"
30+
android:textSize="16sp" />
31+
</LinearLayout>
32+
33+
<View
34+
android:layout_width="1dp"
35+
android:layout_height="fill_parent"
36+
android:layout_marginBottom="10dp"
37+
android:layout_marginTop="10dp"
38+
android:background="#80808080" />
39+
40+
<ImageButton
41+
android:id="@+id/btnRemoveGroup"
42+
android:layout_width="wrap_content"
43+
android:layout_height="wrap_content"
44+
android:background="@android:drawable/list_selector_background"
45+
android:contentDescription="@string/delete_device"
46+
android:padding="5dp"
47+
android:src="@drawable/ic_menu_delete" />
48+
49+
</LinearLayout>
File renamed without changes.

res/layout/outlet_list_item.xml

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="fill_parent"
44
android:layout_height="wrap_content"
5-
android:baselineAligned="true"
6-
android:gravity="center_vertical"
75
android:orientation="horizontal"
86
android:paddingLeft="16dip"
97
android:paddingRight="12dip" >
108

9+
<Spinner
10+
android:id="@+id/outlet_list_spinner"
11+
android:layout_width="0dp"
12+
android:layout_height="wrap_content"
13+
android:layout_weight="0.30" />
14+
1115
<TextView
12-
android:id="@+id/outlet_list_item"
13-
android:layout_width="0dip"
16+
android:id="@+id/outlet_list_text"
17+
android:layout_width="0dp"
1418
android:layout_height="wrap_content"
15-
android:layout_weight="0.48"
16-
android:layout_marginBottom="5dp"
17-
android:layout_marginTop="5dp"
19+
android:layout_gravity="fill"
20+
android:layout_weight="0.70"
1821
android:text="" />
19-
22+
2023
</LinearLayout>

res/layout/shortcut_activity.xml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical" >
6+
7+
<ListView
8+
android:id="@+id/lvOutletSelect"
9+
android:layout_width="match_parent"
10+
android:layout_height="0dp"
11+
android:layout_marginBottom="5dp"
12+
android:layout_marginTop="5dp"
13+
android:layout_weight="1" >
14+
15+
</ListView>
16+
17+
<LinearLayout
18+
style="?android:attr/buttonBarStyle"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:gravity="bottom|right"
22+
android:padding="5dp"
23+
android:orientation="horizontal" >
24+
25+
<Button
26+
style="?android:attr/buttonBarButtonStyle"
27+
android:id="@+id/btnCancelShortcut"
28+
android:layout_width="0dp"
29+
android:layout_height="wrap_content"
30+
android:layout_weight="1"
31+
android:text="@android:string/cancel"
32+
android:drawableLeft="@drawable/ic_menu_close_clear_cancel" />
33+
34+
<Button
35+
style="?android:attr/buttonBarButtonStyle"
36+
android:id="@+id/btnAcceptShortcut"
37+
android:layout_width="0dp"
38+
android:layout_height="wrap_content"
39+
android:layout_weight="1"
40+
android:text="@android:string/ok"
41+
android:drawableLeft="@android:drawable/ic_menu_save" />
42+
43+
</LinearLayout>
44+
45+
</LinearLayout>

res/menu/unconfigured_device_menu.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
33
<item android:id="@+id/menu_add_device" android:title="@string/menu_add_device"></item>
4+
<item android:id="@+id/menu_remove_group" android:title="@string/menu_remove_group"></item>
45
</menu>

res/raw/about.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h3>NET-PwrCtrl</h3>
1+
<h3>NET-PwrCtrl</h3>
2+
VersionX<br>
23

3-
Version 1.0<br>
4-
Copyright 2012<br>
5-
<b>www.nittka.com</b>
4+
© 2013 <b>David Gräff</b><br>
5+
© 2012 <b><a href="http://www.nittka.com">Oliver Nittka</a></b><br><br>

res/values-de/strings.xml

+18
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<string name="device_name_summary">Beliebige Bezeichnung für dieses Gerät.</string>
3535
<string name="device_ip">Hostname or IP</string>
3636
<string name="device_ip_summary">Der Hostname oder die IP-Adresse für dieses Gerät.</string>
37+
<string name="device_mac">MAC Adresse</string>
38+
<string name="device_mac_summary">Die MAC Adresse des Geräts.</string>
3739
<string name="device_default_ports">Standard UDP-Ports?</string>
3840
<string name="device_send_udp">UDP-Port zum Senden</string>
3941
<string name="device_send_udp_summary">Siehe \"Empfangen\" in der Web-Oberfläche des Gerätes.</string>
@@ -47,6 +49,7 @@
4749
<string name="device_outlets_summary">Konfiguration der einzelnen Steckdosen des Gerätes</string>
4850

4951
<string name="menu_add_device">Neues Gerät</string>
52+
<string name="menu_remove_group">Gruppe entfernen</string>
5053
<string name="menu_about">Über</string>
5154
<string name="menu_cancel">Abbruch</string>
5255
<string name="menu_delete_all">Alle löschen</string>
@@ -69,7 +72,22 @@
6972
<string name="outlet_delete">Löschen</string>
7073

7174
<string name="choose_widget_device">Bitte wählen Sie ein Gerät für dieses Widget</string>
75+
<string name="choose_shortcut_outlets">Erstelle Shortcut/Gruppe</string>
7276
<string name="all_outlets">Steckdosen</string>
7377
<string name="groups">Gruppen</string>
7478
<string name="devices">Geräte</string>
79+
80+
<string name="groupname">Gruppename</string>
81+
<string name="groupname_long">Bitte geben Sie einen neuen Gruppennamen ein</string>
82+
83+
<string name="off">Aus</string>
84+
<string name="on">An</string>
85+
<string name="toggle">Wechsel</string>
86+
87+
<string-array name="shortcutchoices">
88+
<item>Ignorieren</item>
89+
<item>Aussschalten</item>
90+
<item>Einschalten</item>
91+
<item>Umschalten</item>
92+
</string-array>
7593
</resources>

res/values-en/strings.xml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">Net-PwrCtrl</string>
4+
5+
<string name="configured_devices">Configured Devices</string>
6+
<string name="discovered_devices">Discovered Devices</string>
7+
8+
<string name="configure_device">Edit Device</string>
9+
<string name="copy_device">Copy Device</string>
10+
<string name="delete_device">Delete Device</string>
11+
<string name="delete_all_devices">Delete all devices</string>
12+
<string name="requery">Re-start discovery</string>
13+
<string name="add_to_configured_devices">Add to configured devices</string>
14+
<string name="error_reading_configured_devices">Error reading configured devices</string>
15+
<string name="error_saving_configured_devices">Error saving configured devices</string>
16+
<string name="suggest_enter_username_password">You probably need to set the username/password in the device\'s settings.</string>
17+
<string name="error_sending_inquiry">Error sending inquiry packet</string>
18+
<string name="error_unknown_device">Internal program error: device unknown!</string>
19+
<string name="error_outlet_number">Configuration error: this outlet was not assigned a number!</string>
20+
<string name="error_packet_received">An error was received from the device: </string>
21+
<string name="error_nopass">Invalid username / password combination</string>
22+
<string name="error_edited_device_not_found">Internal program error: edited device not found!</string>
23+
<string name="error_listen_thread_exception">Could not listen on port %d:\n</string>
24+
<string name="error_port_lt_1024">(ports &lt; 1024 only possible on rooted devices)</string>
25+
<string name="error_outlet_title">Outlet data error</string>
26+
<string name="error_outlet_config_name">Please enter a description for every outlet.</string>
27+
<string name="error_outlet_config_number">Please enter only valid outlet numbers.</string>
28+
<string name="error_port_config_number">Please enter only valid port numbers.</string>
29+
<string name="error_getting_first_packet">No answer from the device. Either the ports are not configured correctly or it is out of reach. You may try sending comands, but the result is uncertain.</string>
30+
<string name="error_setting_outlet">No answer from the device or you don\'t gave the required permission to switch the outlet.</string>
31+
32+
<string name="device_settings">Device Settings</string>
33+
<string name="device_name">Name</string>
34+
<string name="device_name_summary">Custom description of this device.</string>
35+
<string name="device_ip">Hostname or IP</string>
36+
<string name="device_ip_summary">The hostname or IP address to connect to.</string>
37+
<string name="device_mac">MAC Address</string>
38+
<string name="device_mac_summary">The MAC Address as reported by the device.</string>
39+
<string name="device_default_ports">Default UDP ports?</string>
40+
<string name="device_send_udp">UDP port for sending</string>
41+
<string name="device_send_udp_summary">Consult the device\'s web interface ("Receive Port").</string>
42+
<string name="device_recv_udp">UDP port for receiving</string>
43+
<string name="device_recv_udp_summary">Consult the device\'s web interface ("Send Port").</string>
44+
<string name="device_username">Username</string>
45+
<string name="device_username_summary">The username to log on to the device. Can be configured from the device\'s web interface</string>
46+
<string name="device_password">Password</string>
47+
<string name="device_password_summary">The password to log on to the device.</string>
48+
<string name="device_outlets">Outlets</string>
49+
<string name="device_outlets_summary">Configure this device\'s outlets</string>
50+
51+
<string name="menu_add_device">Add</string>
52+
<string name="menu_remove_group">Delete group</string>
53+
<string name="menu_about">About</string>
54+
<string name="menu_cancel">Cancel</string>
55+
<string name="menu_delete_all">Delete all</string>
56+
<string name="menu_preferences">Preferences</string>
57+
<string name="menu_refresh">Refresh</string>
58+
59+
<string name="default_device_name">New device</string>
60+
<string name="copy_of">Copy of %s</string>
61+
62+
<string name="confirmation_delete_device">Are you sure you want to delete this device?</string>
63+
<string name="confirmation_delete_all_devices">Are you sure you want to delete all devices?</string>
64+
65+
<string name="preference_standard_send_port">Standard UDP port for sending queries</string>
66+
<string name="preference_standard_send_port_summary">Queries will be sent to this port. (This corresponds to the \"RECEIVE\" port in the device\'s web interface)</string>
67+
<string name="preference_standard_recv_port">Standard UDP port for receiving from the device</string>
68+
<string name="preference_standard_recv_port_summary">The application will listen on this port for answers (and on each port of your configured devices, if any). This corresponds to the \"SEND\" port in the device\'s web interface</string>
69+
70+
<string name="outlet_name">Name</string>
71+
<string name="outlet_numbers">Number</string>
72+
<string name="outlet_delete">Delete</string>
73+
74+
<string name="choose_widget_device">Please choose a device for this widget</string>
75+
<string name="choose_shortcut_outlets">Create Shortcut/Group</string>
76+
<string name="all_outlets">Outlets</string>
77+
<string name="groups">Groups</string>
78+
<string name="devices">Devices</string>
79+
80+
<string name="groupname">Group name</string>
81+
<string name="groupname_long">Please enter a new group name</string>
82+
83+
<string name="off">Off</string>
84+
<string name="on">On</string>
85+
<string name="toggle">Toggle</string>
86+
87+
<string-array name="shortcutchoices">
88+
<item>No change</item>
89+
<item>Switch off</item>
90+
<item>Switch on</item>
91+
<item>Toggle</item>
92+
</string-array>
93+
</resources>

res/values/strings.xml

+16
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
<string name="menu_add_device">Add</string>
5252
<string name="menu_about">About</string>
53+
<string name="menu_remove_group">Delete group</string>
5354
<string name="menu_cancel">Cancel</string>
5455
<string name="menu_delete_all">Delete all</string>
5556
<string name="menu_preferences">Preferences</string>
@@ -71,7 +72,22 @@
7172
<string name="outlet_delete">Delete</string>
7273

7374
<string name="choose_widget_device">Please choose a device for this widget</string>
75+
<string name="choose_shortcut_outlets">Create Shortcut/Group</string>
7476
<string name="all_outlets">Outlets</string>
7577
<string name="groups">Groups</string>
7678
<string name="devices">Devices</string>
79+
80+
<string name="groupname">Group name</string>
81+
<string name="groupname_long">Please enter a new group name</string>
82+
83+
<string name="off">Off</string>
84+
<string name="on">On</string>
85+
<string name="toggle">Toggle</string>
86+
87+
<string-array name="shortcutchoices">
88+
<item>No change</item>
89+
<item>Switch off</item>
90+
<item>Switch on</item>
91+
<item>Toggle</item>
92+
</string-array>
7793
</resources>

0 commit comments

Comments
 (0)