diff --git a/README.md b/README.md index 60c41f3c2..bac7f5c3b 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,19 @@ This is a Android client for Domoticz and is available for download in the Play ----- **Domoticz** is a very light weight home automation system that lets you monitor and configure various devices like: lights, switches, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more. Notifications/alerts can be sent to any mobile device. +For Beta registration or more information check: +http://hnogames.nl/domoticz.html + # Google Play Store ----- You can download Domoticz from the Google Play Store. There is a premium and free version! Premium features are Geofencing, Android Wear and Widgets. **Free:** -[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/11994769/a4f0bd22-aa44-11e5-9151-b09c19971c7c.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz) +[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/22199304/96017fa6-e15a-11e6-99bd-6fd3412eac8e.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz) **Premium:** -[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/11994769/a4f0bd22-aa44-11e5-9151-b09c19971c7c.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz.premium) +[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/22199304/96017fa6-e15a-11e6-99bd-6fd3412eac8e.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz.premium) # Geofencing ----- diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml index 351ad0b54..7c55bc5a7 100644 --- a/app/src/debug/AndroidManifest.xml +++ b/app/src/debug/AndroidManifest.xml @@ -70,8 +70,12 @@ android:label="@string/app_name_domoticz" android:theme="@style/AppThemeMain" tools:replace="android:icon, android:label, android:theme, android:name" > + + + + - + + + @@ -240,10 +246,13 @@ - + + + @@ -78,13 +79,8 @@ - + android:host="domoticz" + android:scheme="app" /> + + @@ -248,10 +246,13 @@ - + + mDevicesInfo) { ArrayList mNewDevicesInfo = new ArrayList(); - for (DevicesInfo d : mDevicesInfo) - { - if(SmallWidgetSupported(d)) + for (DevicesInfo d : mDevicesInfo) { + if (SmallWidgetSupported(d)) mNewDevicesInfo.add(d); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java index 5ada98bc0..563c07791 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java @@ -377,7 +377,7 @@ private int withButtons(DevicesInfo s) { case DomoticzValues.Device.Type.Value.BLINDS: case DomoticzValues.Device.Type.Value.BLINDINVERTED: - if(DomoticzValues.canHandleStopButton(s)) + if (DomoticzValues.canHandleStopButton(s)) withButton = BUTTON_BLINDS; else withButton = BUTTON_ONOFF; diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentReceiver.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentReceiver.java index 161e7a01c..6b93c9f49 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentReceiver.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentReceiver.java @@ -21,7 +21,6 @@ package nl.hnogames.domoticz.Widgets; -import android.appwidget.AppWidgetManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -75,8 +74,7 @@ public void onReceive(final Context context, Intent intent) { iStart.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); iStart.putExtra("QRCODE", true); context.startActivity(iStart); - } - else { + } else { loadPasswordandValue(); if (intent.getAction().equals("nl.hnogames.domoticz.Service.WIDGET_TOGGLE_ACTION")) { @@ -98,7 +96,7 @@ public void onReceive(final Context context, Intent intent) { private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { if (mExtendedStatusInfo == null) return false; - if(smallWidget) + if (smallWidget) return true; if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && @@ -121,7 +119,7 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { return true; case DomoticzValues.Device.Type.Value.BLINDS: case DomoticzValues.Device.Type.Value.BLINDINVERTED: - if(DomoticzValues.canHandleStopButton(mExtendedStatusInfo)) + if (DomoticzValues.canHandleStopButton(mExtendedStatusInfo)) return false; else return true; @@ -164,12 +162,10 @@ private boolean isPushOffSwitch(DevicesInfo mExtendedStatusInfo) { return false; } - private void loadPasswordandValue() - { + private void loadPasswordandValue() { password = mSharedPrefs.getWidgetPassword(widgetID); value = mSharedPrefs.getWidgetValue(widgetID); - if(UsefulBits.isEmpty(value) && UsefulBits.isEmpty(password)) - { + if (UsefulBits.isEmpty(value) && UsefulBits.isEmpty(password)) { password = mSharedPrefs.getSmallWidgetPassword(widgetID); value = mSharedPrefs.getSmallWidgetValue(widgetID); } @@ -179,7 +175,7 @@ private void processSwitch(final Context context, int idx) { final Domoticz domoticz = new Domoticz(context, AppController.getInstance().getRequestQueue()); boolean isScene = mSharedPrefs.getWidgetisScene(widgetID); - if(smallWidget) + if (smallWidget) isScene = mSharedPrefs.getSmallWidgetisScene(widgetID); Log.i("PROCESS SWITCH", "Device: " + idx + " " + isScene); @@ -225,7 +221,7 @@ public void onError(Exception error) { @Override public void onReceiveScene(final SceneInfo scene) { - Log.i("SCENE TOGGLE", "Device: " + scene.getName() ); + Log.i("SCENE TOGGLE", "Device: " + scene.getName()); if (scene != null) { if (DomoticzValues.Scene.Type.SCENE.equalsIgnoreCase(scene.getType())) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java index aa558de59..a6654cc52 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java @@ -102,7 +102,7 @@ protected void onHandleIntent(Intent intent) { try { updateAppWidget(appWidgetManager, incomingAppWidgetId); } catch (NullPointerException e) { - if(e != null && !UsefulBits.isEmpty(e.getMessage())) + if (e != null && !UsefulBits.isEmpty(e.getMessage())) Log.e(WidgetProviderLarge.class.getSimpleName(), e.getMessage()); } } @@ -174,7 +174,7 @@ public void onReceiveDevice(DevicesInfo s) { views.setTextViewText(R.id.desc, text); if (withButtons == BUTTON_1 && s.getStatus() != null) { - if(s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_ON_BUTTON) + if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_ON_BUTTON) views.setTextViewText(R.id.on_button, context.getString(R.string.button_state_on)); else if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_OFF_BUTTON) views.setTextViewText(R.id.on_button, context.getString(R.string.button_state_off)); @@ -395,7 +395,7 @@ private int withButtons(DevicesInfo s) { case DomoticzValues.Device.Type.Value.BLINDS: case DomoticzValues.Device.Type.Value.BLINDINVERTED: - if(DomoticzValues.canHandleStopButton(s)) + if (DomoticzValues.canHandleStopButton(s)) withButton = BUTTON_3; else withButton = BUTTON_2; diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java index e6fc6a9a5..6a6492160 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java @@ -28,7 +28,6 @@ import android.content.Context; import android.content.Intent; import android.util.Log; -import android.view.View; import android.widget.RemoteViews; import java.util.ArrayList; @@ -85,6 +84,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, public static class UpdateWidgetService extends IntentService { private static final int WITHBUTTON = 1; private RemoteViews views; + public UpdateWidgetService() { super("UpdateWidgetService"); } @@ -100,7 +100,7 @@ protected void onHandleIntent(Intent intent) { try { updateAppWidget(appWidgetManager, incomingAppWidgetId); } catch (NullPointerException e) { - if(e != null && !UsefulBits.isEmpty(e.getMessage())) + if (e != null && !UsefulBits.isEmpty(e.getMessage())) Log.e(WidgetProviderSmall.class.getSimpleName(), e.getMessage()); } } @@ -210,14 +210,14 @@ public void onReceiveScene(SceneInfo s) { return; if (s.getStatusInString() != null) { - views.setTextViewText(R.id.title, s.getName()); - views.setTextViewText(R.id.desc, s.getStatusInString()); - views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - !s.getStatusInBoolean(), - true)); + views.setTextViewText(R.id.title, s.getName()); + views.setTextViewText(R.id.desc, s.getStatusInString()); + views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( + UpdateWidgetService.this, + appWidgetId, + idx, + !s.getStatusInBoolean(), + true)); } views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getType(), null, null, false, false, null)); diff --git a/app/src/main/res/layout/dialog_security.xml b/app/src/main/res/layout/dialog_security.xml index 6176226c7..6ab86fd28 100644 --- a/app/src/main/res/layout/dialog_security.xml +++ b/app/src/main/res/layout/dialog_security.xml @@ -24,7 +24,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/appwidget_bg_clickable" android:orientation="vertical">