Skip to content

Commit 4e0b0c5

Browse files
author
davidgraeff
committed
Add missing files
Still missing / bugs: * Save scenes and configured devices as json files * NFC * Testing * Widget Updates, Update time configurable * Scenes no grid only list
1 parent dffc969 commit 4e0b0c5

31 files changed

+595
-0
lines changed

.idea/dictionaries/david.xml

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

.idea/inspectionProfiles/Project_Default.xml

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

.idea/inspectionProfiles/profiles_settings.xml

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

.idea/libraries/support_v4_19_0_0.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package oly.netpowerctrl.anelservice;
2+
3+
/**
4+
* Created by david on 30.12.13.
5+
*/
6+
public interface DeviceError {
7+
void onDeviceError(String devicename, String errMessage);
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package oly.netpowerctrl.anelservice;
2+
3+
import oly.netpowerctrl.datastructure.DeviceInfo;
4+
5+
/**
6+
* Issued by the listener service through the
7+
* application instance.
8+
*/
9+
public interface DeviceUpdated {
10+
void onDeviceUpdated(DeviceInfo di);
11+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package oly.netpowerctrl.main;
2+
3+
import android.app.AlertDialog;
4+
import android.app.Dialog;
5+
import android.app.DialogFragment;
6+
import android.content.DialogInterface;
7+
import android.content.Intent;
8+
import android.content.pm.ApplicationInfo;
9+
import android.content.pm.PackageManager;
10+
import android.net.Uri;
11+
import android.os.Build;
12+
import android.os.Bundle;
13+
import android.view.LayoutInflater;
14+
15+
import oly.netpowerctrl.R;
16+
17+
public class FeedbackDialog extends DialogFragment {
18+
19+
public FeedbackDialog() {
20+
}
21+
22+
@Override
23+
public Dialog onCreateDialog(Bundle savedInstanceState) {
24+
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
25+
LayoutInflater inflater = getActivity().getLayoutInflater();
26+
builder.setIcon(R.drawable.netpowerctrl);
27+
builder.setTitle(R.string.app_name);
28+
builder.setItems(R.array.feedbackOptions, new DialogInterface.OnClickListener() {
29+
public void onClick(DialogInterface dialog, int which) {
30+
if (which == 0) { // mail
31+
@SuppressWarnings("ConstantConditions")
32+
ApplicationInfo info = getActivity().getApplicationContext().getApplicationInfo();
33+
PackageManager pm = getActivity().getApplicationContext().getPackageManager();
34+
Intent intent = new Intent(Intent.ACTION_SEND);
35+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
36+
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
37+
try {
38+
intent.putExtra(Intent.EXTRA_SUBJECT, info.loadLabel(pm).toString() + "(" + pm.getPackageInfo(info.packageName, 0).versionName + ")" + " Contact Form | Device: " + Build.MANUFACTURER + " " + Build.DEVICE + "(" + Build.MODEL + ") API: " + Build.VERSION.SDK_INT);
39+
} catch (PackageManager.NameNotFoundException ignored) {
40+
}
41+
intent.setType("plain/html");
42+
getActivity().startActivity(intent);
43+
} else if (which == 1) { // bugtracker
44+
@SuppressWarnings("ConstantConditions")
45+
Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/davidgraeff/Android-NetPowerctrl/issues"));
46+
getActivity().startActivity(browse);
47+
} else if (which == 2) {
48+
@SuppressWarnings("ConstantConditions")
49+
Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/davidgraeff/Android-NetPowerctrl"));
50+
getActivity().startActivity(browse);
51+
} else if (which == 3) {
52+
@SuppressWarnings("ConstantConditions")
53+
Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getActivity().getPackageName()));
54+
getActivity().startActivity(browse);
55+
}
56+
57+
}
58+
});
59+
60+
return builder.create();
61+
}
62+
}

0 commit comments

Comments
 (0)