diff --git a/app/build.gradle b/app/build.gradle index 64223a9ed..f7a958783 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -170,20 +170,20 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.annotation:annotation:1.1.0' - implementation "com.google.firebase:firebase-core:16.0.9" + implementation "com.google.firebase:firebase-core:17.0.0" implementation "com.google.firebase:firebase-crash:16.2.1" - implementation "com.google.firebase:firebase-perf:17.0.2" - implementation "com.google.firebase:firebase-messaging:18.0.0" - implementation "com.google.firebase:firebase-ads:17.2.1" + implementation "com.google.firebase:firebase-perf:18.0.1" + implementation "com.google.firebase:firebase-messaging:19.0.1" + implementation "com.google.firebase:firebase-ads:18.0.0" implementation "com.crashlytics.sdk.android:crashlytics:2.10.1" - implementation "com.google.android.gms:play-services-analytics:16.0.8" - implementation "com.google.android.gms:play-services-wearable:16.0.1" - implementation "com.google.android.gms:play-services-maps:16.1.0" - implementation "com.google.android.gms:play-services-gcm:16.1.0" - implementation "com.google.android.gms:play-services-location:16.0.0" - implementation "com.google.android.gms:play-services-places:16.1.0" - implementation "com.google.android.gms:play-services-ads:17.2.1" + implementation "com.google.android.gms:play-services-analytics:17.0.0" + implementation "com.google.android.gms:play-services-wearable:17.0.0" + implementation "com.google.android.gms:play-services-maps:17.0.0" + implementation "com.google.android.gms:play-services-gcm:17.0.0" + implementation "com.google.android.gms:play-services-location:17.0.0" + implementation "com.google.android.gms:play-services-places:17.0.0" + implementation "com.google.android.gms:play-services-ads:18.0.0" implementation 'com.google.android.ads.consent:consent-library:1.0.7' implementation "com.github.nisrulz:recyclerviewhelper:27.1.1" diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/BluetoothAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/BluetoothAdapter.java index f34122c0e..31e194e54 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/BluetoothAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/BluetoothAdapter.java @@ -124,7 +124,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.switch_idx.setText(context.getString(R.string.connectedSwitch) + ": " + mBluetoothInfo.getSwitchIdx()); } else { holder.switch_idx.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mBluetoothInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java index 44638443a..08acfc790 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java @@ -110,7 +110,7 @@ private void SaveSorting() { @Override public DataObjectHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.camera_row, parent, false); + .inflate(R.layout.camera_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -138,16 +138,16 @@ public void onBindViewHolder(@NonNull DataObjectHolder holder, int position) { if (holder.camera.getDrawable() == null) { picasso.load(imageUrl) - .placeholder(R.drawable.placeholder) - //.error(mSharedPrefs.darkThemeEnabled() ? R.drawable.baseline_error_outline_white_24 : R.drawable.baseline_error_outline_black_24) - .into(holder.camera); + .placeholder(R.drawable.placeholder) + //.error(mSharedPrefs.darkThemeEnabled() ? R.drawable.baseline_error_outline_white_24 : R.drawable.baseline_error_outline_black_24) + .into(holder.camera); } else picasso.load(imageUrl) - .memoryPolicy(MemoryPolicy.NO_CACHE) - .noFade() - .noPlaceholder() - //.error(mSharedPrefs.darkThemeEnabled() ? R.drawable.baseline_error_outline_white_24 : R.drawable.baseline_error_outline_black_24) - .into(holder.camera); + .memoryPolicy(MemoryPolicy.NO_CACHE) + .noFade() + .noPlaceholder() + //.error(mSharedPrefs.darkThemeEnabled() ? R.drawable.baseline_error_outline_white_24 : R.drawable.baseline_error_outline_black_24) + .into(holder.camera); } catch (Exception ex) { Log.i("CameraAdapter", ex.getMessage()); } @@ -190,7 +190,7 @@ public interface onClickListener { } public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener, RVHViewHolder { + implements View.OnClickListener, RVHViewHolder { TextView name; ImageView camera; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java index d9efc2825..9266543cb 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java @@ -73,12 +73,12 @@ public class DashboardAdapter extends RecyclerView.Adapter data = null; public ArrayList filteredData = null; @@ -164,10 +164,10 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row; if (showAsList) row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.dashboard_row_list, parent, false); + .inflate(R.layout.dashboard_row_list, parent, false); else row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.dashboard_row, parent, false); + .inflate(R.layout.dashboard_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((row.findViewById(R.id.card_global_wrapper)) != null) @@ -176,6 +176,7 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { (row.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.color.card_background_dark)); if ((row.findViewById(R.id.row_global_wrapper)) != null) (row.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark)); + if ((row.findViewById(R.id.on_button)) != null) ((MaterialButton) row.findViewById(R.id.on_button)).setTextColor(ContextCompat.getColor(context, R.color.white)); if ((row.findViewById(R.id.off_button)) != null) @@ -220,7 +221,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder) { holder.pieView.setVisibility(View.GONE); if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { if (mDeviceInfo.getType() != null && mDeviceInfo.getType().equals("sunrise")) { setButtons(holder, Buttons.CLOCK); setClockRowData(mDeviceInfo, holder); @@ -316,10 +317,8 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, break; case DomoticzValues.Device.Type.Value.DIMMER: - case DomoticzValues.Device.Type.Value.BLINDPERCENTAGE: - case DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED: if (mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.RGB) || - mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { + mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { if (mSharedPrefs.showSwitchesAsButtons()) { setButtons(holder, Buttons.DIMMER_BUTTONS); setDimmerOnOffButtonRowData(mDeviceInfo, holder, true); @@ -338,6 +337,17 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, } break; + case DomoticzValues.Device.Type.Value.BLINDPERCENTAGE: + case DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED: + if (DomoticzValues.canHandleStopButton(mDeviceInfo)) { + setButtons(holder, Buttons.BLINDS_DIMMER); + setBlindsRowData(mDeviceInfo, holder); + } else { + setButtons(holder, Buttons.BLINDS_DIMMER_NOSTOP); + setBlindsRowData(mDeviceInfo, holder); + } + break; + case DomoticzValues.Device.Type.Value.SELECTOR: if (mSharedPrefs.showSwitchesAsButtons()) { setButtons(holder, Buttons.SELECTOR_BUTTONS); @@ -352,11 +362,10 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, case DomoticzValues.Device.Type.Value.BLINDINVERTED: if (DomoticzValues.canHandleStopButton(mDeviceInfo)) { setButtons(holder, Buttons.BLINDS); - setBlindsRowData(mDeviceInfo, holder); } else { - setButtons(holder, Buttons.BUTTONS); - setOnOffButtonRowData(mDeviceInfo, holder); + setButtons(holder, Buttons.BLINDS_NOSTOP); } + setBlindsRowData(mDeviceInfo, holder); break; case DomoticzValues.Device.Type.Value.BLINDVENETIAN: @@ -367,7 +376,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, default: throw new NullPointerException( - "No supported switch type defined in the adapter (setSwitchRowData)"); + "No supported switch type defined in the adapter (setSwitchRowData)"); } } } @@ -397,18 +406,18 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": "; + + ": "; if (mDeviceInfo.getLastUpdateDateTime() != null) { text += UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + mDeviceInfo.getLastUpdateDateTime().getTime()); } holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) { try { @@ -430,10 +439,10 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); if (mDeviceInfo.getType() != null && mDeviceInfo.getType().length() > 0 && - mDeviceInfo.getType().equals("Wind")) { + mDeviceInfo.getType().equals("Wind")) { text = context.getString(R.string.direction) + " " + mDeviceInfo.getDirection() + " " + mDeviceInfo.getDirectionStr(); holder.switch_battery_level.setText(text); } @@ -451,7 +460,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, holder.switch_battery_level.append(", " + context.getString(R.string.dewPoint) + ": " + mDeviceInfo.getDewPoint() + " " + tempSign); if ((mDeviceInfo.getType() != null && mDeviceInfo.getType().equals(DomoticzValues.Device.Type.Value.TEMP)) || - !Double.isNaN(mDeviceInfo.getTemperature())) { + !Double.isNaN(mDeviceInfo.getTemperature())) { holder.switch_battery_level.append(", " + context.getString(R.string.temp) + ": " + mDeviceInfo.getTemperature() + " " + tempSign); holder.pieView.setVisibility(View.VISIBLE); double temp = mDeviceInfo.getTemperature(); @@ -460,7 +469,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, holder.pieView.setPercentage(Float.valueOf(temp + "")); holder.pieView.setInnerText(mDeviceInfo.getTemperature() + " " + tempSign); if ((!UsefulBits.isEmpty(tempSign) && tempSign.equals("C") && mDeviceInfo.getTemperature() < 0) || - (!UsefulBits.isEmpty(tempSign) && tempSign.equals("F") && mDeviceInfo.getTemperature() < 30)) + (!UsefulBits.isEmpty(tempSign) && tempSign.equals("F") && mDeviceInfo.getTemperature() < 30)) holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_blue_600)); else holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_orange_600)); @@ -481,11 +490,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); holder.iconRow.setAlpha(1f); if (!mDeviceInfo.getStatusBoolean()) @@ -508,13 +517,13 @@ private void setSecurityPanelSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHo holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); @@ -535,11 +544,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -564,23 +573,23 @@ private void setOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (holder.buttonOn != null) { if (mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.GROUP) || mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.SCENE)) @@ -644,22 +653,22 @@ private void setOnOffSwitchRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -730,24 +739,24 @@ public void onClick(View v) { String text; if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { String setPointText = - context.getString(R.string.set_point) + ": " + setPoint; + context.getString(R.string.set_point) + ": " + setPoint; holder.switch_battery_level.setText(setPointText); } Picasso.get().load(DomoticzIcons.getDrawableIcon( - mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - false, - false, - null)).into(holder.iconRow); + mDeviceInfo.getTypeImg(), + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + false, + false, + null)).into(holder.iconRow); } /** @@ -797,8 +806,8 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol if (holder.switch_battery_level != null) { String batteryText = context.getString(R.string.temperature) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(batteryText); } } else { @@ -806,17 +815,17 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol holder.signal_level.setVisibility(View.VISIBLE); if (holder.switch_battery_level != null) { String batteryLevelText = context.getString(R.string.temperature) - + ": " - + temperature - + " " + sign; + + ": " + + temperature + + " " + sign; holder.switch_battery_level.setText(batteryLevelText); } if (holder.signal_level != null) { String signalText = context.getString(R.string.set_point) - + ": " - + mDeviceInfo.getSetPoint() - + " " + sign; + + ": " + + mDeviceInfo.getSetPoint() + + " " + sign; holder.signal_level.setText(signalText); } } @@ -869,12 +878,12 @@ public void onClick(View v) { if ((sign.equals("C") && temperature < 0) || (sign.equals("F") && temperature < 30)) { Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), mDeviceInfo.getType(), mDeviceInfo.getSubType(), - mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature(), - true, "Freezing")).into(holder.iconRow); + mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature(), + true, "Freezing")).into(holder.iconRow); } else { Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), mDeviceInfo.getType(), mDeviceInfo.getSubType(), - mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature(), - false, null)).into(holder.iconRow); + mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature(), + false, null)).into(holder.iconRow); } } @@ -903,8 +912,8 @@ private void setContactSwitchRowData(DevicesInfo mDevicesInfo, } String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) { holder.signal_level.setText(text); } @@ -941,11 +950,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDevicesInfo.getTypeImg(), - mDevicesInfo.getType(), - mDevicesInfo.getSwitchType(), - mDevicesInfo.getStatusBoolean(), - mDevicesInfo.getUseCustomImage(), - mDevicesInfo.getImage())).into(holder.iconRow); + mDevicesInfo.getType(), + mDevicesInfo.getSwitchType(), + mDevicesInfo.getStatusBoolean(), + mDevicesInfo.getUseCustomImage(), + mDevicesInfo.getImage())).into(holder.iconRow); if (!mDevicesInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -966,22 +975,22 @@ private void setPushOnOffSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1036,28 +1045,25 @@ public void onClick(View v) { * @param mDeviceInfo Device info * @param holder Holder to use */ - private void setBlindsRowData(DevicesInfo mDeviceInfo, + private void setBlindsRowData(final DevicesInfo mDeviceInfo, DataObjectHolder holder) { String text; - holder.isProtected = mDeviceInfo.isProtected(); - holder.switch_name.setText(mDeviceInfo.getName()); - if (holder.switch_status != null) { + if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate( - context, - mDeviceInfo.getLastUpdateDateTime().getTime()); - holder.switch_status.setText(text); + + ": " + + UsefulBits.getFormattedDate( + context, + mDeviceInfo.getLastUpdateDateTime().getTime()); + holder.signal_level.setText(text); } - if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); } @@ -1067,7 +1073,7 @@ private void setBlindsRowData(DevicesInfo mDeviceInfo, public void onClick(View view) { for (DevicesInfo e : data) { if (e.getIdx() == view.getId()) { - if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED) + if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED || e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED) handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.ON); else handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.OFF); @@ -1094,7 +1100,7 @@ public void onClick(View view) { public void onClick(View view) { for (DevicesInfo e : data) { if (e.getIdx() == view.getId()) { - if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED) + if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED || e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED) handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.OFF); else handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.ON); @@ -1103,12 +1109,44 @@ public void onClick(View view) { } }); + if (holder.dimmer.getVisibility() == View.VISIBLE) { + holder.dimmer.setProgress(mDeviceInfo.getLevel()); + holder.dimmer.setMax(mDeviceInfo.getMaxDimLevel()); + holder.dimmer.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + String percentage = calculateDimPercentage(seekBar.getMax(), progress); + TextView switch_dimmer_level = seekBar.getRootView() + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + if (switch_dimmer_level != null) + switch_dimmer_level.setText(percentage); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + previousDimmerValue = seekBar.getProgress(); + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + int progress = seekBar.getProgress(); + handleDimmerChange(mDeviceInfo.getIdx(), progress + 1, false); + mDeviceInfo.setLevel(progress); + } + }); + + holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); + String percentage = calculateDimPercentage( + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + holder.switch_dimmer_level.setText(percentage); + } + Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1131,15 +1169,15 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } @@ -1151,7 +1189,7 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, holder.spSelector.setTag(mDeviceInfo.getIdx()); if (levelNames != null && levelNames.size() > loadLevel) { ArrayAdapter dataAdapter = new ArrayAdapter(context, - android.R.layout.simple_spinner_item, levelNames); + android.R.layout.simple_spinner_item, levelNames); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); holder.spSelector.setAdapter(dataAdapter); holder.spSelector.setSelection(loadLevel); @@ -1176,11 +1214,11 @@ public void onNothingSelected(AdapterView arg0) { }); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1206,29 +1244,29 @@ private void setDimmerRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1272,7 +1310,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); @@ -1289,7 +1327,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { SwitchMaterial dimmerOnOffSwitch = null; try { dimmerOnOffSwitch = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); + .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); if (progress == 0 && dimmerOnOffSwitch.isChecked()) { dimmerOnOffSwitch.setChecked(false); seekBar.setProgress(previousDimmerValue); @@ -1353,29 +1391,29 @@ private void setDimmerOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null && mDeviceInfo.getLastUpdateDateTime() != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1423,7 +1461,7 @@ public void onClick(View v) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); } @@ -1441,7 +1479,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { } }); - if (!mDeviceInfo.getStatusBoolean()) { + if (!mDeviceInfo.getStatusBoolean() && !(holder.buttonDown.getVisibility() == View.VISIBLE)) { holder.switch_dimmer_level.setVisibility(View.GONE); holder.dimmer.setVisibility(View.GONE); if (isRGB) @@ -1489,12 +1527,12 @@ private void setModalSwitchRowData(DevicesInfo mDeviceInfo, holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); + getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); if (holder.buttonSetStatus != null) { @@ -1509,11 +1547,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } /** @@ -1799,7 +1837,6 @@ public void setButtons(DataObjectHolder holder, int button) { case Buttons.BUTTONS: if (holder.buttonOn != null) holder.buttonOn.setVisibility(View.VISIBLE); - if (holder.buttonOff != null) holder.buttonOff.setVisibility(View.VISIBLE); break; @@ -1826,12 +1863,42 @@ public void setButtons(DataObjectHolder holder, int button) { holder.buttonUp.setVisibility(View.VISIBLE); if (holder.buttonStop != null) holder.buttonStop.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.GONE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.GONE); break; case Buttons.BLINDS_NOSTOP: if (holder.buttonDown != null) holder.buttonDown.setVisibility(View.VISIBLE); if (holder.buttonUp != null) holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.GONE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.GONE); + break; + case Buttons.BLINDS_DIMMER: + if (holder.buttonDown != null) + holder.buttonDown.setVisibility(View.VISIBLE); + if (holder.buttonUp != null) + holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.buttonStop != null) + holder.buttonStop.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.VISIBLE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.VISIBLE); + break; + case Buttons.BLINDS_DIMMER_NOSTOP: + if (holder.buttonDown != null) + holder.buttonDown.setVisibility(View.VISIBLE); + if (holder.buttonUp != null) + holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.VISIBLE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.VISIBLE); break; case Buttons.DIMMER_RGB: if (holder.buttonDown != null) @@ -1911,11 +1978,13 @@ interface Buttons { int SET = 2; int BUTTONS = 3; int BLINDS = 4; + int BLINDS_NOSTOP = 9; + int BLINDS_DIMMER = 15; + int BLINDS_DIMMER_NOSTOP = 16; int DIMMER = 5; int DIMMER_RGB = 6; int BUTTON_ON = 7; int BUTTON_OFF = 8; - int BLINDS_NOSTOP = 9; int MODAL = 10; int DIMMER_BUTTONS = 11; int SELECTOR = 12; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java index 801a2fcd6..3ce7827eb 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java @@ -81,7 +81,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.event_row_default, parent, false); + .inflate(R.layout.event_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -147,7 +147,7 @@ public interface onClickListener { } public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView message; SwitchMaterial buttonON; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java index 5c24fbf1f..8081702e5 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java @@ -118,7 +118,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.connectedSwitch.setText(context.getString(R.string.connectedSwitch) + ": " + mLocationInfo.getSwitchIdx()); } else { holder.connectedSwitch.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mLocationInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java index 9e6b97ae8..4d2646ab0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java @@ -76,7 +76,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.logs_row_default, parent, false); + .inflate(R.layout.logs_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -137,7 +137,7 @@ public interface onClickListener { public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView datetime; TextView message; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java index 3a6b7b74a..0a742d3d6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java @@ -124,7 +124,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) + ": " + mNFCInfo.getSwitchIdx()); } else { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mNFCInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java index d6fda7a2c..f46021f77 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java @@ -96,7 +96,7 @@ private void SaveSorting() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.plan_row, parent, false); + .inflate(R.layout.plan_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java index c4720885f..3fd955ce4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java @@ -125,7 +125,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) + ": " + mQRCodeInfo.getSwitchIdx()); } else { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mQRCodeInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java index cf85c9f13..60448e951 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java @@ -97,7 +97,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.scene_row_default, parent, false); + .inflate(R.layout.scene_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -166,19 +166,19 @@ public void onClick(View v) { holder.switch_name.setText(mSceneInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mSceneInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mSceneInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); holder.switch_battery_level.setText(DomoticzValues.Scene.Type.SCENE); Picasso.get().load(DomoticzIcons.getDrawableIcon( - DomoticzValues.Scene.Type.SCENE.toLowerCase(), - null, - null, - false, - false, - null)).into(holder.iconRow); + DomoticzValues.Scene.Type.SCENE.toLowerCase(), + null, + null, + false, + false, + null)).into(holder.iconRow); if (holder.buttonOn != null) { holder.buttonOn.setId(mSceneInfo.getIdx()); @@ -231,9 +231,9 @@ public void onClick(View v) { holder.switch_name.setText(mSceneInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mSceneInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mSceneInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); holder.switch_battery_level.setText(DomoticzValues.Scene.Type.GROUP); @@ -258,12 +258,12 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon( - DomoticzValues.Scene.Type.GROUP.toLowerCase(), - null, - null, - mSceneInfo.getStatusInBoolean(), - false, - null)).into(holder.iconRow); + DomoticzValues.Scene.Type.GROUP.toLowerCase(), + null, + null, + mSceneInfo.getStatusInBoolean(), + false, + null)).into(holder.iconRow); if (!mSceneInfo.getStatusInBoolean()) holder.iconRow.setAlpha(0.5f); @@ -295,7 +295,7 @@ public void onClick(View v) { }); } } else throw new NullPointerException("Scene type not supported in the adapter for:\n" - + mSceneInfo.toString()); + + mSceneInfo.toString()); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java index 19a66072d..79320d221 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java @@ -32,6 +32,8 @@ import android.widget.CompoundButton; import android.widget.TextView; +import com.google.android.material.button.MaterialButton; + import java.util.ArrayList; import androidx.core.content.ContextCompat; @@ -100,7 +102,7 @@ public View getView(int position, View convertView, ViewGroup parent) { if ((convertView.findViewById(R.id.row_global_wrapper)) != null) (convertView.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark)); if ((convertView.findViewById(R.id.remove_button)) != null) - (convertView.findViewById(R.id.remove_button)).setBackgroundColor(ContextCompat.getColor(context, R.color.button_dark)); + ((MaterialButton) convertView.findViewById(R.id.remove_button)).setTextColor(ContextCompat.getColor(context, R.color.white)); } holder.enable = convertView.findViewById(R.id.enableServer); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java index 5ee7ffc58..98c7c3456 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java @@ -121,14 +121,14 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.Speech_tag_id.setText(context.getString(R.string.connectedSwitch) + ": " + mSpeechInfo.getSwitchIdx()); } else { holder.Speech_tag_id.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mSpeechInfo.getValue())) holder.Speech_tag_id.setText(holder.Speech_tag_id.getText() + " - " + mSpeechInfo.getValue()); holder.Speech_switch_idx.setText("Commando's: \r\n" + "'" + mSpeechInfo.getName() + "' " + "\r\n'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_on).toLowerCase() + "'\r\n" + - "'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_off).toLowerCase() + "'"); + "'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_off).toLowerCase() + "'"); holder.remove.setId(position); holder.remove.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java index d7979b660..d52d33799 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java @@ -71,12 +71,12 @@ public class SwitchesAdapter extends RecyclerView.Adapter data = null; public ArrayList filteredData = null; @@ -158,7 +158,7 @@ public Filter getFilter() { public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = null; row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.switch_row_list, parent, false); + .inflate(R.layout.switch_row_list, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((row.findViewById(R.id.card_global_wrapper)) != null) @@ -256,7 +256,7 @@ public void onClick(View v) { private void setSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder) { if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { switch (mDeviceInfo.getType()) { case DomoticzValues.Scene.Type.GROUP: setButtons(holder, Buttons.BUTTONS); @@ -343,17 +343,9 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, setPushOnOffSwitchRowData(mDeviceInfo, holder, false); break; - case DomoticzValues.Device.Type.Value.BLINDVENETIAN: - case DomoticzValues.Device.Type.Value.BLINDVENETIANUS: - setButtons(holder, Buttons.BLINDS); - setBlindsRowData(mDeviceInfo, holder); - break; - case DomoticzValues.Device.Type.Value.DIMMER: - case DomoticzValues.Device.Type.Value.BLINDPERCENTAGE: - case DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED: if (mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.RGB) || - mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { + mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { if (mSharedPrefs.showSwitchesAsButtons()) { setButtons(holder, Buttons.DIMMER_BUTTONS); setDimmerOnOffButtonRowData(mDeviceInfo, holder, true); @@ -372,6 +364,17 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, } break; + case DomoticzValues.Device.Type.Value.BLINDPERCENTAGE: + case DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED: + if (DomoticzValues.canHandleStopButton(mDeviceInfo)) { + setButtons(holder, Buttons.BLINDS_DIMMER); + setBlindsRowData(mDeviceInfo, holder); + } else { + setButtons(holder, Buttons.BLINDS_DIMMER_NOSTOP); + setBlindsRowData(mDeviceInfo, holder); + } + break; + case DomoticzValues.Device.Type.Value.SELECTOR: if (mSharedPrefs.showSwitchesAsButtons()) { setButtons(holder, Buttons.SELECTOR_BUTTONS); @@ -386,16 +389,21 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, case DomoticzValues.Device.Type.Value.BLINDINVERTED: if (DomoticzValues.canHandleStopButton(mDeviceInfo)) { setButtons(holder, Buttons.BLINDS); - setBlindsRowData(mDeviceInfo, holder); } else { - setButtons(holder, Buttons.BUTTONS); - setOnOffButtonRowData(mDeviceInfo, holder); + setButtons(holder, Buttons.BLINDS_NOSTOP); } + setBlindsRowData(mDeviceInfo, holder); + break; + + case DomoticzValues.Device.Type.Value.BLINDVENETIAN: + case DomoticzValues.Device.Type.Value.BLINDVENETIANUS: + setButtons(holder, Buttons.BLINDS); + setBlindsRowData(mDeviceInfo, holder); break; default: throw new NullPointerException( - "No supported switch type defined in the adapter (setSwitchRowData)"); + "No supported switch type defined in the adapter (setSwitchRowData)"); } } } @@ -426,18 +434,18 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": "; + + ": "; if (mDeviceInfo.getLastUpdateDateTime() != null) { text += UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + mDeviceInfo.getLastUpdateDateTime().getTime()); } holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) { @@ -447,7 +455,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); if (mDeviceInfo.getType().equals("Wind")) { text = context.getString(R.string.direction) + " " + mDeviceInfo.getDirection() + " " + mDeviceInfo.getDirectionStr(); @@ -470,11 +478,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); holder.iconRow.setAlpha(1f); if (!mDeviceInfo.getStatusBoolean()) @@ -494,13 +502,13 @@ private void setSecurityPanelSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHo holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); @@ -521,11 +529,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -550,23 +558,23 @@ private void setOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (holder.buttonOn != null) { if (mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.GROUP) || mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.SCENE)) @@ -630,22 +638,22 @@ private void setOnOffSwitchRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -716,24 +724,24 @@ public void onClick(View v) { String text; if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { String setPointText = - context.getString(R.string.set_point) + ": " + setPoint; + context.getString(R.string.set_point) + ": " + setPoint; holder.switch_battery_level.setText(setPointText); } Picasso.get().load(DomoticzIcons.getDrawableIcon( - mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - false, - false, - null)).into(holder.iconRow); + mDeviceInfo.getTypeImg(), + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + false, + false, + null)).into(holder.iconRow); } /** @@ -755,8 +763,8 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol if (holder.switch_battery_level != null) { String batteryText = context.getString(R.string.temperature) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(batteryText); } } else { @@ -764,17 +772,17 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol holder.signal_level.setVisibility(View.VISIBLE); if (holder.switch_battery_level != null) { String batteryLevelText = context.getString(R.string.temperature) - + ": " - + temperature - + " C"; + + ": " + + temperature + + " C"; holder.switch_battery_level.setText(batteryLevelText); } if (holder.signal_level != null) { String signalText = context.getString(R.string.set_point) - + ": " - + mDeviceInfo.getSetPoint() - + " C"; + + ": " + + mDeviceInfo.getSetPoint() + + " C"; holder.signal_level.setText(signalText); } } @@ -835,8 +843,8 @@ private void setContactSwitchRowData(DevicesInfo mDevicesInfo, } String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) { holder.signal_level.setText(text); } @@ -873,11 +881,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDevicesInfo.getTypeImg(), - mDevicesInfo.getType(), - mDevicesInfo.getSwitchType(), - mDevicesInfo.getStatusBoolean(), - mDevicesInfo.getUseCustomImage(), - mDevicesInfo.getImage())).into(holder.iconRow); + mDevicesInfo.getType(), + mDevicesInfo.getSwitchType(), + mDevicesInfo.getStatusBoolean(), + mDevicesInfo.getUseCustomImage(), + mDevicesInfo.getImage())).into(holder.iconRow); if (!mDevicesInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -898,22 +906,22 @@ private void setPushOnOffSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -968,28 +976,25 @@ public void onClick(View v) { * @param mDeviceInfo Device info * @param holder Holder to use */ - private void setBlindsRowData(DevicesInfo mDeviceInfo, + private void setBlindsRowData(final DevicesInfo mDeviceInfo, DataObjectHolder holder) { String text; - holder.isProtected = mDeviceInfo.isProtected(); - holder.switch_name.setText(mDeviceInfo.getName()); - if (holder.switch_status != null) { + if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate( - context, - mDeviceInfo.getLastUpdateDateTime().getTime()); - holder.switch_status.setText(text); + + ": " + + UsefulBits.getFormattedDate( + context, + mDeviceInfo.getLastUpdateDateTime().getTime()); + holder.signal_level.setText(text); } - if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); holder.switch_battery_level.setText(text); } @@ -999,7 +1004,7 @@ private void setBlindsRowData(DevicesInfo mDeviceInfo, public void onClick(View view) { for (DevicesInfo e : data) { if (e.getIdx() == view.getId()) { - if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED) + if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED || e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED) handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.ON); else handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.OFF); @@ -1026,7 +1031,7 @@ public void onClick(View view) { public void onClick(View view) { for (DevicesInfo e : data) { if (e.getIdx() == view.getId()) { - if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED) + if (e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED || e.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGEINVERTED) handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.OFF); else handleBlindsClick(e.getIdx(), DomoticzValues.Device.Blind.Action.ON); @@ -1035,12 +1040,44 @@ public void onClick(View view) { } }); + if (holder.dimmer.getVisibility() == View.VISIBLE) { + holder.dimmer.setProgress(mDeviceInfo.getLevel()); + holder.dimmer.setMax(mDeviceInfo.getMaxDimLevel()); + holder.dimmer.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + String percentage = calculateDimPercentage(seekBar.getMax(), progress); + TextView switch_dimmer_level = seekBar.getRootView() + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + if (switch_dimmer_level != null) + switch_dimmer_level.setText(percentage); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + previousDimmerValue = seekBar.getProgress(); + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + int progress = seekBar.getProgress(); + handleDimmerChange(mDeviceInfo.getIdx(), progress + 1, false); + mDeviceInfo.setLevel(progress); + } + }); + + holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); + String percentage = calculateDimPercentage( + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + holder.switch_dimmer_level.setText(percentage); + } + Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1063,15 +1100,15 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } @@ -1083,7 +1120,7 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, holder.spSelector.setTag(mDeviceInfo.getIdx()); if (levelNames != null && levelNames.size() > loadLevel) { ArrayAdapter dataAdapter = new ArrayAdapter(context, - android.R.layout.simple_spinner_item, levelNames); + android.R.layout.simple_spinner_item, levelNames); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); holder.spSelector.setAdapter(dataAdapter); holder.spSelector.setSelection(loadLevel); @@ -1108,11 +1145,11 @@ public void onNothingSelected(AdapterView arg0) { }); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1138,29 +1175,29 @@ private void setDimmerRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1204,7 +1241,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); @@ -1221,7 +1258,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { SwitchMaterial dimmerOnOffSwitch = null; try { dimmerOnOffSwitch = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); + .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); if (progress == 0 && dimmerOnOffSwitch.isChecked()) { dimmerOnOffSwitch.setChecked(false); seekBar.setProgress(previousDimmerValue); @@ -1285,29 +1322,29 @@ private void setDimmerOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null && mDeviceInfo.getLastUpdateDateTime() != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - mDeviceInfo.getStatus(); + mDeviceInfo.getStatus(); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1355,7 +1392,7 @@ public void onClick(View v) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); } @@ -1421,12 +1458,12 @@ private void setModalSwitchRowData(DevicesInfo mDeviceInfo, holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); + getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); if (holder.buttonSetStatus != null) { @@ -1441,11 +1478,11 @@ public void onClick(View v) { } Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } /** @@ -1703,12 +1740,42 @@ public void setButtons(DataObjectHolder holder, int button) { holder.buttonUp.setVisibility(View.VISIBLE); if (holder.buttonStop != null) holder.buttonStop.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.GONE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.GONE); break; case Buttons.BLINDS_NOSTOP: if (holder.buttonDown != null) holder.buttonDown.setVisibility(View.VISIBLE); if (holder.buttonUp != null) holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.GONE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.GONE); + break; + case Buttons.BLINDS_DIMMER: + if (holder.buttonDown != null) + holder.buttonDown.setVisibility(View.VISIBLE); + if (holder.buttonUp != null) + holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.buttonStop != null) + holder.buttonStop.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.VISIBLE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.VISIBLE); + break; + case Buttons.BLINDS_DIMMER_NOSTOP: + if (holder.buttonDown != null) + holder.buttonDown.setVisibility(View.VISIBLE); + if (holder.buttonUp != null) + holder.buttonUp.setVisibility(View.VISIBLE); + if (holder.switch_dimmer_level != null) + holder.switch_dimmer_level.setVisibility(View.VISIBLE); + if (holder.dimmer != null) + holder.dimmer.setVisibility(View.VISIBLE); break; case Buttons.DIMMER_RGB: if (holder.buttonDown != null) @@ -1801,15 +1868,18 @@ interface Buttons { int SET = 2; int BUTTONS = 3; int BLINDS = 4; + int BLINDS_NOSTOP = 9; + int BLINDS_DIMMER = 15; + int BLINDS_DIMMER_NOSTOP = 16; int DIMMER = 5; int DIMMER_RGB = 6; int BUTTON_ON = 7; int BUTTON_OFF = 8; - int BLINDS_NOSTOP = 9; int MODAL = 10; int DIMMER_BUTTONS = 11; int SELECTOR = 12; int SELECTOR_BUTTONS = 13; + int CLOCK = 14; } public static class DataObjectHolder extends RecyclerView.ViewHolder { diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java index 9d8d9d9fb..813ff3974 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java @@ -131,7 +131,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.temperature_row_default, parent, false); + .inflate(R.layout.temperature_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -171,20 +171,20 @@ public void onClick(View v) { int modeIconRes = 0; if ((!UsefulBits.isEmpty(sign) && sign.equals("C") && mTemperatureInfo.getTemperature() < 0) || - (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) { + (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) { Picasso.get().load(DomoticzIcons.getDrawableIcon(mTemperatureInfo.getTypeImg(), - mTemperatureInfo.getType(), - null, - mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature(), - true, - "Freezing")).into(holder.iconRow); + mTemperatureInfo.getType(), + null, + mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature(), + true, + "Freezing")).into(holder.iconRow); } else { Picasso.get().load(DomoticzIcons.getDrawableIcon(mTemperatureInfo.getTypeImg(), - mTemperatureInfo.getType(), - null, - mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature(), - false, - null)).into(holder.iconRow); + mTemperatureInfo.getType(), + null, + mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature(), + false, + null)).into(holder.iconRow); } if (!UsefulBits.isEmpty(mTemperatureInfo.getHardwareName()) && mTemperatureInfo.getHardwareName().equalsIgnoreCase(DomoticzValues.Device.Hardware.EVOHOME)) { @@ -204,7 +204,7 @@ public void onClick(View v) { holder.pieView.setPercentageTextSize(16); if ((!UsefulBits.isEmpty(sign) && sign.equals("C") && mTemperatureInfo.getTemperature() < 0) || - (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) + (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_blue_600)); else holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_orange_600)); @@ -298,7 +298,7 @@ public void unLiked(LikeButton likeButton) { holder.data.setText(R.string.wind); holder.data.append(": " + mTemperatureInfo.getData() + " " + mTemperatureInfo.getDirection()); holder.data2.setText(String.format("%s: %s", context.getString(R.string.last_update), UsefulBits.getFormattedDate(context, - mTemperatureInfo.getLastUpdateDateTime().getTime()))); + mTemperatureInfo.getLastUpdateDateTime().getTime()))); holder.data2.setVisibility(View.VISIBLE); } else { double temperature = mTemperatureInfo.getTemperature(); @@ -306,7 +306,7 @@ public void unLiked(LikeButton likeButton) { if (temperature <= 0 || setPoint <= 0) { holder.data.setText(String.format("%s: %s", context.getString(R.string.temperature), mTemperatureInfo.getData())); holder.data2.setText(String.format("%s: %s", context.getString(R.string.last_update), UsefulBits.getFormattedDate(context, - mTemperatureInfo.getLastUpdateDateTime().getTime()))); + mTemperatureInfo.getLastUpdateDateTime().getTime()))); holder.data2.setVisibility(View.VISIBLE); } else { holder.data.setText(String.format("%s: %s %s", context.getString(R.string.temperature), mTemperatureInfo.getTemperature(), sign)); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java index 33a1885b8..616fe1c3f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java @@ -170,19 +170,19 @@ else if (mSwitchTimerInfo.getType() == 27) if (mSwitchTimerInfo.getDate() != null && mSwitchTimerInfo.getDate().length() > 0) holder.switch_name.setText(String.format("%s | %s", - holder.switch_name.getText(), mSwitchTimerInfo.getDate())); + holder.switch_name.getText(), mSwitchTimerInfo.getDate())); else if (mSwitchTimerInfo.getMonthDay() > 0) days = String.format("%s %d", context.getString(R.string.button_status_day).toLowerCase(), mSwitchTimerInfo.getMonthDay()); else { if (mSwitchTimerInfo.getDays() == 128) holder.switch_name.setText(String.format("%s | %s", - holder.switch_name.getText(), context.getString(R.string.timer_every_days))); + holder.switch_name.getText(), context.getString(R.string.timer_every_days))); else if (mSwitchTimerInfo.getDays() == 512) holder.switch_name.setText(String.format("%s | %s", - holder.switch_name.getText(), context.getString(R.string.timer_weekend))); + holder.switch_name.getText(), context.getString(R.string.timer_weekend))); else if (mSwitchTimerInfo.getDays() == 256) holder.switch_name.setText(String.format("%s | %s", - holder.switch_name.getText(), context.getString(R.string.timer_working_days))); + holder.switch_name.getText(), context.getString(R.string.timer_working_days))); if (mSwitchTimerInfo.getOccurence() > 0) { if (mSwitchTimerInfo.getOccurence() == 1) @@ -216,9 +216,9 @@ else if (mSwitchTimerInfo.getOccurence() == 5) if (!UsefulBits.isEmpty(occurence) || !UsefulBits.isEmpty(days) || !UsefulBits.isEmpty(month)) holder.switch_name.setText(String.format("%s | %s %s %s", - holder.switch_name.getText(), occurence != null ? occurence.toLowerCase() : null, - days != null ? days.toLowerCase() : null, - month != null ? month.toLowerCase() : null)); + holder.switch_name.getText(), occurence != null ? occurence.toLowerCase() : null, + days != null ? days.toLowerCase() : null, + month != null ? month.toLowerCase() : null)); else holder.switch_name.setText(String.format("%s", holder.switch_name.getText().toString().toLowerCase())); if (mSwitchTimerInfo.getRandomness()) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java index b843eb8d2..28c33ed45 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java @@ -83,7 +83,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.vars_row_default, parent, false); + .inflate(R.layout.vars_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -135,7 +135,7 @@ public interface onClickListener { public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView datetime; TextView message; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java index 04238b00e..fda1aef84 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java @@ -122,7 +122,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.utilities_row_default, parent, false); + .inflate(R.layout.utilities_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) @@ -151,7 +151,7 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) final double setPoint = mUtilitiesInfo.getSetPoint(); if ((mUtilitiesInfo.getType() != null && DomoticzValues.Device.Utility.Type.THERMOSTAT.equalsIgnoreCase(mUtilitiesInfo.getType())) || - (mUtilitiesInfo.getSubType() != null && DomoticzValues.Device.Utility.SubType.SMARTWARES.equalsIgnoreCase(mUtilitiesInfo.getSubType()))) { + (mUtilitiesInfo.getSubType() != null && DomoticzValues.Device.Utility.SubType.SMARTWARES.equalsIgnoreCase(mUtilitiesInfo.getSubType()))) { setButtons(holder, Buttons.THERMOSTAT); CreateThermostatRow(holder, mUtilitiesInfo, setPoint); } else { @@ -271,7 +271,7 @@ private void CreateDefaultRow(DataObjectHolder holder, UtilitiesInfo mUtilitiesI if (mUtilitiesInfo.getCounterToday() != null && mUtilitiesInfo.getCounterToday().length() > 0) holder.data.append(" " + context.getString(R.string.today) + ": " + mUtilitiesInfo.getCounterToday()); if (mUtilitiesInfo.getCounter() != null && mUtilitiesInfo.getCounter().length() > 0 && - !mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData())) + !mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData())) holder.data.append(" " + context.getString(R.string.total) + ": " + mUtilitiesInfo.getCounter()); holder.dayButton.setId(mUtilitiesInfo.getIdx()); @@ -386,13 +386,13 @@ public void onClick(View v) { }); if (mUtilitiesInfo.getSubType() - .replace("Electric", "counter") - .replace("kWh", "counter") - .replace("Gas", "counter") - .replace("Energy", "counter") - .replace("Voltcraft", "counter") - .replace("SetPoint", "temp") - .replace("YouLess counter", "counter").contains("counter")) + .replace("Electric", "counter") + .replace("kWh", "counter") + .replace("Gas", "counter") + .replace("Energy", "counter") + .replace("Voltcraft", "counter") + .replace("SetPoint", "temp") + .replace("YouLess counter", "counter").contains("counter")) holder.weekButton.setVisibility(View.VISIBLE); holder.yearButton.setId(mUtilitiesInfo.getIdx()); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java index 06ba41020..4bbd61f35 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java @@ -131,7 +131,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.weather_row_default, parent, false); + .inflate(R.layout.weather_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { if ((view.findViewById(R.id.card_global_wrapper)) != null) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java index 94030f546..77a464e94 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java @@ -139,11 +139,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, try { String text = context.getString(R.string.last_update) + ": " + - mDeviceInfo.getLastUpdate().substring(mDeviceInfo.getLastUpdate().indexOf(" ") + 1); + mDeviceInfo.getLastUpdate().substring(mDeviceInfo.getLastUpdate().indexOf(" ") + 1); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.data) + ": " + - mDeviceInfo.getData(); + mDeviceInfo.getData(); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) @@ -151,7 +151,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); } catch (Exception ex) { holder.switch_battery_level.setText(""); @@ -164,11 +164,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, Picasso.get().load(R.drawable.qrcode).into(holder.iconRow); } else { Picasso.get().load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } holder.iconRow.setAlpha(1f); diff --git a/app/src/main/java/nl/hnogames/domoticz/BluetoothSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/BluetoothSettingsActivity.java index adcd472bd..963f5480e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/BluetoothSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/BluetoothSettingsActivity.java @@ -115,33 +115,33 @@ private void showPairedDevices() { } new AlertDialog.Builder(this) - .setSingleChoiceItems(items, 0, null) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - dialog.dismiss(); - int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); - final String Bluetooth_ID = bluetoothDevices.get(position); - - boolean newTagFound = true; - if (BluetoothList != null && BluetoothList.size() > 0) { - for (BluetoothInfo n : BluetoothList) { - if (n.getId().equals(Bluetooth_ID)) - newTagFound = false; + .setSingleChoiceItems(items, 0, null) + .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + dialog.dismiss(); + int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); + final String Bluetooth_ID = bluetoothDevices.get(position); + + boolean newTagFound = true; + if (BluetoothList != null && BluetoothList.size() > 0) { + for (BluetoothInfo n : BluetoothList) { + if (n.getId().equals(Bluetooth_ID)) + newTagFound = false; + } } - } - if (newTagFound) { - UsefulBits.showSnackbar(BluetoothSettingsActivity.this, coordinatorLayout, getString(R.string.bluetooth_saved) + ": " + Bluetooth_ID, Snackbar.LENGTH_SHORT); - BluetoothInfo BluetoothInfo = new BluetoothInfo(); - BluetoothInfo.setId(Bluetooth_ID); - BluetoothInfo.setName(String.valueOf(Bluetooth_ID)); - updateBluetooth(BluetoothInfo); - } else { - UsefulBits.showSnackbar(BluetoothSettingsActivity.this, coordinatorLayout, R.string.bluetooth_exists, Snackbar.LENGTH_SHORT); + if (newTagFound) { + UsefulBits.showSnackbar(BluetoothSettingsActivity.this, coordinatorLayout, getString(R.string.bluetooth_saved) + ": " + Bluetooth_ID, Snackbar.LENGTH_SHORT); + BluetoothInfo BluetoothInfo = new BluetoothInfo(); + BluetoothInfo.setId(Bluetooth_ID); + BluetoothInfo.setName(String.valueOf(Bluetooth_ID)); + updateBluetooth(BluetoothInfo); + } else { + UsefulBits.showSnackbar(BluetoothSettingsActivity.this, coordinatorLayout, R.string.bluetooth_exists, Snackbar.LENGTH_SHORT); + } } - } - }) - .show(); + }) + .show(); } private void createListView() { @@ -184,19 +184,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(BluetoothSettingsActivity.this, coordinatorLayout, BluetoothSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(qrInfo); - } - }, BluetoothSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(qrInfo); + } + }, BluetoothSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final BluetoothInfo BluetoothInfo, - final ArrayList switches) { + final BluetoothInfo BluetoothInfo, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -205,9 +205,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - BluetoothSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + BluetoothSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -237,16 +237,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final BluetoothInfo BluetoothInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - BluetoothInfo.setValue(String.valueOf(text)); - updateBluetooth(BluetoothInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + BluetoothInfo.setValue(String.valueOf(text)); + updateBluetooth(BluetoothInfo); + } + }) + .show(); } public void updateBluetooth(BluetoothInfo BluetoothInfo) { @@ -272,21 +272,21 @@ public void updateBluetooth(BluetoothInfo BluetoothInfo) { private boolean showNoDeviceAttachedDialog(final BluetoothInfo BluetoothInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_bluetooth) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(BluetoothInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_bluetooth) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(BluetoothInfo); + result = true; + } + }) + .show(); return result; } @@ -313,7 +313,7 @@ private void showRemoveUndoSnackbar(final BluetoothInfo BluetoothInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.bluetooth)); + getString(R.string.bluetooth)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java b/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java index 540ec3236..a71b47075 100644 --- a/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java @@ -55,7 +55,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, - camera).commit(); + camera).commit(); camera.setImage(imageUrl); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java b/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java index 36ad6e917..58573c4fe 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java +++ b/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java @@ -131,23 +131,23 @@ public Geofence toGeofence() { try { // Build a new Geofence object. return new Geofence.Builder() - // Set the request ID of the geofence. This is a string to identify this - // geofence. - .setRequestId(String.valueOf(id)) - // Set the circular region of this geofence. - .setCircularRegion( - latLng.latitude, latLng.longitude, radius - ) - // Set the expiration duration of the geofence. This geofence gets automatically - // removed after this period of time. - .setExpirationDuration(Geofence.NEVER_EXPIRE) - // Set the transition types of interest. Alerts are only generated for these - // transition. We track entry and exit transitions in this sample. - .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | - Geofence.GEOFENCE_TRANSITION_EXIT) - .setLoiteringDelay(3000) - // Create the geofence. - .build(); + // Set the request ID of the geofence. This is a string to identify this + // geofence. + .setRequestId(String.valueOf(id)) + // Set the circular region of this geofence. + .setCircularRegion( + latLng.latitude, latLng.longitude, radius + ) + // Set the expiration duration of the geofence. This geofence gets automatically + // removed after this period of time. + .setExpirationDuration(Geofence.NEVER_EXPIRE) + // Set the transition types of interest. Alerts are only generated for these + // transition. We track entry and exit transitions in this sample. + .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | + Geofence.GEOFENCE_TRANSITION_EXIT) + .setLoiteringDelay(3000) + // Create the geofence. + .build(); } catch (Exception ex) { // Wrong LocationInfo data detected return null; diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java index f642da53c..cbf2cfc32 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java @@ -64,8 +64,8 @@ public View onCreateView(LayoutInflater inflater, root = group.findViewById(R.id.image); root.getController().getSettings() - .setFitMethod(Settings.Fit.VERTICAL) - .setFillViewport(false); + .setFitMethod(Settings.Fit.VERTICAL) + .setFillViewport(false); FloatingActionButton fabButton = group.findViewById(R.id.fab); fabButton.setOnClickListener(new View.OnClickListener() { @@ -112,10 +112,10 @@ public void setImage(String url) { File file = new File(url); Uri uri = Uri.fromFile(file); Picasso.get() - .load(uri) - .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) - .networkPolicy(NetworkPolicy.NO_CACHE) - .into(root); + .load(uri) + .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) + .networkPolicy(NetworkPolicy.NO_CACHE) + .into(root); } } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java index 7f1d07ac8..2834fec3a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java @@ -217,7 +217,7 @@ public void onItemClick(int position, View v) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(mAdapter, true, false, - false)); + false)); } if (mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(mRecyclerView); @@ -247,7 +247,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { } } AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_storage), neededPermission); + getActivity().getString(R.string.permission_desc_storage), neededPermission); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java index dc19733a3..69e455756 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java @@ -28,7 +28,9 @@ import android.os.Bundle; import android.os.Parcelable; import android.util.Log; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; @@ -75,7 +77,7 @@ @DebugLog public class Dashboard extends DomoticzDashboardFragment implements DomoticzFragmentListener, - switchesClickListener { + switchesClickListener { public static final String PERMANENT_OVERRIDE = "PermanentOverride"; public static final String AUTO = "Auto"; @@ -108,6 +110,16 @@ public void onAttach(Context context) { getActionBar().setTitle(getString(R.string.title_dashboard)); } + @Override + public View onCreateView(LayoutInflater inflater, + ViewGroup container, + Bundle savedInstanceState) { + View view = super.onCreateView(inflater, container, savedInstanceState); + collapseSortButton.setVisibility(View.VISIBLE); + lySortDevices.setVisibility(View.VISIBLE); + return view; + } + @Override @DebugLog public void refreshFragment() { @@ -129,12 +141,12 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(planName) || planName.length() <= 0) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(planName) || planName.length() <= 0) && + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -207,32 +219,32 @@ private void processDevices(ArrayList devicesInfos) { String switchType = mExtendedStatusInfo.getSwitchType(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - (appSupportedSwitchesValues.contains(switchTypeVal) && appSupportedSwitchesNames.contains(switchType)) || - UsefulBits.isEmpty(switchType)) { + (appSupportedSwitchesValues.contains(switchTypeVal) && appSupportedSwitchesNames.contains(switchType)) || + UsefulBits.isEmpty(switchType)) { if (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) { supportedSwitches.add(mExtendedStatusInfo); } else { if (mContext != null) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); + //UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(mContext.getString(R.string.filter_on) + ": " + super.getSort()); if ((super.getSort().equals(mContext.getString(R.string.filterOn_on)) && mExtendedStatusInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } if ((super.getSort().equals(mContext.getString(R.string.filterOn_off)) && !mExtendedStatusInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } if (super.getSort().equals(mContext.getString(R.string.filterOn_static)) && - !mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + !mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } } } } } - if (mSharedPrefs.addClockToDashboard()) { + if (mSharedPrefs.addClockToDashboard() && (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all)))) { mDomoticz.getSunRise(new SunRiseReceiver() { @Override public void onReceive(SunRiseInfo mSunRiseInfo) { @@ -301,11 +313,11 @@ private void createListView(ArrayList switches, SunRiseInfo sunrise if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(planName) || planName.length() <= 0) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -333,10 +345,10 @@ public void onRefresh() { private void showInfoDialog(final DevicesInfo mSwitch, int idx) { if (mSwitch != null) { DeviceInfoDialog infoDialog = new DeviceInfoDialog( - mContext, - mDomoticz, - mSwitch, - R.layout.dialog_switch_info); + mContext, + mDomoticz, + mSwitch, + R.layout.dialog_switch_info); infoDialog.setIdx(String.valueOf(mSwitch.getIdx())); try { if (mSwitch != null && !UsefulBits.isEmpty(mSwitch.getSubType())) @@ -432,7 +444,7 @@ public void onSwitchClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -480,8 +492,8 @@ private void toggleSwitch(final DevicesInfo clickedSwitch, final boolean checked if (checked) jsonAction = DomoticzValues.Scene.Action.ON; else jsonAction = DomoticzValues.Scene.Action.OFF; } else if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { @@ -549,7 +561,7 @@ public void onButtonClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -655,14 +667,14 @@ public void onColorButtonClick(final int idx) { if (getDevice(idx).getSubType().contains(DomoticzValues.Device.SubType.Name.WW) && getDevice(idx).getSubType().contains(DomoticzValues.Device.SubType.Name.RGB)) { RGBWWColorPickerDialog colorDialog = new RGBWWColorPickerDialog(mContext, - getDevice(idx).getIdx()); + getDevice(idx).getIdx()); colorDialog.show(); colorDialog.onDismissListener(new RGBWWColorPickerDialog.DismissListener() { @Override public void onDismiss(final int value, final boolean isRGB) { if (getDevice(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -700,14 +712,14 @@ public void onChangeKelvinColor(int kelvin) { }); } else if (getDevice(idx).getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { WWColorPickerDialog colorDialog = new WWColorPickerDialog(mContext, - getDevice(idx).getIdx()); + getDevice(idx).getIdx()); colorDialog.show(); colorDialog.onDismissListener(new WWColorPickerDialog.DismissListener() { @Override public void onDismiss(final int kelvin) { if (getDevice(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -738,7 +750,7 @@ public void onChangeColor(int kelvin) { public void onColorSelected(final ColorEnvelope envelope, boolean fromUser) { if (getDevice(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -777,43 +789,43 @@ private void setKelvinColor(int kelvin, final int idx, final String password, fi } mDomoticz.setAction(idx, - DomoticzValues.Json.Url.Set.KELVIN, - DomoticzValues.Device.Dimmer.Action.KELVIN, - kelvin, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (result.contains("WRONG CODE")) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - if (selected) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); - } - } - } - - @Override - @DebugLog - public void onError(Exception error) { - if (selected) { - if (!UsefulBits.isEmpty(password)) { + DomoticzValues.Json.Url.Set.KELVIN, + DomoticzValues.Device.Dimmer.Action.KELVIN, + kelvin, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (result.contains("WRONG CODE")) { UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + if (selected) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.color_set); + } } } - } - }); + + @Override + @DebugLog + public void onError(Exception error) { + if (selected) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } + } + } + }); } private void setRGBColor(int selectedColor, final int idx, final String password, final boolean selected) { @@ -842,38 +854,38 @@ private void setRGBColor(int selectedColor, final int idx, final String password isWhite = true; } mDomoticz.setRGBColorAction(idx, - DomoticzValues.Json.Url.Set.RGBCOLOR, - hue, - getDevice(idx).getLevel(), - isWhite, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (selected) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); + DomoticzValues.Json.Url.Set.RGBCOLOR, + hue, + getDevice(idx).getLevel(), + isWhite, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (selected) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.color_set); + } } - } - @Override - @DebugLog - public void onError(Exception error) { - if (selected) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + @Override + @DebugLog + public void onError(Exception error) { + if (selected) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } } } - } - }); + }); } @Override @@ -904,8 +916,8 @@ public void onThermostatClick(final int idx) { if (tempUtil != null) { TemperatureDialog tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @Override @@ -915,7 +927,7 @@ public void onDialogAction(final double newSetPoint, DialogAction dialogAction) if (dialogAction == DialogAction.POSITIVE) { if (tempUtil.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -926,28 +938,28 @@ public void onDismiss(final String password) { if (newSetPoint < tempUtil.getSetPoint()) action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(idx, jsonUrl, action, newSetPoint, password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (result.contains("WRONG CODE")) { + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (result.contains("WRONG CODE")) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + successHandling(result, false); + processDashboard(); + } + } + + @Override + @DebugLog + public void onError(Exception error) { UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - successHandling(result, false); - processDashboard(); } - } - - @Override - @DebugLog - public void onError(Exception error) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } - }); + }); } @Override @@ -960,26 +972,26 @@ public void onCancel() { if (newSetPoint < tempUtil.getSetPoint()) action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(idx, jsonUrl, action, newSetPoint, null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (result.contains("WRONG CODE")) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - successHandling(result, false); - processDashboard(); + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (result.contains("WRONG CODE")) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + successHandling(result, false); + processDashboard(); + } + } + + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error, coordinatorLayout); } - } - - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error, coordinatorLayout); - } - }); + }); } } } @@ -1024,13 +1036,13 @@ public void onError(Exception error) { TemperatureDialog tempDialog; if (evohomeZone) { tempDialog = new ScheduledTemperatureDialog( - mContext, - tempUtil.getSetPoint(), - !AUTO.equalsIgnoreCase(tempUtil.getStatus())); + mContext, + tempUtil.getSetPoint(), + !AUTO.equalsIgnoreCase(tempUtil.getStatus())); } else { tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); } tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @@ -1041,7 +1053,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to " + newSetPoint); String params = "&setpoint=" + newSetPoint + - "&mode=" + PERMANENT_OVERRIDE; + "&mode=" + PERMANENT_OVERRIDE; // add query parameters mDomoticz.setDeviceUsed(idx, tempUtil.getName(), tempUtil.getDescription(), params, commandReceiver); @@ -1049,7 +1061,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to Auto"); String params = "&setpoint=" + newSetPoint + - "&mode=" + AUTO; + "&mode=" + AUTO; // add query parameters mDomoticz.setDeviceUsed(idx, tempUtil.getName(), tempUtil.getDescription(), params, commandReceiver); @@ -1067,8 +1079,8 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { @DebugLog public void onSecurityPanelButtonClick(int idx) { SecurityPanelDialog securityDialog = new SecurityPanelDialog( - mContext, mDomoticz, - getDevice(idx)); + mContext, mDomoticz, + getDevice(idx)); securityDialog.show(); securityDialog.onDismissListener(new SecurityPanelDialog.DismissListener() { @Override @@ -1093,32 +1105,32 @@ public void onStateButtonClick(final int idx, int itemsRes, final int[] stateIds } new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(itemsRes) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { - if (getDevice(idx).isProtected()) { - PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - setState(idx, stateIds[which], password); - } + .title(R.string.choose_status) + .items(itemsRes) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { + if (getDevice(idx).isProtected()) { + PasswordDialog passwordDialog = new PasswordDialog( + mContext, mDomoticz); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + setState(idx, stateIds[which], password); + } - @Override - public void onCancel() { - } - }); - } else - setState(idx, stateIds[which], null); - } - }) - .show(); + @Override + public void onCancel() { + } + }); + } else + setState(idx, stateIds[which], null); + } + }) + .show(); } @Override @@ -1134,20 +1146,20 @@ public void onSelectorDimmerClick(final int idx, final String[] levelNames) { return; } new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - for (int i = 0; i < levelNames.length; i++) { - if (levelNames[i].equals(text)) { - onDimmerChange(idx, i * 10, true); + .title(R.string.choose_status) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + for (int i = 0; i < levelNames.length; i++) { + if (levelNames[i].equals(text)) { + onDimmerChange(idx, i * 10, true); + } } } - } - }) - .show(); + }) + .show(); } @Override @@ -1178,30 +1190,30 @@ private void setState(final int idx, int state, final String password) { return; } mDomoticz.setModalAction(idx, - state, - 1, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.state_set); - processDashboard(); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + state, + 1, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else - errorHandling(error, coordinatorLayout); - } - }); + ((MainActivity) getActivity()).Talk(R.string.state_set); + processDashboard(); + } + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else + errorHandling(error, coordinatorLayout); + } + }); } private DevicesInfo getSwitch(int idx) { @@ -1225,7 +1237,7 @@ public void onBlindClick(final int idx, final int jsonAction) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1342,7 +1354,7 @@ public void onDimmerChange(int idx, final int value, final boolean selector) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1373,8 +1385,8 @@ private void setDimmerState(DevicesInfo clickedSwitch, int value, final boolean return; } String text = String.format(mContext.getString(R.string.set_level_switch), - clickedSwitch.getName(), - !selector ? (value - 1) : ((value) / 10) + 1); + clickedSwitch.getName(), + !selector ? (value - 1) : ((value) / 10) + 1); UsefulBits.showSnackbar(mContext, coordinatorLayout, text, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(text); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java index 3adb71ce9..d6b5c37fc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java @@ -161,7 +161,7 @@ public View onCreateView(LayoutInflater inflater, chart.setHighlightPerDragEnabled(true); if (range.equals("day")) { - xAxis.setValueFormatter(new ValueFormatter(){ + xAxis.setValueFormatter(new ValueFormatter() { @Override public String getFormattedValue(float value) { Calendar calendar = Calendar.getInstance(); @@ -170,7 +170,7 @@ public String getFormattedValue(float value) { } }); } else { - xAxis.setValueFormatter(new ValueFormatter(){ + xAxis.setValueFormatter(new ValueFormatter() { @Override public String getFormattedValue(float value) { Calendar calendar = Calendar.getInstance(); @@ -471,7 +471,7 @@ private LineData generateData(View view) { } if ((addTemperature && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuest, ((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -479,7 +479,7 @@ private LineData generateData(View view) { entries.add(dataSet); if ((addSetpoint && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()))) { dataSet = new LineDataSet(valuesse, ((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_pink_600)); dataSet.setDrawCircles(false); @@ -508,7 +508,7 @@ private LineData generateData(View view) { } if ((addHumidity && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueshu, ((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -517,7 +517,7 @@ private LineData generateData(View view) { } if ((addBarometer && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesba, ((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_green_600)); dataSet.setDrawCircles(false); @@ -526,7 +526,7 @@ private LineData generateData(View view) { } if ((addCounter && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_counter)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_counter)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesc, ((TextView) view.findViewById(R.id.legend_counter)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_indigo_600)); dataSet.setDrawCircles(false); @@ -535,7 +535,7 @@ private LineData generateData(View view) { } if ((addPowerUsage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueeu, ((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_yellow_600)); dataSet.setDrawCircles(false); @@ -543,7 +543,7 @@ private LineData generateData(View view) { entries.add(dataSet); } if ((addPowerDelivery && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueeg, ((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_deep_purple_600)); dataSet.setDrawCircles(false); @@ -552,7 +552,7 @@ private LineData generateData(View view) { } if ((addPercentage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesv, ((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_yellow_600)); dataSet.setDrawCircles(false); @@ -580,7 +580,7 @@ private LineData generateData(View view) { } if ((addSecondPercentage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesv2, ((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -589,7 +589,7 @@ private LineData generateData(View view) { } if ((addDirection && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_direction)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_direction)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesdi, ((TextView) view.findViewById(R.id.legend_direction)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_green_600)); dataSet.setDrawCircles(false); @@ -598,7 +598,7 @@ private LineData generateData(View view) { } if ((addSunPower && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesuv, ((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_deep_purple_600)); dataSet.setDrawCircles(false); @@ -607,7 +607,7 @@ private LineData generateData(View view) { } if ((addSpeed && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_speed)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_speed)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuessp, ((TextView) view.findViewById(R.id.legend_speed)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_amber_600)); dataSet.setDrawCircles(false); @@ -616,7 +616,7 @@ private LineData generateData(View view) { } if ((addUsage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_usage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_usage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesu, ((TextView) view.findViewById(R.id.legend_usage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -625,7 +625,7 @@ private LineData generateData(View view) { } if ((addRain && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_rain)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_rain)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesmm, ((TextView) view.findViewById(R.id.legend_rain)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -634,7 +634,7 @@ private LineData generateData(View view) { } if ((addCO2 && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2, ((TextView) view.findViewById(R.id.legend_co2)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -643,7 +643,7 @@ private LineData generateData(View view) { } if ((addCO2Min && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2min, ((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -652,7 +652,7 @@ private LineData generateData(View view) { } if ((addCO2Max && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2max, ((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); dataSet.setDrawCircles(false); @@ -661,7 +661,7 @@ private LineData generateData(View view) { } if ((addLux && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLux, ((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -670,7 +670,7 @@ private LineData generateData(View view) { } if ((addLuxMin && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxmin, ((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -679,7 +679,7 @@ private LineData generateData(View view) { } if ((addLuxMax && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxmax, ((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); dataSet.setDrawCircles(false); @@ -688,7 +688,7 @@ private LineData generateData(View view) { } if ((addLuxAvg && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxAvg, ((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_yellow_400)); dataSet.setDrawCircles(false); @@ -699,10 +699,10 @@ private LineData generateData(View view) { if (entries.size() > 1) { if (addTemperature) { (view.findViewById(R.id.legend_temperature)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); if (addSetpoint) { (view.findViewById(R.id.legend_set_point)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); } addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_temperature)).getText()); @@ -711,116 +711,116 @@ private LineData generateData(View view) { if (addHumidity) { addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_humidity)).getText()); (view.findViewById(R.id.legend_humidity)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); } if (addBarometer) { (view.findViewById(R.id.legend_barometer)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_barometer)).getText()); } if (addCounter) { (view.findViewById(R.id.legend_counter)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.legend_counter)) - .setText(axisYLabel); + .setText(axisYLabel); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_counter)).getText()); } if (addPercentage) { (view.findViewById(R.id.legend_percentage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_percentage)).getText()); } if (addSecondPercentage) { (view.findViewById(R.id.legend_percentage2)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_percentage2)).getText()); } if (addDirection) { (view.findViewById(R.id.legend_direction)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_direction)).getText()); } if (addSunPower) { (view.findViewById(R.id.legend_sunpower)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_sunpower)).getText()); } if (addSpeed) { (view.findViewById(R.id.legend_speed)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_speed)).getText()); } if (addUsage) { (view.findViewById(R.id.legend_usage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_usage)).getText()); } if (addPowerDelivery) { (view.findViewById(R.id.legend_powerdeliv)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_powerdeliv)).getText()); } if (addPowerUsage) { (view.findViewById(R.id.legend_powerusage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_powerusage)).getText()); } if (addRain) { (view.findViewById(R.id.legend_rain)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_rain)).getText()); } if (addCO2) { (view.findViewById(R.id.legend_co2)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2)).getText()); } if (addCO2Min) { (view.findViewById(R.id.legend_co2min)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2min)).getText()); } if (addCO2Max) { (view.findViewById(R.id.legend_co2max)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2max)).getText()); } if (addLux) { (view.findViewById(R.id.legend_Lux)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Lux)).getText()); } if (addLuxMin) { (view.findViewById(R.id.legend_Luxmin)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Luxmin)).getText()); } if (addLuxMax) { (view.findViewById(R.id.legend_Luxmax)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Luxmax)).getText()); } if (addLuxAvg) { (view.findViewById(R.id.legend_LuxAvg)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_LuxAvg)).getText()); } } @@ -867,41 +867,41 @@ public boolean onOptionsItemSelected(MenuItem item) { lineLabels.toArray(items); new MaterialDialog.Builder(context) - .title(context.getString(R.string.filter)) - .items(items) - .itemsCallbackMultiChoice(selectedFilters, new MaterialDialog.ListCallbackMultiChoice() { - @Override - @DebugLog - public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) { - selectedFilters = which; - enableFilters = true; - - if (text != null && text.length > 0) { - filterLabels = new ArrayList<>(); - - //set filters - for (CharSequence c : text) - filterLabels.add((String) c); - - LineData columnData = generateData(root); - if (columnData != null) { - chart.setData(columnData); - chart.invalidate(); // refresh - chart.setVisibility(View.VISIBLE); - chart.animateX(1000); - if (getActivity() != null) - getActivity().invalidateOptionsMenu(); + .title(context.getString(R.string.filter)) + .items(items) + .itemsCallbackMultiChoice(selectedFilters, new MaterialDialog.ListCallbackMultiChoice() { + @Override + @DebugLog + public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) { + selectedFilters = which; + enableFilters = true; + + if (text != null && text.length > 0) { + filterLabels = new ArrayList<>(); + + //set filters + for (CharSequence c : text) + filterLabels.add((String) c); + + LineData columnData = generateData(root); + if (columnData != null) { + chart.setData(columnData); + chart.invalidate(); // refresh + chart.setVisibility(View.VISIBLE); + chart.animateX(1000); + if (getActivity() != null) + getActivity().invalidateOptionsMenu(); + } + } else { + enableFilters = false; + Toast.makeText(context, context.getString(R.string.filter_graph_empty), Toast.LENGTH_SHORT).show(); } - } else { - enableFilters = false; - Toast.makeText(context, context.getString(R.string.filter_graph_empty), Toast.LENGTH_SHORT).show(); + return true; } - return true; - } - }) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .show(); + }) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .show(); return true; default: break; diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java index 71235fd30..0bc9c597e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java @@ -24,6 +24,9 @@ import android.content.Context; import android.os.AsyncTask; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; import java.util.ArrayList; @@ -68,6 +71,17 @@ public void onAttach(Context context) { SetTitle(getString(R.string.title_logs)); } + @Override + public View onCreateView(LayoutInflater inflater, + ViewGroup container, + Bundle savedInstanceState) { + View view = super.onCreateView(inflater, container, savedInstanceState); + collapseSortButton.setText(getString(R.string.filter_all)); + collapseSortButton.setVisibility(View.VISIBLE); + lySortLogs.setVisibility(View.VISIBLE); + return view; + } + public void SetTitle(String title) { if (getActionBar() != null) getActionBar().setTitle(title); @@ -177,8 +191,6 @@ protected void onPostExecute(Boolean result) { if (getSort().equals(getString(R.string.filter_error))) LogLevel = DomoticzValues.Log.LOGLEVEL.ERROR; - SetTitle(LogLevel != DomoticzValues.Log.LOGLEVEL.ALL ? getString(R.string.title_logs) + " (" + getSort() + ")" : getString(R.string.title_logs)); - mDomoticz.getLogs(new LogsReceiver() { @Override @DebugLog diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java index ebe59ee21..a2a2a4e90 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java @@ -67,8 +67,8 @@ public void onCreate(Bundle savedInstanceState) { public void RefreshFragment() { try { Fragment f = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (f instanceof DomoticzRecyclerFragment) { ((DomoticzRecyclerFragment) f).refreshFragment(); ((DomoticzRecyclerFragment) f).showViews(); @@ -88,8 +88,8 @@ public void RefreshFragment() { public void Filter(String newText) { try { Fragment n = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (n instanceof DomoticzDashboardFragment) { ((DomoticzDashboardFragment) n).Filter(newText); } else if (n instanceof DomoticzRecyclerFragment) { @@ -105,8 +105,8 @@ public void Filter(String newText) { public void sortFragment(String selectedSort) { try { Fragment f = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (f instanceof DomoticzRecyclerFragment) { ((DomoticzRecyclerFragment) f).sortFragment(selectedSort); } else if (f instanceof DomoticzDashboardFragment) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java index 31c8ecd6d..7f1117d10 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java @@ -184,7 +184,7 @@ public void onItemClick(int position, View v) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(mAdapter, true, false, - false)); + false)); } if (mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(mRecyclerView); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java index 45364a6b3..e519dc5ab 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java @@ -25,7 +25,9 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Parcelable; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.LinearLayout; @@ -62,7 +64,7 @@ import nl.hnogames.domoticzapi.Utils.PhoneConnectionUtil; public class Scenes extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - ScenesClickListener { + ScenesClickListener { @SuppressWarnings("unused") private static final String TAG = Scenes.class.getSimpleName(); @@ -92,6 +94,16 @@ public void onAttach(Context context) { getActionBar().setTitle(getString(R.string.title_scenes)); } + @Override + public View onCreateView(LayoutInflater inflater, + ViewGroup container, + Bundle savedInstanceState) { + View view = super.onCreateView(inflater, container, savedInstanceState); + collapseSortButton.setVisibility(View.VISIBLE); + lySortDevices.setVisibility(View.VISIBLE); + return view; + } + @Override public void onActivityCreated(Bundle savedInstanceState) { onAttachFragment(this); @@ -107,11 +119,11 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -172,7 +184,7 @@ public void createListView(final ArrayList scenes) { supportedScenes.add(s); } else { if (mContext != null) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); + //UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(R.string.filter_on); if ((super.getSort().equals(getContext().getString(R.string.filterOn_on)) && s.getStatusInBoolean()) && mDomoticz.isOnOffScene(s)) @@ -197,10 +209,10 @@ public void createListView(final ArrayList scenes) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -238,9 +250,9 @@ private SceneInfo getScene(int idx) { private void showInfoDialog(final SceneInfo mSceneInfo) { SceneInfoDialog infoDialog = new SceneInfoDialog( - getActivity(), - mSceneInfo, - R.layout.dialog_scene_info); + getActivity(), + mSceneInfo, + R.layout.dialog_scene_info); infoDialog.setIdx(String.valueOf(mSceneInfo.getIdx())); infoDialog.setLastUpdate(mSceneInfo.getLastUpdate()); infoDialog.setIsFavorite(mSceneInfo.getFavoriteBoolean()); @@ -310,7 +322,7 @@ public void onSceneClick(int idx, final boolean action) { final SceneInfo clickedScene = getScene(idx); if (clickedScene.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - getActivity(), mDomoticz); + getActivity(), mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -392,9 +404,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(getContext(), "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - getActivity(), - switchLogs, - R.layout.dialog_switch_logs); + getActivity(), + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java index 6f3c95923..9b5cd0502 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java @@ -28,7 +28,9 @@ import android.os.Bundle; import android.os.Parcelable; import android.util.Log; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.LinearLayout; @@ -80,7 +82,7 @@ import nl.hnogames.domoticzapi.Utils.PhoneConnectionUtil; public class Switches extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - switchesClickListener { + switchesClickListener { @SuppressWarnings("unused") private static final String TAG = Switches.class.getSimpleName(); @@ -119,6 +121,16 @@ public void onAttach(Context context) { getActionBar().setTitle(getString(R.string.title_switches)); } + @Override + public View onCreateView(LayoutInflater inflater, + ViewGroup container, + Bundle savedInstanceState) { + View view = super.onCreateView(inflater, container, savedInstanceState); + collapseSortButton.setVisibility(View.VISIBLE); + lySortDevices.setVisibility(View.VISIBLE); + return view; + } + @Override public void onActivityCreated(Bundle savedInstanceState) { onAttachFragment(this); @@ -134,11 +146,11 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -195,25 +207,25 @@ private void createListView(ArrayList switches) { String switchType = mDevicesInfo.getSwitchType(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - appSupportedSwitchesValues.contains(switchTypeVal) && - appSupportedSwitchesNames.contains(switchType)) { + appSupportedSwitchesValues.contains(switchTypeVal) && + appSupportedSwitchesNames.contains(switchType)) { if (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) { supportedSwitches.add(mDevicesInfo); } else { if (mContext != null) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); + // UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.filter_on) + ": " + super.getSort(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(mContext.getString(R.string.filter_on) + ": " + super.getSort()); if ((super.getSort().equals(mContext.getString(R.string.filterOn_on)) && mDevicesInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mDevicesInfo)) { + mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } if ((super.getSort().equals(mContext.getString(R.string.filterOn_off)) && !mDevicesInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mDevicesInfo)) { + mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } if (super.getSort().equals(mContext.getString(R.string.filterOn_static)) && - !mDomoticz.isOnOffSwitch(mDevicesInfo)) { + !mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } } @@ -234,10 +246,10 @@ private void createListView(ArrayList switches) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -269,10 +281,10 @@ public void onRefresh() { private void showInfoDialog(final DevicesInfo mSwitch) { SwitchInfoDialog infoDialog = new SwitchInfoDialog( - mContext, - mDomoticz, - mSwitch, - R.layout.dialog_switch_info); + mContext, + mDomoticz, + mSwitch, + R.layout.dialog_switch_info); infoDialog.setIdx(String.valueOf(mSwitch.getIdx())); infoDialog.setLastUpdate(mSwitch.getLastUpdate()); try { @@ -297,9 +309,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } @@ -309,9 +321,9 @@ private void showTimerDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No timer found.", Toast.LENGTH_LONG).show(); } else { SwitchTimerInfoDialog infoDialog = new SwitchTimerInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } @@ -321,8 +333,8 @@ private void showNotificationDialog(ArrayList notificationInfo Toast.makeText(mContext, "No notifications found.", Toast.LENGTH_LONG).show(); } else { NotificationInfoDialog infoDialog = new NotificationInfoDialog( - mContext, - notificationInfo); + mContext, + notificationInfo); infoDialog.show(); } } @@ -415,14 +427,14 @@ public void onLikeButtonClick(int idx, boolean checked) { public void onColorButtonClick(final int idx) { if (getSwitch(idx).getSubType().contains(DomoticzValues.Device.SubType.Name.WW) && getSwitch(idx).getSubType().contains(DomoticzValues.Device.SubType.Name.RGB)) { RGBWWColorPickerDialog colorDialog = new RGBWWColorPickerDialog(mContext, - getSwitch(idx).getIdx()); + getSwitch(idx).getIdx()); colorDialog.show(); colorDialog.onDismissListener(new RGBWWColorPickerDialog.DismissListener() { @Override public void onDismiss(final int value, final boolean isRGB) { if (getSwitch(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -460,14 +472,14 @@ public void onChangeKelvinColor(int kelvin) { }); } else if (getSwitch(idx).getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) { WWColorPickerDialog colorDialog = new WWColorPickerDialog(mContext, - getSwitch(idx).getIdx()); + getSwitch(idx).getIdx()); colorDialog.show(); colorDialog.onDismissListener(new WWColorPickerDialog.DismissListener() { @Override public void onDismiss(final int kelvin) { if (getSwitch(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -498,7 +510,7 @@ public void onChangeColor(int kelvin) { public void onColorSelected(final ColorEnvelope envelope, boolean fromUser) { if (getSwitch(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -537,45 +549,45 @@ private void setKelvinColor(int kelvin, final int idx, final String password, fi } mDomoticz.setAction(idx, - DomoticzValues.Json.Url.Set.KELVIN, - DomoticzValues.Device.Dimmer.Action.KELVIN, - kelvin, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (result.contains("WRONG CODE")) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - if (getSwitch(idx) == null) - return; - if (selected) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); - } - } - } - - @Override - @DebugLog - public void onError(Exception error) { - if (selected) { - if (!UsefulBits.isEmpty(password)) { + DomoticzValues.Json.Url.Set.KELVIN, + DomoticzValues.Device.Dimmer.Action.KELVIN, + kelvin, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (result.contains("WRONG CODE")) { UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + if (getSwitch(idx) == null) + return; + if (selected) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.color_set); + } } } - } - }); + + @Override + @DebugLog + public void onError(Exception error) { + if (selected) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } + } + } + }); } private void setRGBColor(int selectedColor, final int idx, final String password, final boolean selected) { @@ -594,40 +606,40 @@ private void setRGBColor(int selectedColor, final int idx, final String password isWhite = true; } mDomoticz.setRGBColorAction(idx, - DomoticzValues.Json.Url.Set.RGBCOLOR, - hue, - getSwitch(idx).getLevel(), - isWhite, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (getSwitch(idx) == null) - return; - if (selected) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); + DomoticzValues.Json.Url.Set.RGBCOLOR, + hue, + getSwitch(idx).getLevel(), + isWhite, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (getSwitch(idx) == null) + return; + if (selected) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.color_set); + } } - } - @Override - @DebugLog - public void onError(Exception error) { - if (selected) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + @Override + @DebugLog + public void onError(Exception error) { + if (selected) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } } } - } - }); + }); } @Override @@ -686,8 +698,8 @@ public void onSetTemperatureClick(int idx) { @DebugLog public void onSecurityPanelButtonClick(int idx) { SecurityPanelDialog securityDialog = new SecurityPanelDialog( - mContext, mDomoticz, - getSwitch(idx)); + mContext, mDomoticz, + getSwitch(idx)); securityDialog.show(); securityDialog.onDismissListener(new SecurityPanelDialog.DismissListener() { @@ -703,52 +715,52 @@ public void onDismiss() { @DebugLog public void onStateButtonClick(final int idx, int itemsRes, final int[] stateIds) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(itemsRes) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { - if (getSwitch(idx).isProtected()) { - PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - setState(idx, stateIds[which], password); - } + .title(R.string.choose_status) + .items(itemsRes) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { + if (getSwitch(idx).isProtected()) { + PasswordDialog passwordDialog = new PasswordDialog( + mContext, mDomoticz); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + setState(idx, stateIds[which], password); + } - @Override - public void onCancel() { - } - }); - } else - setState(idx, stateIds[which], null); - } - }) - .show(); + @Override + public void onCancel() { + } + }); + } else + setState(idx, stateIds[which], null); + } + }) + .show(); } @Override @DebugLog public void onSelectorDimmerClick(final int idx, final String[] levelNames) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - for (int i = 0; i < levelNames.length; i++) { - if (levelNames[i].equals(text)) { - onDimmerChange(idx, i * 10, true); + .title(R.string.choose_status) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + for (int i = 0; i < levelNames.length; i++) { + if (levelNames[i].equals(text)) { + onDimmerChange(idx, i * 10, true); + } } } - } - }) - .show(); + }) + .show(); } @Override @@ -791,32 +803,32 @@ public boolean onItemLongClicked(int idx) { private void setState(final int idx, int state, final String password) { mDomoticz.setModalAction(idx, - state, - 1, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (getSwitch(idx) == null) - return; - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.state_set); - getSwitchesData(); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + state, + 1, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (getSwitch(idx) == null) + return; + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else - errorHandling(error); - } - }); + ((MainActivity) getActivity()).Talk(R.string.state_set); + getSwitchesData(); + } + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else + errorHandling(error); + } + }); } private DevicesInfo getSwitch(int idx) { @@ -840,7 +852,7 @@ public void onSwitchClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -886,8 +898,8 @@ private void toggleSwitch(DevicesInfo clickedSwitch, boolean checked, final Stri if (checked) jsonAction = DomoticzValues.Scene.Action.ON; else jsonAction = DomoticzValues.Scene.Action.OFF; } else if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { @@ -934,7 +946,7 @@ public void onButtonClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1016,7 +1028,7 @@ public void onBlindClick(final int idx, final int jsonAction) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1110,7 +1122,7 @@ public void onDimmerChange(int idx, final int value, final boolean selector) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1140,8 +1152,8 @@ private void setDimmerState(DevicesInfo clickedSwitch, int value, final boolean return; } String text = String.format(mContext.getString(R.string.set_level_switch), - clickedSwitch.getName(), - !selector ? (value - 1) : ((value) / 10) + 1); + clickedSwitch.getName(), + !selector ? (value - 1) : ((value) / 10) + 1); UsefulBits.showSnackbar(mContext, coordinatorLayout, text, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(text); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java index c34a9e8a5..b75fcfac7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java @@ -113,11 +113,11 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -168,10 +168,10 @@ private void createListView(ArrayList mTemperatureInfos) { } if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -193,9 +193,9 @@ public void onRefresh() { private void showInfoDialog(final TemperatureInfo mTemperatureInfo) { TemperatureInfoDialog infoDialog = new TemperatureInfoDialog( - mContext, - mTemperatureInfo, - R.layout.dialog_utilities_info); + mContext, + mTemperatureInfo, + R.layout.dialog_utilities_info); infoDialog.setIdx(String.valueOf(mTemperatureInfo.getIdx())); infoDialog.setLastUpdate(mTemperatureInfo.getLastUpdate()); infoDialog.setIsFavorite(mTemperatureInfo.getFavoriteBoolean()); @@ -321,13 +321,13 @@ public void onError(Exception error) { TemperatureDialog tempDialog; if (evohomeZone) { tempDialog = new ScheduledTemperatureDialog( - mContext, - t.getSetPoint(), - !"auto".equalsIgnoreCase(t.getStatus())); + mContext, + t.getSetPoint(), + !"auto".equalsIgnoreCase(t.getStatus())); } else { tempDialog = new TemperatureDialog( - mContext, - t.getSetPoint()); + mContext, + t.getSetPoint()); } tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @@ -338,7 +338,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to " + newSetPoint); String params = "&setpoint=" + newSetPoint + - "&mode=" + PERMANENT_OVERRIDE; + "&mode=" + PERMANENT_OVERRIDE; // add query parameters mDomoticz.setDeviceUsed(idx, t.getName(), t.getDescription(), params, commandReceiver); @@ -346,7 +346,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to Auto"); String params = "&setpoint=" + newSetPoint + - "&mode=" + AUTO; + "&mode=" + AUTO; // add query parameters mDomoticz.setDeviceUsed(idx, t.getName(), t.getDescription(), params, commandReceiver); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/TemperatureMainPager.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/TemperatureMainPager.java index e01c35ceb..f3fc7bca1 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/TemperatureMainPager.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/TemperatureMainPager.java @@ -67,8 +67,8 @@ public void onCreate(Bundle savedInstanceState) { public void RefreshFragment() { try { Fragment f = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (f instanceof DomoticzRecyclerFragment) { ((DomoticzRecyclerFragment) f).refreshFragment(); ((DomoticzRecyclerFragment) f).showViews(); @@ -88,8 +88,8 @@ public void RefreshFragment() { public void Filter(String newText) { try { Fragment n = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (n instanceof DomoticzDashboardFragment) { ((DomoticzDashboardFragment) n).Filter(newText); } else if (n instanceof DomoticzRecyclerFragment) { @@ -105,8 +105,8 @@ public void Filter(String newText) { public void sortFragment(String selectedSort) { try { Fragment f = (Fragment) vpPager - .getAdapter() - .instantiateItem(vpPager, vpPager.getCurrentItem()); + .getAdapter() + .instantiateItem(vpPager, vpPager.getCurrentItem()); if (f instanceof DomoticzRecyclerFragment) { ((DomoticzRecyclerFragment) f).sortFragment(selectedSort); } else if (f instanceof DomoticzDashboardFragment) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java index 9ef9a496b..fe43e0974 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java @@ -160,19 +160,19 @@ public void onUserVariableClick(final UserVariableInfo clickedVar) { return; } new MaterialDialog.Builder(mContext) - .title(R.string.title_vars) - .content(clickedVar.getName() + " -> " + clickedVar.getTypeValue()) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(null, clickedVar.getValue(), new MaterialDialog.InputCallback() { - @Override - public void onInput(MaterialDialog dialog, CharSequence input) { - if (validateInput(String.valueOf(input), clickedVar.getType())) { - updateUserVariable(String.valueOf(input), clickedVar); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.var_input), Snackbar.LENGTH_SHORT); + .title(R.string.title_vars) + .content(clickedVar.getName() + " -> " + clickedVar.getTypeValue()) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(null, clickedVar.getValue(), new MaterialDialog.InputCallback() { + @Override + public void onInput(MaterialDialog dialog, CharSequence input) { + if (validateInput(String.valueOf(input), clickedVar.getType())) { + updateUserVariable(String.valueOf(input), clickedVar); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.var_input), Snackbar.LENGTH_SHORT); + } } - } - }).show(); + }).show(); } private boolean validateInput(String input, String type) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java index ac452a359..c4916f4ab 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java @@ -64,7 +64,7 @@ import nl.hnogames.domoticzapi.Utils.PhoneConnectionUtil; public class Utilities extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - UtilityClickListener { + UtilityClickListener { private ArrayList mUtilitiesInfos; private double thermostatSetPointValue; @@ -113,11 +113,11 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -168,10 +168,10 @@ private void createListView() { } if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -194,9 +194,9 @@ public void onRefresh() { private void showInfoDialog(final UtilitiesInfo mUtilitiesInfo) { UtilitiesInfoDialog infoDialog = new UtilitiesInfoDialog( - mContext, - mUtilitiesInfo, - R.layout.dialog_utilities_info); + mContext, + mUtilitiesInfo, + R.layout.dialog_utilities_info); infoDialog.setIdx(String.valueOf(mUtilitiesInfo.getIdx())); infoDialog.setLastUpdate(mUtilitiesInfo.getLastUpdate()); infoDialog.setIsFavorite(mUtilitiesInfo.getFavoriteBoolean()); @@ -240,24 +240,24 @@ private void changeFavorite(final UtilitiesInfo mUtilitiesInfo, final boolean is else jsonAction = DomoticzValues.Device.Favorite.OFF; mDomoticz.setAction(mUtilitiesInfo.getIdx(), - jsonUrl, - jsonAction, - 0, - null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - mUtilitiesInfo.setFavoriteBoolean(isFavorite); - } + jsonUrl, + jsonAction, + 0, + null, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + mUtilitiesInfo.setFavoriteBoolean(isFavorite); + } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } /** @@ -326,20 +326,20 @@ public void onClick(UtilitiesInfo utility) { public void onLogClick(final UtilitiesInfo utility, final String range) { int steps = 2; String graphType = utility.getSubType() - .replace("Electric", "counter") - .replace("kWh", "counter") - .replace("Gas", "counter") - .replace("Energy", "counter") - .replace("Voltcraft", "counter") - .replace("Voltage", "counter") - .replace("SetPoint", "temp") - .replace("Lux", "counter") - .replace("BWR102", "counter") - .replace("Sound Level", "counter") - .replace("Managed Counter", "counter") - .replace("Pressure", "counter") - .replace("Custom Sensor", "Percentage") - .replace("YouLess counter", "counter"); + .replace("Electric", "counter") + .replace("kWh", "counter") + .replace("Gas", "counter") + .replace("Energy", "counter") + .replace("Voltcraft", "counter") + .replace("Voltage", "counter") + .replace("SetPoint", "temp") + .replace("Lux", "counter") + .replace("BWR102", "counter") + .replace("Sound Level", "counter") + .replace("Managed Counter", "counter") + .replace("Pressure", "counter") + .replace("Custom Sensor", "Percentage") + .replace("YouLess counter", "counter"); if (graphType.toLowerCase().contains("counter")) graphType = "counter"; @@ -371,8 +371,8 @@ public void onThermostatClick(final int idx) { final UtilitiesInfo tempUtil = getUtility(idx); TemperatureDialog tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @Override @@ -383,7 +383,7 @@ public void onDialogAction(final double newSetPoint, DialogAction dialogAction) if (tempUtil != null) { if (tempUtil.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -430,30 +430,30 @@ public void setThermostatAction(final UtilitiesInfo tempUtil, action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(tempUtil.getIdx(), - jsonUrl, - action, - newSetPoint, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - if (result.contains("WRONG CODE")) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - updateThermostatSetPointValue(tempUtil.getIdx(), thermostatSetPointValue); - successHandling(result, false); + jsonUrl, + action, + newSetPoint, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + if (result.contains("WRONG CODE")) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + updateThermostatSetPointValue(tempUtil.getIdx(), thermostatSetPointValue); + successHandling(result, false); + } } - } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } @@ -523,9 +523,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java index 333e2f526..3d628130e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java @@ -112,11 +112,11 @@ public void Filter(String text) { try { if (adapter != null) { if (UsefulBits.isEmpty(text) && - (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } mItemTouchHelper.attachToRecyclerView(gridView); } else { @@ -167,10 +167,10 @@ private void createListView(ArrayList mWeatherInfos) { if (mItemTouchHelper == null) { mItemTouchHelper = new ItemTouchHelper(new RVHItemTouchHelperCallback(adapter, true, false, - false)); + false)); } if ((UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) && - mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { + mSharedPrefs.enableCustomSorting() && !mSharedPrefs.isCustomSortingLocked()) { mItemTouchHelper.attachToRecyclerView(gridView); } else { if (mItemTouchHelper != null) @@ -192,9 +192,9 @@ public void onRefresh() { private void showInfoDialog(final WeatherInfo mWeatherInfo) { WeatherInfoDialog infoDialog = new WeatherInfoDialog( - mContext, - mWeatherInfo, - R.layout.dialog_weather); + mContext, + mWeatherInfo, + R.layout.dialog_weather); infoDialog.setWeatherInfo(mWeatherInfo); infoDialog.show(); infoDialog.onDismissListener(new WeatherInfoDialog.DismissListener() { @@ -236,24 +236,24 @@ private void changeFavorite(final WeatherInfo mWeatherInfo, final boolean isFavo else jsonAction = DomoticzValues.Device.Favorite.OFF; mDomoticz.setAction(mWeatherInfo.getIdx(), - jsonUrl, - jsonAction, - 0, - null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - mWeatherInfo.setFavoriteBoolean(isFavorite); - } + jsonUrl, + jsonAction, + 0, + null, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + mWeatherInfo.setFavoriteBoolean(isFavorite); + } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } @Override @@ -280,9 +280,9 @@ public void onPause() { @DebugLog public void onLogClick(final WeatherInfo weather, final String range) { final String graphType = weather.getTypeImg() - .toLowerCase() - .replace("temperature", "temp") - .replace("visibility", "counter"); + .toLowerCase() + .replace("temperature", "temp") + .replace("visibility", "counter"); JSONObject language = null; Language languageObj = new SharedPrefUtil(mContext).getSavedLanguage(); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java index 573004e16..90e7c5a34 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java @@ -160,563 +160,563 @@ public List generateCards(List cardsToGenerate) { for (String card : cardsToGenerate) { if (card.equalsIgnoreCase(WELCOME)) { cards.add((new Card.Builder(context) - .setTag(WELCOME) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_welcome_card_layout) - .setTitle(context.getString(R.string.wizard_welcome)) - .setTitleColor(titleColorLight) - .setDescription(context.getString(R.string.wizard_welcome_description)) - .setDescriptionColor(titleColorLight) - .setSubtitleColor(titleColorLight) - .setBackgroundColor(blueColor) - .addAction(R.id.ok_button, new WelcomeButtonAction(context) - .setText(context.getString(R.string.wizard_button_nice)) - .setTextColor(titleColorLight) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - }))).endConfig().build()); + .setTag(WELCOME) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_welcome_card_layout) + .setTitle(context.getString(R.string.wizard_welcome)) + .setTitleColor(titleColorLight) + .setDescription(context.getString(R.string.wizard_welcome_description)) + .setDescriptionColor(titleColorLight) + .setSubtitleColor(titleColorLight) + .setBackgroundColor(blueColor) + .addAction(R.id.ok_button, new WelcomeButtonAction(context) + .setText(context.getString(R.string.wizard_button_nice)) + .setTextColor(titleColorLight) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + }))).endConfig().build()); } if (card.equalsIgnoreCase(FAVORITE)) { cards.add(new Card.Builder(context) - .setTag(FAVORITE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setBackgroundColor(otherColor) - .setTitle(context.getString(R.string.wizard_favorites)) - .setTitleColor(titleColorOther) - .setDescription(context.getString(R.string.wizard_favorites_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_switches)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(FAVORITE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setBackgroundColor(otherColor) + .setTitle(context.getString(R.string.wizard_favorites)) + .setTitleColor(titleColorOther) + .setDescription(context.getString(R.string.wizard_favorites_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_switches)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(STARTUP)) { cards.add(new Card.Builder(context) - .setTag(STARTUP) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_startup)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_startup_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(STARTUP) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_startup)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_startup_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(GEOFENCE)) { cards.add(new Card.Builder(context) - .setTag(GEOFENCE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_geo)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_geo_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(GEOFENCE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_geo)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_geo_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(NFC)) { cards.add(new Card.Builder(context) - .setTag(NFC) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_nfc)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_nfc_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(NFC) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_nfc)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_nfc_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(QRCODE)) { cards.add(new Card.Builder(context) - .setTag(QRCODE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_qrcode)) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_qrcode_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(QRCODE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_qrcode)) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_qrcode_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(BLUETOOTH)) { cards.add(new Card.Builder(context) - .setTag(BLUETOOTH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.bluetooth)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_bluetooth_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(BLUETOOTH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.bluetooth)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_bluetooth_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(SPEECH)) { cards.add(new Card.Builder(context) - .setTag(SPEECH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_speech)) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_speech_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(SPEECH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_speech)) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_speech_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(WEAR)) { cards.add(new Card.Builder(context) - .setTag(WEAR) - .setDismissible() - .withProvider(new CardProvider()) - .setTitleColor(titleColorOther) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_wear)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_wear_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(WEAR) + .setDismissible() + .withProvider(new CardProvider()) + .setTitleColor(titleColorOther) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_wear)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_wear_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(AUTO)) { cards.add(new Card.Builder(context) - .setTag(AUTO) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setBackgroundColor(otherColor) - .setTitle(context.getString(R.string.wizard_auto)) - .setTitleColor(titleColorOther) - .setDescription(context.getString(R.string.wizard_auto_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(AUTO) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setBackgroundColor(otherColor) + .setTitle(context.getString(R.string.wizard_auto)) + .setTitleColor(titleColorOther) + .setDescription(context.getString(R.string.wizard_auto_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(LANGUAGE)) { cards.add(new Card.Builder(context) - .setTag(LANGUAGE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setBackgroundColor(otherColor) - .setTitle(context.getString(R.string.category_help)) - .setTitleColor(titleColorOther) - .setDescription(context.getString(R.string.translate_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.ok)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse("https://crowdin.com/project/domoticz-for-android")); - startActivity(i); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(LANGUAGE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setBackgroundColor(otherColor) + .setTitle(context.getString(R.string.category_help)) + .setTitleColor(titleColorOther) + .setDescription(context.getString(R.string.translate_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.ok)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse("https://crowdin.com/project/domoticz-for-android")); + startActivity(i); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(NOTIFICATIONS)) { cards.add(new Card.Builder(context) - .setTag(NOTIFICATIONS) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_notifications)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_notifications_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(NOTIFICATIONS) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_notifications)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_notifications_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(MULTISERVER)) { cards.add(new Card.Builder(context) - .setTag(MULTISERVER) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_multiserver)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_multiserver_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(MULTISERVER) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_multiserver)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_multiserver_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(GRAPH)) { cards.add(new Card.Builder(context) - .setTag(GRAPH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_graph)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_graph_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_utilities)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(GRAPH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_graph)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_graph_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_utilities)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(FILTER)) { cards.add(new Card.Builder(context) - .setTag(FILTER) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_filter)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_filter_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_nice)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(FILTER) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_filter)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_filter_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_nice)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(WIDGETS)) { cards.add(new Card.Builder(context) - .setTag(WIDGETS) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_widgets)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_widgets_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText("") - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); + .setTag(WIDGETS) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_widgets)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_widgets_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText("") + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(FINISH)) { cards.add(new Card.Builder(context) - .setTag(FINISH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_menuitem)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_menuitem_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_wizard)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - mSharedPrefs.removeWizard(); - ((MainActivity) getActivity()).drawNavigationMenu(null); - ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText("") - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - mSharedPrefs.removeWizard(); - ((MainActivity) getActivity()).drawNavigationMenu(null); - ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); - } - })) - .endConfig() - .build()); + .setTag(FINISH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_menuitem)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_menuitem_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_wizard)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + mSharedPrefs.removeWizard(); + ((MainActivity) getActivity()).drawNavigationMenu(null); + ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText("") + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + mSharedPrefs.removeWizard(); + ((MainActivity) getActivity()).drawNavigationMenu(null); + ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); + } + })) + .endConfig() + .build()); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java index de822de0b..604b39d8a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java @@ -128,13 +128,13 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { geoSwitch.setChecked(false); geoNotificationSwitch.setEnabled(false); permissionHelper - .request(PermissionsUtil.INITIAL_LOCATION_PERMS); + .request(PermissionsUtil.INITIAL_LOCATION_PERMS); } else { if (!PermissionsUtil.canAccessStorage(GeoSettingsActivity.this)) { geoSwitch.setChecked(false); geoNotificationSwitch.setEnabled(false); permissionHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } else { //all settings are correct mSharedPrefs.setGeofenceEnabled(true); @@ -176,8 +176,8 @@ protected void onResume() { } private void showSwitchesDialog( - final LocationInfo selectedLocation, - final ArrayList switches) { + final LocationInfo selectedLocation, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -186,9 +186,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - GeoSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + GeoSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -222,18 +222,18 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final LocationInfo selectedLocation, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - selectedLocation.setValue(String.valueOf(text)); - mSharedPrefs.updateLocation(selectedLocation); - adapter.data = mSharedPrefs.getLocations(); - adapter.notifyDataSetChanged(); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + selectedLocation.setValue(String.valueOf(text)); + mSharedPrefs.updateLocation(selectedLocation); + adapter.data = mSharedPrefs.getLocations(); + adapter.notifyDataSetChanged(); + } + }) + .show(); } private void createListView() { @@ -289,7 +289,7 @@ private void showRemoveUndoSnackbar(final LocationInfo locationInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.geofence)); + getString(R.string.geofence)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -346,33 +346,33 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(GeoSettingsActivity.this, coordinatorLayout, GeoSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(locationInfo); - } - }, GeoSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(locationInfo); + } + }, GeoSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private boolean showNoDeviceAttachedDialog(final LocationInfo locationInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(locationInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(locationInfo); + result = true; + } + }) + .show(); return result; } @@ -403,17 +403,17 @@ protected void onActivityResult(int requestCode, int resultCode, final Intent da String name = data.getStringExtra(LocationPickerActivity.LOCATION_ADDRESS); if (nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) { new MaterialDialog.Builder(this) - .title(R.string.title_edit_location) - .content(R.string.Location_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(null, prefillEditedName, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - String name = String.valueOf(input); - if (!nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) - showRadiusEditor(editedID, name, latLng); - } - }).show(); + .title(R.string.title_edit_location) + .content(R.string.Location_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(null, prefillEditedName, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + String name = String.valueOf(input); + if (!nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) + showRadiusEditor(editedID, name, latLng); + } + }).show(); } else showRadiusEditor(editedLocationID, name, latLng); } else if (resultCode != RESULT_CANCELED) @@ -438,35 +438,35 @@ private void showRadiusEditor(final int editedLocationID, String name, LatLng la final LocationInfo finalLocation = location; new MaterialDialog.Builder(GeoSettingsActivity.this) - .title(R.string.radius) - .content(R.string.radius) - .inputType(InputType.TYPE_CLASS_NUMBER) - .input("500", String.valueOf(location.getRadius()), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - try { - finalLocation.setRadius(Integer.parseInt(String.valueOf(input))); - } catch (Exception ex) { - } + .title(R.string.radius) + .content(R.string.radius) + .inputType(InputType.TYPE_CLASS_NUMBER) + .input("500", String.valueOf(location.getRadius()), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + try { + finalLocation.setRadius(Integer.parseInt(String.valueOf(input))); + } catch (Exception ex) { + } - if (editedLocationID != -1 && locations != null) { - mSharedPrefs.updateLocation(finalLocation); - for (int i = locations.size() - 1; i >= 0; i--) - if (locations.get(i).getID() == editedLocationID) { - locations.set(i, finalLocation); - GeoUtils.geofencesAlreadyRegistered = false; - oGeoUtils.AddGeofences(); - break; - } - } else { - mSharedPrefs.addLocation(finalLocation); - locations = mSharedPrefs.getLocations(); - GeoUtils.geofencesAlreadyRegistered = false; - oGeoUtils.AddGeofences(); + if (editedLocationID != -1 && locations != null) { + mSharedPrefs.updateLocation(finalLocation); + for (int i = locations.size() - 1; i >= 0; i--) + if (locations.get(i).getID() == editedLocationID) { + locations.set(i, finalLocation); + GeoUtils.geofencesAlreadyRegistered = false; + oGeoUtils.AddGeofences(); + break; + } + } else { + mSharedPrefs.addLocation(finalLocation); + locations = mSharedPrefs.getLocations(); + GeoUtils.geofencesAlreadyRegistered = false; + oGeoUtils.AddGeofences(); + } + adapter.notifyDataSetChanged(); } - adapter.notifyDataSetChanged(); - } - }).show(); + }).show(); } private void showEditLocationDialog(LocationInfo location) { @@ -507,7 +507,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionHelper.declinedPermissions(GeoSettingsActivity.this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(GeoSettingsActivity.this, permissionHelper, GeoSettingsActivity.this.getString(R.string.permission_title), - GeoSettingsActivity.this.getString(R.string.permission_desc_location), neededPermission); + GeoSettingsActivity.this.getString(R.string.permission_desc_location), neededPermission); if (!alert.isShowing()) { alert.show(); } @@ -548,7 +548,7 @@ public void onPermissionGranted(@NonNull String[] permissionName) { invalidateOptionsMenu(); } else { permissionHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } } } diff --git a/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java b/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java index 2eb26b6ad..da0a1c6b3 100644 --- a/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java @@ -60,7 +60,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, - graph).commit(); + graph).commit(); } catch (Exception ex) { this.finish(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Helpers/BasicAuthInterceptor.java b/app/src/main/java/nl/hnogames/domoticz/Helpers/BasicAuthInterceptor.java index 8ce402c51..6e66a7565 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Helpers/BasicAuthInterceptor.java +++ b/app/src/main/java/nl/hnogames/domoticz/Helpers/BasicAuthInterceptor.java @@ -20,8 +20,8 @@ public BasicAuthInterceptor(String username, String password) { public Response intercept(Chain chain) throws IOException { String credential = Credentials.basic(username, password); Request compressedRequest = chain.request().newBuilder() - .header("Authorization", credential) - .build(); + .header("Authorization", credential) + .build(); return chain.proceed(compressedRequest); } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Helpers/DefaultHeadersInterceptor.java b/app/src/main/java/nl/hnogames/domoticz/Helpers/DefaultHeadersInterceptor.java index 892f75f54..969447c1c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Helpers/DefaultHeadersInterceptor.java +++ b/app/src/main/java/nl/hnogames/domoticz/Helpers/DefaultHeadersInterceptor.java @@ -44,12 +44,12 @@ public Response intercept(Chain chain) throws IOException { Request request = chain.request(); Request.Builder builder = request.newBuilder(); builder.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") - .header("Connection", "keep-alive") - //.header("Accept-Language", "en-GB,en;q=0.5") - //.header("Upgrade-Insecure-Requests", "1") - .header("Accept-Encoding", "gzip, deflate, br") - //.header("X-Client-Id", getPackageName() + "-" + getVersionName() + "-" + getVersionCode() + "-" + getBuildType()) - .header("User-Agent", getPackageName() + "-" + getVersionName() + "-" + getVersionCode() + "-" + getBuildType()); + .header("Connection", "keep-alive") + //.header("Accept-Language", "en-GB,en;q=0.5") + //.header("Upgrade-Insecure-Requests", "1") + .header("Accept-Encoding", "gzip, deflate, br") + //.header("X-Client-Id", getPackageName() + "-" + getVersionName() + "-" + getVersionCode() + "-" + getBuildType()) + .header("User-Agent", getPackageName() + "-" + getVersionName() + "-" + getVersionCode() + "-" + getBuildType()); if (useBasicAuth) builder.header("Authorization", Credentials.basic(sUsername, sPassword)); if (useCookie) diff --git a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java index c8d36d918..f980cb928 100644 --- a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java @@ -87,8 +87,6 @@ import nl.hnogames.domoticz.Fragments.Cameras; import nl.hnogames.domoticz.Fragments.Logs; import nl.hnogames.domoticz.Fragments.MainPager; -import nl.hnogames.domoticz.Fragments.Scenes; -import nl.hnogames.domoticz.Fragments.Switches; import nl.hnogames.domoticz.Fragments.TemperatureMainPager; import nl.hnogames.domoticz.UI.PasswordDialog; import nl.hnogames.domoticz.UI.SortDialog; @@ -110,15 +108,11 @@ import nl.hnogames.domoticzapi.Containers.ConfigInfo; import nl.hnogames.domoticzapi.Containers.DevicesInfo; import nl.hnogames.domoticzapi.Containers.ServerInfo; -import nl.hnogames.domoticzapi.Containers.ServerUpdateInfo; import nl.hnogames.domoticzapi.Containers.UserInfo; -import nl.hnogames.domoticzapi.Containers.VersionInfo; import nl.hnogames.domoticzapi.Domoticz; import nl.hnogames.domoticzapi.DomoticzValues; import nl.hnogames.domoticzapi.Interfaces.ConfigReceiver; import nl.hnogames.domoticzapi.Interfaces.DevicesReceiver; -import nl.hnogames.domoticzapi.Interfaces.UpdateVersionReceiver; -import nl.hnogames.domoticzapi.Interfaces.VersionReceiver; import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver; import nl.hnogames.domoticzapi.Utils.ServerUtil; import shortbread.Shortcut; @@ -205,9 +199,10 @@ protected void onCreate(Bundle savedInstanceState) { } toolbar = findViewById(R.id.toolbar); - if (mSharedPrefs.darkThemeEnabled()) + if (mSharedPrefs.darkThemeEnabled()) { toolbar.setBackgroundColor(getResources().getColor(R.color.secondary)); - + toolbar.setPopupTheme(R.style.ThemeOverlay_AppCompat_Dark); + } setSupportActionBar(toolbar); boolean resolvableError = UsefulBits.checkPlayServicesAvailable(this); @@ -251,11 +246,11 @@ public void onAuthenticationFailed() { } }); promptInfo = new BiometricPrompt.PromptInfo.Builder() - .setTitle(getString(R.string.app_name_domoticz)) - .setSubtitle(getString(R.string.fingerprint_make_sure)) - .setDescription(getString(R.string.fingerprint_dialog_description)) - .setNegativeButtonText(getString(R.string.security_password_fallback)) - .build(); + .setTitle(getString(R.string.app_name_domoticz)) + .setSubtitle(getString(R.string.fingerprint_make_sure)) + .setDescription(getString(R.string.fingerprint_dialog_description)) + .setNegativeButtonText(getString(R.string.security_password_fallback)) + .build(); } private void FallbackSecurity() { @@ -365,7 +360,6 @@ public void buildscreen() { drawNavigationMenu(mConfigInfo); if (!fromShortcut) addFragment(); - checkDomoticzServerUpdate(mConfigInfo); } /* Called when the second activity's finishes */ @@ -441,10 +435,10 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { public void hideViews() { toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator(2)); toolbar.setVisibility(View.GONE); + toolbar.animate().translationY(0).setInterpolator(new DecelerateInterpolator(2)); } public void showViews() { - toolbar.animate().translationY(0).setInterpolator(new DecelerateInterpolator(2)); toolbar.setVisibility(View.VISIBLE); } @@ -469,7 +463,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { if (!isSceneOrGroup) { if (inputJSONAction < 0) { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (!mDevicesInfo.getStatusBoolean()) { jsonAction = DomoticzValues.Device.Switch.Action.OFF; if (!UsefulBits.isEmpty(value)) { @@ -500,7 +494,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } } else { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (inputJSONAction == 1) { jsonAction = DomoticzValues.Device.Switch.Action.OFF; if (!UsefulBits.isEmpty(value)) { @@ -748,7 +742,7 @@ public void run() { } }); } - }, 0, 5000);//schedule in 5 seconds + }, 0, (mSharedPrefs.getAutoRefreshTimer() * 1000)); } } @@ -787,10 +781,10 @@ private void setupMobileDevice() { private void appRate() { if (!BuildConfig.DEBUG) { AppRate.with(this) - .setInstallDays(0) // default 10, 0 means install day. - .setLaunchTimes(3) // default 10 - .setRemindInterval(2) // default 1 - .monitor(); + .setInstallDays(0) // default 10, 0 means install day. + .setLaunchTimes(3) // default 10 + .setRemindInterval(2) // default 1 + .monitor(); // Show a dialog if meets conditions AppRate.showRateDialogIfMeetsConditions(this); @@ -806,9 +800,9 @@ public void drawNavigationMenu(final ConfigInfo mConfig) { config = mServerUtil.getActiveServer().getConfigInfo(this); ProfileDrawerItem loggedinAccount = new ProfileDrawerItem() - .withName("Logged in") - .withEmail(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME)) - .withIcon(R.mipmap.ic_launcher); + .withName("Logged in") + .withEmail(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME)) + .withIcon(R.mipmap.ic_launcher); if (mSharedPrefs.darkThemeEnabled()) { loggedinAccount.withSelectedColorRes(R.color.primary); loggedinAccount.withSelectedTextColorRes(R.color.white); @@ -818,78 +812,78 @@ public void drawNavigationMenu(final ConfigInfo mConfig) { // Create the AccountHeader final ConfigInfo finalConfig = config; AccountHeader headerResult = new AccountHeaderBuilder() - .withActivity(this) - .withHeaderBackground(R.drawable.darkheader) - .addProfiles(loggedinAccount) - .withOnlyMainProfileImageVisible(true) - .withTextColorRes(R.color.white) - .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { - @Override - @DebugLog - public boolean onProfileChanged(View view, final IProfile profile, boolean current) { - if (!current) { - if (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated()) { - if (getFragmentCoordinatorLayout() != null) { - Snackbar.make(getFragmentCoordinatorLayout(), getString(R.string.category_account) + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) - .setAction(R.string.upgrade, new View.OnClickListener() { - @Override - public void onClick(View view) { - UsefulBits.openPremiumAppStore(MainActivity.this); - } - }) - .setActionTextColor(ContextCompat.getColor(MainActivity.this, R.color.primary)) - .show(); - } - return false; - } else { - PasswordDialog passwordDialog = new PasswordDialog(MainActivity.this, null); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - if (UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - Talk(R.string.security_wrong_code); - drawNavigationMenu(finalConfig); - } else { - for (UserInfo user : finalConfig.getUsers()) { - if (user.getUsername().equals(profile.getEmail().getText())) { - String md5Pass = UsefulBits.getMd5String(password); - if (md5Pass.equals(user.getPassword())) { - domoticz.LogOff(); - domoticz.setUserCredentials(user.getUsername(), password); - initScreen(); - } else { - UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - drawNavigationMenu(finalConfig); + .withActivity(this) + .withHeaderBackground(R.drawable.darkheader) + .addProfiles(loggedinAccount) + .withOnlyMainProfileImageVisible(true) + .withTextColorRes(R.color.white) + .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { + @Override + @DebugLog + public boolean onProfileChanged(View view, final IProfile profile, boolean current) { + if (!current) { + if (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated()) { + if (getFragmentCoordinatorLayout() != null) { + Snackbar.make(getFragmentCoordinatorLayout(), getString(R.string.category_account) + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) + .setAction(R.string.upgrade, new View.OnClickListener() { + @Override + public void onClick(View view) { + UsefulBits.openPremiumAppStore(MainActivity.this); + } + }) + .setActionTextColor(ContextCompat.getColor(MainActivity.this, R.color.primary)) + .show(); + } + return false; + } else { + PasswordDialog passwordDialog = new PasswordDialog(MainActivity.this, null); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + if (UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + Talk(R.string.security_wrong_code); + drawNavigationMenu(finalConfig); + } else { + for (UserInfo user : finalConfig.getUsers()) { + if (user.getUsername().equals(profile.getEmail().getText())) { + String md5Pass = UsefulBits.getMd5String(password); + if (md5Pass.equals(user.getPassword())) { + domoticz.LogOff(); + domoticz.setUserCredentials(user.getUsername(), password); + initScreen(); + } else { + UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + drawNavigationMenu(finalConfig); + } } } } } - } - @Override - public void onCancel() { - } - }); - } + @Override + public void onCancel() { + } + }); + } - drawNavigationMenu(finalConfig); + drawNavigationMenu(finalConfig); + } + return false; } - return false; - } - }) - .build(); + }) + .build(); if (config != null && - config.getUsers() != null) { + config.getUsers() != null) { for (UserInfo user : config.getUsers()) { if (!allUsers.contains(user.getUsername())) { ProfileDrawerItem profile = new ProfileDrawerItem().withName(user.getRightsValue(this) ).withEmail(user.getUsername()) - .withIcon(R.drawable.users) - .withEnabled(user.isEnabled()); + .withIcon(R.drawable.users) + .withEnabled(user.isEnabled()); if (mSharedPrefs.darkThemeEnabled()) { profile.withSelectedColorRes(R.color.primary); @@ -901,38 +895,38 @@ public void onCancel() { } drawer = new DrawerBuilder() - .withActivity(this) - .withTranslucentStatusBar(false) - .withActionBarDrawerToggle(true) - .withAccountHeader(headerResult) - .withToolbar(toolbar) - .withSelectedItem(-1) - .withDrawerItems(getDrawerItems()) - .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { - @Override - @DebugLog - public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { - if (drawerItem != null) { - if (searchViewAction != null) { - searchViewAction.setQuery("", false); - searchViewAction.clearFocus(); - } + .withActivity(this) + .withTranslucentStatusBar(false) + .withActionBarDrawerToggle(true) + .withAccountHeader(headerResult) + .withToolbar(toolbar) + .withSelectedItem(-1) + .withDrawerItems(getDrawerItems()) + .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { + @Override + @DebugLog + public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { + if (drawerItem != null) { + if (searchViewAction != null) { + searchViewAction.setQuery("", false); + searchViewAction.clearFocus(); + } - if (drawerItem.getTag() != null && String.valueOf(drawerItem.getTag()).equals("Settings")) { - stopCameraTimer(); - startActivityForResult(new Intent(MainActivity.this, SettingsActivity.class), iSettingsResultCode); - } else if (drawerItem.getTag() != null) { - changeFragment(String.valueOf(drawerItem.getTag())); - stopCameraTimer(); - invalidateOptionsMenu(); - if (onPhone) - drawer.closeDrawer(); + if (drawerItem.getTag() != null && String.valueOf(drawerItem.getTag()).equals("Settings")) { + stopCameraTimer(); + startActivityForResult(new Intent(MainActivity.this, SettingsActivity.class), iSettingsResultCode); + } else if (drawerItem.getTag() != null) { + changeFragment(String.valueOf(drawerItem.getTag())); + stopCameraTimer(); + invalidateOptionsMenu(); + if (onPhone) + drawer.closeDrawer(); + } } + return false; } - return false; - } - }) - .build(); + }) + .build(); drawer.addStickyFooterItem(createSecondaryDrawerItem(this.getString(R.string.action_settings), "gmd_settings", "Settings")); } @@ -962,20 +956,20 @@ private List getDrawerItems() { for (int i = 0; i < drawerActions.length; i++) if (fragments[i].contains("Fragments.Dashboard") || - (fragments[i].contains("Fragments.Switch") && (mConfigInfo != null && mConfigInfo.isEnableTabLights())) || - (fragments[i].contains("Fragments.Scene") && (mConfigInfo != null && mConfigInfo.isEnableTabScenes()))) + (fragments[i].contains("Fragments.Switch") && (mConfigInfo != null && mConfigInfo.isEnableTabLights())) || + (fragments[i].contains("Fragments.Scene") && (mConfigInfo != null && mConfigInfo.isEnableTabScenes()))) drawerItems.add(createPrimaryDrawerItem(drawerActions[i], ICONS[i], fragments[i])); drawerItems.add(new DividerDrawerItem()); for (int i = 0; i < drawerActions.length; i++) if ((fragments[i].contains("Fragments.Temperature") && (mConfigInfo != null && mConfigInfo.isEnableTabTemp())) || - (fragments[i].contains("Fragments.Weather") && (mConfigInfo != null && mConfigInfo.isEnableTabWeather()))) + (fragments[i].contains("Fragments.Weather") && (mConfigInfo != null && mConfigInfo.isEnableTabWeather()))) drawerItems.add(createPrimaryDrawerItem(drawerActions[i], ICONS[i], fragments[i])); drawerItems.add(new DividerDrawerItem()); for (int i = 0; i < drawerActions.length; i++) { if ((fragments[i].contains("Fragments.Plans")) || - (fragments[i].contains("Fragments.Utilities") && (mConfigInfo != null && mConfigInfo.isEnableTabUtility()))) + (fragments[i].contains("Fragments.Utilities") && (mConfigInfo != null && mConfigInfo.isEnableTabUtility()))) drawerItems.add(createPrimaryDrawerItem(drawerActions[i], ICONS[i], fragments[i])); } @@ -999,8 +993,8 @@ private List getDrawerItems() { private SecondaryDrawerItem createSecondaryDrawerItem(String title, String icon, String fragmentID) { SecondaryDrawerItem item = new SecondaryDrawerItem(); item.withName(title) - .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.primary) - .withTag(fragmentID); + .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.primary) + .withTag(fragmentID); if (mSharedPrefs.darkThemeEnabled()) { item.withIconColorRes(R.color.white); item.withSelectedColorRes(R.color.primary); @@ -1013,8 +1007,8 @@ private SecondaryDrawerItem createSecondaryDrawerItem(String title, String icon, private PrimaryDrawerItem createPrimaryDrawerItem(String title, String icon, String fragmentID) { PrimaryDrawerItem item = new PrimaryDrawerItem(); item.withName(title) - .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.primary) - .withTag(fragmentID); + .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.primary) + .withTag(fragmentID); if (mSharedPrefs.darkThemeEnabled()) { item.withIconColorRes(R.color.white); item.withSelectedColorRes(R.color.primary); @@ -1024,92 +1018,6 @@ private PrimaryDrawerItem createPrimaryDrawerItem(String title, String icon, Str return item; } - private void showSnackBarToUpdateServer(String message) { - CoordinatorLayout layout = getFragmentCoordinatorLayout(); - if (layout != null) { - UsefulBits.showSnackbarWithAction(this, layout, message, Snackbar.LENGTH_SHORT, null, new View.OnClickListener() { - @Override - @DebugLog - public void onClick(View v) { - startActivity(new Intent(MainActivity.this, UpdateActivity.class)); - } - }, this.getString(R.string.update_server)); - } - } - - private void checkDomoticzServerUpdate(final ConfigInfo config) { - if (config == null) - return; - domoticz.getUpdate(new UpdateVersionReceiver() { - @Override - @DebugLog - public void onReceiveUpdate(ServerUpdateInfo serverUpdateInfo) { - if (mServerUtil != null && - mServerUtil.getActiveServer() != null) { - mServerUtil.getActiveServer().setServerUpdateInfo(MainActivity.this, serverUpdateInfo); - mServerUtil.saveDomoticzServers(true); - checkCurrentServerVersion(config); - } - } - - @Override - @DebugLog - public void onError(Exception error) { - if (mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this).setCurrentServerVersion(""); - mServerUtil.saveDomoticzServers(true); - } - }); - } - - private void checkCurrentServerVersion(final ConfigInfo mConfigInfo) { - if (domoticz == null || mConfigInfo == null) - return; - domoticz.getServerVersion(new VersionReceiver() { - @Override - @DebugLog - public void onReceiveVersion(VersionInfo serverVersion) { - if (serverVersion != null) { - if (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) { - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this).setCurrentServerVersion(serverVersion.getVersion()); - } - - String[] version - = serverVersion.getVersion().split("\\."); - String updateVersion = (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) ? - version[0] + "." - + mServerUtil.getActiveServer() - .getServerUpdateInfo(MainActivity.this) - .getUpdateRevisionNumber() : - version[0]; - - if (!serverVersion.getVersion().equals(updateVersion) && serverVersion.isHaveUpdate()) { - String message = String.format(getString(R.string.update_available_enhanced), serverVersion.getVersion(), updateVersion); - if (mSharedPrefs.checkForUpdatesEnabled() && !mSharedPrefs.getLastUpdateShown().equals(updateVersion)) { - if (mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this).getSystemName().equalsIgnoreCase("linux")) { - // Great! We can remote/auto update Linux systems - showSnackBarToUpdateServer(message); - } else { - // No remote/auto updating available for other systems (like Windows, Synology) - showSnackbar(getString(R.string.server_update_available)); - } - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this).setUpdateAvailable(true); - mSharedPrefs.setLastUpdateShown(updateVersion); - } - mServerUtil.saveDomoticzServers(true); - } - } - } - - @Override - @DebugLog - public void onError(Exception error) { - } - }); - } - @Override @DebugLog public boolean onCreateOptionsMenu(Menu menu) { @@ -1123,10 +1031,7 @@ public boolean onCreateOptionsMenu(Menu menu) { else getMenuInflater().inflate(R.menu.menu_camera, menu); } else if ((f instanceof DomoticzDashboardFragment) || (f instanceof DomoticzRecyclerFragment) || (f instanceof RefreshFragment)) { - if ((f instanceof MainPager) || (f instanceof Scenes) || (f instanceof Switches) || (f instanceof Logs)) - getMenuInflater().inflate(R.menu.menu_main_sort, menu); - else - getMenuInflater().inflate(R.menu.menu_main, menu); + getMenuInflater().inflate(R.menu.menu_main, menu); MenuItem searchMenuItem = menu.findItem(R.id.search); searchViewAction = (SearchView) MenuItemCompat.getActionView(searchMenuItem); @@ -1232,11 +1137,11 @@ public void onResults(Bundle results) { recognitionProgressView.setBackgroundColor(color); } int[] colors = { - ContextCompat.getColor(this, R.color.material_amber_600), - ContextCompat.getColor(this, R.color.material_blue_600), - ContextCompat.getColor(this, R.color.material_deep_purple_600), - ContextCompat.getColor(this, R.color.material_green_600), - ContextCompat.getColor(this, R.color.material_orange_600) + ContextCompat.getColor(this, R.color.material_amber_600), + ContextCompat.getColor(this, R.color.material_blue_600), + ContextCompat.getColor(this, R.color.material_deep_purple_600), + ContextCompat.getColor(this, R.color.material_green_600), + ContextCompat.getColor(this, R.color.material_orange_600) }; recognitionProgressView.setColors(colors); recognitionProgressView.setSpeechRecognizer(speechRecognizer); @@ -1295,13 +1200,13 @@ public void run() { return true; case R.id.action_sort: SortDialog infoDialog = (latestFragment instanceof Logs) ? - new SortDialog( - this, - R.layout.dialog_switch_logs, - new String[]{getString(R.string.filter_all), getString(R.string.filter_normal), getString(R.string.filter_status), getString(R.string.filter_error)}) : - new SortDialog( - this, - R.layout.dialog_switch_logs, null); + new SortDialog( + this, + R.layout.dialog_switch_logs, + new String[]{getString(R.string.filter_all), getString(R.string.filter_normal), getString(R.string.filter_status), getString(R.string.filter_error)}) : + new SortDialog( + this, + R.layout.dialog_switch_logs, null); infoDialog.onDismissListener(new SortDialog.DismissListener() { @Override @DebugLog @@ -1344,7 +1249,7 @@ private void stopRecognitionAnimation() { @DebugLog private void showSpeechResults(Bundle results) { ArrayList matches = results - .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); + .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); if (matches == null) return; int jsonAction = -1; @@ -1439,35 +1344,35 @@ public void showServerDialog() { for (ServerInfo s : mServerUtil.getEnabledServerList()) { serverNames[count] = s.getServerName(); if (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerName().equals(s.getServerName())) + mServerUtil.getActiveServer().getServerName().equals(s.getServerName())) selectionId = count; count++; } //show dialog with servers new MaterialDialog.Builder(this) - .title(R.string.choose_server) - .items(serverNames) - .itemsCallbackSingleChoice(selectionId, new MaterialDialog.ListCallbackSingleChoice() { - @Override - @DebugLog - public boolean onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) { - try { - for (ServerInfo s : mServerUtil.getEnabledServerList()) { - if (s.getServerName() != null && s.getServerName().contentEquals(text)) { - String message = String.format(getString(R.string.switch_to_server), s.getServerName()); - showSnackbar(message); - mServerUtil.setActiveServer(s); - MainActivity.this.recreate(); + .title(R.string.choose_server) + .items(serverNames) + .itemsCallbackSingleChoice(selectionId, new MaterialDialog.ListCallbackSingleChoice() { + @Override + @DebugLog + public boolean onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) { + try { + for (ServerInfo s : mServerUtil.getEnabledServerList()) { + if (s.getServerName() != null && s.getServerName().contentEquals(text)) { + String message = String.format(getString(R.string.switch_to_server), s.getServerName()); + showSnackbar(message); + mServerUtil.setActiveServer(s); + MainActivity.this.recreate(); + } } + return false; + } catch (Exception ex) { + return false; } - return false; - } catch (Exception ex) { - return false; } - } - }) - .show(); + }) + .show(); } /** diff --git a/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java index 4c7d70b6b..962189aab 100644 --- a/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java @@ -69,16 +69,16 @@ public class NFCSettingsActivity extends AppCompatAssistActivity implements NFCClickListener { // list of NFC technologies detected: private final String[][] techList = new String[][]{ - new String[]{ - NfcA.class.getName(), - NfcB.class.getName(), - NfcF.class.getName(), - NfcV.class.getName(), - IsoDep.class.getName(), - MifareClassic.class.getName(), - MifareUltralight.class.getName(), - Ndef.class.getName() - } + new String[]{ + NfcA.class.getName(), + NfcB.class.getName(), + NfcF.class.getName(), + NfcV.class.getName(), + IsoDep.class.getName(), + MifareClassic.class.getName(), + MifareUltralight.class.getName(), + Ndef.class.getName() + } }; boolean result = false; @@ -178,22 +178,22 @@ protected void onNewIntent(Intent intent) { if (newTagFound) { UsefulBits.showSnackbar(this, coordinatorLayout, getString(R.string.nfc_tag_found) + ": " + tagID, Snackbar.LENGTH_SHORT); new MaterialDialog.Builder(this) - .title(R.string.nfc_tag_found) - .content(R.string.nfc_tag_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(R.string.category_nfc, 0, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, getString(R.string.nfc_saved) + ": " + input, Snackbar.LENGTH_SHORT); - NFCInfo newNFC = new NFCInfo(); - newNFC.setId(tagID); - newNFC.setName(String.valueOf(input)); - updateNFC(newNFC); + .title(R.string.nfc_tag_found) + .content(R.string.nfc_tag_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(R.string.category_nfc, 0, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, getString(R.string.nfc_saved) + ": " + input, Snackbar.LENGTH_SHORT); + NFCInfo newNFC = new NFCInfo(); + newNFC.setId(tagID); + newNFC.setName(String.valueOf(input)); + updateNFC(newNFC); + } + busyWithTag = false; } - busyWithTag = false; - } - }).show(); + }).show(); } else { UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, R.string.nfc_exists, Snackbar.LENGTH_SHORT); busyWithTag = false; @@ -227,20 +227,20 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final NFCInfo mNFCInfo) { busyWithTag = true; new MaterialDialog.Builder(this) - .title(R.string.nfc_tag_edit) - .content(R.string.nfc_tag_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_nfc), mNFCInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mNFCInfo.setName(String.valueOf(input)); - updateNFC(mNFCInfo); + .title(R.string.nfc_tag_edit) + .content(R.string.nfc_tag_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_nfc), mNFCInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mNFCInfo.setName(String.valueOf(input)); + updateNFC(mNFCInfo); + } + busyWithTag = false; } - busyWithTag = false; - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final NFCInfo nfcInfo) { @@ -260,19 +260,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(NFCSettingsActivity.this, coordinatorLayout, NFCSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(nfcInfo); - } - }, NFCSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(nfcInfo); + } + }, NFCSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final NFCInfo nfcInfo, - ArrayList switches) { + final NFCInfo nfcInfo, + ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -281,9 +281,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - NFCSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + NFCSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -312,16 +312,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final NFCInfo nfcInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - nfcInfo.setValue(String.valueOf(text)); - updateNFC(nfcInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + nfcInfo.setValue(String.valueOf(text)); + updateNFC(nfcInfo); + } + }) + .show(); } public void updateNFC(NFCInfo nfcInfo) { @@ -347,21 +347,21 @@ public void updateNFC(NFCInfo nfcInfo) { private boolean showNoDeviceAttachedDialog(final NFCInfo nfcInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_nfc) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(nfcInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_nfc) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(nfcInfo); + result = true; + } + }) + .show(); return result; } @@ -400,7 +400,7 @@ private void showRemoveUndoSnackbar(final NFCInfo nfcInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.nfc)); + getString(R.string.nfc)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/PlanActivity.java b/app/src/main/java/nl/hnogames/domoticz/PlanActivity.java index 93a76623f..3805dec9e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/PlanActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/PlanActivity.java @@ -24,6 +24,9 @@ import android.os.Bundle; import android.view.MenuItem; +import java.util.Timer; +import java.util.TimerTask; + import androidx.fragment.app.FragmentTransaction; import hugo.weaving.DebugLog; import nl.hnogames.domoticz.Fragments.Dashboard; @@ -34,19 +37,40 @@ import nl.hnogames.domoticzapi.Utils.ServerUtil; public class PlanActivity extends AppCompatAssistActivity { - private ServerUtil mServerUtil; + private Timer autoRefreshTimer = null; + private Dashboard dash; + private SharedPrefUtil mSharedPrefs; @DebugLog public ConfigInfo getConfig() { return mServerUtil != null && mServerUtil.getActiveServer() != null ? - mServerUtil.getActiveServer().getConfigInfo(this) : - null; + mServerUtil.getActiveServer().getConfigInfo(this) : + null; + } + + private void setupAutoRefresh() { + if (mSharedPrefs.getAutoRefresh() && autoRefreshTimer == null) { + autoRefreshTimer = new Timer("autorefresh", true); + autoRefreshTimer.scheduleAtFixedRate(new TimerTask() { + @Override + @DebugLog + public void run() { + runOnUiThread(new Runnable() { + @Override + @DebugLog + public void run() { + dash.refreshFragment(); + } + }); + } + }, 0, (mSharedPrefs.getAutoRefreshTimer() * 1000)); + } } @Override protected void onCreate(Bundle savedInstanceState) { - SharedPrefUtil mSharedPrefs = new SharedPrefUtil(this); + mSharedPrefs = new SharedPrefUtil(this); if (mSharedPrefs.darkThemeEnabled()) setTheme(R.style.AppThemeDark); else @@ -55,6 +79,7 @@ protected void onCreate(Bundle savedInstanceState) { UsefulBits.setDisplayLanguage(this, mSharedPrefs.getDisplayLanguage()); super.onCreate(savedInstanceState); + Bundle bundle = getIntent().getExtras(); if (bundle != null) { //noinspection SpellCheckingInspection @@ -63,7 +88,7 @@ protected void onCreate(Bundle savedInstanceState) { int selectedPlanID = bundle.getInt("PLANID"); this.setTitle(selectedPlan); - Dashboard dash = new Dashboard(); + dash = new Dashboard(); dash.selectedPlan(selectedPlanID, selectedPlan); if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -71,9 +96,18 @@ protected void onCreate(Bundle savedInstanceState) { FragmentTransaction tx = getSupportFragmentManager().beginTransaction(); tx.replace(android.R.id.content, dash); tx.commit(); + setupAutoRefresh(); } else this.finish(); } + private void stopAutoRefreshTimer() { + if (autoRefreshTimer != null) { + autoRefreshTimer.cancel(); + autoRefreshTimer.purge(); + autoRefreshTimer = null; + } + } + public ServerUtil getServerUtil() { if (mServerUtil == null) mServerUtil = new ServerUtil(this); @@ -89,4 +123,32 @@ public boolean onOptionsItemSelected(MenuItem item) { } return super.onOptionsItemSelected(item); } + + @Override + @DebugLog + public void onDestroy() { + stopAutoRefreshTimer(); + super.onDestroy(); + } + + @Override + @DebugLog + public void onPause() { + stopAutoRefreshTimer(); + super.onPause(); + } + + @Override + @DebugLog + public void onBackPressed() { + stopAutoRefreshTimer(); + this.finish(); + } + + @Override + @DebugLog + public void onResume() { + super.onResume(); + setupAutoRefresh(); + } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java b/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java index 1e856bf93..1f692bfef 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java +++ b/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java @@ -71,7 +71,6 @@ import nl.hnogames.domoticz.SettingsActivity; import nl.hnogames.domoticz.SpeechSettingsActivity; import nl.hnogames.domoticz.UI.SimpleTextDialog; -import nl.hnogames.domoticz.UpdateActivity; import nl.hnogames.domoticz.Utils.DeviceUtils; import nl.hnogames.domoticz.Utils.NotificationUtil; import nl.hnogames.domoticz.Utils.PermissionsUtil; @@ -79,12 +78,9 @@ import nl.hnogames.domoticz.Utils.UsefulBits; import nl.hnogames.domoticz.app.AppController; import nl.hnogames.domoticzapi.Containers.ConfigInfo; -import nl.hnogames.domoticzapi.Containers.ServerUpdateInfo; -import nl.hnogames.domoticzapi.Containers.VersionInfo; import nl.hnogames.domoticzapi.Domoticz; import nl.hnogames.domoticzapi.Interfaces.ConfigReceiver; import nl.hnogames.domoticzapi.Interfaces.MobileDeviceReceiver; -import nl.hnogames.domoticzapi.Interfaces.VersionReceiver; import nl.hnogames.domoticzapi.Utils.ServerUtil; import static android.content.Context.KEYGUARD_SERVICE; @@ -124,9 +120,9 @@ public void onCreate(Bundle savedInstanceState) { setPreferences(); setStartUpScreenDefaultValue(); - setVersionInfo(); handleImportExportButtons(); handleInfoAndAbout(); + GetVersion(); } private void setupDefaultValues() { @@ -530,24 +526,24 @@ public boolean onPreferenceChange(android.preference.Preference preference, Obje } else { if ((boolean) newValue) { new MaterialDialog.Builder(mContext) - .title(R.string.wizard_widgets) - .content(R.string.widget_warning) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.SetWidgetsEnabled(true); - ((SettingsActivity) getActivity()).reloadSettings(); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.SetWidgetsEnabled(false); - } - }) - .show(); + .title(R.string.wizard_widgets) + .content(R.string.widget_warning) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.SetWidgetsEnabled(true); + ((SettingsActivity) getActivity()).reloadSettings(); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.SetWidgetsEnabled(false); + } + }) + .show(); return false; } else { return true; @@ -597,9 +593,9 @@ public boolean onPreferenceClick(android.preference.Preference preference) { if (logs != null && logs.size() > 0) { Collections.reverse(logs); new MaterialDialog.Builder(mContext) - .title(mContext.getString(R.string.notification_show_title)) - .items((CharSequence[]) logs.toArray(new String[0])) - .show(); + .title(mContext.getString(R.string.notification_show_title)) + .items((CharSequence[]) logs.toArray(new String[0])) + .show(); } else UsefulBits.showSimpleToast(mContext, getString(R.string.notification_show_nothing), Toast.LENGTH_LONG); return true; @@ -640,19 +636,19 @@ public boolean onPreferenceClick(android.preference.Preference preference) { public boolean onPreferenceClick(android.preference.Preference preference) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { new MaterialDialog.Builder(mContext) - .title(R.string.category_Reset) - .content(R.string.are_you_sure_clear_settings) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @SuppressLint("NewApi") - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - ((ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE)) - .clearApplicationUserData(); - } - }) - .show(); + .title(R.string.category_Reset) + .content(R.string.are_you_sure_clear_settings) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @SuppressLint("NewApi") + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + ((ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE)) + .clearApplicationUserData(); + } + }) + .show(); } else { startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); } @@ -688,18 +684,18 @@ public boolean onPreferenceChange(android.preference.Preference preference, Obje return false; } else { new MaterialDialog.Builder(mContext) - .title(R.string.category_startup_security) - .content(R.string.fingerprint_sure) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.setStartupSecurityEnabled(true); - ((SettingsActivity) getActivity()).reloadSettings(); - } - }) - .show(); + .title(R.string.category_startup_security) + .content(R.string.fingerprint_sure) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.setStartupSecurityEnabled(true); + ((SettingsActivity) getActivity()).reloadSettings(); + } + }) + .show(); return false; } @@ -710,6 +706,23 @@ public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) }); } + private void GetVersion() { + android.preference.Preference appVersion = findPreference("version"); + PackageInfo pInfo = null; + try { + pInfo = mContext + .getPackageManager() + .getPackageInfo(mContext + .getPackageName(), 0); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + String appVersionStr = mContext.getString(R.string.unknown); + if (pInfo != null) appVersionStr = pInfo.versionName; + if (appVersion != null && !UsefulBits.isEmpty(appVersionStr)) + appVersion.setSummary(appVersionStr); + } + private Boolean checkBiometricSupport() { KeyguardManager keyguardManager = (KeyguardManager) mContext.getSystemService(KEYGUARD_SERVICE); PackageManager packageManager = mContext.getPackageManager(); @@ -718,8 +731,8 @@ private Boolean checkBiometricSupport() { return false; } if (ActivityCompat.checkSelfPermission(mContext, - Manifest.permission.USE_BIOMETRIC) != - PackageManager.PERMISSION_GRANTED) { + Manifest.permission.USE_BIOMETRIC) != + PackageManager.PERMISSION_GRANTED) { return false; } if (packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) @@ -771,20 +784,20 @@ public void onError(Exception error) { private void showRestartMessage() { new MaterialDialog.Builder(mContext) - .title(R.string.restart_required_title) - .content(mContext.getString(R.string.restart_required_msg) - + UsefulBits.newLine() - + UsefulBits.newLine() - + mContext.getString(R.string.restart_now)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - UsefulBits.restartApplication(getActivity()); - } - }) - .show(); + .title(R.string.restart_required_title) + .content(mContext.getString(R.string.restart_required_msg) + + UsefulBits.newLine() + + UsefulBits.newLine() + + mContext.getString(R.string.restart_now)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + UsefulBits.restartApplication(getActivity()); + } + }) + .show(); } private void handleInfoAndAbout() { @@ -817,29 +830,29 @@ public boolean onPreferenceClick(android.preference.Preference preference) { private void handleImportExportButtons() { SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); android.preference.Preference exportButton = findPreference("export_settings"); exportButton.setOnPreferenceClickListener( - new android.preference.Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(android.preference.Preference preference) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (!PermissionsUtil.canAccessStorage(mContext)) { - permissionHelper.request(PermissionsUtil.INITIAL_STORAGE_PERMS); + new android.preference.Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(android.preference.Preference preference) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (!PermissionsUtil.canAccessStorage(mContext)) { + permissionHelper.request(PermissionsUtil.INITIAL_STORAGE_PERMS); + } else + exportSettings(); } else exportSettings(); - } else - exportSettings(); - return false; - } - }); + return false; + } + }); android.preference.Preference importButton = findPreference("import_settings"); importButton.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() { @Override @@ -874,82 +887,6 @@ private void exportSettings() { showSnackbar(mContext.getString(R.string.settings_export_failed)); } - private void setVersionInfo() { - final ServerUtil serverUtil = new ServerUtil(mContext); - PackageInfo pInfo = null; - try { - pInfo = mContext - .getPackageManager() - .getPackageInfo(mContext - .getPackageName(), 0); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - String appVersionStr = mContext.getString(R.string.unknown); - if (pInfo != null) appVersionStr = pInfo.versionName; - - final android.preference.Preference appVersion = findPreference("version"); - if (appVersion != null && !UsefulBits.isEmpty(appVersionStr)) - appVersion.setSummary(appVersionStr); - - final android.preference.Preference domoticzVersion = findPreference("version_domoticz"); - if (domoticzVersion == null) - return; - - mDomoticz.getServerVersion(new VersionReceiver() { - @Override - @DebugLog - public void onReceiveVersion(VersionInfo serverVersion) { - if (serverVersion != null) { - try { - ServerUpdateInfo updateInfo = null; - if (serverUtil.getActiveServer() != null) - updateInfo = serverUtil.getActiveServer().getServerUpdateInfo(mContext); - - if (updateInfo != null) { - String message = serverVersion.getVersion(); - if (updateInfo.isUpdateAvailable() || mSharedPrefs.isDebugEnabled()) { - String version = updateInfo.getUpdateRevisionNumber(); - message = String.format(getString(R.string.update_available_enhanced), - serverVersion.getVersion(), - version); - if (updateInfo.getSystemName() != null && - updateInfo.getSystemName().equalsIgnoreCase("linux")) { - message += UsefulBits.newLine() + mContext.getString(R.string.click_to_update_server); - domoticzVersion.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(android.preference.Preference preference) { - Intent intent = new Intent(mContext, UpdateActivity.class); - startActivity(intent); - return false; - } - }); - } - } - domoticzVersion.setSummary(message); - } - } catch (Exception ex) { - String ex_message = mDomoticz.getErrorMessage(ex); - if (!UsefulBits.isEmpty(ex_message)) - Log.e(TAG, mDomoticz.getErrorMessage(ex)); - } - } - } - - @Override - @DebugLog - public void onError(Exception error) { - try { - String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); - showSnackbar(message); - } catch (Exception ignored) { - } - } - }); - } - private void setStartUpScreenDefaultValue() { int defaultValue = mSharedPrefs.getActualStartupScreenIndex(); ListPreference startup_screen = (ListPreference) findPreference("startup_nav"); @@ -963,14 +900,14 @@ private void showPremiumSnackbar(final String category) { public void run() { if (getView() != null) { Snackbar.make(getView(), category + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) - .setAction(R.string.upgrade, new View.OnClickListener() { - @Override - public void onClick(View view) { - UsefulBits.openPremiumAppStore(mContext); - } - }) - .setActionTextColor(ContextCompat.getColor(mContext, R.color.material_blue_600)) - .show(); + .setAction(R.string.upgrade, new View.OnClickListener() { + @Override + public void onClick(View view) { + UsefulBits.openPremiumAppStore(mContext); + } + }) + .setActionTextColor(ContextCompat.getColor(mContext, R.color.material_blue_600)) + .show(); } } }, (300)); diff --git a/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java b/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java index 0e8c07663..653c9e8cc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java @@ -42,7 +42,7 @@ public class QRCodeCaptureActivity extends AppCompatAssistActivity implements ZX public void onCreate(Bundle state) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setSystemUiFlags(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); setFullscreenFlags(); } @@ -60,7 +60,7 @@ private void setSystemUiFlags(int flags) { private void setFullscreenFlags() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { int fullscreenFlags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | - View.SYSTEM_UI_FLAG_FULLSCREEN; + View.SYSTEM_UI_FLAG_FULLSCREEN; setSystemUiFlags(fullscreenFlags); } diff --git a/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java index e6e18566a..638165c7a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java @@ -126,19 +126,19 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final QRCodeInfo mQRCodeInfo) { new MaterialDialog.Builder(this) - .title(R.string.qrcode_edit) - .content(R.string.qrcode_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_QRCode), mQRCodeInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mQRCodeInfo.setName(String.valueOf(input)); - updateQRCode(mQRCodeInfo); + .title(R.string.qrcode_edit) + .content(R.string.qrcode_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_QRCode), mQRCodeInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mQRCodeInfo.setName(String.valueOf(input)); + updateQRCode(mQRCodeInfo); + } } - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final QRCodeInfo qrInfo) { @@ -158,19 +158,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(QRCodeSettingsActivity.this, coordinatorLayout, QRCodeSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(qrInfo); - } - }, QRCodeSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(qrInfo); + } + }, QRCodeSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final QRCodeInfo qrcodeInfo, - final ArrayList switches) { + final QRCodeInfo qrcodeInfo, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -179,9 +179,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - QRCodeSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + QRCodeSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -211,16 +211,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final QRCodeInfo qrcodeInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - qrcodeInfo.setValue(String.valueOf(text)); - updateQRCode(qrcodeInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + qrcodeInfo.setValue(String.valueOf(text)); + updateQRCode(qrcodeInfo); + } + }) + .show(); } public void updateQRCode(QRCodeInfo qrcodeInfo) { @@ -246,21 +246,21 @@ public void updateQRCode(QRCodeInfo qrcodeInfo) { private boolean showNoDeviceAttachedDialog(final QRCodeInfo qrcodeInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_qrcode) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(qrcodeInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_qrcode) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(qrcodeInfo); + result = true; + } + }) + .show(); return result; } @@ -287,7 +287,7 @@ private void showRemoveUndoSnackbar(final QRCodeInfo qrcodeInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.qrcode)); + getString(R.string.qrcode)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -370,21 +370,21 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (newTagFound) { UsefulBits.showSnackbar(this, coordinatorLayout, getString(R.string.qrcode_found) + ": " + QR_Code_ID, Snackbar.LENGTH_SHORT); new MaterialDialog.Builder(this) - .title(R.string.qrcode_found) - .content(R.string.qrcode_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(R.string.category_QRCode, 0, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - UsefulBits.showSnackbar(QRCodeSettingsActivity.this, coordinatorLayout, getString(R.string.qrcode_saved) + ": " + input, Snackbar.LENGTH_SHORT); - QRCodeInfo qrCodeInfo = new QRCodeInfo(); - qrCodeInfo.setId(QR_Code_ID); - qrCodeInfo.setName(String.valueOf(input)); - updateQRCode(qrCodeInfo); + .title(R.string.qrcode_found) + .content(R.string.qrcode_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(R.string.category_QRCode, 0, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + UsefulBits.showSnackbar(QRCodeSettingsActivity.this, coordinatorLayout, getString(R.string.qrcode_saved) + ": " + input, Snackbar.LENGTH_SHORT); + QRCodeInfo qrCodeInfo = new QRCodeInfo(); + qrCodeInfo.setId(QR_Code_ID); + qrCodeInfo.setName(String.valueOf(input)); + updateQRCode(qrCodeInfo); + } } - } - }).show(); + }).show(); } else { UsefulBits.showSnackbar(this, coordinatorLayout, R.string.qrcode_exists, Snackbar.LENGTH_SHORT); } diff --git a/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java index b8af6c808..7f57854b7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java @@ -157,7 +157,7 @@ private void showRemoveUndoSnackbar(final ServerInfo serverInfo) { removeServerFromListView(serverInfo); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, String.format(getString(R.string.something_deleted), - getString(R.string.server)), Snackbar.LENGTH_SHORT, new Snackbar.Callback() { + getString(R.string.server)), Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override public void onDismissed(Snackbar snackbar, int event) { super.onDismissed(snackbar, event); diff --git a/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java index 115741b90..5cd5ed303 100644 --- a/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java @@ -75,8 +75,8 @@ protected void onCreate(Bundle savedInstanceState) { if (!addNew && UsefulBits.isEmpty(updateName)) { Fragment serverSettings = WelcomePage3.newInstance(SETTINGS); getSupportFragmentManager().beginTransaction() - .replace(android.R.id.content, serverSettings) - .commit(); + .replace(android.R.id.content, serverSettings) + .commit(); } else { SetupServerSettings serverSettings = SetupServerSettings.newInstance(SETTINGS); @@ -88,8 +88,8 @@ protected void onCreate(Bundle savedInstanceState) { } getSupportFragmentManager().beginTransaction() - .replace(android.R.id.content, serverSettings) - .commit(); + .replace(android.R.id.content, serverSettings) + .commit(); } } @@ -127,17 +127,17 @@ public void ServerAdded(Boolean added) { public void onBackPressed() { if (addNew) { new AlertDialog.Builder(this) - .setIcon(android.R.drawable.ic_dialog_alert) - .setTitle(getString(R.string.dont_save_new_server)) - .setMessage(R.string.are_you_sure) - .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - ServerCancel(); - } - }) - .setNegativeButton(R.string.cancel, null) - .show(); + .setIcon(android.R.drawable.ic_dialog_alert) + .setTitle(getString(R.string.dont_save_new_server)) + .setMessage(R.string.are_you_sure) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + ServerCancel(); + } + }) + .setNegativeButton(R.string.cancel, null) + .show(); } else super.onBackPressed(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/BluetoothConnectionReceiver.java b/app/src/main/java/nl/hnogames/domoticz/Service/BluetoothConnectionReceiver.java index da2c1e97e..45a221dac 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/BluetoothConnectionReceiver.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/BluetoothConnectionReceiver.java @@ -49,7 +49,7 @@ public void onReceive(Context context, Intent intent) { if (connectedDevice != null && connectedDevice.isEnabled()) { handleSwitch(context, connectedDevice.getSwitchIdx(), connectedDevice.getSwitchPassword(), (BluetoothDevice.ACTION_ACL_CONNECTED.equals(intent.getAction())), - connectedDevice.getValue(), connectedDevice.isSceneOrGroup()); + connectedDevice.getValue(), connectedDevice.isSceneOrGroup()); Toast.makeText(context, context.getString(R.string.bluetooth) + " " + connectedDevice.getName(), Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, context.getString(R.string.bluetooth_disabled), Toast.LENGTH_SHORT).show(); @@ -92,8 +92,8 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java b/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java index 91da1fffc..8214ff5a7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java @@ -42,7 +42,7 @@ public void onMessageReceived(RemoteMessage remoteMessage) { } if (!UsefulBits.isEmpty(subject) && !UsefulBits.isEmpty(body) && - !body.equals(subject)) { + !body.equals(subject)) { String deviceid = decode(data.containsKey("deviceid") ? data.get("deviceid").toString() : ""); if (!UsefulBits.isEmpty(deviceid) && isDigitsOnly(deviceid) && Integer.valueOf(deviceid) > 0) diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java index 35421019d..167b195e7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java @@ -72,16 +72,16 @@ private void handleEnterExit(GeofencingEvent geoFenceEvent) { if (Geofence.GEOFENCE_TRANSITION_ENTER == transitionType || Geofence.GEOFENCE_TRANSITION_DWELL == transitionType) { for (Geofence geofence : geoFenceEvent.getTriggeringGeofences()) { LocationInfo locationFound = - mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); + mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); Log.d(TAG, "Triggered entering a geofence location: " - + locationFound.getName()); + + locationFound.getName()); if (mSharedPrefs.isGeofenceNotificationsEnabled()) { notificationTitle = String.format( - context.getString(R.string.geofence_location_entering), locationFound.getName()); + context.getString(R.string.geofence_location_entering), locationFound.getName()); notificationDescription = context.getString(R.string.geofence_location_entering_text); NotificationUtil.sendSimpleNotification(notificationTitle, - notificationDescription, 0, context); + notificationDescription, 0, context); } if (locationFound.getSwitchIdx() > 0) handleSwitch(context, locationFound.getSwitchIdx(), locationFound.getSwitchPassword(), true, locationFound.getValue(), locationFound.isSceneOrGroup()); @@ -89,17 +89,17 @@ private void handleEnterExit(GeofencingEvent geoFenceEvent) { } else if (Geofence.GEOFENCE_TRANSITION_EXIT == transitionType) { for (Geofence geofence : geoFenceEvent.getTriggeringGeofences()) { LocationInfo locationFound - = mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); + = mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); Log.d(TAG, "Triggered leaving a geofence location: " - + locationFound.getName()); + + locationFound.getName()); if (mSharedPrefs.isGeofenceNotificationsEnabled()) { notificationTitle = String.format( - context.getString(R.string.geofence_location_leaving), - locationFound.getName()); + context.getString(R.string.geofence_location_leaving), + locationFound.getName()); notificationDescription = context.getString(R.string.geofence_location_leaving_text); NotificationUtil.sendSimpleNotification(notificationTitle, - notificationDescription, 0, context); + notificationDescription, 0, context); } if (locationFound.getSwitchIdx() > 0) handleSwitch(context, locationFound.getSwitchIdx(), locationFound.getSwitchPassword(), false, locationFound.getValue(), locationFound.isSceneOrGroup()); @@ -147,8 +147,8 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java b/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java index 5092d2a0c..f186bc13b 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java @@ -98,8 +98,8 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { if (!isSceneOrGroup) { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (!mDevicesInfo.getStatusBoolean()) { jsonAction = DomoticzValues.Device.Switch.Action.OFF; if (!UsefulBits.isEmpty(value)) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java b/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java index eccc5e942..dc9a55f73 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java @@ -71,7 +71,7 @@ public void run() { NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes(mApiClient).await(); for (Node node : nodes.getNodes()) { MessageApi.SendMessageResult result = Wearable.MessageApi.sendMessage( - mApiClient, node.getId(), path, text.getBytes()).await(); + mApiClient, node.getId(), path, text.getBytes()).await(); if (result.getStatus().isSuccess()) { Log.v("WEAR", "Message: {" + "my object" + "} sent to: " + node.getDisplayName()); @@ -132,7 +132,7 @@ public void onMessageReceived(MessageEvent messageEvent) { default: throw new NullPointerException( - "Toggle event received from wear device for unsupported switch type: " + selectedSwitch.getSwitchTypeVal()); + "Toggle event received from wear device for unsupported switch type: " + selectedSwitch.getSwitchTypeVal()); } //now send latest status getSwitches(); @@ -182,7 +182,7 @@ private void processAllSwitches(ArrayList extendedStatusSwitches) { String name = mDevicesInfo.getName(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - mDevicesInfo.getFavoriteBoolean()) {//only dashboard switches.. + mDevicesInfo.getFavoriteBoolean()) {//only dashboard switches.. supportedSwitches.add(mDevicesInfo); } } @@ -221,9 +221,9 @@ private void processAllSwitches(ArrayList extendedStatusSwitches) { private void initGoogleApiClient() { mApiClient = new GoogleApiClient.Builder(this) - .addApi(Wearable.API) - .addConnectionCallbacks(this) - .build(); + .addApi(Wearable.API) + .addConnectionCallbacks(this) + .build(); mApiClient.connect(); } @@ -244,8 +244,8 @@ public void onSwitchToggle(DevicesInfo toggledDevice) { boolean checked = !toggledDevice.getStatusBoolean(); if (toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { diff --git a/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java index 0c7c178e1..305642578 100644 --- a/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java @@ -47,7 +47,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getFragmentManager().beginTransaction().replace(android.R.id.content, - new Preference()).commit(); + new Preference()).commit(); } @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java index fc7b613e4..c54dce4f6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java @@ -137,19 +137,19 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final SpeechInfo mSpeechInfo) { new MaterialDialog.Builder(this) - .title(R.string.Speech_edit) - .content(R.string.Speech_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_Speech), mSpeechInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mSpeechInfo.setName(String.valueOf(input)); - updateSpeech(mSpeechInfo); + .title(R.string.Speech_edit) + .content(R.string.Speech_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_Speech), mSpeechInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mSpeechInfo.setName(String.valueOf(input)); + updateSpeech(mSpeechInfo); + } } - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final SpeechInfo qrInfo) { @@ -169,19 +169,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(SpeechSettingsActivity.this, coordinatorLayout, SpeechSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(qrInfo); - } - }, SpeechSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(qrInfo); + } + }, SpeechSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final SpeechInfo SpeechInfo, - final ArrayList switches) { + final SpeechInfo SpeechInfo, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -190,9 +190,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - SpeechSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + SpeechSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -220,16 +220,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final SpeechInfo SpeechInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - SpeechInfo.setValue(String.valueOf(text)); - updateSpeech(SpeechInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + SpeechInfo.setValue(String.valueOf(text)); + updateSpeech(SpeechInfo); + } + }) + .show(); } public void updateSpeech(SpeechInfo SpeechInfo) { @@ -255,21 +255,21 @@ public void updateSpeech(SpeechInfo SpeechInfo) { private boolean showNoDeviceAttachedDialog(final SpeechInfo SpeechInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_Speech) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(SpeechInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_Speech) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(SpeechInfo); + result = true; + } + }) + .show(); return result; } @@ -295,7 +295,7 @@ private void showRemoveUndoSnackbar(final SpeechInfo SpeechInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.Speech)); + getString(R.string.Speech)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -353,11 +353,11 @@ public void onResults(Bundle results) { } int[] colors = { - ContextCompat.getColor(this, R.color.material_amber_600), - ContextCompat.getColor(this, R.color.material_blue_600), - ContextCompat.getColor(this, R.color.material_deep_purple_600), - ContextCompat.getColor(this, R.color.material_green_600), - ContextCompat.getColor(this, R.color.material_orange_600) + ContextCompat.getColor(this, R.color.material_amber_600), + ContextCompat.getColor(this, R.color.material_blue_600), + ContextCompat.getColor(this, R.color.material_deep_purple_600), + ContextCompat.getColor(this, R.color.material_green_600), + ContextCompat.getColor(this, R.color.material_orange_600) }; recognitionProgressView.setColors(colors); recognitionProgressView.setSpeechRecognizer(speechRecognizer); @@ -389,7 +389,7 @@ private void stopRecognitionAnimation() { private void showSpeechResults(Bundle results) { ArrayList matches = results - .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); + .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); if (matches != null) processResult(matches.get(0).toLowerCase()); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropActions.java b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropActions.java new file mode 100644 index 000000000..2f962da65 --- /dev/null +++ b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropActions.java @@ -0,0 +1,7 @@ +package nl.hnogames.domoticz.UI.Backdrop; + +public interface BackdropActions { + void showBackview(); + + void closeBackview(); +} diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropContainer.java b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropContainer.java new file mode 100644 index 000000000..64f129503 --- /dev/null +++ b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/BackdropContainer.java @@ -0,0 +1,106 @@ +package nl.hnogames.domoticz.UI.Backdrop; + +import android.content.Context; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.util.TypedValue; +import android.view.View; +import android.view.ViewGroup; +import android.view.animation.Interpolator; +import android.widget.FrameLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import nl.hnogames.domoticz.R; + +public class BackdropContainer extends FrameLayout implements BackdropActions { + + Interpolator interpolator; + int duration; + private Context context; + private Toolbar toolbar; + private ToolbarIconClick toolbarIconClick; + private Drawable mMenuicon; + private Drawable mCloseicon; + private int height; + + public BackdropContainer(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + + this.context = context; + + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BackdropContainer, 0, 0); + + mMenuicon = typedArray.getDrawable(R.styleable.BackdropContainer_menuIcon); + mCloseicon = typedArray.getDrawable(R.styleable.BackdropContainer_closeIcon); + duration = typedArray.getInt(R.styleable.BackdropContainer_duration, 1000); + typedArray.recycle(); + height = 600; + } + + public BackdropContainer attachToolbar(Toolbar toolbar) { + this.toolbar = toolbar; + if (toolbar != null) + this.toolbar.setNavigationIcon(mMenuicon); + return this; + } + + public BackdropContainer dropHeight(int peek) { + height = height - peek; + return this; + } + + public BackdropContainer dropInterpolator(Interpolator interpolator) { + this.interpolator = interpolator; + return this; + } + + public void build() { + if (checkTotalview()) { + toolbarIconClick = new ToolbarIconClick(context, getChildAt(1), getBackview(), mMenuicon, + mCloseicon, height, interpolator, duration); + if (toolbar != null) { + toolbar.setNavigationOnClickListener(toolbarIconClick); + } + } else { + throw new ArrayIndexOutOfBoundsException("Backdrop should contain only two child"); + } + } + + private int getFrontViewMargin() { + ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) getFrontview().getLayoutParams(); + int frontViewtopMargin = layoutParams.topMargin; + return frontViewtopMargin; + } + + boolean checkTotalview() { + return getChildCount() <= 2; + } + + View getFrontview() { + return getChildAt(1); + } + + View getBackview() { + return getChildAt(0); + } + + private int dpToPx(int topmargin) { + Resources resources = getResources(); + float topMArginPixels = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, topmargin, resources.getDisplayMetrics()); + return (int) topMArginPixels; + } + + @Override + public void showBackview() { + toolbarIconClick.open(); + } + + @Override + public void closeBackview() { + toolbarIconClick.close(); + } +} \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/ToolbarIconClick.java b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/ToolbarIconClick.java new file mode 100644 index 000000000..f3ee10fb2 --- /dev/null +++ b/app/src/main/java/nl/hnogames/domoticz/UI/Backdrop/ToolbarIconClick.java @@ -0,0 +1,80 @@ +package nl.hnogames.domoticz.UI.Backdrop; + +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.view.View; +import android.view.animation.Interpolator; + +import androidx.appcompat.widget.AppCompatImageButton; + +public class ToolbarIconClick implements View.OnClickListener { + + private Context context; + private View backlayer; + private View frontlayer; + private Drawable hambergerIcon; + private Drawable closeIcon; + private int translate; + private Interpolator interpolator; + private int anim_duration; + private boolean dropped = false; + private AnimatorSet animatorSet = new AnimatorSet(); + private AppCompatImageButton toolbaricon; + + public ToolbarIconClick(Context context, View frontview, View backview, Drawable mMenuicon, + Drawable mCloseicon, int height, Interpolator interpolator, int duration) { + + this.context = context; + this.frontlayer = frontview; + this.backlayer = backview; + this.hambergerIcon = mMenuicon; + this.closeIcon = mCloseicon; + this.interpolator = interpolator; + anim_duration = duration; + this.translate = height; + } + + public void open() { + if (!dropped) { + onClick(toolbaricon); + } + } + + public void close() { + if (dropped) { + onClick(toolbaricon); + } + } + + @Override + public void onClick(View v) { + if (toolbaricon == null) { + this.toolbaricon = (AppCompatImageButton) v; + } + dropped = !dropped; + animatorSet.removeAllListeners(); + animatorSet.end(); + animatorSet.cancel(); + + updateIcon(v); + + ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(frontlayer, "translationY", + dropped ? translate : 0); + animatorSet.play(objectAnimator); + objectAnimator.setDuration(anim_duration); + objectAnimator.setInterpolator(interpolator); + objectAnimator.start(); + } + + private void updateIcon(View v) { + if (toolbaricon != null && hambergerIcon != null && closeIcon != null) { + if (dropped) { + toolbaricon.setImageDrawable(closeIcon); + } else { + toolbaricon.setImageDrawable(hambergerIcon); + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java index f7fda7f36..0be5d6659 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java @@ -74,8 +74,8 @@ public DeviceInfoDialog(Context mContext, boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -138,7 +138,7 @@ public boolean onTouch(View v, MotionEvent event) { }); signalLevelIndicator.setMax(Domoticz.signalLevelMax * 100); ProgressBarAnimation anim = - new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); + new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); anim.setDuration(1000); signalLevelIndicator.startAnimation(anim); @@ -184,7 +184,7 @@ private void InitButtons(View view) { public void onClick(View v) { if (mSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -209,7 +209,7 @@ public void onCancel() { public void onClick(View v) { if (mSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java index 9182403fc..9f4eb1dc0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java @@ -59,23 +59,23 @@ public FingerprintPasswordDialog(Context c, Domoticz mDomoticz) { mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_password, true) - .positiveText(android.R.string.ok) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onDismiss(editPassword.getText().toString()); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onCancel(); - } - }); + .positiveText(android.R.string.ok) + .negativeText(android.R.string.cancel) + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onDismiss(editPassword.getText().toString()); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onCancel(); + } + }); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java b/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java index 8efd24670..9e14a33c0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java @@ -62,7 +62,7 @@ private int getStartOfSequence(byte[] sequence) throws IOException { /*********************************************************************************************/ private int parseContentLength(byte[] headerBytes) - throws IOException, NumberFormatException { + throws IOException, NumberFormatException { ByteArrayInputStream headerIn = new ByteArrayInputStream(headerBytes); Properties props = new Properties(); props.load(headerIn); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java b/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java index 8db436345..887af9110 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java @@ -52,7 +52,7 @@ public MultiSelectionSpinner(Context context) { super(context); simple_adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item); + android.R.layout.simple_spinner_item); super.setAdapter(simple_adapter); } @@ -69,7 +69,7 @@ public MultiSelectionSpinner(Context context, AttributeSet attrs) { this.mContext = context; simple_adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item); + android.R.layout.simple_spinner_item); super.setAdapter(simple_adapter); } @@ -81,7 +81,7 @@ public void onClick(DialogInterface dialog, int which, boolean isChecked) { simple_adapter.add(buildSelectedItemString()); } else { throw new IllegalArgumentException( - "Argument 'which' is out of bounds."); + "Argument 'which' is out of bounds."); } } @@ -97,7 +97,7 @@ public boolean performClick() { @Override public void setAdapter(SpinnerAdapter adapter) { throw new RuntimeException( - "setAdapter is not supported by MultiSelectSpinner."); + "setAdapter is not supported by MultiSelectSpinner."); } @SuppressWarnings("unused") @@ -162,7 +162,7 @@ public void setSelection(int index) { mSelection[index] = true; } else { throw new IllegalArgumentException("Index " + index - + " is out of bounds."); + + " is out of bounds."); } simple_adapter.clear(); simple_adapter.add(buildSelectedItemString()); @@ -178,7 +178,7 @@ public void setSelection(int[] selectedIndices) { mSelection[index] = true; } else { throw new IllegalArgumentException("Index " + index - + " is out of bounds."); + + " is out of bounds."); } } simple_adapter.clear(); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java index 1e8f37059..60b7c32b0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java @@ -48,8 +48,8 @@ public NotificationInfoDialog(Context c, mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_switch_timer, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void show() { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java index b71a30891..f4d0a81f7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java @@ -58,37 +58,37 @@ public PasswordDialog(Context c, Domoticz mDomoticz) { mSharedPrefs = new SharedPrefUtil(c); mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_password, true) - .positiveText(android.R.string.ok) - .cancelListener(new DialogInterface.OnCancelListener() { - @Override - public void onCancel(DialogInterface dialog) { - if (dismissListener != null) - dismissListener.onCancel(); - } - }) - .dismissListener(new DialogInterface.OnDismissListener() { - @Override - public void onDismiss(DialogInterface dialog) { - if (dismissListener != null) - dismissListener.onDismiss(null); - } - }) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onDismiss(editPassword.getText().toString()); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onCancel(); - } - }); + .positiveText(android.R.string.ok) + .cancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + if (dismissListener != null) + dismissListener.onCancel(); + } + }) + .dismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + if (dismissListener != null) + dismissListener.onDismiss(null); + } + }) + .negativeText(android.R.string.cancel) + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onDismiss(editPassword.getText().toString()); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onCancel(); + } + }); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/RGBWWColorPickerDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/RGBWWColorPickerDialog.java index e477e97c4..bceea4af4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/RGBWWColorPickerDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/RGBWWColorPickerDialog.java @@ -54,8 +54,8 @@ public RGBWWColorPickerDialog(Context mContext, int idx) { this.idx = idx; mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_rgbwwcolor, true) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java index 77b1c1269..a2b1b89ba 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java @@ -53,8 +53,8 @@ public SceneInfoDialog(Context mContext, boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java index 5b486f4d3..848729494 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java @@ -31,7 +31,7 @@ public ScheduledTemperatureDialog(Context mContext, double temp, boolean canCanc if (canCancel) { getMaterialDialogBuilder() - .neutralText(R.string.follow_schedule); + .neutralText(R.string.follow_schedule); } } } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java index cd21ed776..b2e5063a1 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java @@ -73,8 +73,8 @@ public SecurityPanelDialog(Context c, Domoticz mDomoticz, DevicesInfo panelInfo) mSharedPrefs = new SharedPrefUtil(c); mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_security, true) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .negativeText(android.R.string.cancel); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -152,11 +152,11 @@ private void setFields(boolean enabled) { private void processRequest(final int status) { setFields(false); InputMethodManager imm = - (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); + (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editPinCode.getWindowToken(), 0); final String password = - UsefulBits.getMd5String(editPinCode.getText().toString()); + UsefulBits.getMd5String(editPinCode.getText().toString()); if (validatePassword(password)) { if (mSettings.getSecOnDelay() <= 0 || status == DomoticzValues.Security.Status.DISARM) { @@ -172,8 +172,8 @@ public void onReceiveResult(String result) { public void onError(Exception error) { Log.e(TAG, domoticz.getErrorMessage(error)); Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); setFields(true); } }); @@ -195,8 +195,8 @@ public void onReceiveResult(String result) { @Override public void onError(Exception error) { Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); setFields(true); } }); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java index 662b09283..43449251f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java @@ -49,8 +49,8 @@ public SimpleTextDialog(Context mContext) { //noinspection ConstantConditions mdb.customView(R.layout.dialog_text, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void setTitle(String title) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java index caf07f0da..fa73cc8b0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java @@ -49,7 +49,7 @@ public SortDialog(Context c, names = new String[]{mContext.getString(R.string.filterOn_on), mContext.getString(R.string.filterOn_off), mContext.getString(R.string.filterOn_static), mContext.getString(R.string.filterOn_all)}; mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .negativeText(android.R.string.cancel); + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -63,7 +63,7 @@ public void show() { View view = md.getCustomView(); ListView listView = view.findViewById(R.id.list); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, names); + android.R.layout.simple_list_item_1, android.R.id.text1, names); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SunriseInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SunriseInfoDialog.java index 42d889fb9..660ea3b07 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SunriseInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SunriseInfoDialog.java @@ -57,8 +57,8 @@ public SunriseInfoDialog(Context mContext, //noinspection ConstantConditions mdb.customView(R.layout.dialog_sunrise, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void show() { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java index b4a6d21ee..eeb45d88f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java @@ -56,8 +56,8 @@ public SwitchDialog(Context c, mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .negativeText(android.R.string.cancel); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -72,7 +72,7 @@ public void show() { ListView listView = view.findViewById(R.id.list); String[] listData = processSwitches(); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, listData); + android.R.layout.simple_list_item_1, android.R.id.text1, listData); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, final int position, long id) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java index 020ed9e60..43d3c5901 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java @@ -73,8 +73,8 @@ public SwitchInfoDialog(Context mContext, mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -139,7 +139,7 @@ public boolean onTouch(View v, MotionEvent event) { }); signalLevelIndicator.setMax(Domoticz.signalLevelMax * 100); ProgressBarAnimation anim = - new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); + new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); anim.setDuration(1000); signalLevelIndicator.startAnimation(anim); @@ -189,7 +189,7 @@ private void InitButtons(View view) { public void onClick(View v) { if (mSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -214,7 +214,7 @@ public void onCancel() { public void onClick(View v) { if (mSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java index 3b7b50f32..aa91531bb 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java @@ -49,8 +49,8 @@ public SwitchLogInfoDialog(Context c, this.mContext = c; mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -66,7 +66,7 @@ public void show() { String[] listData = processLogs(); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, listData); + android.R.layout.simple_list_item_1, android.R.id.text1, listData); listView.setAdapter(adapter); md.show(); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java index 122cdb35c..09984da3f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java @@ -49,8 +49,8 @@ public SwitchTimerInfoDialog(Context c, mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void show() { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java index ba2192d95..7691e7ac4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java @@ -62,10 +62,10 @@ public TemperatureDialog(Context mContext, double temp) { mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_temperature, false) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefUtil.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok) - .onAny(this); + .negativeText(android.R.string.cancel) + .theme(mSharedPrefUtil.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok) + .onAny(this); ConfigInfo configInfo = new ServerUtil(mContext).getActiveServer().getConfigInfo(mContext); if (configInfo != null) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java index 94216ba98..192cb32a9 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java @@ -54,8 +54,8 @@ public TemperatureInfoDialog(Context mContext, boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java index 6c9d592cd..307d66f44 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java @@ -34,9 +34,9 @@ import nl.hnogames.domoticz.Utils.SharedPrefUtil; public class TextDialog implements - DialogInterface.OnDismissListener, - DialogInterface.OnCancelListener, - MaterialDialog.SingleButtonCallback { + DialogInterface.OnDismissListener, + DialogInterface.OnCancelListener, + MaterialDialog.SingleButtonCallback { private final MaterialDialog.Builder mdb; private Context context; @@ -54,7 +54,7 @@ public TextDialog(Context context) { mdb = new MaterialDialog.Builder(context); mdb.customView(R.layout.dialog_text, true).negativeText(android.R.string.cancel) - .theme((new SharedPrefUtil(context)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT); + .theme((new SharedPrefUtil(context)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT); mdb.dismissListener(this); mdb.cancelListener(this); mdb.onPositive(this); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java index f5eafa9c8..476c6e9f6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java @@ -53,8 +53,8 @@ public UtilitiesInfoDialog(Context mContext, boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/WWColorPickerDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/WWColorPickerDialog.java index 26ce23a97..09cf96596 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/WWColorPickerDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/WWColorPickerDialog.java @@ -46,8 +46,8 @@ public WWColorPickerDialog(Context mContext, int idx) { this.idx = idx; mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_wwcolor, true) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java index 6a3470bc8..0f41576aa 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java @@ -51,8 +51,8 @@ public WeatherInfoDialog(Context mContext, boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java b/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java index 2d0f09154..f46ed8245 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java @@ -108,14 +108,14 @@ public void onReceiveVersion(VersionInfo serverVersion) { if (serverVersion == null) return; if (serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) { + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) { currentServerVersionValue.setText(serverVersion.getVersion()); if (serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).isUpdateAvailable()) { updateSummary.setText(R.string.server_update_available); updateServerVersionValue.setText(serverUtil.getActiveServer() - .getServerUpdateInfo(UpdateActivity.this) - .getUpdateRevisionNumber()); + .getServerUpdateInfo(UpdateActivity.this) + .getUpdateRevisionNumber()); } else if (mSharedPrefs.isDebugEnabled()) { String message = "Debugging: " + getString(R.string.server_update_available); updateSummary.setText(message); @@ -130,7 +130,7 @@ public void onClick(View v) { } }); if (!serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).isUpdateAvailable() - && !mSharedPrefs.isDebugEnabled()) + && !mSharedPrefs.isDebugEnabled()) buttonUpdateServer.setEnabled(false); } } @@ -139,12 +139,12 @@ public void onClick(View v) { public void onError(Exception error) { mSwipeRefreshLayout.setRefreshing(false); String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + mDomoticz.getErrorMessage(error)); showSnackbar(message); if (serverUtil != null && - serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) + serverUtil.getActiveServer() != null && + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setCurrentServerVersion(""); currentServerVersionValue.setText(R.string.not_available); } @@ -158,20 +158,20 @@ private void refreshData() { private void showServerUpdateWarningDialog() { new MaterialDialog.Builder(this) - .title(R.string.server_update) - .content(getString(R.string.update_server_warning) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.continue_question)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - updateServer(); - } - }) - .show(); + .title(R.string.server_update) + .content(getString(R.string.update_server_warning) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.continue_question)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + updateServer(); + } + }) + .show(); } private void updateServer() { @@ -181,13 +181,13 @@ private void updateServer() { final boolean showMinMax = false; final MaterialDialog dialog = new MaterialDialog.Builder(this) - .title(R.string.msg_please_wait) - .content(getString(R.string.please_wait_while_server_updated) - + UsefulBits.newLine() - + getString(R.string.this_take_minutes)) - .cancelable(false) - .progress(false, SERVER_UPDATE_TIME * 60, showMinMax) - .show(); + .title(R.string.msg_please_wait) + .content(getString(R.string.please_wait_while_server_updated) + + UsefulBits.newLine() + + getString(R.string.this_take_minutes)) + .cancelable(false) + .progress(false, SERVER_UPDATE_TIME * 60, showMinMax) + .show(); CountDownTimer mCountDownTimer = new CountDownTimer(SERVER_UPDATE_TIME * 60 * 1000, 1000) { @@ -314,8 +314,8 @@ public void onReceiveUpdate(ServerUpdateInfo serverUpdateInfo) { @Override public void onError(Exception error) { String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + mDomoticz.getErrorMessage(error)); showSnackbar(message); serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setUpdateRevisionNumber(""); updateServerVersionValue.setText(R.string.not_available); @@ -335,8 +335,8 @@ public void onReceiveVersion(VersionInfo serverVersion) { mSwipeRefreshLayout.setRefreshing(false); if (serverVersion != null && !UsefulBits.isEmpty(serverVersion.getVersion())) { if (serverUtil != null && - serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) + serverUtil.getActiveServer() != null && + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setCurrentServerVersion(serverVersion.getVersion()); currentServerVersionValue.setText(serverVersion.getVersion()); } else currentServerVersionValue.setText(R.string.not_available); @@ -346,12 +346,12 @@ public void onReceiveVersion(VersionInfo serverVersion) { public void onError(Exception error) { mSwipeRefreshLayout.setRefreshing(false); String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + mDomoticz.getErrorMessage(error)); showSnackbar(message); if (serverUtil != null && - serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) + serverUtil.getActiveServer() != null && + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setCurrentServerVersion(""); currentServerVersionValue.setText(R.string.not_available); } @@ -367,9 +367,9 @@ private void showSnackbar(String message) { private void showSimpleDialog(String title, String message) { new MaterialDialog.Builder(this) - .title(title) - .content(message) - .positiveText(R.string.ok) - .show(); + .title(title) + .content(message) + .positiveText(R.string.ok) + .show(); } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java b/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java index 20185e6d6..af8ff4327 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java @@ -28,8 +28,8 @@ import androidx.collection.LruCache; public class BitmapLruCache - extends LruCache - implements ImageLoader.ImageCache { + extends LruCache + implements ImageLoader.ImageCache { public BitmapLruCache() { this(getDefaultLruCacheSize()); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java b/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java index 082e5b3fd..03a07afcc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java @@ -36,7 +36,7 @@ public static boolean isAutomatedToggableDevice(DevicesInfo mDeviceInfo) { if (mDeviceInfo.equals(null)) return false; if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { if (mDeviceInfo.getSubType() != null && mDeviceInfo.getSubType().equals(DomoticzValues.Device.Utility.SubType.SMARTWARES)) { return true; } else { diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java index 945a2260a..7d39e154a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java @@ -82,16 +82,16 @@ public static void sendSimpleNotification(int idx, String title, String text, in } NotificationCompat.Builder builder = - new NotificationCompat.Builder(context) - .setSmallIcon(R.drawable.domoticz_white) - .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) - .setContentTitle(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + title : title) - .setContentText(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + text : text) - .setChannelId(CHANNEL_ID) - .setStyle(new NotificationCompat.BigTextStyle().setSummaryText(text)) - //.setGroupSummary(true) - //.setGroup(GROUP_KEY_NOTIFICATIONS) - .setAutoCancel(true); + new NotificationCompat.Builder(context) + .setSmallIcon(R.drawable.domoticz_white) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) + .setContentTitle(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + title : title) + .setContentText(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + text : text) + .setChannelId(CHANNEL_ID) + .setStyle(new NotificationCompat.BigTextStyle().setSummaryText(text)) + //.setGroupSummary(true) + //.setGroup(GROUP_KEY_NOTIFICATIONS) + .setAutoCancel(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { int nrOfNotifications = 1; @@ -124,7 +124,7 @@ public static void sendSimpleNotification(int idx, String title, String text, in } if (prefUtil.showAutoNotifications()) { builder.extend(new NotificationCompat.CarExtender() - .setUnreadConversation(getUnreadConversation(context, text))); + .setUnreadConversation(getUnreadConversation(context, text))); } mNotificationManager.notify(NOTIFICATION_ID, builder.build()); @@ -140,8 +140,8 @@ private static void CreateChannel(String channelid, int priority, boolean backgr SharedPrefUtil prefUtil = new SharedPrefUtil(context); NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationChannel channel = new NotificationChannel(channelid, - channelid, - GetPriority(priority)); + channelid, + GetPriority(priority)); if (!backgroundProcess) { channel.setShowBadge(true); @@ -164,12 +164,12 @@ public static Notification getForegroundServiceNotification(Context context, Str } return new NotificationCompat.Builder(context) - .setSmallIcon(R.drawable.domoticz_white) - .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) - .setContentTitle("Domoticz") - .setContentText("Processing widget request..") - .setChannelId(channelid) - .setContentIntent(contentIntent).build(); + .setSmallIcon(R.drawable.domoticz_white) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) + .setContentTitle("Domoticz") + .setContentText("Processing widget request..") + .setChannelId(channelid) + .setContentIntent(contentIntent).build(); } private static int GetPriority(int priority) { @@ -224,41 +224,41 @@ public static void sendSimpleNotification(String title, String text, int priorit private static Intent getMessageReadIntent() { return new Intent() - .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) - .setAction(MESSAGE_READ_ACTION) - .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); + .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) + .setAction(MESSAGE_READ_ACTION) + .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); } private static PendingIntent getMessageReadPendingIntent(Context context) { return PendingIntent.getBroadcast(context, - NOTIFICATION_ID, - getMessageReadIntent(), - PendingIntent.FLAG_UPDATE_CURRENT); + NOTIFICATION_ID, + getMessageReadIntent(), + PendingIntent.FLAG_UPDATE_CURRENT); } private static Intent getMessageReplyIntent() { return new Intent() - .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) - .setAction(MESSAGE_REPLY_ACTION) - .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); + .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) + .setAction(MESSAGE_REPLY_ACTION) + .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); } private static PendingIntent getMessageReplyPendingIntent(Context context) { return PendingIntent.getBroadcast(context, - NOTIFICATION_ID, - getMessageReplyIntent(), - PendingIntent.FLAG_UPDATE_CURRENT); + NOTIFICATION_ID, + getMessageReplyIntent(), + PendingIntent.FLAG_UPDATE_CURRENT); } private static RemoteInput getVoiceReplyRemoteInput() { return new RemoteInput.Builder(VOICE_REPLY_KEY) - .setLabel("Reply") - .build(); + .setLabel("Reply") + .build(); } private static NotificationCompat.CarExtender.UnreadConversation getUnreadConversation(Context context, String text) { NotificationCompat.CarExtender.UnreadConversation.Builder unreadConversationBuilder = - new NotificationCompat.CarExtender.UnreadConversation.Builder(UNREAD_CONVERSATION_BUILDER_NAME + text); + new NotificationCompat.CarExtender.UnreadConversation.Builder(UNREAD_CONVERSATION_BUILDER_NAME + text); unreadConversationBuilder.setReadPendingIntent(getMessageReadPendingIntent(context)); unreadConversationBuilder.setReplyAction(getMessageReplyPendingIntent(context), getVoiceReplyRemoteInput()); unreadConversationBuilder.addMessage(text); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java index 92e85d89e..c66323425 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java @@ -37,34 +37,34 @@ public class PermissionsUtil { //these permissions are needed for Wifi scanning public static final String[] INITIAL_LOCATION_PERMS = { - Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.ACCESS_COARSE_LOCATION, + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION, }; //these permissions are needed for storing camera images public static final String[] INITIAL_STORAGE_PERMS = { - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE }; //these permissions are needed for getting device id public static final String[] INITIAL_DEVICE_PERMS = { - Manifest.permission.READ_PHONE_STATE + Manifest.permission.READ_PHONE_STATE }; //these permissions are needed for scanning qrcodes public static final String[] INITIAL_CAMERA_PERMS = { - Manifest.permission.CAMERA + Manifest.permission.CAMERA }; //these permissions are needed for bluetooth public static final String[] INITIAL_BLUETOOTH_PERMS = { - Manifest.permission.BLUETOOTH, - Manifest.permission.BLUETOOTH_ADMIN + Manifest.permission.BLUETOOTH, + Manifest.permission.BLUETOOTH_ADMIN }; //these permissions are needed for recording audio public static final String[] INITIAL_AUDIO_PERMS = { - Manifest.permission.RECORD_AUDIO + Manifest.permission.RECORD_AUDIO }; //these permissions are needed for fingerprint public static final String[] INITIAL_FINGERPRINT_PERMS = { - Manifest.permission.USE_FINGERPRINT + Manifest.permission.USE_FINGERPRINT }; //This range is from 0 to 255!! @@ -110,7 +110,7 @@ public static boolean canAccessAudioState(Context context) { private static boolean hasPermission(String permission, Context context) { // Using ContextCompat.checkSelfPermission will work on all API versions return (PackageManager.PERMISSION_GRANTED - == ContextCompat.checkSelfPermission(context, permission)); + == ContextCompat.checkSelfPermission(context, permission)); } public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String[] permissions) { @@ -123,8 +123,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String[] permissions, DialogInterface.OnClickListener oncancel) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.request_again), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -142,8 +142,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String permission) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, "Request", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -165,8 +165,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionHelper permissionFragmentHelper, String title, String description, final String[] permissions, DialogInterface.OnClickListener oncancel) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.request_again), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -184,8 +184,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionHelper permissionFragmentHelper, String title, String description, final String permission) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, "Request", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/PicassoUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/PicassoUtil.java index 1e4022f2b..d8e097d0d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/PicassoUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/PicassoUtil.java @@ -87,7 +87,7 @@ private static long calculateAvailableCacheSize(File dir) { } // Target at least 90% of available or 25% of total space size = (long) Math.min(availableBytes * MAX_AVAILABLE_SPACE_USE_FRACTION, totalBytes - * MAX_TOTAL_SPACE_USE_FRACTION); + * MAX_TOTAL_SPACE_USE_FRACTION); } catch (Exception e) { // ignored } @@ -96,12 +96,12 @@ private static long calculateAvailableCacheSize(File dir) { public Picasso getPicasso(Context context, final String username, final String password) { OkHttpClient okHttpClient = providesOkHttpClient(context, new LoggingInterceptor.Builder() - .loggable(BuildConfig.DEBUG) - .setLevel(Level.BASIC) - .log(Platform.INFO) - .request("Request") - .response("Response") - .build(), username, password); + .loggable(BuildConfig.DEBUG) + .setLevel(Level.BASIC) + .log(Platform.INFO) + .request("Request") + .response("Response") + .build(), username, password); OkHttp3Downloader okHttpDownloader = providesPicassoOkHttpClient(okHttpClient); Picasso picasso = providesCustomPicasso(context, okHttpDownloader); return picasso; @@ -109,12 +109,12 @@ public Picasso getPicasso(Context context, final String username, final String p public Picasso getPicasso(Context context, final String cookie) { OkHttpClient okHttpClient = providesOkHttpClient(context, new LoggingInterceptor.Builder() - .loggable(BuildConfig.DEBUG) - .setLevel(Level.BASIC) - .log(Platform.INFO) - .request("Request") - .response("Response") - .build(), cookie); + .loggable(BuildConfig.DEBUG) + .setLevel(Level.BASIC) + .log(Platform.INFO) + .request("Request") + .response("Response") + .build(), cookie); OkHttp3Downloader okHttpDownloader = providesPicassoOkHttpClient(okHttpClient); Picasso picasso = providesCustomPicasso(context, okHttpDownloader); return picasso; @@ -122,16 +122,16 @@ public Picasso getPicasso(Context context, final String cookie) { Picasso providesCustomPicasso(Context context, OkHttp3Downloader okHttpDownloader) { return new Picasso.Builder(context) - .listener(new Picasso.Listener() { - @Override - public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) { - Log.e(TAG, "onImageLoadFailed: uri: " + uri, exception); - } - }) - .downloader(okHttpDownloader) - //.memoryCache(new LruCache(context)) - .executor(Executors.newSingleThreadExecutor())//avoid OutOfMemoryError - .build(); + .listener(new Picasso.Listener() { + @Override + public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) { + Log.e(TAG, "onImageLoadFailed: uri: " + uri, exception); + } + }) + .downloader(okHttpDownloader) + //.memoryCache(new LruCache(context)) + .executor(Executors.newSingleThreadExecutor())//avoid OutOfMemoryError + .build(); } public OkHttp3Downloader providesPicassoOkHttpClient(OkHttpClient okHttpClient) { @@ -143,20 +143,20 @@ public OkHttpClient providesOkHttpClient(Context context, Interceptor loggingInt long cacheSize = calculateDiskCacheSize(cacheDir); // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } } - } }; SSLSocketFactory sslSocketFactory = null; @@ -176,14 +176,14 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers() { e.printStackTrace(); } return new OkHttpClient.Builder() - .protocols(Arrays.asList(Protocol.HTTP_1_1)) - .hostnameVerifier(new TrustAllHostnameVerifier()) - .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) - .addNetworkInterceptor(new DefaultHeadersInterceptor(context)) - .addInterceptor(new DefaultHeadersInterceptor(context)) - .addInterceptor(loggingInterceptor) - //.cache(new Cache(cacheDir, cacheSize)) - .build(); + .protocols(Arrays.asList(Protocol.HTTP_1_1)) + .hostnameVerifier(new TrustAllHostnameVerifier()) + .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) + .addNetworkInterceptor(new DefaultHeadersInterceptor(context)) + .addInterceptor(new DefaultHeadersInterceptor(context)) + .addInterceptor(loggingInterceptor) + //.cache(new Cache(cacheDir, cacheSize)) + .build(); } public OkHttpClient providesOkHttpClient(Context context, Interceptor loggingInterceptor, String username, String password) { @@ -191,20 +191,20 @@ public OkHttpClient providesOkHttpClient(Context context, Interceptor loggingInt long cacheSize = calculateDiskCacheSize(cacheDir); // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } } - } }; SSLSocketFactory sslSocketFactory = null; @@ -224,14 +224,14 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers() { e.printStackTrace(); } return new OkHttpClient.Builder() - .protocols(Arrays.asList(Protocol.HTTP_1_1)) - .hostnameVerifier(new TrustAllHostnameVerifier()) - .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) - .addNetworkInterceptor(new DefaultHeadersInterceptor(context, username, password)) - .addInterceptor(new DefaultHeadersInterceptor(context, username, password)) - .addInterceptor(loggingInterceptor) - //.cache(new Cache(cacheDir, cacheSize)) - .build(); + .protocols(Arrays.asList(Protocol.HTTP_1_1)) + .hostnameVerifier(new TrustAllHostnameVerifier()) + .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) + .addNetworkInterceptor(new DefaultHeadersInterceptor(context, username, password)) + .addInterceptor(new DefaultHeadersInterceptor(context, username, password)) + .addInterceptor(loggingInterceptor) + //.cache(new Cache(cacheDir, cacheSize)) + .build(); } public OkHttpClient providesOkHttpClient(Context context, Interceptor loggingInterceptor, String cookie) { @@ -239,20 +239,20 @@ public OkHttpClient providesOkHttpClient(Context context, Interceptor loggingInt long cacheSize = calculateDiskCacheSize(cacheDir); // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } } - } }; SSLSocketFactory sslSocketFactory = null; @@ -273,14 +273,14 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers() { } return new OkHttpClient.Builder() - .protocols(Arrays.asList(Protocol.HTTP_1_1)) - .hostnameVerifier(new TrustAllHostnameVerifier()) - .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) - .addNetworkInterceptor(new DefaultHeadersInterceptor(context, cookie)) - .addInterceptor(new DefaultHeadersInterceptor(context, cookie)) - .addInterceptor(loggingInterceptor) - //.cache(new Cache(cacheDir, cacheSize)) - .build(); + .protocols(Arrays.asList(Protocol.HTTP_1_1)) + .hostnameVerifier(new TrustAllHostnameVerifier()) + .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]) + .addNetworkInterceptor(new DefaultHeadersInterceptor(context, cookie)) + .addInterceptor(new DefaultHeadersInterceptor(context, cookie)) + .addInterceptor(loggingInterceptor) + //.cache(new Cache(cacheDir, cacheSize)) + .build(); } @SuppressLint("BadHostnameVerifier") diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java b/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java index 10b17603c..97f4b6ad6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java @@ -56,10 +56,10 @@ public static void cleanAllSerializableObjects(Context context) { */ public static void saveSerializable(Context context, Object objectToSave, String fileName) { File SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); @@ -85,10 +85,10 @@ public static Object readSerializedObject(Context context, String fileName) { Object objectToReturn = null; File SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java index 75293817c..ac1eaae6d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java @@ -74,6 +74,7 @@ public class SharedPrefUtil { private static final String PREF_CUSTOM_WEAR_ITEMS = "wearItems"; private static final String PREF_ALWAYS_ON = "alwayson"; private static final String PREF_AUTO_REFRESH = "autorefresh"; + private static final String PREF_AUTO_REFRESH_TIMER = "autorefreshTimer"; private static final String PREF_NOTIFICATION_VIBRATE = "notification_vibrate"; private static final String PREF_NOTIFICATION_SOUND = "notification_sound"; private static final String PREF_DISPLAY_LANGUAGE = "displayLanguage"; @@ -155,9 +156,9 @@ public boolean showSwitchesAsButtons() { return prefs.getBoolean(PREF_SWITCH_BUTTONS, false); } - public boolean checkForUpdatesEnabled() { - return prefs.getBoolean(PREF_CHECK_UPDATES, false); - } + // public boolean checkForUpdatesEnabled() { + // return prefs.getBoolean(PREF_CHECK_UPDATES, false); + // } public boolean IsWidgetsEnabled() { return prefs.getBoolean(PREF_WIDGET_ENABLED, false); @@ -205,6 +206,20 @@ public boolean getAutoRefresh() { return prefs.getBoolean(PREF_AUTO_REFRESH, false); } + public int getAutoRefreshTimer() { + try { + int value = Integer.valueOf(prefs.getString(PREF_AUTO_REFRESH_TIMER, "5")); + if (value == -1) { + editor.putString(PREF_AUTO_REFRESH_TIMER, "5").apply(); + return 5; + } + return value; + } catch (Exception ex) { + editor.putString(PREF_AUTO_REFRESH_TIMER, "5").apply(); + return 5; + } + } + public int getAlarmTimer() { try { String timer = prefs.getString(PREF_ALARM_TIMER, "5"); @@ -703,7 +718,7 @@ public int getStartupScreenIndex() { public void setStartupScreenIndex(int position) { String[] startupScreenValues = - mContext.getResources().getStringArray(R.array.startup_actions); + mContext.getResources().getStringArray(R.array.startup_actions); String startupScreenValue; try { @@ -869,27 +884,27 @@ public boolean isBluetoothEnabled() { return prefs.getBoolean(PREF_ENABLE_Bluetooth, false); } - public boolean isServerUpdateAvailable() { - return prefs.getBoolean(PREF_UPDATE_SERVER_AVAILABLE, false); - } + //public boolean isServerUpdateAvailable() { + // return prefs.getBoolean(PREF_UPDATE_SERVER_AVAILABLE, false); + //} - public String getPreviousVersionNumber() { - return prefs.getString(PREF_LAST_VERSION, ""); - } + //public String getPreviousVersionNumber() { + // return prefs.getString(PREF_LAST_VERSION, ""); + //} - public void setVersionNumber(String version) { - editor.putString(PREF_LAST_VERSION, version); - editor.commit(); - } + //public void setVersionNumber(String version) { + // editor.putString(PREF_LAST_VERSION, version); + // editor.commit(); + //} - public String getLastUpdateShown() { - return prefs.getString(PREF_UPDATE_SERVER_SHOWN, ""); - } + //public String getLastUpdateShown() { + // return prefs.getString(PREF_UPDATE_SERVER_SHOWN, ""); + //} - public void setLastUpdateShown(String revisionNb) { - editor.putString(PREF_UPDATE_SERVER_SHOWN, revisionNb); - editor.commit(); - } + //public void setLastUpdateShown(String revisionNb) { + // editor.putString(PREF_UPDATE_SERVER_SHOWN, revisionNb); + // editor.commit(); + //} public boolean isGeofenceEnabled() { return prefs.getBoolean(PREF_GEOFENCE_ENABLED, false); @@ -942,7 +957,7 @@ public ArrayList getNFCList() { String jsonNFCs = prefs.getString(PREF_NFC_TAGS, null); Gson gson = new Gson(); NFCInfo[] item = gson.fromJson(jsonNFCs, - NFCInfo[].class); + NFCInfo[].class); nfcs = Arrays.asList(item); for (NFCInfo n : nfcs) { oReturnValue.add(n); @@ -966,7 +981,7 @@ public ArrayList getBluetoothList() { String jsonBluetooths = prefs.getString(PREF_BLUETOOTH, null); Gson gson = new Gson(); BluetoothInfo[] item = gson.fromJson(jsonBluetooths, - BluetoothInfo[].class); + BluetoothInfo[].class); Bluetooths = Arrays.asList(item); for (BluetoothInfo n : Bluetooths) { oReturnValue.add(n); @@ -989,7 +1004,7 @@ public ArrayList getQRCodeList() { String jsonNFCs = prefs.getString(PREF_QR_CODES, null); Gson gson = new Gson(); QRCodeInfo[] item = gson.fromJson(jsonNFCs, - QRCodeInfo[].class); + QRCodeInfo[].class); qrs = Arrays.asList(item); for (QRCodeInfo n : qrs) { oReturnValue.add(n); @@ -1013,7 +1028,7 @@ public ArrayList getSpeechList() { String jsonNFCs = prefs.getString(PREF_SPEECH_COMMANDS, null); Gson gson = new Gson(); SpeechInfo[] item = gson.fromJson(jsonNFCs, - SpeechInfo[].class); + SpeechInfo[].class); qrs = Arrays.asList(item); for (SpeechInfo n : qrs) { oReturnValue.add(n); @@ -1040,7 +1055,7 @@ public ArrayList getLocations() { String jsonLocations = prefs.getString(PREF_GEOFENCE_LOCATIONS, null); Gson gson = new Gson(); LocationInfo[] locationItem = gson.fromJson(jsonLocations, - LocationInfo[].class); + LocationInfo[].class); locations = Arrays.asList(locationItem); for (LocationInfo l : locations) { if (l.toGeofence() != null) { @@ -1052,8 +1067,8 @@ public ArrayList getLocations() { if (incorrectDetected) { saveLocations(returnValue); Toast.makeText(mContext, - R.string.geofence_error_recreateLocations, - Toast.LENGTH_LONG).show(); + R.string.geofence_error_recreateLocations, + Toast.LENGTH_LONG).show(); } } else return null; @@ -1112,12 +1127,6 @@ public boolean saveSharedPreferencesToFile(File dst) { boolean isServerUpdateAvailableValue = false; ServerUpdateInfo mServerUpdateInfo = new ServerUtil(mContext).getActiveServer().getServerUpdateInfo(mContext); - // Before saving to file set server update available preference to false - if (isServerUpdateAvailable()) { - isServerUpdateAvailableValue = true; - mServerUpdateInfo.setUpdateAvailable(false); - } - Map oAllPrefs = this.prefs.getAll(); HashMap oSavePrefs = new HashMap(); for (Map.Entry entry : oAllPrefs.entrySet()) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java b/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java index 9e83bff25..cebb1ae12 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java @@ -139,8 +139,8 @@ public static char[] Reverse(char[] A) { public static String Join(List msgs) { return msgs == null || msgs.size() == 0 ? - "" : msgs.size() == 1 ? msgs.get(0) : - msgs.subList(0, msgs.size() - 1).toString().replaceAll("^.|.$", "") + " and " + msgs.get(msgs.size() - 1); + "" : msgs.size() == 1 ? msgs.get(0) : + msgs.subList(0, msgs.size() - 1).toString().replaceAll("^.|.$", "") + " and " + msgs.get(msgs.size() - 1); } public static String newLine() { @@ -200,7 +200,7 @@ public static String getMd5String(String password) { for (byte aHash : hash) { if ((0xff & aHash) < 0x10) { hexString.append("0" - + Integer.toHexString((0xFF & aHash))); + + Integer.toHexString((0xFF & aHash))); } else { hexString.append(Integer.toHexString(0xFF & aHash)); } @@ -338,9 +338,9 @@ public static void checkDownloadedLanguage(Context context, ServerUtil serverUti showSimpleToast(context, "Downloaded language files did not match the preferred language", Toast.LENGTH_SHORT); Log.d(TAG, "Downloaded language files did not match the preferred language:" + newLine() - + "Current downloaded language: " + downloadedLanguage + newLine() - + "Active language: " + activeLanguage + newLine() - + "Downloading the correct language"); + + "Current downloaded language: " + downloadedLanguage + newLine() + + "Active language: " + activeLanguage + newLine() + + "Downloading the correct language"); mSharedPrefs.getLanguageStringsFromServer(activeLanguage.toLowerCase(), serverUtil); } } @@ -413,14 +413,14 @@ public static void setScheduledTasks(Context context) { @SuppressWarnings("PointlessArithmeticExpression") PeriodicTask task = new PeriodicTask.Builder() - .setService(TaskService.class) // Service to start - .setPersisted(true) // Will survive reboots - .setTag(TASK_TAG_PERIODIC) // Schedule periodic - .setPeriod(60 * 60 * 24 * 1) // Every day - .setFlex(60 * 60 * 8) // Flex of 8 hours - .setRequiredNetwork(Task.NETWORK_STATE_UNMETERED) // Only un metered networks - .setRequiresCharging(true) // Only when charging - .build(); + .setService(TaskService.class) // Service to start + .setPersisted(true) // Will survive reboots + .setTag(TASK_TAG_PERIODIC) // Schedule periodic + .setPeriod(60 * 60 * 24 * 1) // Every day + .setFlex(60 * 60 * 8) // Flex of 8 hours + .setRequiredNetwork(Task.NETWORK_STATE_UNMETERED) // Only un metered networks + .setRequiresCharging(true) // Only when charging + .build(); mGcmNetworkManager.schedule(task); mSharedPrefUtil.setTaskIsScheduled(true); @@ -466,8 +466,8 @@ public void onError(Exception error) { public void onError(Exception error) { if (error != null && domoticz != null) showSimpleToast(context, String.format( - context.getString(R.string.error_couldNotCheckForConfig), - domoticz.getErrorMessage(error)), Toast.LENGTH_SHORT); + context.getString(R.string.error_couldNotCheckForConfig), + domoticz.getErrorMessage(error)), Toast.LENGTH_SHORT); if (receiver != null) receiver.onError(error); } @@ -480,8 +480,8 @@ public static void GetServerUserInfo(final Domoticz domoticz, final AuthInfo aut ArrayList mDetailUserInfo = new ArrayList<>(); UserInfo currentUser = new UserInfo(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME), - UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), - auth != null ? auth.getRights() : 0); + UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), + auth != null ? auth.getRights() : 0); if (currentConfig != null && currentConfig.getUsers() != null) { for (UserInfo user : currentConfig.getUsers()) { if (!user.getUsername().equals(currentUser.getUsername())) @@ -501,8 +501,8 @@ public void onReceiveUsers(final ArrayList mUserInfo) { ArrayList mDetailUserInfo = new ArrayList<>(); //also add current user UserInfo currentUser = new UserInfo(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME), - UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), - auth != null ? auth.getRights() : 0); + UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), + auth != null ? auth.getRights() : 0); for (UserInfo user : mUserInfo) { if (!user.getUsername().equals(currentUser.getUsername())) mDetailUserInfo.add(user); @@ -542,7 +542,7 @@ public static boolean checkPlayServicesAvailable(final Activity activity) { // Unresolvable error Log.e(TAG, "Google Play services is unavailable."); showSimpleToast(activity, - activity.getString(R.string.google_play_services_unavailable), Toast.LENGTH_SHORT); + activity.getString(R.string.google_play_services_unavailable), Toast.LENGTH_SHORT); return false; } } @@ -584,27 +584,27 @@ public static void showSnackbarWithAction(Context context, CoordinatorLayout coo View.OnClickListener onclickListener, String actiontext) { try { if (context != null && - coordinatorLayout != null && - !UsefulBits.isEmpty(message)) { + coordinatorLayout != null && + !UsefulBits.isEmpty(message)) { if (onclickListener == null || UsefulBits.isEmpty(actiontext)) { if (callback != null) { Snackbar.make(coordinatorLayout, message, length) - .setCallback(callback) - .show(); + .setCallback(callback) + .show(); } else { Snackbar.make(coordinatorLayout, message, length) - .show(); + .show(); } } else { if (callback != null) { Snackbar.make(coordinatorLayout, message, length) - .setAction(actiontext, onclickListener) - .setCallback(callback) - .show(); + .setAction(actiontext, onclickListener) + .setCallback(callback) + .show(); } else { Snackbar.make(coordinatorLayout, message, length) - .setAction(actiontext, onclickListener) - .show(); + .setAction(actiontext, onclickListener) + .show(); } } } @@ -623,8 +623,8 @@ public static void openPremiumAppStore(Context context) { if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( - otherAppActivity.applicationInfo.packageName, - otherAppActivity.name + otherAppActivity.applicationInfo.packageName, + otherAppActivity.name ); rateIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); rateIntent.setComponent(componentName); @@ -663,21 +663,21 @@ public static void checkAPK(final Context context, final SharedPrefUtil mSharedP // release build PiracyChecker oPiracyChecker = new PiracyChecker(context); oPiracyChecker - .enableSigningCertificate(context.getString(R.string.APK_VALIDATE_PROD)) - .enableGooglePlayLicensing(context.getString(R.string.APK_LICENSE_PREMIUM)) - .enableInstallerId(InstallerID.GOOGLE_PLAY) - .callback(new PiracyCheckerCallback() { - @Override - public void allow() { - mSharedPrefs.setAPKValidated(true); - } + .enableSigningCertificate(context.getString(R.string.APK_VALIDATE_PROD)) + .enableGooglePlayLicensing(context.getString(R.string.APK_LICENSE_PREMIUM)) + .enableInstallerId(InstallerID.GOOGLE_PLAY) + .callback(new PiracyCheckerCallback() { + @Override + public void allow() { + mSharedPrefs.setAPKValidated(true); + } - @Override - public void dontAllow(@NonNull PiracyCheckerError piracyCheckerError, @Nullable PirateApp pirateApp) { - mSharedPrefs.setAPKValidated(false); - } - }) - .start(); + @Override + public void dontAllow(@NonNull PiracyCheckerError piracyCheckerError, @Nullable PirateApp pirateApp) { + mSharedPrefs.setAPKValidated(false); + } + }) + .start(); } } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java index a218d286b..876cd98d6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java @@ -73,9 +73,9 @@ public class SetupServerSettings extends Fragment implements OnPermissionCallbac private ServerUtil mServerUtil; private AppCompatEditText remote_server_input, remote_port_input, - remote_username_input, remote_password_input, - remote_directory_input, local_server_input, local_password_input, - local_username_input, local_port_input, local_directory_input, server_name_input; + remote_username_input, remote_password_input, + remote_directory_input, local_server_input, local_password_input, + local_username_input, local_port_input, local_directory_input, server_name_input; private Spinner remote_protocol_spinner, local_protocol_spinner; private SwitchMaterial localServer_switch; @@ -164,27 +164,27 @@ private void getLayoutReferences() { @Override public void onClick(View v) { new MaterialDialog.Builder(getContext()) - .title(R.string.welcome_ssid_button_prompt) - .content(R.string.welcome_msg_no_ssid_found) - .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) - .input(null, null, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); - final ArrayList ssidListFromPrefs = new ArrayList<>(); - if (ssidFromPrefs != null) { - if (ssidFromPrefs.size() > 0) { - for (String wifi : ssidFromPrefs) { - ssidListFromPrefs.add(wifi); + .title(R.string.welcome_ssid_button_prompt) + .content(R.string.welcome_msg_no_ssid_found) + .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) + .input(null, null, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); + final ArrayList ssidListFromPrefs = new ArrayList<>(); + if (ssidFromPrefs != null) { + if (ssidFromPrefs.size() > 0) { + for (String wifi : ssidFromPrefs) { + ssidListFromPrefs.add(wifi); + } } } - } - ssidListFromPrefs.add(String.valueOf(input)); - mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); - setSsid_spinner(); - } - }).show(); + ssidListFromPrefs.add(String.valueOf(input)); + mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); + setSsid_spinner(); + } + }).show(); } }); @@ -243,10 +243,10 @@ private void checkConnectionData() { if (!UsefulBits.isEmpty(status)) { showErrorPopup(getString(R.string.welcome_msg_connectionDataIncomplete) + "\n\n" + status + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!mDomoticz.isUrlValid(newServer)) { showErrorPopup(getString(R.string.welcome_msg_connectionDataInvalid) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!isUpdateRequest && !mServerUtil.checkUniqueServerName(newServer)) { showErrorPopup("Server name must be unique!"); } else { @@ -256,15 +256,15 @@ private void checkConnectionData() { private void showErrorPopup(String error) { new AlertDialog.Builder(getActivity()) - .setIcon(android.R.drawable.ic_dialog_info) - .setTitle("Failed") - .setMessage(error) - .setPositiveButton(this.getString(R.string.yes), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - } - }) - .show(); + .setIcon(android.R.drawable.ic_dialog_info) + .setTitle("Failed") + .setMessage(error) + .setPositiveButton(this.getString(R.string.yes), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }) + .show(); } private void setPreferenceValues() { @@ -349,7 +349,7 @@ public void ReceiveSSIDs(CharSequence[] ssidFound) { private void setProtocol_spinner() { String[] protocols = getResources().getStringArray(R.array.remote_server_protocols); ArrayAdapter protocolAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); remote_protocol_spinner.setAdapter(protocolAdapter); remote_protocol_spinner.setSelection(getPrefsDomoticzRemoteSecureIndex()); remote_protocol_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @@ -382,17 +382,17 @@ public void onNothingSelected(AdapterView adapterView) { private void buildServerInfo() { newServer = new ServerInfo(); newServer.setRemoteServerUsername( - remote_username_input.getText().toString().trim()); + remote_username_input.getText().toString().trim()); newServer.setRemoteServerPassword( - remote_password_input.getText().toString().trim()); + remote_password_input.getText().toString().trim()); newServer.setRemoteServerUrl( - remote_server_input.getText().toString().trim()); + remote_server_input.getText().toString().trim()); newServer.setRemoteServerPort( - remote_port_input.getText().toString().trim()); + remote_port_input.getText().toString().trim()); newServer.setRemoteServerDirectory( - remote_directory_input.getText().toString().trim()); + remote_directory_input.getText().toString().trim()); newServer.setRemoteServerSecure( - getSpinnerDomoticzRemoteSecureBoolean()); + getSpinnerDomoticzRemoteSecureBoolean()); newServer.setEnabled(false); if (!localServer_switch.isChecked()) { @@ -400,17 +400,17 @@ private void buildServerInfo() { newServer.setIsLocalServerAddressDifferent(false); } else { newServer.setLocalServerUsername( - local_username_input.getText().toString().trim()); + local_username_input.getText().toString().trim()); newServer.setLocalServerPassword( - local_password_input.getText().toString().trim()); + local_password_input.getText().toString().trim()); newServer.setLocalServerUrl( - local_server_input.getText().toString().trim()); + local_server_input.getText().toString().trim()); newServer.setLocalServerPort( - local_port_input.getText().toString().trim()); + local_port_input.getText().toString().trim()); newServer.setLocalServerDirectory( - local_directory_input.getText().toString().trim()); + local_directory_input.getText().toString().trim()); newServer.setLocalServerSecure( - getSpinnerDomoticzLocalSecureBoolean()); + getSpinnerDomoticzLocalSecureBoolean()); newServer.setIsLocalServerAddressDifferent(true); } @@ -502,13 +502,13 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - if (mPhoneConnectionUtil != null) - mPhoneConnectionUtil.stopReceiver(); - } - }); + getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (mPhoneConnectionUtil != null) + mPhoneConnectionUtil.stopReceiver(); + } + }); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java index 2ac9642c0..83d4e1317 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java @@ -29,11 +29,11 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.Toast; import com.fastaccess.permission.base.PermissionFragmentHelper; import com.fastaccess.permission.base.callback.OnPermissionCallback; +import com.google.android.material.button.MaterialButton; import java.io.File; import java.util.Arrays; @@ -61,14 +61,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, SettingsFile = new File(Environment.getExternalStorageDirectory(), "/Domoticz/DomoticzSettings.txt"); permissionFragmentHelper = PermissionFragmentHelper.getInstance(this); - Button importButton = v.findViewById(R.id.import_settings); + MaterialButton importButton = v.findViewById(R.id.import_settings); + MaterialButton demoSetup = v.findViewById(R.id.demo_settings); importButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!PermissionsUtil.canAccessStorage(getActivity())) { permissionFragmentHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } else { importSettings(); } @@ -77,6 +78,14 @@ public void onClick(View v) { } } }); + + demoSetup.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + ((WelcomeViewActivity) getActivity()).setDemoAccount(); + } + }); + if (!SettingsFile.exists()) { importButton.setVisibility(View.GONE); } @@ -97,7 +106,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_STORAGE_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_storage), neededPermission); + getActivity().getString(R.string.permission_desc_storage), neededPermission); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java index 4e60a1024..33be54a10 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java @@ -70,9 +70,9 @@ public class WelcomePage3 extends Fragment implements OnPermissionCallback { private ServerUtil mServerUtil; private AppCompatEditText remote_server_input, remote_port_input, - remote_username_input, remote_password_input, - remote_directory_input, local_server_input, local_password_input, - local_username_input, local_port_input, local_directory_input; + remote_username_input, remote_password_input, + remote_directory_input, local_server_input, local_password_input, + local_username_input, local_port_input, local_directory_input; private Spinner remote_protocol_spinner, local_protocol_spinner; private SwitchMaterial localServer_switch; @@ -148,27 +148,27 @@ private void getLayoutReferences() { @Override public void onClick(View v) { new MaterialDialog.Builder(getContext()) - .title(R.string.welcome_ssid_button_prompt) - .content(R.string.welcome_msg_no_ssid_found) - .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) - .input(null, null, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); - final ArrayList ssidListFromPrefs = new ArrayList<>(); - if (ssidFromPrefs != null) { - if (ssidFromPrefs.size() > 0) { - for (String wifi : ssidFromPrefs) { - ssidListFromPrefs.add(wifi); + .title(R.string.welcome_ssid_button_prompt) + .content(R.string.welcome_msg_no_ssid_found) + .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) + .input(null, null, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); + final ArrayList ssidListFromPrefs = new ArrayList<>(); + if (ssidFromPrefs != null) { + if (ssidFromPrefs.size() > 0) { + for (String wifi : ssidFromPrefs) { + ssidListFromPrefs.add(wifi); + } } } - } - ssidListFromPrefs.add(String.valueOf(input)); - mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); + ssidListFromPrefs.add(String.valueOf(input)); + mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); - setSsid_spinner(); - } - }).show(); + setSsid_spinner(); + } + }).show(); } }); @@ -288,7 +288,7 @@ public void ReceiveSSIDs(CharSequence[] ssidFound) { private void setProtocol_spinner() { String[] protocols = getResources().getStringArray(R.array.remote_server_protocols); ArrayAdapter protocolAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); remote_protocol_spinner.setAdapter(protocolAdapter); remote_protocol_spinner.setSelection(getPrefsDomoticzRemoteSecureIndex()); remote_protocol_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @@ -320,34 +320,34 @@ public void onNothingSelected(AdapterView adapterView) { private void writePreferenceValues() { mServerUtil.getActiveServer().setRemoteServerUsername( - remote_username_input.getText().toString().trim()); + remote_username_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerPassword( - remote_password_input.getText().toString().trim()); + remote_password_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerUrl( - remote_server_input.getText().toString().trim()); + remote_server_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerPort( - remote_port_input.getText().toString().trim()); + remote_port_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerDirectory( - remote_directory_input.getText().toString().trim()); + remote_directory_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerSecure( - getSpinnerDomoticzRemoteSecureBoolean()); + getSpinnerDomoticzRemoteSecureBoolean()); SwitchMaterial useSameAddress = v.findViewById(R.id.localServer_switch); if (!useSameAddress.isChecked()) { mServerUtil.getActiveServer().setLocalSameAddressAsRemote(); mServerUtil.getActiveServer().setIsLocalServerAddressDifferent(false); } else { mServerUtil.getActiveServer().setLocalServerUsername( - local_username_input.getText().toString().trim()); + local_username_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerPassword( - local_password_input.getText().toString().trim()); + local_password_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerUrl( - local_server_input.getText().toString().trim()); + local_server_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerPort( - local_port_input.getText().toString().trim()); + local_port_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerDirectory( - local_directory_input.getText().toString().trim()); + local_directory_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerSecure( - getSpinnerDomoticzLocalSecureBoolean()); + getSpinnerDomoticzLocalSecureBoolean()); mServerUtil.getActiveServer().setIsLocalServerAddressDifferent(true); } @@ -418,13 +418,13 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - if (mPhoneConnectionUtil != null) - mPhoneConnectionUtil.stopReceiver(); - } - }); + getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (mPhoneConnectionUtil != null) + mPhoneConnectionUtil.stopReceiver(); + } + }); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java index f00394859..82158d529 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java @@ -81,10 +81,10 @@ private void checkConnectionData() { if (!mDomoticz.isConnectionDataComplete(mServerUtil.getActiveServer())) { setResultText(getString(R.string.welcome_msg_connectionDataIncomplete) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!mDomoticz.isUrlValid(mServerUtil.getActiveServer())) { setResultText(getString(R.string.welcome_msg_connectionDataInvalid) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else { mDomoticz.getServerVersion(new VersionReceiver() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java index c7613b00b..ac4540272 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java @@ -34,14 +34,16 @@ import nl.hnogames.domoticz.R; import nl.hnogames.domoticz.Utils.SharedPrefUtil; import nl.hnogames.domoticz.Utils.UsefulBits; +import nl.hnogames.domoticzapi.Utils.ServerUtil; public class WelcomeViewActivity extends AppIntro2 { private static final int WELCOME_WIZARD = 1; private int p = 0; + private SharedPrefUtil mSharedPrefs; @Override protected void onCreate(Bundle savedInstanceState) { - SharedPrefUtil mSharedPrefs = new SharedPrefUtil(this); + mSharedPrefs = new SharedPrefUtil(this); if (!UsefulBits.isEmpty(mSharedPrefs.getDisplayLanguage())) UsefulBits.setDisplayLanguage(this, mSharedPrefs.getDisplayLanguage()); @@ -54,13 +56,28 @@ protected void onCreate(Bundle savedInstanceState) { sliderPage.setDescription(getString(R.string.welcome_info_domoticz)); sliderPage.setImageDrawable(R.drawable.domoticz); sliderPage.setBgColor(R.color.black); - addSlide(AppIntroFragment.newInstance(sliderPage)); + addSlide(AppIntroFragment.newInstance(sliderPage)); addSlide(WelcomePage2.newInstance()); addSlide(WelcomePage3.newInstance(WELCOME_WIZARD)); addSlide(WelcomePage4.newInstance()); } + public void setDemoAccount() { + ServerUtil mServerUtil = new ServerUtil(this); + mServerUtil.getActiveServer().setRemoteServerUsername("admin"); + mServerUtil.getActiveServer().setRemoteServerPassword("D@m@t1czCl0ud"); + mServerUtil.getActiveServer().setRemoteServerUrl("gandalf.domoticz.com"); + mServerUtil.getActiveServer().setRemoteServerPort("1883"); + mServerUtil.getActiveServer().setRemoteServerDirectory(""); + mServerUtil.getActiveServer().setRemoteServerSecure(true); + mServerUtil.getActiveServer().setLocalSameAddressAsRemote(); + mServerUtil.getActiveServer().setIsLocalServerAddressDifferent(false); + mServerUtil.saveDomoticzServers(true); + mSharedPrefs.setWelcomeWizardSuccess(true); + endWelcomeWizard(); + } + @Override public void onBackPressed() { if (p > 0) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java index 76a44a7b3..eeac72ecc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java @@ -101,10 +101,10 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View view) { InputMethodManager imm = - (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); + (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editPin.getWindowToken(), 0); final String password = - UsefulBits.getMd5String(editPin.getText().toString()); + UsefulBits.getMd5String(editPin.getText().toString()); if (UsefulBits.isEmpty(password)) { Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); return; @@ -118,7 +118,7 @@ public void onReceiveSettings(SettingsInfo settings) { if (validatePassword(password)) { if (sSecurityPanel != null) { getBackground(sSecurityPanel, password, getApplicationContext().getString(R.string.status) + ": " + - sSecurityPanel.getData()); + sSecurityPanel.getData()); } } else Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); @@ -133,7 +133,7 @@ public void onError(Exception error) { if (validatePassword(password)) { if (sSecurityPanel != null) { getBackground(sSecurityPanel, password, getApplicationContext().getString(R.string.status) + ": " + - sSecurityPanel.getData()); + sSecurityPanel.getData()); } } else Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); @@ -170,17 +170,17 @@ public void onError(Exception error) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, value, password, getWidgetLayout(String.valueOf(text))); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, value, password, getWidgetLayout(String.valueOf(text))); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private int getWidgetLayout(String background) { @@ -234,12 +234,12 @@ public void onReceiveDevices(final ArrayList mDevicesInfo) { boolean deviceFound = false; for (DevicesInfo d : mDevicesInfo) { if (!UsefulBits.isEmpty(d.getSwitchType()) && - d.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY)) { + d.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY)) { if (d.getSubType().equals(DomoticzValues.Device.SubType.Name.SECURITYPANEL)) { sSecurityPanel = d; txtTitle.setText(sSecurityPanel.getName()); txtStatus.setText(getApplicationContext().getString(R.string.status) + ": " + - sSecurityPanel.getData()); + sSecurityPanel.getData()); deviceFound = true; } } @@ -276,10 +276,10 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String value, String pin if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); mSharedPrefs.setSecurityWidgetIDX(mAppWidgetId, idx, value, pin, layout); Intent startService = new Intent(SecurityWidgetConfigurationActivity.this, - SecurityWidgetProvider.UpdateSecurityWidgetService.class); + SecurityWidgetProvider.UpdateSecurityWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java index 8fc17a3fd..2980d4209 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java @@ -87,18 +87,18 @@ private void processRequest(final int idx, final int status, final String passwo public void onReceiveResult(String result) { if (action == DomoticzValues.Security.Status.ARMAWAY) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_arm_away), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_arm_away), + Toast.LENGTH_LONG).show(); } else if (action == DomoticzValues.Security.Status.ARMHOME) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_arm_home), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_arm_home), + Toast.LENGTH_LONG).show(); } else if (action == DomoticzValues.Security.Status.DISARM) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_disarm), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_disarm), + Toast.LENGTH_LONG).show(); } WidgetUtils.RefreshWidgets(mContext); } @@ -107,8 +107,8 @@ public void onReceiveResult(String result) { public void onError(Exception error) { Log.e("SECURITYWIDGET", domoticz.getErrorMessage(error)); Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); } }); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java index 58973a3a9..84bdbddb2 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java @@ -87,7 +87,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, // Get all ids ComponentName thisWidget = new ComponentName(context, - SecurityWidgetProvider.class); + SecurityWidgetProvider.class); int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); if (allWidgetIds != null) { for (int mAppWidgetId : allWidgetIds) { @@ -114,10 +114,10 @@ public int onStartCommand(Intent intent, int flags, int startId) { this.startForeground(1337, NotificationUtil.getForegroundServiceNotification(this, "Widget")); } AppWidgetManager appWidgetManager = AppWidgetManager - .getInstance(UpdateSecurityWidgetService.this); + .getInstance(UpdateSecurityWidgetService.this); try { int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { try { updateAppWidget(appWidgetManager, incomingAppWidgetId); @@ -166,24 +166,24 @@ public void onReceiveDevice(DevicesInfo s) { views = new RemoteViews(packageName, mSharedPrefs.getSecurityWidgetLayout(appWidgetId)); views.setTextViewText(R.id.title, s.getName()); views.setTextViewText(R.id.status, getApplicationContext().getString(R.string.status) + ": " + - s.getData()); + s.getData()); views.setOnClickPendingIntent(R.id.armhome, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_ARMHOME, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_ARMHOME, password)); views.setViewVisibility(R.id.armhome, View.VISIBLE); views.setOnClickPendingIntent(R.id.armaway, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_ARMAWAY, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_ARMAWAY, password)); views.setViewVisibility(R.id.armaway, View.VISIBLE); views.setOnClickPendingIntent(R.id.disarm, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_DISARM, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_DISARM, password)); views.setViewVisibility(R.id.disarm, View.VISIBLE); views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getTypeImg(), s.getType(), s.getSwitchType(), true, s.getUseCustomImage(), s.getImage())); diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java index 022f4335c..e7c3ecaae 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java @@ -161,7 +161,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) if (mDeviceInfo.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - SmallWidgetConfigurationActivity.this, domoticz); + SmallWidgetConfigurationActivity.this, domoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -208,15 +208,15 @@ public void onError(Exception error) { private void showSelectorDialog(final DevicesInfo selector, final String pass) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - getBackground(selector, pass, String.valueOf(text)); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + getBackground(selector, pass, String.valueOf(text)); + } + }) + .show(); } private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { @@ -238,17 +238,17 @@ private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String value, int layoutId) { @@ -258,7 +258,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String int idx = mSelectedSwitch.getIdx(); if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (UsefulBits.isEmpty(mSelectedSwitch.getType())) { Log.i(TAG, "Widget without a type saved"); @@ -274,7 +274,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String } Intent startService = new Intent(SmallWidgetConfigurationActivity.this, - WidgetProviderSmall.UpdateWidgetService.class); + WidgetProviderSmall.UpdateWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); @@ -302,7 +302,7 @@ public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.search); searchViewAction = (SearchView) MenuItemCompat - .getActionView(searchMenuItem); + .getActionView(searchMenuItem); searchViewAction.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { @@ -321,14 +321,14 @@ public boolean onQueryTextChange(String newText) { private boolean SmallWidgetSupported(DevicesInfo s) { if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: case DomoticzValues.Scene.Type.GROUP: return true; } } else if (s.getSwitchTypeVal() == 0 && - (s.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY))) { + (s.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY))) { return false; //security panel is not supported for small widgets } else { switch (s.getSwitchTypeVal()) { 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 76745005c..62cbde9a3 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java @@ -153,7 +153,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) final DevicesInfo mDeviceInfo = (DevicesInfo) adapter.getItem(position); if (mDeviceInfo.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - WidgetConfigurationActivity.this, domoticz); + WidgetConfigurationActivity.this, domoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -200,15 +200,15 @@ public void onError(Exception error) { private void showSelectorDialog(final DevicesInfo selector, final String pass) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - getBackground(selector, pass, String.valueOf(text)); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + getBackground(selector, pass, String.valueOf(text)); + } + }) + .show(); } private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { @@ -257,17 +257,17 @@ private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String value, int layoutId) { @@ -277,7 +277,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String int idx = mSelectedSwitch.getIdx(); if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (UsefulBits.isEmpty(mSelectedSwitch.getType())) { Log.i(TAG, "Widget without a type saved"); mSharedPrefs.setWidgetIDX(mAppWidgetId, idx, false, password, value, layoutId); @@ -291,7 +291,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String } } Intent startService = new Intent(WidgetConfigurationActivity.this, - WidgetProviderLarge.UpdateWidgetService.class); + WidgetProviderLarge.UpdateWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); @@ -318,7 +318,7 @@ public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.search); searchViewAction = (SearchView) MenuItemCompat - .getActionView(searchMenuItem); + .getActionView(searchMenuItem); searchViewAction.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { @@ -338,7 +338,7 @@ private int withButtons(DevicesInfo s) { int withButton = 0; if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: withButton = BUTTON_TOGGLE; diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java index aa0693455..b1ed3e0e8 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java @@ -116,8 +116,8 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { return true; if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { switch (mExtendedStatusInfo.getType()) { case DomoticzValues.Scene.Type.GROUP: return true; @@ -143,8 +143,8 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { private boolean isPushOnSwitch(DevicesInfo mExtendedStatusInfo) { if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { switch (mExtendedStatusInfo.getType()) { case DomoticzValues.Scene.Type.SCENE: return true; @@ -163,8 +163,8 @@ private boolean isPushOnSwitch(DevicesInfo mExtendedStatusInfo) { private boolean isPushOffSwitch(DevicesInfo mExtendedStatusInfo) { if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { return false; } else switch (mExtendedStatusInfo.getSwitchTypeVal()) { @@ -338,8 +338,8 @@ public void onSwitchClick(final DevicesInfo clickedSwitch, boolean checked, Domo int jsonValue = 0; if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE || + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) { if (checked) { jsonAction = DomoticzValues.Device.Switch.Action.OFF; if (!UsefulBits.isEmpty(value)) { 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 0eb72162a..f1a093a80 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java @@ -75,7 +75,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, packageName = context.getPackageName(); ComponentName thisWidget = new ComponentName(context, - WidgetProviderLarge.class); + WidgetProviderLarge.class); int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); if (allWidgetIds != null) { @@ -107,10 +107,10 @@ public int onStartCommand(Intent intent, int flags, int startId) { try { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this - .getApplicationContext()); + .getApplicationContext()); int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { updateAppWidget(appWidgetManager, incomingAppWidgetId); } @@ -142,11 +142,11 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, views.setImageViewResource(R.id.rowIcon, R.drawable.mic); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); appWidgetManager.updateAppWidget(appWidgetId, views); } else if (idx == iQRCodeAction) { @@ -155,11 +155,11 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, views.setImageViewResource(R.id.rowIcon, R.drawable.qrcode); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); appWidgetManager.updateAppWidget(appWidgetId, views); } else { @@ -184,7 +184,7 @@ public void onReceiveDevice(DevicesInfo s) { if (s.getCounterToday() != null && s.getCounterToday().length() > 0) text += " Today: " + s.getCounterToday(); if (s.getCounter() != null && s.getCounter().length() > 0 && - !s.getCounter().equals(s.getData())) + !s.getCounter().equals(s.getData())) text += " Total: " + s.getCounter(); views.setTextViewText(R.id.desc, text); @@ -201,46 +201,46 @@ else if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_OFF_BUTTO } views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - !s.getStatusBoolean(), - true)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + !s.getStatusBoolean(), + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); } else if (withButtons == BUTTON_2 && s.getStatus() != null) { views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), true, - false)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), true, + false)); views.setViewVisibility(R.id.on_button, View.VISIBLE); views.setOnClickPendingIntent(R.id.off_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), false, - false)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), false, + false)); views.setViewVisibility(R.id.off_button, View.VISIBLE); } else if (withButtons == BUTTON_3 && s.getStatus() != null) { views.setOnClickPendingIntent(R.id.switch_button_up, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.ON : DomoticzValues.Device.Blind.Action.OFF)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.ON : DomoticzValues.Device.Blind.Action.OFF)); views.setViewVisibility(R.id.switch_button_up, View.VISIBLE); views.setOnClickPendingIntent(R.id.switch_button_stop, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), DomoticzValues.Device.Blind.Action.STOP)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), DomoticzValues.Device.Blind.Action.STOP)); views.setViewVisibility(R.id.switch_button_stop, View.VISIBLE); views.setOnClickPendingIntent(R.id.switch_button_down, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.OFF : DomoticzValues.Device.Blind.Action.ON)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.OFF : DomoticzValues.Device.Blind.Action.ON)); views.setViewVisibility(R.id.switch_button_down, View.VISIBLE); } else { views.setViewVisibility(R.id.on_button, View.GONE); @@ -277,11 +277,11 @@ public void onReceiveScene(SceneInfo s) { views.setTextViewText(R.id.on_button, getApplicationContext().getString(R.string.button_state_on)); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - !s.getStatusInBoolean(), - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + !s.getStatusInBoolean(), + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); } else { @@ -290,18 +290,18 @@ public void onReceiveScene(SceneInfo s) { views.setTextViewText(R.id.off_button, getApplicationContext().getString(R.string.button_state_off)); views.setTextViewText(R.id.on_button, getApplicationContext().getString(R.string.button_state_on)); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - true, - false)); + UpdateWidgetService.this, + appWidgetId, + idx, + true, + false)); views.setViewVisibility(R.id.on_button, View.VISIBLE); views.setOnClickPendingIntent(R.id.off_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - false)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + false)); views.setViewVisibility(R.id.off_button, View.VISIBLE); } @@ -381,7 +381,7 @@ private int withButtons(DevicesInfo s) { int withButton = 0; if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: withButton = BUTTON_1; 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 3a5e0c67b..a67b8c4b4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java @@ -76,7 +76,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, packageName = context.getPackageName(); // Get all ids ComponentName thisWidget = new ComponentName(context, - WidgetProviderSmall.class); + WidgetProviderSmall.class); int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); if (allWidgetIds != null) { for (int mAppWidgetId : allWidgetIds) { @@ -110,11 +110,11 @@ public int onStartCommand(Intent intent, int flags, int startId) { } AppWidgetManager appWidgetManager = AppWidgetManager - .getInstance(UpdateWidgetService.this); + .getInstance(UpdateWidgetService.this); try { int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { try { updateAppWidget(appWidgetManager, incomingAppWidgetId); @@ -151,22 +151,22 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_speech)); views.setImageViewResource(R.id.rowIcon, R.drawable.mic); views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); appWidgetManager.updateAppWidget(appWidgetId, views); } else if (idx == iQRCodeAction) { views.setTextViewText(R.id.desc, getApplicationContext().getString(R.string.qrcode_desc)); views.setTextViewText(R.id.title, getApplicationContext().getString(R.string.action_qrcode_scan)); views.setImageViewResource(R.id.rowIcon, R.drawable.qrcode); views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); appWidgetManager.updateAppWidget(appWidgetId, views); } else { appWidgetManager.updateAppWidget(appWidgetId, views); @@ -189,7 +189,7 @@ public void onReceiveDevice(DevicesInfo s) { if (s.getCounterToday() != null && s.getCounterToday().length() > 0) text += " Today: " + s.getCounterToday(); if (s.getCounter() != null && s.getCounter().length() > 0 && - !s.getCounter().equals(s.getData())) + !s.getCounter().equals(s.getData())) text += " Total: " + s.getCounter(); views.setTextViewText(R.id.desc, text); @@ -197,11 +197,11 @@ public void onReceiveDevice(DevicesInfo s) { boolean newStatus = !s.getStatusBoolean();//toggle views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - newStatus, - true)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + newStatus, + true)); } views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getTypeImg(), s.getType(), s.getSwitchType(), true, s.getUseCustomImage(), s.getImage())); @@ -236,11 +236,11 @@ public void onReceiveScene(SceneInfo s) { 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)); + UpdateWidgetService.this, + appWidgetId, + idx, + !s.getStatusInBoolean(), + true)); } views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getType(), null, null, false, false, null)); @@ -291,7 +291,7 @@ private int withButtons(DevicesInfo s) { int withButton = 0; if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: withButton = WITHBUTTON; diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java index 827552769..cf36c5101 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java @@ -43,13 +43,13 @@ public void onProvideAssistContent(AssistContent outContent) { super.onProvideAssistContent(outContent); try { outContent.setStructuredData( - new JSONObject() - .put("@type", "SoftwareApplication") - .put("author", "Domoticz") - .put("name", "Domoticz") - .put("id", "http://www.domoticz.com") - .put("description", "Domoticz is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more." - ).toString() + new JSONObject() + .put("@type", "SoftwareApplication") + .put("author", "Domoticz") + .put("name", "Domoticz") + .put("id", "http://www.domoticz.com") + .put("description", "Domoticz is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more." + ).toString() ); } catch (JSONException e) { e.printStackTrace(); diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java index 804fdd33a..b1231168e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java @@ -56,7 +56,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.READ_PHONE_STATE")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_phone), permissionName); + this.getString(R.string.permission_desc_phone), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -64,7 +64,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.READ_EXTERNAL_STORAGE") || builder.toString().contains("android.permission.WRITE_EXTERNAL_STORAGE")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_storage), permissionName); + this.getString(R.string.permission_desc_storage), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -72,7 +72,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.CAMERA")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_camera), permissionName); + this.getString(R.string.permission_desc_camera), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -80,7 +80,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.RECORD_AUDIO")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_audio), permissionName); + this.getString(R.string.permission_desc_audio), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -88,7 +88,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.USE_FINGERPRINT")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_finger), permissionName); + this.getString(R.string.permission_desc_finger), permissionName); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppController.java b/app/src/main/java/nl/hnogames/domoticz/app/AppController.java index b02107cdf..c737d5ab8 100755 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppController.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppController.java @@ -76,7 +76,7 @@ public RequestQueue getRequestQueue() { HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); HttpsURLConnection.setDefaultHostnameVerifier( - mtm.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())); + mtm.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())); } catch (KeyManagementException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { @@ -91,8 +91,8 @@ public void addToRequestQueue(Request req) { req.setTag(TAG); RetryPolicy retryPolicy = new DefaultRetryPolicy(socketTimeout, - DefaultRetryPolicy.DEFAULT_MAX_RETRIES, - DefaultRetryPolicy.DEFAULT_BACKOFF_MULT); + DefaultRetryPolicy.DEFAULT_MAX_RETRIES, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT); req.setRetryPolicy(retryPolicy); getRequestQueue().add(req); diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java index 296ceefdf..54ba1e54b 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java @@ -86,9 +86,9 @@ public void setTheme() { ((ImageView) root.findViewById(R.id.errorImage)).setImageDrawable(getResources().getDrawable(R.drawable.sad_smiley_dark)); if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.setColorSchemeResources( - R.color.secondary, - R.color.secondary_dark, - R.color.background_dark); + R.color.secondary, + R.color.secondary_dark, + R.color.background_dark); } } @@ -137,7 +137,7 @@ public void onAttachFragment(Fragment fragment) { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -229,7 +229,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } @@ -241,7 +241,7 @@ private void setErrorLayoutMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } } @@ -261,7 +261,7 @@ private void setMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideRecyclerView() { diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java index 17bd369fa..4634b102d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java @@ -23,6 +23,7 @@ import android.app.Activity; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.Configuration; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; @@ -30,6 +31,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.LinearInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.ImageView; import android.widget.LinearLayout; @@ -37,6 +39,8 @@ import android.widget.TextView; import android.widget.Toast; +import com.google.android.material.button.MaterialButton; +import com.google.android.material.card.MaterialCardView; import com.google.android.material.snackbar.Snackbar; import java.util.List; @@ -58,6 +62,7 @@ import nl.hnogames.domoticz.MainActivity; import nl.hnogames.domoticz.PlanActivity; import nl.hnogames.domoticz.R; +import nl.hnogames.domoticz.UI.Backdrop.BackdropContainer; import nl.hnogames.domoticz.Utils.SharedPrefUtil; import nl.hnogames.domoticz.Utils.UsefulBits; import nl.hnogames.domoticzapi.Containers.ConfigInfo; @@ -74,16 +79,20 @@ public class DomoticzDashboardFragment extends Fragment { public Domoticz mDomoticz; public SharedPrefUtil mSharedPrefs; public PhoneConnectionUtil mPhoneConnectionUtil; + public LinearLayout lySortDevices; + public BackdropContainer backdropContainer; + public MaterialCardView bottomLayoutWrapper; + public MaterialButton collapseSortButton, sortAll, sortOn, sortOff, sortStatic; private DomoticzFragmentListener listener; private String fragmentName; private TextView debugText; private boolean debug; private ViewGroup root; private String sort = ""; - private int scrolledDistance = 0; private int SCROLL_THRESHOLD = 600; private boolean controlsVisible = true; + private boolean backdropShown = false; public DomoticzDashboardFragment() { } @@ -101,16 +110,35 @@ public void setTheme() { (root.findViewById(R.id.coordinatorLayout)).setBackgroundColor(ContextCompat.getColor(getContext(), R.color.background_dark)); if (root.findViewById(R.id.errorImage) != null) ((ImageView) root.findViewById(R.id.errorImage)).setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.sad_smiley_dark)); - + if (bottomLayoutWrapper != null) + bottomLayoutWrapper.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.background_dark)); + if (collapseSortButton != null) { + int[][] states = new int[][]{ + new int[]{android.R.attr.state_enabled}, // enabled + new int[]{-android.R.attr.state_enabled}, // disabled + new int[]{-android.R.attr.state_checked}, // unchecked + new int[]{android.R.attr.state_pressed} // pressed + }; + + int[] colors = new int[]{ + R.color.primary, R.color.primary, R.color.primary, R.color.primary + }; + + ColorStateList newStates = new ColorStateList(states, colors); + collapseSortButton.setTextColor(ContextCompat.getColor(getContext(), R.color.primary)); + collapseSortButton.setIconTint(newStates); + } mSwipeRefreshLayout.setColorSchemeResources( - R.color.secondary, - R.color.secondary_dark, - R.color.background_dark); + R.color.secondary, + R.color.secondary_dark, + R.color.background_dark); } } @DebugLog public void hideViews() { + if (backdropShown) + return; if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).hideViews(); controlsVisible = false; @@ -167,6 +195,7 @@ public UserInfo getCurrentUser(Context context, Domoticz domoticz) { public void sortFragment(String sort) { this.sort = sort; + collapseSortButton.setText(sort); refreshFragment(); } @@ -178,6 +207,68 @@ public void initViews(View root) { setGridViewLayout(); coordinatorLayout = root.findViewById(R.id.coordinatorLayout); mSwipeRefreshLayout = root.findViewById(R.id.swipe_refresh_layout); + bottomLayoutWrapper = root.findViewById(R.id.bottomLayoutWrapper); + lySortDevices = root.findViewById(R.id.lySortDevices); + collapseSortButton = root.findViewById(R.id.btnSortCollapse); + collapseSortButton.setVisibility(View.VISIBLE); + if (collapseSortButton != null) { + collapseSortButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + toggleBackDrop(); + } + }); + } + + sortStatic = root.findViewById(R.id.btnSortStatic); + if (sortStatic != null) { + sortStatic.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + sortFragment(String.valueOf(sortStatic.getText())); + toggleBackDrop(); + } + }); + } + + sortOn = root.findViewById(R.id.btnSortOn); + if (sortOn != null) { + sortOn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + sortFragment(String.valueOf(sortOn.getText())); + toggleBackDrop(); + } + }); + } + + sortOff = root.findViewById(R.id.btnSortOff); + if (sortOff != null) { + sortOff.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + sortFragment(String.valueOf(sortOff.getText())); + toggleBackDrop(); + } + }); + } + + sortAll = root.findViewById(R.id.btnSortAll); + if (sortAll != null) { + sortAll.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + sortFragment(String.valueOf(sortAll.getText())); + toggleBackDrop(); + } + }); + } + + backdropContainer = root.findViewById(R.id.backdropcontainer); + backdropContainer + .dropInterpolator(new LinearInterpolator()) + .dropHeight(this.getResources().getDimensionPixelSize(R.dimen.sneek_height)) + .build(); //setting up our OnScrollListener gridView.setOnScrollListener(new RecyclerView.OnScrollListener() { @@ -306,7 +397,7 @@ public void onAttachFragment(Fragment fragment) { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -320,6 +411,23 @@ public void showSpinner(boolean show) { } } + public void toggleBackDrop() { + if (!backdropShown) { + if (backdropContainer != null) { + showViews(); + backdropContainer.showBackview(); + backdropShown = true; + collapseSortButton.setIconResource(R.drawable.baseline_keyboard_arrow_up_black_18); + } + } else { + if (backdropContainer != null) { + backdropContainer.closeBackview(); + backdropShown = false; + collapseSortButton.setIconResource(R.drawable.baseline_keyboard_arrow_down_black_18); + } + } + } + /** * Checks for a active connection */ @@ -420,7 +528,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } } @@ -434,7 +542,7 @@ private void setErrorLayoutMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } public void setMessage(String message) { @@ -453,14 +561,14 @@ public void setMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideListView() { if (gridView != null) { gridView.setVisibility(View.GONE); } else throw new RuntimeException( - "Layout should have a ListView defined with the ID of listView"); + "Layout should have a ListView defined with the ID of listView"); } private void showDebugLayout() { diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java index 53c102c27..381bcfc27 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java @@ -23,6 +23,7 @@ import android.app.Activity; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.Configuration; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; @@ -30,6 +31,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.LinearInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.ImageView; import android.widget.LinearLayout; @@ -37,6 +39,8 @@ import android.widget.TextView; import android.widget.Toast; +import com.google.android.material.button.MaterialButton; +import com.google.android.material.card.MaterialCardView; import com.google.android.material.snackbar.Snackbar; import java.util.List; @@ -45,6 +49,7 @@ import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; @@ -57,6 +62,7 @@ import nl.hnogames.domoticz.MainActivity; import nl.hnogames.domoticz.PlanActivity; import nl.hnogames.domoticz.R; +import nl.hnogames.domoticz.UI.Backdrop.BackdropContainer; import nl.hnogames.domoticz.Utils.SharedPrefUtil; import nl.hnogames.domoticz.Utils.UsefulBits; import nl.hnogames.domoticzapi.Containers.ConfigInfo; @@ -74,16 +80,22 @@ public class DomoticzRecyclerFragment extends Fragment { public Domoticz mDomoticz; public SharedPrefUtil mSharedPrefs; public PhoneConnectionUtil mPhoneConnectionUtil; + + public LinearLayout lySortDevices, lySortLogs; + public BackdropContainer backdropContainer; + public MaterialCardView bottomLayoutWrapper; + public MaterialButton collapseSortButton, sortAll, sortOn, sortOff, sortStatic, sortLogsAll, sortLogsNormal, sortLogsError, sortLogsStatus; + private DomoticzFragmentListener listener; private String fragmentName; private TextView debugText; private boolean debug; private ViewGroup root; private String sort = ""; - private int scrolledDistance = 0; private int SCROLL_THRESHOLD = 600; private boolean controlsVisible = true; + private boolean backdropShown = false; public DomoticzRecyclerFragment() { } @@ -101,11 +113,28 @@ public void setTheme() { (root.findViewById(R.id.coordinatorLayout)).setBackgroundColor(getResources().getColor(R.color.background_dark)); if (root.findViewById(R.id.errorImage) != null) ((ImageView) root.findViewById(R.id.errorImage)).setImageDrawable(getResources().getDrawable(R.drawable.sad_smiley_dark)); - + if (bottomLayoutWrapper != null) + bottomLayoutWrapper.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.background_dark)); + if (collapseSortButton != null) { + int[][] states = new int[][]{ + new int[]{android.R.attr.state_enabled}, // enabled + new int[]{-android.R.attr.state_enabled}, // disabled + new int[]{-android.R.attr.state_checked}, // unchecked + new int[]{android.R.attr.state_pressed} // pressed + }; + + int[] colors = new int[]{ + R.color.primary, R.color.primary, R.color.primary, R.color.primary + }; + + ColorStateList newStates = new ColorStateList(states, colors); + collapseSortButton.setTextColor(ContextCompat.getColor(getContext(), R.color.primary)); + collapseSortButton.setIconTint(newStates); + } mSwipeRefreshLayout.setColorSchemeResources( - R.color.secondary, - R.color.secondary_dark, - R.color.background_dark); + R.color.secondary, + R.color.secondary_dark, + R.color.background_dark); } } @@ -167,6 +196,7 @@ public ServerUtil getServerUtil() { public void sortFragment(String sort) { this.sort = sort; + collapseSortButton.setText(sort); refreshFragment(); } @@ -178,6 +208,58 @@ public void initViews(View root) { coordinatorLayout = root.findViewById(R.id.coordinatorLayout); mSwipeRefreshLayout = root.findViewById(R.id.swipe_refresh_layout); + View.OnClickListener onSortClick = new View.OnClickListener() { + @Override + public void onClick(View v) { + sortFragment(String.valueOf(((MaterialButton) v).getText())); + toggleBackDrop(); + } + }; + + lySortDevices = root.findViewById(R.id.lySortDevices); + lySortLogs = root.findViewById(R.id.lySortLogs); + bottomLayoutWrapper = root.findViewById(R.id.bottomLayoutWrapper); + collapseSortButton = root.findViewById(R.id.btnSortCollapse); + if (collapseSortButton != null) { + collapseSortButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + toggleBackDrop(); + } + }); + } + + sortStatic = root.findViewById(R.id.btnSortStatic); + if (sortStatic != null) + sortStatic.setOnClickListener(onSortClick); + sortOn = root.findViewById(R.id.btnSortOn); + if (sortOn != null) + sortOn.setOnClickListener(onSortClick); + sortOff = root.findViewById(R.id.btnSortOff); + if (sortOff != null) + sortOff.setOnClickListener(onSortClick); + sortAll = root.findViewById(R.id.btnSortAll); + if (sortAll != null) + sortAll.setOnClickListener(onSortClick); + sortLogsAll = root.findViewById(R.id.btnSortLogsAll); + if (sortLogsAll != null) + sortLogsAll.setOnClickListener(onSortClick); + sortLogsError = root.findViewById(R.id.btnSortLogsError); + if (sortLogsError != null) + sortLogsError.setOnClickListener(onSortClick); + sortLogsNormal = root.findViewById(R.id.btnSortLogsNormal); + if (sortLogsNormal != null) + sortLogsNormal.setOnClickListener(onSortClick); + sortLogsStatus = root.findViewById(R.id.btnSortLogsStatus); + if (sortLogsStatus != null) + sortLogsStatus.setOnClickListener(onSortClick); + + backdropContainer = root.findViewById(R.id.backdropcontainer); + backdropContainer + .dropInterpolator(new LinearInterpolator()) + .dropHeight(this.getResources().getDimensionPixelSize(R.dimen.sneek_height)) + .build(); + //setting up our OnScrollListener gridView.setOnScrollListener(new RecyclerView.OnScrollListener() { @@ -225,7 +307,7 @@ public void setGridViewLayout() { isPortrait = true; if (getActivity() instanceof MainActivity) { isTablet = ! - ((MainActivity) getActivity()).onPhone; + ((MainActivity) getActivity()).onPhone; } gridView.setHasFixedSize(true); @@ -285,7 +367,7 @@ public void onAttachFragment(Fragment fragment) { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -299,6 +381,23 @@ public void showSpinner(boolean show) { } } + public void toggleBackDrop() { + if (!backdropShown) { + if (backdropContainer != null) { + showViews(); + backdropContainer.showBackview(); + backdropShown = true; + collapseSortButton.setIconResource(R.drawable.baseline_keyboard_arrow_up_black_18); + } + } else { + if (backdropContainer != null) { + backdropContainer.closeBackview(); + backdropShown = false; + collapseSortButton.setIconResource(R.drawable.baseline_keyboard_arrow_down_black_18); + } + } + } + /** * Checks for a active connection */ @@ -390,7 +489,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } } @@ -404,7 +503,7 @@ private void setErrorLayoutMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } public void setMessage(String message) { @@ -423,14 +522,14 @@ public void setMessage(String message) { TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideListView() { if (gridView != null) { gridView.setVisibility(View.GONE); } else throw new RuntimeException( - "Layout should have a ListView defined with the ID of listView"); + "Layout should have a ListView defined with the ID of listView"); } private void showDebugLayout() { diff --git a/app/src/main/res/drawable-hdpi/baseline_close_white_18.png b/app/src/main/res/drawable-hdpi/baseline_close_white_18.png new file mode 100644 index 000000000..de001ab0b Binary files /dev/null and b/app/src/main/res/drawable-hdpi/baseline_close_white_18.png differ diff --git a/app/src/main/res/drawable-hdpi/baseline_close_white_24.png b/app/src/main/res/drawable-hdpi/baseline_close_white_24.png new file mode 100644 index 000000000..c8598b613 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/baseline_close_white_24.png differ diff --git a/app/src/main/res/drawable-hdpi/baseline_close_white_36.png b/app/src/main/res/drawable-hdpi/baseline_close_white_36.png new file mode 100644 index 000000000..0419ecc52 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/baseline_close_white_36.png differ diff --git a/app/src/main/res/drawable-hdpi/baseline_close_white_48.png b/app/src/main/res/drawable-hdpi/baseline_close_white_48.png new file mode 100644 index 000000000..3af97b1df Binary files /dev/null and b/app/src/main/res/drawable-hdpi/baseline_close_white_48.png differ diff --git a/app/src/main/res/drawable-mdpi/baseline_close_white_18.png b/app/src/main/res/drawable-mdpi/baseline_close_white_18.png new file mode 100644 index 000000000..1f7ab2851 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/baseline_close_white_18.png differ diff --git a/app/src/main/res/drawable-mdpi/baseline_close_white_24.png b/app/src/main/res/drawable-mdpi/baseline_close_white_24.png new file mode 100644 index 000000000..08d810992 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/baseline_close_white_24.png differ diff --git a/app/src/main/res/drawable-mdpi/baseline_close_white_36.png b/app/src/main/res/drawable-mdpi/baseline_close_white_36.png new file mode 100644 index 000000000..c8598b613 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/baseline_close_white_36.png differ diff --git a/app/src/main/res/drawable-mdpi/baseline_close_white_48.png b/app/src/main/res/drawable-mdpi/baseline_close_white_48.png new file mode 100644 index 000000000..4419c31ab Binary files /dev/null and b/app/src/main/res/drawable-mdpi/baseline_close_white_48.png differ diff --git a/app/src/main/res/drawable-xhdpi/baseline_close_white_18.png b/app/src/main/res/drawable-xhdpi/baseline_close_white_18.png new file mode 100644 index 000000000..c8598b613 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/baseline_close_white_18.png differ diff --git a/app/src/main/res/drawable-xhdpi/baseline_close_white_24.png b/app/src/main/res/drawable-xhdpi/baseline_close_white_24.png new file mode 100644 index 000000000..4419c31ab Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/baseline_close_white_24.png differ diff --git a/app/src/main/res/drawable-xhdpi/baseline_close_white_36.png b/app/src/main/res/drawable-xhdpi/baseline_close_white_36.png new file mode 100644 index 000000000..3af97b1df Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/baseline_close_white_36.png differ diff --git a/app/src/main/res/drawable-xhdpi/baseline_close_white_48.png b/app/src/main/res/drawable-xhdpi/baseline_close_white_48.png new file mode 100644 index 000000000..f5a903fd7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/baseline_close_white_48.png differ diff --git a/app/src/main/res/drawable-xxhdpi/baseline_close_white_18.png b/app/src/main/res/drawable-xxhdpi/baseline_close_white_18.png new file mode 100644 index 000000000..0419ecc52 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/baseline_close_white_18.png differ diff --git a/app/src/main/res/drawable-xxhdpi/baseline_close_white_24.png b/app/src/main/res/drawable-xxhdpi/baseline_close_white_24.png new file mode 100644 index 000000000..3af97b1df Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/baseline_close_white_24.png differ diff --git a/app/src/main/res/drawable-xxhdpi/baseline_close_white_36.png b/app/src/main/res/drawable-xxhdpi/baseline_close_white_36.png new file mode 100644 index 000000000..3d430758d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/baseline_close_white_36.png differ diff --git a/app/src/main/res/drawable-xxhdpi/baseline_close_white_48.png b/app/src/main/res/drawable-xxhdpi/baseline_close_white_48.png new file mode 100644 index 000000000..412081ebf Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/baseline_close_white_48.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_close_white_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_18.png new file mode 100644 index 000000000..3af97b1df Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_18.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_close_white_24.png b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_24.png new file mode 100644 index 000000000..f5a903fd7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_24.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_close_white_36.png b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_36.png new file mode 100644 index 000000000..412081ebf Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_36.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_close_white_48.png b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_48.png new file mode 100644 index 000000000..0c02f3556 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/baseline_close_white_48.png differ diff --git a/app/src/main/res/layout-sw720dp/activity_newmain_free.xml b/app/src/main/res/layout-sw720dp/activity_newmain_free.xml index df9d5c2ba..1f10ee5d1 100644 --- a/app/src/main/res/layout-sw720dp/activity_newmain_free.xml +++ b/app/src/main/res/layout-sw720dp/activity_newmain_free.xml @@ -40,7 +40,6 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/primary_dark" - android:elevation="4dp" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> diff --git a/app/src/main/res/layout-sw720dp/activity_newmain_paid.xml b/app/src/main/res/layout-sw720dp/activity_newmain_paid.xml index c35ae1f71..d0b917743 100644 --- a/app/src/main/res/layout-sw720dp/activity_newmain_paid.xml +++ b/app/src/main/res/layout-sw720dp/activity_newmain_paid.xml @@ -38,7 +38,6 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/primary_dark" - android:elevation="4dp" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 0aac597d3..012891e9f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -31,15 +31,13 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" - android:elevation="4dp" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> + android:layout_height="match_parent"> diff --git a/app/src/main/res/layout/activity_newmain_paid.xml b/app/src/main/res/layout/activity_newmain_paid.xml index 6611d5ccf..068ca46bb 100644 --- a/app/src/main/res/layout/activity_newmain_paid.xml +++ b/app/src/main/res/layout/activity_newmain_paid.xml @@ -38,7 +38,6 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/primary_dark" - android:elevation="4dp" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> diff --git a/app/src/main/res/layout/dashboard_row_list.xml b/app/src/main/res/layout/dashboard_row_list.xml index 84c3509b5..d1cbcc95f 100644 --- a/app/src/main/res/layout/dashboard_row_list.xml +++ b/app/src/main/res/layout/dashboard_row_list.xml @@ -80,9 +80,9 @@ android:id="@+id/sunriseLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_gravity="center" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:layout_gravity="center" android:gravity="center" android:orientation="vertical" android:visibility="gone"> @@ -100,8 +100,8 @@ android:layout_width="50dp" android:layout_height="50dp" android:layout_gravity="center" - android:gravity="center" android:foregroundGravity="center" + android:gravity="center" app:clockColor="@color/orange_button" app:frameWidth="thin" app:hours="16" @@ -116,17 +116,17 @@ style="@style/row_body1" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="0dp" - android:gravity="center_horizontal"/> + android:gravity="center_horizontal" + android:paddingLeft="0dp"/> @@ -135,8 +135,8 @@ style="@style/row_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="0dp" android:gravity="center_horizontal" + android:paddingLeft="0dp" android:text="@string/now"/> + android:gravity="center_horizontal" + android:paddingLeft="0dp"/> @@ -188,8 +188,8 @@ android:layout_width="50dp" android:layout_height="50dp" android:layout_gravity="center" - android:gravity="center" android:foregroundGravity="center" + android:gravity="center" app:clockColor="@color/orange_button" app:frameWidth="thin" app:hours="16" @@ -203,235 +203,235 @@ android:id="@+id/sunsetText" style="@style/row_body1" android:layout_width="wrap_content" - android:paddingLeft="0dp" android:layout_height="wrap_content" - android:gravity="center_horizontal"/> + android:gravity="center_horizontal" + android:paddingLeft="0dp"/> + + - + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toStartOf="@+id/linearLayout7864" + android:layout_toLeftOf="@+id/linearLayout7864" + android:gravity="center_vertical" + android:orientation="vertical"> + + - + android:text="@string/battery_level"/> - + + + + - - - - + + + + + + + android:orientation="horizontal"> - - - + + + + + + + + + - - - - - - - - - - - + android:orientation="horizontal"> - + - - - - - - - - - - + android:text="@string/button_state_on" + android:textSize="10dp"/> + + + app:useMaterialThemeColors="false"/> - - + + + + + diff --git a/app/src/main/res/layout/fragment_cameras.xml b/app/src/main/res/layout/fragment_cameras.xml index 8530442fa..7fa974080 100644 --- a/app/src/main/res/layout/fragment_cameras.xml +++ b/app/src/main/res/layout/fragment_cameras.xml @@ -21,101 +21,268 @@ --> + android:layout_height="fill_parent" + android:background="@color/primary"> - + app:closeIcon="@drawable/baseline_close_white_24" + app:duration="150" + app:menuIcon="@drawable/ic_sort"> - - + + + android:orientation="vertical" + android:visibility="gone"> - - + - + - + - - - - - + + + + + + + + + + android:orientation="vertical" + android:visibility="gone"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + + - + - + + + - + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_welcome2.xml b/app/src/main/res/layout/fragment_welcome2.xml index 5243864ce..398fad06f 100644 --- a/app/src/main/res/layout/fragment_welcome2.xml +++ b/app/src/main/res/layout/fragment_welcome2.xml @@ -58,6 +58,14 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="@string/import_settings"/> + + Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-bg/strings_into.xml b/app/src/main/res/values-bg/strings_into.xml deleted file mode 100644 index fb433e791..000000000 --- a/app/src/main/res/values-bg/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - diff --git a/app/src/main/res/values-bg/strings_settings.xml b/app/src/main/res/values-bg/strings_settings.xml index 2b9c31dab..622d29da3 100644 --- a/app/src/main/res/values-bg/strings_settings.xml +++ b/app/src/main/res/values-bg/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-bs/strings.xml b/app/src/main/res/values-bs/strings.xml index 8376e976e..6d14af741 100644 --- a/app/src/main/res/values-bs/strings.xml +++ b/app/src/main/res/values-bs/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-bs/strings_into.xml b/app/src/main/res/values-bs/strings_into.xml deleted file mode 100644 index 0d6f591d2..000000000 --- a/app/src/main/res/values-bs/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Program za automatizaciju kuće, kontrolu vaših kućnih uređaja i pametniji život - Upravljajte i nadzirite kućne uređaje poput svjetala, prekidača, ventilatora, različitih senzora / mjerača poput temperature, vlage, pritiska, padavina, vjetra, ultraljubičastog (UV) zračenja, korištenja / proizvodnje električne energije, potrošnje plina, potrošnje vode i još mnogo toga na dodir prsta s najcjenjenijim automatizacijskim sistemom \"Domoticz - Automatizacija u kući\". Aplikacija automatizira svaki uređaj u vašem domu i možete ga kontrolirati putem mobilnog uređaja s bilo kojeg mjesta. Isključite ili uključite svjetla u spavaćoj sobi dok sjedite u dnevnoj sobi. \"Domoticz - Home Automation\" aplikacija podržava NFC i omogućuje vam da uključite klimu ili druge uređaje kada ste gotovo došli do kuće. Pomoću značajke geo-fencing aplikacija može otkriti vašu lokaciju i te prema tome upravljati uređajima ili vas upozoravati. -Aplikacija \"Domoticz\" ima odlično korisničko sučelje s jednostavnim korisničkim kontrolama. Aplikacija također podržava dodatke koji vam pomažu direktno kontrolisati s početnog zaslona mobilnog uređaja te uštedjeti vrijeme za uključivanje ili isključivanje uređaja. Aplikacija je savršena za uštedu električne potrošnje, čime se štedi novac. Budite jedinstveni i imajte kontrolu na dohvat ruke. Automatskom kontrolom uređaja \"Domoticz\" podržava i prepoznavanje otiska kako bi se osigurala visoka sigurnost vaših uređaja. -Pratite potrošnju plina i električne energije s mobilnog uređaja i konfigurišite njegovu upotrebu prema vašim potrebama i buđetu. Program je najbolji za planiranje mjesečnog proračun na različitim uređajima. Program također šalje obavijest o pushu na bilo koji konfigurirani mobilni uređaj kako bi vas upozorio na korisnike i potrošnju. - -************************** -OSOBINE PREMIUM VARIJANTE -************************** -- NFC podrška - Kontrola prekidača preko NFC oznaka -- Geofencing (višestruko), uključite svjetlo kada ste blizu kuće -- Android Wear, kontrolirajte svoj dom sa vašeg zgloba -- Dodaci, postavite dodatke na svoj početni zaslon -- Konfiguracija više servera, povezivanje više Domoticz servera sa jednom aplikacijom -- Sigurnost otiskom prsta -- Prilagođeni prikazi -- Talkback -- Obavijesti -- Alarmi - Aplikacija \"Domoticz - Kućna automatizacija\" kompatibilna je sa svim Android pametnim telefonima, tabletima i svim Android Wearima. Budi pametan.! Konfigurirajte više poslužitelja za jednostavnu i učinkovitu upotrebu aplikacije. Preuzmite pametnu automatsku aplikaciju \"Domoticz\" i živite pametnije. -  -*********************** -RECI ZDRAVO -*********************** -Neprestano radimo na tome da aplikacija Domoticz - Kućna automatizacija bude bolja i korisnija za vas. Slobodno nam pošaljite e-poštu za bilo kakve upite / prijedloge / probleme ili ako nas samo želite pozdraviti. Ako ste uživali u svim značajkama aplikacije Domoticz - Kućna automatizacija, ocijenite nas u Android trgovini i podijelite iskustva među prijateljima. - - diff --git a/app/src/main/res/values-bs/strings_settings.xml b/app/src/main/res/values-bs/strings_settings.xml index 641e09c40..9a6bc05cd 100644 --- a/app/src/main/res/values-bs/strings_settings.xml +++ b/app/src/main/res/values-bs/strings_settings.xml @@ -64,8 +64,8 @@ Zaključavanje zaslona na uvijek Uključeno Nemoj zaključati zaslon na uvijek uključeno Automatsko osvježavanje - Osvježi stanje uređaja svakih 5 sekundi - Ne osvježavaj stanje uređaja svakih 5 sekundi + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Prekidači Prikaži prekidače sa uključi/isključi prekidačima Prikaži prekidače sa uključi/isključi dugmadima diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 88e0b6de9..67533ca45 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-ca/strings_into.xml b/app/src/main/res/values-ca/strings_into.xml deleted file mode 100644 index e6246874e..000000000 --- a/app/src/main/res/values-ca/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Aplicació domótica per a controlar els aparells de casa i tenir una vida més guai - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - diff --git a/app/src/main/res/values-ca/strings_settings.xml b/app/src/main/res/values-ca/strings_settings.xml index be5a98699..7b0add33a 100644 --- a/app/src/main/res/values-ca/strings_settings.xml +++ b/app/src/main/res/values-ca/strings_settings.xml @@ -64,8 +64,8 @@ Bloqueja pantalla sempre Actiu No Bloquegis pantalla sempre Actiu Auto-actualitza - Actualitza l\'estat del dispositiu cada 5 segons - No actualitzis l\'estat del dispositiu cada 5 segons + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Interruptors Mostra interruptors com a interruptor encès/apagat Mostra interruptors com a botò encès/apagat diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index f9592b665..0719bab93 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -47,15 +47,15 @@ Zajištěný Plné světlo Noční světlo - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Východ slunce + Západ slunce + Nyní + Počátek astronomického soumraku + Konec astronomického soumraku + Počátek občanského soumraku + Konec občanského soumraku + Počátek námořního soumraku + Konec námořního soumraku Naposledy viděný Úroveň signálu Stav baterie @@ -126,8 +126,11 @@ Pokračovat? Nelze odstranit výchozí server Po nastavení jazyka je vyžadováno restartování aplikace - All - Normal - Status - Error + Vše + Normální + Stav + Chyba + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-cs/strings_actions.xml b/app/src/main/res/values-cs/strings_actions.xml index 0ec5ce9b1..190bc2e24 100644 --- a/app/src/main/res/values-cs/strings_actions.xml +++ b/app/src/main/res/values-cs/strings_actions.xml @@ -28,6 +28,6 @@ Spustit Pozastavit Načíst QR kód - Show paired devices + Zobrazit spárovaná zařízení Rozpoznávání řeči diff --git a/app/src/main/res/values-cs/strings_bluetooth.xml b/app/src/main/res/values-cs/strings_bluetooth.xml index e8efb3b7d..38b971c11 100644 --- a/app/src/main/res/values-cs/strings_bluetooth.xml +++ b/app/src/main/res/values-cs/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + Bluetooth není na tomto zařízení podporováno + Připojit zařízení bluetooth + Nalezeno nové zařízení bluetooth + Upravit zařízení bluetooth + Dejte tomuto bluetooth zařízení vhodný název. + Zkontrolovat seznam spárovaných bluetooth zařízení. + Bluetooth je již v Domoticz nakonfigurováno. + Bluetooth musí být zapnuto v nastavení vašeho zařízení. + Uloženo nové připojení zařízení bluetooth. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Bluetooth automatizace zakázána, prosím nastavte ji pomocí nastavení. + Pro automatizaci něčeho v Domoticz pomocí bluetooth zařízení by měl být přepínač propojen s bluetooth diff --git a/app/src/main/res/values-cs/strings_into.xml b/app/src/main/res/values-cs/strings_into.xml deleted file mode 100644 index ec7808cff..000000000 --- a/app/src/main/res/values-cs/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Aplikace pro ovládání domácích zařízení inteligentního domova - Ovládejte a monitorujte vaše domácí zařízení jako jsou světla, vypínače, ventilátory, různé senzory/měřiče teploty, srážek, větru, UV záření, spotřeby/produkce elektřiny, spotřeby vody a mnoho dalšího. S automatizačním systémem \"Domoticz - domácí automatizace\" máte vše na dosah ruky. Aplikace automatizuje každé vaše domácí zařízení a také vám umožňuje ho ovládat z mobilního zařízení z libovolného místa. Vypněte nebo zapněte světla v ložnici zatímco sedíte v obývacím pokoji. Aplikace \"Domoticz - domácí automatizace\" podporuje NFC a umožňuje zapnout klimatizaci nebo jiné spotřebiče, když se vracíte domů. Díky funkci geo-fence může aplikace detekovat vaši polohu a podle toho ovládat vaše zařízení nebo vás upozornit. -Aplikace \"Domoticz\" má skvělé uživatelské rozhraní s jednoduchým ovládáním. Aplikace také podporuje widgety, které vám umožní přímo zapnout nebo vypnout ovládané zařízení z domovské obrazovky vašeho mobilního zařízení. Aplikace je ideální k úspoře zbytečné spotřeby elektrické energie a tím vám šetří peníze. Přizpůsobte si ovládání tak, aby vyhovovalo vašim potřebám. Pro zabezpečení přístupu k vašim zařízením má aplikace \"Domoticz\" podporu snímače otisků prstů. -Monitorujte spotřebu plynu a elektřiny z vašeho mobilního zařízení a nastavte jejich využití podle vašich požadavků a rozpočtu. Tato aplikace je nejlepší v plánování vašeho měsíčního rozpočtu na různá zařízení. Aplikace také umí posílat Push notifikace na jakékoliv mobilní zařízení, aby vás informovala o využívání a spotřebě. - -************************** -PRÉMIOVÝ KLÍČ - FUNKCE -************************** -- Podpora NFC - přepíná spínače NFC tagem -- Geofencing (výcenásobný), zapne světlo, když jste už skoro doma -- Android Wear podpora, ovládejte svůj domov z vašeho zápěstí -- Widgety, umístěte widgety na vaši domovskou obrazovku -- Konfigurace s více servery, připojte více domoticz serverů k jedné aplikaci -- Zabezpečení aplikace otiskem prstu -- Uživatelské pohledy -- Funkce hlasové odezvy -- Notifikace -- Funkce Alarm - Aplikace \"Domoticz - domácí automatizace\" je kompatibilní se všemi smartphony s Androidem, Tablety a všemi zařízeními s Android Wear. Buďte chytří! Efektivně a jednoduše si nastavte více serverů v jedné aplikaci. Stáhněte si aplikaci \"Domoticz\" a žijte chytřejší život! - -*********************** -ŘEKNĚTE NÁM AHOJ -*********************** -Neustále tvrdě pracujeme na vylepšení aplikace \"Domoticz - domácí automatizace\", aby byla pro vás užitečnější. Prosím, neváhejte nás kontaktovat emailem s dotazem, návrhem, problémem nebo prostě jen pozdravem. Pokud se vám \"Domoticz - domácí automatizace\" líbí, ohodnoťte ji v obchodě Play a sdílejte ji s vašimi známými. - diff --git a/app/src/main/res/values-cs/strings_nfc.xml b/app/src/main/res/values-cs/strings_nfc.xml index 5962132bb..f90c61af3 100644 --- a/app/src/main/res/values-cs/strings_nfc.xml +++ b/app/src/main/res/values-cs/strings_nfc.xml @@ -7,7 +7,7 @@ Upravit NFC tag Dejte tomuto NFC tagu vhodný název. NFC tag je již registrován. - Uložit nový NFC tag. + Uložen nový NFC tag. NFC - Aby NFC tag funguval, musí být nalinkován na přepínač + Aby NFC tag fungoval, měl by být přepínač propojen s NFC tagem diff --git a/app/src/main/res/values-cs/strings_qrcode.xml b/app/src/main/res/values-cs/strings_qrcode.xml index 64eb3d42c..2b479a969 100644 --- a/app/src/main/res/values-cs/strings_qrcode.xml +++ b/app/src/main/res/values-cs/strings_qrcode.xml @@ -5,14 +5,14 @@ Registrovat QR kód Nalezen nový QR kód Upravit QR kód - Dejte tomuto QR kódu vhodný název. + Dejte tomuto QR kódu vhodný název. Skenování QR kódu. QR kód je již registrován. - Uložit nový QR kód. + Uložen nový QR kód. QR kód Zjištěn nový QR kód, nastavte ho pomocí nastavení. QR kód zakázán, prosím nastavte ho pomocí nastavení. - Pro QR kód skenování účinku přepínač by měla souviset s QR kódu + Aby skenování QR kódu fungovalo, měl by být přepínač propojen s QR kódem Pro detekci je zapotřebí přístup k fotoaparátu QR kód závislost nelze stáhnou kvůli nedostatku místa v zařízení Tuto aplikaci nelze spustit, protože nemá oprávnění k fotoaparátu. Aplikace bude nyní ukončena. diff --git a/app/src/main/res/values-cs/strings_security.xml b/app/src/main/res/values-cs/strings_security.xml index 872f947dc..286df66b2 100644 --- a/app/src/main/res/values-cs/strings_security.xml +++ b/app/src/main/res/values-cs/strings_security.xml @@ -27,10 +27,10 @@ Zastřežit doma Zastřežit pryč z domu Byl zadán nesprávný kód! - You do not have the rights for this action! + Nemáte oprávnění pro tuto akci! Nelze změnit stav zabezpečení Bylo zadáno špatné heslo, při selhání ověření pomocí otisku prstu použijte vaše heslo domoticz účtu! Zobrazit heslo - We need to make sure its you - Touch your finger on the fingerprint sensor to authorise your account. + Musíme si ověřit že jste to vy + Přiložte prst na čtečku otisků prstů pro ověření svého účtu. diff --git a/app/src/main/res/values-cs/strings_server.xml b/app/src/main/res/values-cs/strings_server.xml index 5e24ba72f..5f3321f43 100644 --- a/app/src/main/res/values-cs/strings_server.xml +++ b/app/src/main/res/values-cs/strings_server.xml @@ -4,6 +4,6 @@ Vyberte server Neukládat nový server? Název serveru musí být jedinečný - "Přepnout server na %1$s" + "Přepínám server na %1$s" Nelze zakázat výchozí server diff --git a/app/src/main/res/values-cs/strings_settings.xml b/app/src/main/res/values-cs/strings_settings.xml index f1c82e94e..d56cc31d1 100644 --- a/app/src/main/res/values-cs/strings_settings.xml +++ b/app/src/main/res/values-cs/strings_settings.xml @@ -38,7 +38,7 @@ Ladění Export/Import nastavení Téma - Clock + Hodiny NFC připojení Zabezpečení Účty @@ -46,17 +46,17 @@ Bluetooth Řeč Obnovit - Contribute + Zapojte se Úvodní obrazovka Povolit/zakázat položky - Sorting - Sort devices like sorted on the server - Custom sorting, drag and drop devices to sort them - Lock - Lock the current custom sorting (disable drag/drop) - Třídit panel podle abecedy + Řazení + Řadit zařízení, jako jsou seřazeny na serveru + Vlastní řazení, přetáhněte zařízení pro jejich seřazení + Zamknout + Uzamknout současné vlastní řazení (zakázat přetažení) + Seřadit panel podle abecedy Extra data na panelu Zobrazit extra data na panelu Skrýt extra data na panelu @@ -64,20 +64,20 @@ Vždy uzamknout obrazovku Nikdy nezamykat obrazovku Obnovovat automaticky - Obnovovat stav zařízení každých 5 sekund - Neobnovovat stav zařízení každých 5 sekund + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Přepínače - Zobrazit přepínače s zap/vyp přepínačem - Zobrazit přepínače se zap/vyp tlačítkem + Zobrazit přepínače se zap/vyp přepínačem + Zobrazit přepínače se zap/vyp tlačítky Mřížka řídícího panelu Zobrazit řídící panel jako seznam Zobrazit řídící panel jako mřížku - Clock - Show a clock on the dashboard + Hodiny + Zobrazit hodiny na panelu Vlastní položky Android Wear Zvolte Wear přepínače - Vyberte přepínače, které chcete vidět na vašem Android Wear zařízení + Vyberte přepínače, které chcete zobrazit na svém Android Wear zařízení Zapnout vlastní položky Android Wear Zakázat vlastní položky Android Wear @@ -116,10 +116,10 @@ Nastavení QR kódů Povolit QR kódy Povolit funkce QR kódů - Setup Bluetooth devices - Enable Bluetooth functionality - You can help make our translations better, and even add new languages to this app via our Crowdin project - Translations + Nastavit Bluetooth zařízení + Povolit funkce Bluetooth + Můžete pomoci zdokonalit naše překlady a také přidávat nové jazykové mutace prostřednictvím našeho projektu na Crowdin + Překlady Nastavení zabezpečení Povolit ochranu otisk při startu Zakázat ochranu otiskem prstu po startu @@ -178,7 +178,7 @@ Musíte mít alespoň jednu položku Aktualizace serveru - "Could not check for version: %1$s" + "Nepodařilo se zkontrolovat verzi: %1$s" "Nepodařilo se zkontrolovat aktualizace: %1$s" "Nepodařilo se získat konfiguraci ze serveru Domoticz: %1$s" Aktualizace serveru je k dispozici: %1$s na verzi: %2$s diff --git a/app/src/main/res/values-cs/strings_speech.xml b/app/src/main/res/values-cs/strings_speech.xml index f03b1a38e..faa20133e 100644 --- a/app/src/main/res/values-cs/strings_speech.xml +++ b/app/src/main/res/values-cs/strings_speech.xml @@ -5,11 +5,11 @@ Zaznamenat hlasový příkaz Nalezen nový hlasový příkaz Upravit hlasový příkaz - Dejte příkazu rozpoznávání vlastní název. - Příkaz rozpoznávání je již zaznamenán. - Uložit nový příkaz rozpoznávání. + Dejte tomuto hlasovému příkazu vhodný název. + Hlasový příkaz je již zaznamenán. + Uložen nový hlasový příkaz. Proveďte nový hlasový příkaz. Rozpoznávání řeči - Hlasový příkaz byl zakázán, prosím, povolte ho v nastavení. + Hlasový příkaz zakázán, prosím povolte jej v nastavení. Pro správnou funkci hlasových příkazů by měl být propojený přepínač diff --git a/app/src/main/res/values-cs/strings_timer.xml b/app/src/main/res/values-cs/strings_timer.xml index 30f09cf07..000ff38b1 100644 --- a/app/src/main/res/values-cs/strings_timer.xml +++ b/app/src/main/res/values-cs/strings_timer.xml @@ -39,28 +39,28 @@ Měsíčně (pracovní dny) Ročně Ročně (pracovní dny) - Before Sun at South - After Sun at South - Before Civil Twilight Start - After Civil Twilight Start - Before Civil Twilight End - After Civil Twilight End - Before Nautical Twilight Start - After Nautical Twilight Start - Before Nautical Twilight End - After Nautical Twilight End - Before Austronomical Twilight Start - After Austronomical Twilight Start - Before Austronomical Twilight End - After Austronomical Twilight End + Před sluncem na jihu + Po slunci na jihu + Před počátkem občanského soumraku + Po počátku občanského soumraku + Před koncem občanského soumraku + Po skončení občanského soumraku + Před počátkem námořního soumraku + Po počátku námořního soumraku + Před koncem námořního soumraku + Po skončení námořního soumraku + Před počátkem astronomického soumraku + Po počátku astronomického soumraku + Před koncem astronomického soumraku + Po skončení astronomického soumraku Každý den V pracovní dny Víkend Jiné Časovače - First - Second - Third - Fourth - Last + První + Druhý + Třetí + Čtvrtý + Poslední diff --git a/app/src/main/res/values-cs/strings_widgets.xml b/app/src/main/res/values-cs/strings_widgets.xml index 3f180c880..1fd5c94cd 100644 --- a/app/src/main/res/values-cs/strings_widgets.xml +++ b/app/src/main/res/values-cs/strings_widgets.xml @@ -24,7 +24,7 @@ Vyberte zařízení Zvolte zařízení - Ve vašich přepínačích nebyl nalezen žádný Bezpečnostní panel + Ve vašich přepínačích nebyl nalezen žádný bezpečnostní panel Nepodařilo se získat zařízení Přepnutí zařízení se nezdařilo "Přepnout zařízení" diff --git a/app/src/main/res/values-cs/strings_wizard.xml b/app/src/main/res/values-cs/strings_wizard.xml index 50406700d..02ed6325b 100644 --- a/app/src/main/res/values-cs/strings_wizard.xml +++ b/app/src/main/res/values-cs/strings_wizard.xml @@ -36,7 +36,7 @@ Geofencing V nastavení si můžete nastavit svou spouštěcí obrazovku! Android Wear - Můžete si vybrat, které přepínače chcete ovládat z vašeho Android Wear zařízení! + Můžete si vybrat, které přepínače chcete ovládat ze svého Android Wear zařízení! Android Auto Přijímat oznámení Domoticz přímo ve vašem zařízení Android Auto! Grafy @@ -48,11 +48,11 @@ Zakázat průvodce Tohoto průvodce můžete nyní odebrat z navigačního menu! NFC - Jste schopni přepínat pomocí NFC! + Můžete přepínat přepínače pomocí NFC! QR kód - Páčkové spínače skenování QR kód (nebo čárového kódu)! + Přepínejte přepínače naskenováním QR kód (nebo čárového kódu)! Hlasové příkazy - Přepínače s vaším hlasem! Konfigurace hlasové příkazy prostřednictvím nastavení obrazovky a připojení přepínače. + Přepínejte přepínače svým hlasem! Nadefinujte hlasové příkazy v nastavení a připojte přepínače. Hezké Přepínače Nastavení diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 0b205e695..88e258416 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-da/strings_into.xml b/app/src/main/res/values-da/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-da/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-da/strings_settings.xml b/app/src/main/res/values-da/strings_settings.xml index fd8099f98..2ed3329a0 100644 --- a/app/src/main/res/values-da/strings_settings.xml +++ b/app/src/main/res/values-da/strings_settings.xml @@ -64,8 +64,8 @@ Hold skærmen tændt Hold ikke skærmen tændt Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switche Vis switche med tænd/sluk-knap Vis switche med tænd/sluk-knapper diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 1dc159446..644712956 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -47,15 +47,15 @@ Entschärfen Volles Licht Nachtlicht - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Sonnenaufgang + Sonnenuntergang + Jetzt + Beginn der astronomischen Dämmerung + Ende der astronomischen Dämmerung + Beginn der zivilen Dämmerung + Ende der zivilen Dämmerung + Beginn der nautischen Dämmerung + Ende der nautischen Dämmerung Zuletzt gesehen Signalpegel Batteriezustand @@ -65,10 +65,10 @@ Status RGB Farbe oder warmes weiß Sollwert - Set point min value - Min temperature that you can set for your thermostat - Set point max value - Max temperature that you can set for your thermostat + Minimaler Sollwert + Minimale Temperatur, die Sie für Ihren Thermostat einstellen können + Maximaler Sollwert + Maximale Temperatur, die Sie für Ihren Thermostat einstellen können Vorgang erfolgreich Vorgang gescheitert Ergebnis der Aktion unbekannt @@ -86,7 +86,7 @@ Ja Nein Sind Sie sicher? - Are you sure?? This also clears all homescreen widget settings, so you should re-add them afterwards.. + Sind Sie sicher? Alle Homescreen-Widgets werden gelöscht, so dass Sie sie anschließend erneut hinzufügen sollten.... Hinzufügen Abbrechen Fertig @@ -101,8 +101,8 @@ %1$s gelöscht Schalte ein Schalte aus - Turning switch to night light - Turning switch to full light + Auf Nachtlicht umschalten + Auf Volllicht umschalten Ziehe Vorhang hoch Lasse Vorhang herunter Halte Vorhang an @@ -130,4 +130,7 @@ Normal Status Fehler + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-de/strings_bluetooth.xml b/app/src/main/res/values-de/strings_bluetooth.xml index e8efb3b7d..ac439f287 100644 --- a/app/src/main/res/values-de/strings_bluetooth.xml +++ b/app/src/main/res/values-de/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + Bluetooth wird von diesem Gerät nicht unterstützt + Mit Bluetooth-Gerät verbinden + Neues Bluetooth-Gerät gefunden + Bluetooth-Gerät einstellen + Geben Sie diesem Bluetooth-Gerät einen richtigen Namen. + Überprüfe die Liste der gepaarten Bluetooth-Geräte. + Bluetooth wurde bereits auf Domoticz konfiguriert. + Bluetooth muss in den Geräteeinstellungen aktiviert werden. + Neue Bluetooth-Geräteverbindung gespeichert. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Bluetooth-Automatisierung deaktiviert, bitte über die Einstellungen einstellen. + Damit ein Bluetooth-Gerät etwas in Domoticz automatisieren kann, sollte ein Schalter mit einem Bluetooth-Gerät verbunden sein diff --git a/app/src/main/res/values-de/strings_into.xml b/app/src/main/res/values-de/strings_into.xml deleted file mode 100644 index 060589044..000000000 --- a/app/src/main/res/values-de/strings_into.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Heimautomationsapp welche deine Smart Home Geräte steuern kann und dein Leben etwas smarter macht - Überwache und kontrolliere deine Smart Home Geräte wie bspw. Lampen, Schalter, Ventilatoren, verschiedenste Sensoren wie Regenfall, Wind, Ultra-Violette Strahlung, Stromverbrauch, Gasverbrauch, Wasserverbrauch und viele mehr direkt mit der coolsten Smart Home Lösung die es gibt: Domoticz. -Diese App automatisiert jede von dir verwendete Lösung und gibt dir die Möglichkeit alles über ein Gerät von jedem Standort zu steuern. -Schalte das Licht im Schlafzimmer an oder aus, während du im Wohnzimmer auf der Couch sitzt. Domoticz unterstützt NFC und erlaubt es dir, die Heizung einzuschalten wenn du fast zuhause bist. -Mit Hilfe von GeoFencing ist es der App möglich, deinen Standort zu ermitteln und benutzerdefinierte Aktionen durchzuführen oder dich zu warnen. -Domoticz hat eine sehr durchdachte Benutzeroberfläche welche eine einfache Bedienung ermöglicht. -Zudem unterstützt die App Widgets mit der direkt vom Startbildschirm Geräte ein - oder ausgeschaltet werden können, was zusätzlich Zeit spart. -Diese App hilft ganz einfach Strom zu sparen da sie unbenutzte Geräte einfach ausschaltet. Das bedeutet im Umkehrschluss auch das Sparen von barem Geld! -Die App unterstützt eine Authentifizierung Mithilfe des Fingerabdrucks damit nicht jeder Mithilfe des Smartphones die Kontrolle übernehmen kann. -Neben all diesen Funktionen bietet die App die Möglichkeit Push Benachrichtigungen an konfigurierte Geräte zu senden um über Nutzung und Verbrauch von Geräten zu informieren. - -************************** -PREMIUM FUNKTIONEN ************************** -- NFC Support: Schalter Mithilfe von NFC Tags steuern -- GeoFencing: Das Licht einschalten wenn du fast zuhause bist -- Android Wear: Steuer dein Zuhause über deine Smartwatch -- Widgets: Platziere sie auf dem Startbildschirm um schneller auf Schalter zuzugreifen -- Mehrere Server mit einer App verwalten -- Fingerabdrucksicherheit -- Eigene Übersichten -- TalkBack Funktion -- Benachrichtigungen -- Alarm Funktion - -Die Domoticz App ist kompatibel mit allen Android Smart, Tablets und Android Wear Geräten. Konfiguriere mehrere Server für eine einfache und effiziente Nutzung der App. Lade dir die Smart Home App Domoticz und beginne dein smartes Leben noch heute! - -*********************** -SAG HALLO -*********************** -Wir arbeiten kontinuierlich daran, diese App weiter zu verbessern und noch hilfreicher zu gestalten. Wir sind daher auf dein Feedback angewiesen und würden uns freuen wenn du uns Vorschläge/Ideen/Probleme per E-Mail schickst oder uns einfach mal Hallo sagst. Wenn dir die Funktionen dieser App gefallen haben, so würden wir uns über eine Bewertung im Play Store und eine Weiterempfehlung freuen. - diff --git a/app/src/main/res/values-de/strings_locations.xml b/app/src/main/res/values-de/strings_locations.xml index 14940a8b0..9ccdc990e 100644 --- a/app/src/main/res/values-de/strings_locations.xml +++ b/app/src/main/res/values-de/strings_locations.xml @@ -59,7 +59,7 @@ Jetzt einen verbinden? Geofencing deaktiviert, da keine Geofences aktiviert sind Geofence-Dienst ist zurzeit nicht verfügbar - App registered too many geofences - Too many PendingIntents provided + App hat zu viele Geofenzen registriert + Zu viele PendingIntents bereitgestellt Unbekannter Fehler diff --git a/app/src/main/res/values-de/strings_security.xml b/app/src/main/res/values-de/strings_security.xml index a4c851ebe..5901b98f0 100644 --- a/app/src/main/res/values-de/strings_security.xml +++ b/app/src/main/res/values-de/strings_security.xml @@ -27,10 +27,10 @@ Zuhause scharfstellen Abwesend scharfstellen Falschen Code eingegeben! - You do not have the rights for this action! + Du hast keine Rechte für diese Aktion! Status der Security Panel konnte nicht geändert werden. Falsches Passwort eingegeben, dein domoticz Account Passwort ist der Ersatz für deinen Fingerabdruck...! Passwort anzeigen - We need to make sure its you - Touch your finger on the fingerprint sensor to authorise your account. + Wir müssen sicherstellen, dass du es bist + Berühren Sie mit Ihrem Finger den Fingerabdrucksensor, um Ihr Konto zu autorisieren. diff --git a/app/src/main/res/values-de/strings_settings.xml b/app/src/main/res/values-de/strings_settings.xml index 4f06ad324..0dce0e83f 100644 --- a/app/src/main/res/values-de/strings_settings.xml +++ b/app/src/main/res/values-de/strings_settings.xml @@ -38,7 +38,7 @@ Debugging Einstellungen importieren/exportieren Designs - Clock + Uhr NFC-Verbindungen Sicherheit Konten @@ -46,16 +46,16 @@ Bluetooth Sprachkommando Zurücksetzen - Contribute + Mitwirken Startbildschirm Menüpunkte einschalten/ausschalten Sortierung - Sort devices like sorted on the server - Custom sorting, drag and drop devices to sort them - Lock - Lock the current custom sorting (disable drag/drop) + Geräte wie auf dem Server sortiert sortieren + Benutzerdefinierte Sortierung, Geräte per Drag & Drop sortieren + Sperren + Aktuelle benutzerdefinierte Sortierung sperren (Drag & Drop aus) Dashboard alphabetisch sortieren Extra Informationen auf dem Dashboard Zeige extra Informationen auf dem Dashboard @@ -63,17 +63,17 @@ Aufwachsperre Bildschirmsperre immer An Bildschirmsperre immer Aus - Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Automatische Aktualisierung + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Schalter Zeige Schalter mit Ein-/Ausschalter Zeige Schalter mit Ein-/Aus Taste Dashboard-Raster Dashboard als Liste anzeigen Dashboard als Raster anzeigen - Clock - Show a clock on the dashboard + Uhr + Uhr im Dashboard anzeigen Android Wear benutzerdefinierte Elemente Wähle Wear Schalter @@ -117,9 +117,9 @@ QR-Codes aktivieren QR-Codes Funktionalität aktivieren Bluetooth Geräte einrichten - Enable Bluetooth functionality - You can help make our translations better, and even add new languages to this app via our Crowdin project - Translations + Bluetooth-Funktionalität aktivieren + Sie können unsere Übersetzungen verbessern und über unser Crowdin-Projekt sogar neue Sprachen zu dieser App hinzufügen + Übersetzungen Sicherheits-Einstellungen Fingerabdruck-Schutz beim Start aktivieren Fingerabdruck-Schutz beim Start deaktivieren @@ -129,9 +129,9 @@ Sind Sie sicher? Das Sicherheitskennwort ist das Passwort deines Domoticz Kontos. Widgets (BETA) - Enable or Disable Widget on this device - Widgets are not enabled on this device, please check your settings of Domoticz - Please use widgets on your own risk!! Widgets are currently in Beta stage and probably contain certain bugs. It can cause large data / battery usage... + Widget auf diesem Gerät aktivieren oder deaktivieren + Widgets sind auf diesem Gerät nicht aktiviert, bitte überprüfen Sie Ihre Einstellungen von Domoticz + Bitte verwenden Sie Widgets auf eigenes Risiko!! Widgets befinden sich derzeit in der Beta-Phase und enthalten wahrscheinlich einige Fehler. Es kann großen Daten-/Akkuverbrauch verursachen... Google Cloud Messaging ID Schicke Registrierungs-ID an Domoticz @@ -161,9 +161,9 @@ Alarm Alarmtimer Sekunden bis zum Alarm - Default values - Max value should be higher than Min value - Max value should be higher than Min value + Standardwerte + Maximalwert sollte größer als der Minimalwert sein + Maximalwert sollte größer als der Minimalwert sein Version Domoticz version @@ -178,7 +178,7 @@ Sie benötigen mindestens ein Element Update-server - "Could not check for version: %1$s" + "Konnte Version nicht prüfen: %1$s" "Konnte nicht auf Updates prüfen: %1$s" "Konnte Domoticz Server-Konfiguration nicht laden: %1$s" Serverupdate verfügbar: %1$s zu Version: %2$s diff --git a/app/src/main/res/values-de/strings_timer.xml b/app/src/main/res/values-de/strings_timer.xml index e8bef552d..b0b759440 100644 --- a/app/src/main/res/values-de/strings_timer.xml +++ b/app/src/main/res/values-de/strings_timer.xml @@ -41,26 +41,26 @@ Jährlich (Wochentag) Vor der Sonne im Süden Nach der Sonne im Süden - Before Civil Twilight Start - After Civil Twilight Start - Before Civil Twilight End - After Civil Twilight End - Before Nautical Twilight Start - After Nautical Twilight Start - Before Nautical Twilight End - After Nautical Twilight End - Before Austronomical Twilight Start - After Austronomical Twilight Start - Before Austronomical Twilight End - After Austronomical Twilight End + Vor Beginn der zivilen Dämmerung + Nach Beginn der zivilen Dämmerung + Vor Ende der zivilen Dämmerung + Nach Ende der zivilen Dämmerung + Vor Beginn der nautischen Dämmerung + Nach Beginn der nautischen Dämmerung + Vor Ende der nautischen Dämmerung + Nach Ende der nautischen Dämmerung + Vor Beginn der astronomischen Dämmerung + Nach Beginn der astronomischen Dämmerung + Vor Ende der astronomischen Dämmerung + Nach Ende der astronomischen Dämmerung Jeden Tag Arbeitstage Wochenende Andere Timer-Einstellungen - First - Second - Third - Fourth - Last + Erster + Zweiter + Dritter + Vierter + Letzter diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 5ad68085f..e6ba98888 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-el/strings_into.xml b/app/src/main/res/values-el/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-el/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-el/strings_settings.xml b/app/src/main/res/values-el/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-el/strings_settings.xml +++ b/app/src/main/res/values-el/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 033d13061..ef9ecd25d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -130,4 +130,7 @@ Normal Estado Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-es/strings_into.xml b/app/src/main/res/values-es/strings_into.xml deleted file mode 100644 index be9533018..000000000 --- a/app/src/main/res/values-es/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - App domótica para controlar los dispositivos de tu hogar haciendo tu vida más cómoda - Controla y monitoriza dipositivos de tu hogar como luces, interruptores, ventiladores, sensores de diversos tipos como temperatura, lluvia, viento, radiación ultravioleta, consumo y producción eléctrica, consumo de gas y agua, y mucho más al alcance de tu mano con el sistema domótico más atractivo \"Domoticz - Home Automation\". La app automatiza los dispositivos de tu hogar y te permite controlarlos a través de tu dispositivo móvil desde cualquier lugar. Apaga las luces de la habitación sentado en el salón. La app \"Domoticz - Home Automation\" soporta NFC y te permite encender el aire acondicionado u otros dispositivos cuando estás llegando a casa. Gracias a la funcionalidad de geo-cercas la app puede detectar tu posición y te notifica convenientemente según el estado de los dispositivos. -La app \"Domoticz\" proporciona una magnífica interfaz de usuario con controles sencillos. La app también soporta widgets que te permiten controlar dispositivos desde la pantalla de inicio de tu dispositivo móvil, ahorrándote tiempo al encender o apagar el dispositivo. La app es perfecta para acabar con los consumos eléctricos inncesarios ahorrando así dinero. Sé único y pon el control en las puntas de tus dedos. La app \"Domoticz\" para controlar tus dispositivos soporta la identificación por huella dactilar para garantizar la seguridad en el control de tus dispositivos. -Monitoriza los consumos de gas y electricidad desde tu dispositivo móvil y configura su uso ajustado a tus requisitos y presupuesto. La app es ideal para planificar el presupuesto mensual en varios dispositivos. La app también manda notificaciones a cualquier dispositivo móvil configurado para alertar con los usos y consumos. - -************************** -FUNCIONALIDADES PREMIUM MÁS RELEVANTES -************************** -- Soporte de NFC -- Conmutación de interruptores mediante etiquetas NFC -- Geo-cercas (múltiples), para encender las luces cuando estás llegando a casa -- Android Wear, controla tu hogar desde tu muñeca -- Widgets, instala widgets en tu pantalla de inicio -- Configuración de varios servidores, conecta múltiples servidores domoticz con una app -- Seguridad mediante huella dactilar -- Vistas personalizadas -- Respuestas habladas -- Notificaciones -- Alarmas -(La app \"Domoticz - Home Automation\" es compatible con todos los teléfonos y tablets Android, y los Android Wears. ¡Sé inteligente! Configura múltiples servidores para un uso fácil y eficiente de la aplicación. Descárgate la app inteligente \"Domoticz\" para el control de tus dispositivos y ¡vive una vida más inteligente!) - *********************** -DI HOLA -*********************** -Estamos trabajando duro constantemente para hacer de \"Domoticz - Home Automation\" una app mejor y más útil para ti. Por favor, siéntete libre de mandarnos un correo electrónico sobre cualquier pregunta/sugerencia/problema o sólo para decirnos hola. Si te ha encantado cualquier funcionalidad de la app \"Domoticz - Home Automation\", valóranos en la Play Store y compártelo con tus amigos. - diff --git a/app/src/main/res/values-es/strings_settings.xml b/app/src/main/res/values-es/strings_settings.xml index daf9bd38f..74eeb76c7 100644 --- a/app/src/main/res/values-es/strings_settings.xml +++ b/app/src/main/res/values-es/strings_settings.xml @@ -64,8 +64,8 @@ Bloquear la pantalla siempre Encendido No bloquear la pantalla siempre Encendido Actualización automática - Actualizar el estado del dispositivo cada 5 segundos - No actualizar el estado del dispositivo cada 5 segundos + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Interruptores Mostrar los interruptores con interruptor encendido/apagado Mostrar los interruptores con botones de encendido/apagado diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 7d076b9ba..4f1405973 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-fa/strings_into.xml b/app/src/main/res/values-fa/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-fa/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-fa/strings_settings.xml b/app/src/main/res/values-fa/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-fa/strings_settings.xml +++ b/app/src/main/res/values-fa/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index f466fd81e..7cb8fbea7 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-fi/strings_into.xml b/app/src/main/res/values-fi/strings_into.xml deleted file mode 100644 index 3fc631e3f..000000000 --- a/app/src/main/res/values-fi/strings_into.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Kotiautomaatiosovellus, joka johdattaa sinut kohti älykkäämpää elämää - Ohjaa ja tarkkaile kotona olevia laitteitasi, kuten valaistusta, kytkimiä, puhaltimia, erilaisia antureita (esim. lämpötila, sade, tuuli, UV-säteily, sähkönkulutus/-tuotanto, kaasunkulutus, vedenkulutus) ja paljon muuta sormenpäilläsi käyttämällä suosituinta Domoticz-kotiautomaatiojärjestelmää. Sovelluksen avulla voit automatisoida jokaisen laitteen kotonasi ja voit ohjata niitä mistä tahansa mobiililaitteesi avulla. Sytytä tai sammuta makuuhuoneen valot istumalla olohuoneen olohuoneessa. \"Domoticz - Home Automation\" -sovellus tukee NFC: tä ja mahdollistaa esimerkiksi ilmastoinnin päällekytkemisen kun olet saapumaisillasi kotiin. Geoaitojen avulla sovellus tunnistaa sijaintisi ja voi ohjata laitteita haluamallasi tavalla. -Sovelluksessa on mahtava käyttöliittymä, jonka toiminnot on helppo oppia. Sovellus tukee myös widgettejä, joten voit lisätä mobiililaitteesi kotinäytölle painikkeita joilla voit ohjata laitteita helposti. Sovelluksen avulla voit säästää sähkölaskussa sammuttamalla turhia laitteita. Ota ohjat sormenpäihisi. Sovellus tukee sormenjälkitunnistinta, joten turvallisuus on taattu. -Tarkkaile kaasun ja sähkön kulutusta mobiililaitteellasi ja sovita kulutus tarpeisiisi ja budjettiisi. Sovellus on hyvä apu suunnittellessasi kuukausittaista kulutustasi. Sovellus myös tukee ilmoituksia, joita voit käyttää esimerkiksi hälyttämään kun sähkönkulutus ylittää määrittelemäsi rajan. - - -************************** -TÄRKEIMMÄT PREMIUM OMINAISUUDET -************************** -- NFC-tuki. ohjaa kytkimiä NFC-tagien avulla -- Geoaidat (useita), kytke valot päälle kun olet saapumaisillasi kotiin -- Android Wear, ohjaa kotiasi ranteesta käsin -- Widgetit, laita widgettejä kotinäytöllesi -- Usean palvelimen tuki, kytkeydy useaan Domoticz-pavelimeen yhdellä sovelluksella -- Sormenjälkitunnistus -- Muokattavat näkymät -- Puhetoiminnot -- Ilmoitukset -- Hälytystoiminto -\"Domoticz -Home Automation\" -sovellus on yhteensopiva kaikkien Android-älypuhelinten ja -tablettien kanssa sekä kaikkien Android Wear-laitteiden kanssa. Ole älykäs! Määritä useita palvelimia jotta käyttö olisi mahdollisimman helppoa ja tehokasta. Lataa älykäs \"Domoticz\"-kotiautomaatiosovellus ja elä älykkäämmin! - -************************** -KERRO TERVEISIÄ -************************** -Työskentelemme jatkuvasti tehdäksemme \"Domoticz - Home Automation\" -sovelluksesta paremman ja käytännöllisemmän. Ota vapaasti yhteyttä tehdäksesi pyyntöjä tai ehdotuksia tai jos haluat vain kertoa terveisesi meille. Jos olet pitänyt sovelluksen ominaisuuksista, anna meille arvostelu Play Storessa ja jaa sovellus kavereillesi. - - diff --git a/app/src/main/res/values-fi/strings_settings.xml b/app/src/main/res/values-fi/strings_settings.xml index 30cb657f5..eb62b4c11 100644 --- a/app/src/main/res/values-fi/strings_settings.xml +++ b/app/src/main/res/values-fi/strings_settings.xml @@ -64,8 +64,8 @@ Pakota näyttö päälle Älä pakota näyttöä päälle Automaattinen päivitys - Päivitä laitteen tila 5 sekunnin välein - Älä päivitä laitteen tilaa 5 sekunnin välein + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Kytkimet Näytä kytkimet on/off-tyyppisesti Näytä kytkimet painikkeina diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 83e5a24e9..f9855f147 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -47,15 +47,15 @@ Désarmer Lumière complète Lumière de nuit - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Lever du soleil + Coucher du soleil + Maintenant + Début du crépuscule astronomique + Fin du crépuscule astronomique + Début du crépuscule civil + Fin du crépuscule civil + Début de crépuscule nautique + Fin du crépuscule nautique Dernière activité Niveau du signal Niveau de batterie @@ -130,4 +130,7 @@ Normal Statut Erreur + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-fr/strings_actions.xml b/app/src/main/res/values-fr/strings_actions.xml index a8ce827cb..33856af20 100644 --- a/app/src/main/res/values-fr/strings_actions.xml +++ b/app/src/main/res/values-fr/strings_actions.xml @@ -28,6 +28,6 @@ Lecture Pause Scanner le QR code - Show paired devices + Afficher les périphériques apairés Reconnaissance vocale diff --git a/app/src/main/res/values-fr/strings_bluetooth.xml b/app/src/main/res/values-fr/strings_bluetooth.xml index e8efb3b7d..6e28b7f89 100644 --- a/app/src/main/res/values-fr/strings_bluetooth.xml +++ b/app/src/main/res/values-fr/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + Le Bluetooth n’est pas pris en charge sur cet appareil + Connecter un périphérique bluetooth + Nouveau dispositif bluetooth trouvé + Modifier le périphérique bluetooth + Donnez un nom à cet appareil bluetooth. + Vérifiez la liste des appareils Bluetooth jumelés. + Bluetooth déjà configuré sur Domoticz. + Bluetooth doit être activé dans les paramètres de votre appareil. + Enregistrement d\'une nouvelle connexion de périphérique bluetooth. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Commande vocale désactivée. Veuillez voir les paramètres pour l\'activer. + Un interrupteur doit être liée au bluetooth pour qu\'un dispositif bluetooth puisse exécuter une action diff --git a/app/src/main/res/values-fr/strings_dashboard.xml b/app/src/main/res/values-fr/strings_dashboard.xml index 19d282d20..df389ab05 100644 --- a/app/src/main/res/values-fr/strings_dashboard.xml +++ b/app/src/main/res/values-fr/strings_dashboard.xml @@ -4,7 +4,7 @@ Tableau de bord Utilisation - Aujoud\'hui + Aujourd\'hui Total  ajouté au tableau de bord. supprimé du tableau de bord. diff --git a/app/src/main/res/values-fr/strings_into.xml b/app/src/main/res/values-fr/strings_into.xml deleted file mode 100644 index 490da2126..000000000 --- a/app/src/main/res/values-fr/strings_into.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Application domotique pour contrôler vos objets connectés de manière intelligente - Contrôler et surveiller vos objets connectés comme les lumières, commutateurs, ventilateurs, divers capteurs/compteurs comme température, précipitations, vent, Rayonnement Ultraviolet (UV), l’utilisation/production d’électricité, la consommation d’eau, de gaz, et beaucoup plus à portée de main avec le système d’automatisation plus cool \"Domoticz - Home Automation\". L’application automatise tous les appareils de votre domicile et vous pouvez la contrôler par le biais du mobile de n’importe quel endroit. Activer ou désactiver les lumières de la chambre à coucher assis dans le salon. L\'application \"Domoticz - Home Automation\" supporte le NFC et permet de mettre en marche l’air conditionné ou autres appareils, en arrivant à proximité du domicile. Avec \"geo fencing\" l’application peut détecter votre emplacement et vous alerte en conséquence avec la gestion des périphériques. -L’application « Domoticz » a une interface étendue avec des contrôles utilisateur simple. L’application prend également en charge les widgets qui permettent le contrôle d\'objets directement depuis votre écran d’accueil afin de gagner du temps. -Le soft est parfait pour réduire la consommation électrique inutile, économisant ainsi de l’argent. Personnalisez et commandez vos objets du bout des doigts. Le dispositif automatique contrôleur app « Domoticz » prend en charge la fonctionnalité de sécurité avec empreintes digitales pour assurer la sécurité de vos appareils. -Surveiller le gaz et la consommation électrique depuis votre appareil mobile et configurer son utilisation selon vos besoins et votre budget. L’app est le meilleur pour planifier votre budget mensuel sur divers périphériques. L’application envoie également la notification push à n’importe quel appareil mobile configuré pour vous alerter avec les usages et consommations. - -*** CARACTÉRISTIQUES PRINCIPALES PREMIUM *** -- Support du NFC et de \"tumbleurs\" via les tags NFC -- Geofencing (multiple), Allumage des lumières à l\'approche de la maison -- Android Wear, contrôler votre maison depuis votre poignet -- Widgets, mettre des widgets sur votre écran d’accueil -- Plusieurs config serveur, se connecter à plusieurs serveurs de domoticz avec une seule application -- Sécurité par empreintes digitales -- Affichages personnalisés -- Fonctionnalités pour mal-voyants (Google Talkback) -- Notifications -- Alarme -L\'application \"Domoticz - Home Automation\" est compatible avec tous les smartphones Android , Les tablettes et les montres Android. Soyez futé. ! Configurez plusieurs serveurs pour une utilisation simple et efficace de l’application. Téléchargez le contrôleur domotique « Domoticz » et vivez plus intelligemment. ! - -*** DIRE BONJOUR *** -Nous travaillons constamment sur cette application pour la rendre meilleure et plus utile pour vous. S’il vous plaît n’hésitez pas à envoyer un email pour des questions/suggestions/problèmes ou si vous voulez juste dire bonjour. Si vous avez aimé toute caractéristique de la Domoticz - app de domotique, Notez nous sur le playstore et faites en part à vos amis. - diff --git a/app/src/main/res/values-fr/strings_settings.xml b/app/src/main/res/values-fr/strings_settings.xml index e2e815b3f..403d9255d 100644 --- a/app/src/main/res/values-fr/strings_settings.xml +++ b/app/src/main/res/values-fr/strings_settings.xml @@ -38,7 +38,7 @@ Debuggage Export/Import des paramètres Thème - Clock + Horloge Associations NFC Sécurité  Comptes @@ -46,7 +46,7 @@ Bluetooth Commande vocale. Ràz - Contribute + Contribuer Écran d\'accueil Activer/Désactiver des éléments @@ -64,16 +64,16 @@ Toujours verrouiller l\'écran Ne jamais verrouiller l\'écran Rafraîchir Automatiquement - Actualiser l\'état de l\'appareil toutes les 5 secondes - Ne pas rafraîchir l\'état de l\'appareil toutes les 5 secondes + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Interrupteurs Afficher les interrupteurs avec les interrupteurs On / Off Afficher les interrupteurs avec les boutons On / Off Tableau de bord | Grille Voir la tableau de bord en tant que liste Voir la tableau de bord comme une grille - Clock - Show a clock on the dashboard + Horloge + Afficher une horloge sur le tableau de bord Activer Android Wear Interrupteurs Wear @@ -116,10 +116,10 @@ Configuration des QR Code Activer les QR Code Activer la fonctionnalité de QR Code - Setup Bluetooth devices - Enable Bluetooth functionality - You can help make our translations better, and even add new languages to this app via our Crowdin project - Translations + Configurer les périphériques Bluetooth + Activez la fonctionnalité Bluetooth + Vous pouvez aider à améliorer nos traductions, et même ajouter de nouvelles langues à cette application via notre projet Crowdin + Traductions Configurer la sécurité Activer la protection par empreinte digitale au démarrage Désactiver la protection d’empreintes digitales au démarrage @@ -178,7 +178,7 @@ Vous avez besoin d\'au moins un item. Mettre à jour le serveur - "Could not check for version: %1$s" + "Impossible de vérifier la version : %1$s" "Impossible de mettre à jour: %1$s" "Impossible d'obtenir la configuration du serveur Domoticz: %1$s" Mise à jour du serveur disponible : %1$s version : %2$s diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index 7b9f13545..523ebd93c 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-he/strings_into.xml b/app/src/main/res/values-he/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-he/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-he/strings_settings.xml b/app/src/main/res/values-he/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-he/strings_settings.xml +++ b/app/src/main/res/values-he/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 5ad68085f..e6ba98888 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-hr/strings_into.xml b/app/src/main/res/values-hr/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-hr/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-hr/strings_settings.xml b/app/src/main/res/values-hr/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-hr/strings_settings.xml +++ b/app/src/main/res/values-hr/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 84148f2d5..0ca029b12 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -32,7 +32,7 @@ Be Ki Zárva - Megnyitás + Nyit Zárva Nyitva Napló @@ -45,17 +45,17 @@ Szín Élesít Hatástalanít - Full light - Night light - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Teljes fény + Éjszakai fény + Napkelte + Naplemente + Most + Csillagászati szürkület kezdete + Csillagászati szürkület vége + Polgári szürkület kezdete + Polgári szürkület vége + Tengerészeti szürkület kezdete + Tengerészeti szürkület vége Utolsó érzékelés Jelerősség Akku töltöttségi szint @@ -63,7 +63,7 @@ Hardver Hőmérséklet Állapot - RGB color or warm white + RGB színek, vagy meleg fehér Munkapont Setpoint minimum értéke Minimum hőmérséklet, amit beállíthatsz a termosztáton @@ -101,8 +101,8 @@ %1$s törölve Kapcsoló bekapcsolása Kapcsoló kikapcsolása - Turning switch to night light - Turning switch to full light + Kapcsolás éjszakai fényre + Kapcsolás teljes fényerőre Redőny felhúzása Redőny leengedése Redőny megállítása @@ -126,8 +126,11 @@ Folytatod? Nem lehet eltávolítani az alapértelmezett kiszolgálót A nyelvi beállítások életbe léptetéséhez az alkalmazás újraindítása szükséges - All - Normal - Status - Error + Összes + Normál + Állapot + Hiba + Demó beállítások + Időzítő frissítése + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-hu/strings_actions.xml b/app/src/main/res/values-hu/strings_actions.xml index d195d8a34..ba7fcf554 100644 --- a/app/src/main/res/values-hu/strings_actions.xml +++ b/app/src/main/res/values-hu/strings_actions.xml @@ -28,6 +28,6 @@ Lejátszás Szünet QR kód beolvasása - Show paired devices + Párosított eszközök megtekintése Beszédfelismerés diff --git a/app/src/main/res/values-hu/strings_bluetooth.xml b/app/src/main/res/values-hu/strings_bluetooth.xml index e8efb3b7d..be55fbee6 100644 --- a/app/src/main/res/values-hu/strings_bluetooth.xml +++ b/app/src/main/res/values-hu/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + A Bluetooth nem támogatott ezen az eszközön + Csatlakozás Bluetooth-eszközhöz + Új Bluetooth eszköz érhető el + Bluetooth eszköz szerkesztése + Bluetooth eszköz elnevezése. + Párosított Bluetooth eszközök listája. + A Bluetooth eszköz már konfigurálva lett korábban a Domoticzban. + Be kell kapcsolni a Bluetooth-t a telefon beállításaiban. + Új Bluetooth kapcsolat mentve. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Bluetooth automatika ki van kapcsolva. Bekapcsolás a beállításoknál. + A Bluetooth automatizálás használatához kapcsolót kell rendelni hozzá a Domoticzban diff --git a/app/src/main/res/values-hu/strings_cameras.xml b/app/src/main/res/values-hu/strings_cameras.xml index 0115eca93..6aa5f79cf 100644 --- a/app/src/main/res/values-hu/strings_cameras.xml +++ b/app/src/main/res/values-hu/strings_cameras.xml @@ -1,6 +1,6 @@ - - Kamerák + + Kamerák diff --git a/app/src/main/res/values-hu/strings_dashboard.xml b/app/src/main/res/values-hu/strings_dashboard.xml index 8834cf679..eb203f0d1 100644 --- a/app/src/main/res/values-hu/strings_dashboard.xml +++ b/app/src/main/res/values-hu/strings_dashboard.xml @@ -1,11 +1,11 @@ - - Vezérlőpult - Használat - Ma - Összesen - vezérlőpulthoz hozzáadva. - vezérlőpultról eltávolítva. + + Vezérlőpult + Használat + Ma + Összesen + vezérlőpulthoz hozzáadva. + vezérlőpultról eltávolítva. diff --git a/app/src/main/res/values-hu/strings_errors.xml b/app/src/main/res/values-hu/strings_errors.xml index 3a5beafb0..2ea5a843d 100644 --- a/app/src/main/res/values-hu/strings_errors.xml +++ b/app/src/main/res/values-hu/strings_errors.xml @@ -1,11 +1,11 @@ - - Érvénytelen azonosító - Kapcsolat időtúllépés - Szerverhiba - Hálózati hiba, állapot kód %1$d - Feldolgozási hiba - Hiba: nem kapcsolódik semmilyen hálózathoz + + Érvénytelen azonosító + Kapcsolat időtúllépés + Szerverhiba + Hálózati hiba, állapot kód %1$d + Feldolgozási hiba + Hiba: nem kapcsolódik semmilyen hálózathoz diff --git a/app/src/main/res/values-hu/strings_events.xml b/app/src/main/res/values-hu/strings_events.xml index b6f7d5f91..a155daf3d 100644 --- a/app/src/main/res/values-hu/strings_events.xml +++ b/app/src/main/res/values-hu/strings_events.xml @@ -1,7 +1,7 @@ - - Események - Ez a művelet egyelőre nem támogatott! + + Események + Ez a művelet egyelőre nem támogatott! diff --git a/app/src/main/res/values-hu/strings_into.xml b/app/src/main/res/values-hu/strings_into.xml deleted file mode 100644 index d6984c825..000000000 --- a/app/src/main/res/values-hu/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Otthonautomatizáló alkalmazás, hogy irányíthasd az otthoni eszközeidet - Vezéreld és ellenőrizd az otthoni eszközeidet, lámpákat, kapcsolókat, ventilátorokat, többféle érzékelőt, úgymint hőmérséklet, csapadék, szélerősség, UV (ultraibolya) sugárzás, elektromos áram fogyasztás/termelés, gáz fogyasztás, víz fogyasztás és sok más, ami karnyújtásnyira kerül Tőled a legjobb otthonautomatizáló rendszerrel, ami a \"Domoticz - Otthonautomatizálás\". Az alkalmazás automatizál minden okos eszközt az otthonodban és vezérelni tudod őket a mobilodon keresztül bárhonnan. Kapcsold le vagy fel a hálószoba lámpát a nappaliban ülve. A \"Domoticz - Otthonautomatizálás\" támogatja az NFC-t, így bekapcsolhatod az udvari világítást vagy bármit, néhány perccel a hazaérkezésed előtt. A Geofencing funkció segítségével tudja az alkalmazás hol vagy és ennek megfelelően küldhet riasztást vagy irányíthat eszközöket. -A \"Domoticz\" alkalmazásnak nagyszerű felhasználói felülete van. Támogatja a widgeteket, amivel időt spórolhatsz meg és lezárt telefonképernyővel is be- vagy kikapcsolhatsz eszközöket. Az alkalmazás tökéletes indokolatlan áramfogyasztás megakadályozására és így kevesebb lesz a fizetendő díj! A \"Domoticz\" alkalmazás ujjlenyomathoz is köthető a maximális biztonság érdekében. -Ellenőrizd a gáz és áramfogyasztásodat és igazítsd a szokásaidhoz, így spórolhatsz! Az alkalmazással jól tervezhető a havi fogyasztás és bármilyen beállított értékhez kötve értesítéseket küld a mobilodra, hogy figyelmeztessen a fogyasztás csökkentésére. - -************************** -PRÉMIUM FUNKCIÓK -************************** -- NFC támogatás - Kapcsolj eszközöket NFC matricákkal -- Geofencing (több is), világítás felkapcsolás, mielőtt hazaérsz -- Android Wear viselhető eszközök támogatása -- Widgetek helyezhetők a kezdőlapra -- Több szerver beállítása egy alkalmazáson belül (ha több okos lakásod is van) -- Ujjlenyomatos azonosítás -- Egyedi megjelenítések -- Beszédfunkció -- Értesítések -- Riasztások -A \"Domoticz - Otthonautomatizálás\" alkalmazás kompatibilis minden Androidos okostelefonnal, tablettel és viselhető eszközzel. Légy okos! Állíts be több szervert az alkalmazás egyszerű és hatékony használatához! Töltsd le az otthonautomatizáló szoftvert, a \"Domoticz\"-ot és élj okosabban! - -*********************** -KÖSZÖNJ NEKÜNK -*********************** -Keményen dolgozunk azon, hogy a \"Domoticz - Otthonautomatizálás\" alkalmazás még jobb és hasznosabb legyen számodra. Írj nekünk bármilyen kéréssel/kérdéssel/javaslattal/problémával kapcsolatban vagy csak ha köszönnél. Ha tetszik a \"Domoticz - Otthonautomatizálás\" alkalmazás, értékelj itt a play store-ban és oszd meg barátaiddal. - - diff --git a/app/src/main/res/values-hu/strings_locations.xml b/app/src/main/res/values-hu/strings_locations.xml index 05006d635..b6113f411 100644 --- a/app/src/main/res/values-hu/strings_locations.xml +++ b/app/src/main/res/values-hu/strings_locations.xml @@ -21,45 +21,45 @@ ~ under the License. --> - - Hely hozzáadása - Hely szerkesztése - Hosszúság - Szélesség - Sugár (méter) - Csatlakoztatott kapcsoló - Nem fértem hozzá minden kapcsolóhoz. Kérlek próbáld újra - DEL - Törlés - Hely neve - Aktuális pozíció - Manuális - GET - Cím - Ismeretlen - N/A - Nem érvényes szélességi vagy hosszúsági kör - Geofence szolgáltatás indítása - Nem találtam a megadott helyet, kérlek próbáld újra. - A Google Play szolgáltatás nem érhető el. - Hely nem található. - Geofencing - Geofencing engedélyezése - Geofence engedélyezése és beállítása - Értesítések engedélyezése - Engedélyezi az értesítéseket kiváltó eseményeknek - Hely: %s - "Belépés ide: %1$s " - Távozás innét: %1$s - Belépés valamelyik helyre - Távozás valamelyik helyről - A Geofencing változtatásai miatt add újra hozzá a helyeid - Nincs kiválasztott kapcsoló - A Geofencing megfelelő működéséhez egy kapcsolót kell társítani a Geofence-hez - Csatlakoztatsz egyet most? - A Geofencing letiltva, mert egyetlen Geofence sincs engedélyezve - GeoFence szolgáltatás most nem érhető el - Az applikáció túl sok geofence-t regisztrált - Túl sok függőben lévő kérés lett megadva - Ismeretlen hiba + + Hely hozzáadása + Hely szerkesztése + Hosszúság + Szélesség + Sugár (méter) + Csatlakoztatott kapcsoló + Nem fértem hozzá minden kapcsolóhoz. Kérlek próbáld újra + DEL + Törlés + Hely neve + Aktuális pozíció + Manuális + GET + Cím + Ismeretlen + N/A + Nem érvényes szélességi vagy hosszúsági kör + Geofence szolgáltatás indítása + Nem találtam a megadott helyet, kérlek próbáld újra. + A Google Play szolgáltatás nem érhető el. + Hely nem található. + Geofencing + Geofencing engedélyezése + Geofence engedélyezése és beállítása + Értesítések engedélyezése + Engedélyezi az értesítéseket kiváltó eseményeknek + Hely: %s + "Belépés ide: %1$s " + Távozás innét: %1$s + Belépés valamelyik helyre + Távozás valamelyik helyről + A Geofencing változtatásai miatt add újra hozzá a helyeid + Nincs kiválasztott kapcsoló + A Geofencing megfelelő működéséhez egy kapcsolót kell társítani a Geofence-hez + Csatlakoztatsz egyet most? + A Geofencing letiltva, mert egyetlen Geofence sincs engedélyezve + GeoFence szolgáltatás most nem érhető el + Az applikáció túl sok geofence-t regisztrált + Túl sok függőben lévő kérés lett megadva + Ismeretlen hiba diff --git a/app/src/main/res/values-hu/strings_logs.xml b/app/src/main/res/values-hu/strings_logs.xml index b0608ba36..e0383fccf 100644 --- a/app/src/main/res/values-hu/strings_logs.xml +++ b/app/src/main/res/values-hu/strings_logs.xml @@ -1,6 +1,6 @@ - - Napló + + Napló diff --git a/app/src/main/res/values-hu/strings_nfc.xml b/app/src/main/res/values-hu/strings_nfc.xml index b8eb81d73..c4f368ce1 100644 --- a/app/src/main/res/values-hu/strings_nfc.xml +++ b/app/src/main/res/values-hu/strings_nfc.xml @@ -1,13 +1,13 @@ - Az NFC nem támogatott ezen az eszközön - NFC-címke regisztrálása - Új NFC-címke található - NFC-címke szerkesztése - Nevezd el az NFC-címkét. - Az NFC-címke már regisztrálva van. - Új NFC-címke rögzítve. - NFC - Az NFC működéséhez a címkét egy kapcsolóhoz kell kötni + Az NFC nem támogatott ezen az eszközön + NFC-címke regisztrálása + Új NFC-címke található + NFC-címke szerkesztése + Nevezd el az NFC-címkét. + Az NFC-címke már regisztrálva van. + Új NFC-címke rögzítve. + NFC + Az NFC működéséhez a címkét egy kapcsolóhoz kell kötni diff --git a/app/src/main/res/values-hu/strings_notifications.xml b/app/src/main/res/values-hu/strings_notifications.xml index f60903752..8bbf92294 100644 --- a/app/src/main/res/values-hu/strings_notifications.xml +++ b/app/src/main/res/values-hu/strings_notifications.xml @@ -1,11 +1,11 @@ - Prioritás - Vészhelyzet - Magas - Alacsony - Nagyon alacsony - Minden rendszer - Rendszerek + Prioritás + Vészhelyzet + Magas + Alacsony + Nagyon alacsony + Minden rendszer + Rendszerek diff --git a/app/src/main/res/values-hu/strings_permissions.xml b/app/src/main/res/values-hu/strings_permissions.xml index 9ce298628..a15000afa 100644 --- a/app/src/main/res/values-hu/strings_permissions.xml +++ b/app/src/main/res/values-hu/strings_permissions.xml @@ -1,13 +1,13 @@ - Engedély megtagadva - Engedélyek - Domoticz app engedélyeinek beállítása - Ezek a tárolási engedélyek szükségesek a cache fájl, a beállítások, és a kamera képek mentéséhez. - Ezek a helyengedélyek szükségesek a Geofencinghez és a Wifi SSID-k tárolásához! - Ezek a telefon állapot engedélyek szükségesek az értesítések megjelenítéséhez! - Ezek a kamera engedélyek szükségesek a QR kódok olvasásához! - Ezek az hang engedélyek szükségesek a Beszédfelismeréshez! - Ezek az ujjenyomat engedélyek szükségesek az Ujjlenyomat olvasásához! + Engedély megtagadva + Engedélyek + Domoticz app engedélyeinek beállítása + Ezek a tárolási engedélyek szükségesek a cache fájl, a beállítások, és a kamera képek mentéséhez. + Ezek a helyengedélyek szükségesek a Geofencinghez és a Wifi SSID-k tárolásához! + Ezek a telefon állapot engedélyek szükségesek az értesítések megjelenítéséhez! + Ezek a kamera engedélyek szükségesek a QR kódok olvasásához! + Ezek az hang engedélyek szükségesek a Beszédfelismeréshez! + Ezek az ujjenyomat engedélyek szükségesek az Ujjlenyomat olvasásához! diff --git a/app/src/main/res/values-hu/strings_plans.xml b/app/src/main/res/values-hu/strings_plans.xml index aa6ae5685..08fc50a9e 100644 --- a/app/src/main/res/values-hu/strings_plans.xml +++ b/app/src/main/res/values-hu/strings_plans.xml @@ -1,10 +1,10 @@ - - Tervek - - %1d eszköz - %1d eszköz - + + Tervek + + %1d eszköz + %1d eszköz + diff --git a/app/src/main/res/values-hu/strings_qrcode.xml b/app/src/main/res/values-hu/strings_qrcode.xml index 7e5b22916..9196bafed 100644 --- a/app/src/main/res/values-hu/strings_qrcode.xml +++ b/app/src/main/res/values-hu/strings_qrcode.xml @@ -1,19 +1,19 @@ - A QR kód nem támogatott ezen a készüléken - ÚJ QR kód rögzítése - ÚJ QR kód észlelve - QR kód szerkesztése - Nevezd el a QR kódot. - Olvass be egy QR kódot. - Ez a QR kód már rögzítve lett. - ÚJ QR kód elmentve. - QR kód - Új QR kód észlelve, állítsd be a Beállításokon keresztül. - QR kód letiltva, állítsd be a Beállításokon keresztül. - Hogy működjön a QR szkennelés, hozzá kell rendelni QR kódot egy kapcsolóhoz - Kamera hozzáférés szükséges az azonosításhoz - Nem lehet letölteni a QR kód függőségeket, nincs elég szabad hely az eszközön - Az alkalmazás nem tud lefutni, mert nincs meghatalmazása kamera használatára. Az alkalmazás bezárul. + A QR kód nem támogatott ezen a készüléken + ÚJ QR kód rögzítése + ÚJ QR kód észlelve + QR kód szerkesztése + Nevezd el a QR kódot. + Olvass be egy QR kódot. + Ez a QR kód már rögzítve lett. + ÚJ QR kód elmentve. + QR kód + Új QR kód észlelve, állítsd be a Beállításokon keresztül. + QR kód letiltva, állítsd be a Beállításokon keresztül. + Hogy működjön a QR szkennelés, hozzá kell rendelni QR kódot egy kapcsolóhoz + Kamera hozzáférés szükséges az azonosításhoz + Nem lehet letölteni a QR kód függőségeket, nincs elég szabad hely az eszközön + Az alkalmazás nem tud lefutni, mert nincs meghatalmazása kamera használatára. Az alkalmazás bezárul. diff --git a/app/src/main/res/values-hu/strings_scenes.xml b/app/src/main/res/values-hu/strings_scenes.xml index 7b1cbb3e0..ae19eae13 100644 --- a/app/src/main/res/values-hu/strings_scenes.xml +++ b/app/src/main/res/values-hu/strings_scenes.xml @@ -1,6 +1,6 @@ - - Jelenetek + + Jelenetek diff --git a/app/src/main/res/values-hu/strings_security.xml b/app/src/main/res/values-hu/strings_security.xml index 765697223..a2125b926 100644 --- a/app/src/main/res/values-hu/strings_security.xml +++ b/app/src/main/res/values-hu/strings_security.xml @@ -27,10 +27,10 @@ Otthoni élesítés Távolléti élesítés Rossz kódot adtál meg! - You do not have the rights for this action! + Nincs megfelelő jogosultsága a tevékenységhez! Nem lehet megváltoztatni a biztonsági állapotot. Rossz jelszót írtál be, a domoticz fiókod jelszava a biztonsági jelszavad hibás ujjlenyomat olvasás esetére...! Jelszó megjelenítése - We need to make sure its you - Touch your finger on the fingerprint sensor to authorise your account. + Biztosnak kell lennünk, hogy Te vagy az + Érintsd meg az ujjlenyomat olvasót a felhasználói fiók engedélyezéséhez. diff --git a/app/src/main/res/values-hu/strings_server.xml b/app/src/main/res/values-hu/strings_server.xml index 12abca175..a3846490f 100644 --- a/app/src/main/res/values-hu/strings_server.xml +++ b/app/src/main/res/values-hu/strings_server.xml @@ -1,9 +1,9 @@ - Válassz szervert - Ne mentsem az új szervert? - A kiszolgáló nevének egyedinek kell lennie - "Váltás erre a szerverre: %1$s" - Nem lehet letiltani az alapértelmezett kiszolgálót + Válassz szervert + Ne mentsem az új szervert? + A kiszolgáló nevének egyedinek kell lennie + "Váltás erre a szerverre: %1$s" + Nem lehet letiltani az alapértelmezett kiszolgálót diff --git a/app/src/main/res/values-hu/strings_settings.xml b/app/src/main/res/values-hu/strings_settings.xml index b9d7d61b5..f3070b38b 100644 --- a/app/src/main/res/values-hu/strings_settings.xml +++ b/app/src/main/res/values-hu/strings_settings.xml @@ -64,8 +64,8 @@ A képernyő mindig bekapcsolva marad A képernyő nem marad bekapcsolva Automatikus frissítés - Frissítse az eszköz állapotát 5 másodpercenként - Ne frissítse az eszköz állapotát 5 másodpercenként + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Kapcsolók KI/BE kapcsolók mutatása KI/BE gombú kapcsolók mutatása diff --git a/app/src/main/res/values-hu/strings_speech.xml b/app/src/main/res/values-hu/strings_speech.xml index 3609ae54d..e0af1e6cc 100644 --- a/app/src/main/res/values-hu/strings_speech.xml +++ b/app/src/main/res/values-hu/strings_speech.xml @@ -1,15 +1,15 @@ - A hangutasítás nem támogatott ezen az eszközön - Vegyél fel egy hangutasítást - Új hangutasítás felvéve - Hangutasítás szerkesztése - Adj a hangutasításnak egy megfelelő nevet. - Ez a hangutasítás már rögzítve lett. - Új hangutasítás elmentve: - Vegyél fel egy új hangutasítást. - Beszéd - Hangutasítás kikapcsolva, kapcsold be a beállításokban. - Hangutasítás működéséhez párosítanod kell egy kapcsolót + A hangutasítás nem támogatott ezen az eszközön + Vegyél fel egy hangutasítást + Új hangutasítás felvéve + Hangutasítás szerkesztése + Adj a hangutasításnak egy megfelelő nevet. + Ez a hangutasítás már rögzítve lett. + Új hangutasítás elmentve: + Vegyél fel egy új hangutasítást. + Beszéd + Hangutasítás kikapcsolva, kapcsold be a beállításokban. + Hangutasítás működéséhez párosítanod kell egy kapcsolót diff --git a/app/src/main/res/values-hu/strings_switches.xml b/app/src/main/res/values-hu/strings_switches.xml index de3468323..5075be3a9 100644 --- a/app/src/main/res/values-hu/strings_switches.xml +++ b/app/src/main/res/values-hu/strings_switches.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Kapcsolók - N/A - IDX - 255 - Szín beállítva - Állapot beállítása - Nem sikerült kedvencnek beállítani - Nem találok megjeleníthető naplót - Nem tudtam megváltoztatni a színt - Nem tudtam megváltoztatni az állapotot - Az időzítők mutatása nem lehetséges - Az értesítést nem lehetett megjeleníteni - "Szint beállítása a kapcsolóhoz: %1$s-tól %2$d-ig" + + Kapcsolók + N/A + IDX + 255 + Szín beállítva + Állapot beállítása + Nem sikerült kedvencnek beállítani + Nem találok megjeleníthető naplót + Nem tudtam megváltoztatni a színt + Nem tudtam megváltoztatni az állapotot + Az időzítők mutatása nem lehetséges + Az értesítést nem lehetett megjeleníteni + "Szint beállítása a kapcsolóhoz: %1$s-tól %2$d-ig" diff --git a/app/src/main/res/values-hu/strings_temperature.xml b/app/src/main/res/values-hu/strings_temperature.xml index 8a68ab9eb..f288db405 100644 --- a/app/src/main/res/values-hu/strings_temperature.xml +++ b/app/src/main/res/values-hu/strings_temperature.xml @@ -1,10 +1,10 @@ - - Hőmérséklet - Felülbírálás visszavonása - Szél - Nem sikerült beolvasni a következő naplózási adatot - Ütemterv követése + + Hőmérséklet + Felülbírálás visszavonása + Szél + Nem sikerült beolvasni a következő naplózási adatot + Ütemterv követése diff --git a/app/src/main/res/values-hu/strings_utilities.xml b/app/src/main/res/values-hu/strings_utilities.xml index f5eaa53c7..d3f666c54 100644 --- a/app/src/main/res/values-hu/strings_utilities.xml +++ b/app/src/main/res/values-hu/strings_utilities.xml @@ -1,7 +1,7 @@ - - Kiegészítők - Beállít + + Kiegészítők + Beállít diff --git a/app/src/main/res/values-hu/strings_vars.xml b/app/src/main/res/values-hu/strings_vars.xml index 3a6343b7e..14fd16243 100644 --- a/app/src/main/res/values-hu/strings_vars.xml +++ b/app/src/main/res/values-hu/strings_vars.xml @@ -1,8 +1,8 @@ - - Felhasználói változók - Bemeneti érték érvénytelen - Nem sikerült frissíteni a felhasználói változót + + Felhasználói változók + Bemeneti érték érvénytelen + Nem sikerült frissíteni a felhasználói változót diff --git a/app/src/main/res/values-hu/strings_weather.xml b/app/src/main/res/values-hu/strings_weather.xml index 8ffb3ff83..70d9cfde8 100644 --- a/app/src/main/res/values-hu/strings_weather.xml +++ b/app/src/main/res/values-hu/strings_weather.xml @@ -1,19 +1,19 @@ - - Időjárás - Harmatpont - Hőmérséklet - Légnyomás - Hőérzet - Irány - Páratartalom - Sebesség - Előrejelzés - Eső - Eső intenzitása - CO2 - CO2 Min - CO2 Max + + Időjárás + Harmatpont + Hőmérséklet + Légnyomás + Hőérzet + Irány + Páratartalom + Sebesség + Előrejelzés + Eső + Eső intenzitása + CO2 + CO2 Min + CO2 Max diff --git a/app/src/main/res/values-hu/strings_welcome.xml b/app/src/main/res/values-hu/strings_welcome.xml index e621a15c5..173d59e7f 100644 --- a/app/src/main/res/values-hu/strings_welcome.xml +++ b/app/src/main/res/values-hu/strings_welcome.xml @@ -1,51 +1,50 @@ - - Üdvözlünk - A Domoticz egy otthonautomatizálási rendszer, amelynek segítségével különböző kapcsolók, érzékelők (pl. hőmérők, esőérzékelők, UV érzékelők) és mérők (mint víz-, villany- és gázfogyasztás) monitorozása és távvezérlése lehetséges. A rendszer képes értesítést/riasztást küldeni bármilyen mobileszközre. - A folytatáshoz lapozz jobbra, vagy használd a navigációs gombot a képernyő alján - A következő képernyőn megadhatja a Domoticz beállításait. - - Megadhatsz helyi és a távoli kiszolgáló beállításokat. + + Üdvözlünk + A Domoticz egy otthonautomatizálási rendszer, amelynek segítségével különböző kapcsolók, érzékelők (pl. hőmérők, esőérzékelők, UV érzékelők) és mérők (mint víz-, villany- és gázfogyasztás) monitorozása és távvezérlése lehetséges. A rendszer képes értesítést/riasztást küldeni bármilyen mobileszközre. + A folytatáshoz lapozz jobbra, vagy használd a navigációs gombot a képernyő alján + A következő képernyőn megadhatja a Domoticz beállításait. + Megadhatsz helyi és a távoli kiszolgáló beállításokat. A helyi beállítások az otthoni wifi hálózatra kapcsolódáskor érvényesek. A távoli beállítások esetén az alkalmazás nem csatlakozik az otthoni wifi hálózatra, mobilnetes (2G, 3G, 4G stb.) hozzáférést használ. - A kapcsolat beállításainak ellenőrzése - A csatlakozási adat hiányos vagy üres - Az URL nem kell kezdődhet http-vel - Kérlek, javítsd az adatokat az előző oldalon - Domoticz verzió - %1$d eszköz észlelve - Nem találtam wifi SSID-t - Otthoni SSID kiválasztása - Helyi wifi SSID hozzáadása - Szerver beállítások - Kezdőképernyő - következő - előző - befejezés - Szerver címe - Protokoll - Port - felhasználónév - Jelszó - Mappa - Távoli - Helyi - Szerver név - Eltérő kiszolgáló cím - Eltérő cím a helyi kapcsolat használatához - Szerver haladó beállítások - Csak nem szabvány Domoticz szerver esetén - Helyi wifi SSID - Helyi szerver címe - Helyi protokoll - Helyi port - Helyi mappa (hagyd üresen, ha nem használod) - Helyi felhasználónév (hagyd üresen, ha nem használod) - Helyi jelszó (ha nem használja, hagyja üresen) - - HTTP - HTTPS - + A kapcsolat beállításainak ellenőrzése + A csatlakozási adat hiányos vagy üres + Az URL nem kell kezdődhet http-vel + Kérlek, javítsd az adatokat az előző oldalon + Domoticz verzió + %1$d eszköz észlelve + Nem találtam wifi SSID-t + Otthoni SSID kiválasztása + Helyi wifi SSID hozzáadása + Szerver beállítások + Kezdőképernyő + következő + előző + befejezés + Szerver címe + Protokoll + Port + felhasználónév + Jelszó + Mappa + Távoli + Helyi + Szerver név + Eltérő kiszolgáló cím + Eltérő cím a helyi kapcsolat használatához + Szerver haladó beállítások + Csak nem szabvány Domoticz szerver esetén + Helyi wifi SSID + Helyi szerver címe + Helyi protokoll + Helyi port + Helyi mappa (hagyd üresen, ha nem használod) + Helyi felhasználónév (hagyd üresen, ha nem használod) + Helyi jelszó (ha nem használja, hagyja üresen) + + HTTP + HTTPS + diff --git a/app/src/main/res/values-hu/strings_widgets.xml b/app/src/main/res/values-hu/strings_widgets.xml index 331e683f6..10c215585 100644 --- a/app/src/main/res/values-hu/strings_widgets.xml +++ b/app/src/main/res/values-hu/strings_widgets.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Válassz egy eszközt - Válassz egy eszközt - Nem találtam biztonsági panelt a kapcsolóid között - Az eszközök lekérdezése sikertelen - A kapcsolás sikertelen - "Eszköz váltása" - Betöltés... - Mehet - Háttér - Sötét - Világos - Sötét átlátszó - Világos átlásztó + + Válassz egy eszközt + Válassz egy eszközt + Nem találtam biztonsági panelt a kapcsolóid között + Az eszközök lekérdezése sikertelen + A kapcsolás sikertelen + "Eszköz váltása" + Betöltés... + Mehet + Háttér + Sötét + Világos + Sötét átlátszó + Világos átlásztó diff --git a/app/src/main/res/values-hu/strings_wizard.xml b/app/src/main/res/values-hu/strings_wizard.xml index 441628c58..8427728f7 100644 --- a/app/src/main/res/values-hu/strings_wizard.xml +++ b/app/src/main/res/values-hu/strings_wizard.xml @@ -21,42 +21,42 @@ ~ under the License. --> - - Beállítási Varázsló - Üdvözlünk - A Domoticz egy nagyon alacsony erőforrásigényű otthonautomatizálási rendszer, segítségével beállíthatod és nyomon követheted az eszközeid. - Kedvencek - Eszközeid közül kedvenceket adhatsz a kezdőképernyőre. Ehhez tartsd az ujjad az eszköz nevén! - Kezdőképernyő - Kezdőképernyődet a Beállításokban szabhatod saját ízlésedre! - Értesítések beállítása - Mostantól értesítést kaphatsz Android eszközödre! A Beállításokban testre szabhatod az értesítéseket - Több kiszolgáló használata - A Beállításokban több Domoticz szervert is konfigurálhatsz. - Geofencing - Kezdőképernyőjét a Beállításokban szabhatja saját ízlésére! - Android Wear - Megadhatod Android Wear eszközről vezérelhető kapcsolókat! - Android Auto - Jeleníts meg Domoticz értesítéseket közvetlenül az Android Auto eszközödön! - Grafikon - A Vegyes, Időjárás és Hőmérséklet historikus adatait grafikonokon nézheti meg. - Szűrők - Állapot alapján szűrheti eszközeit. Használja a jobb felső sarokban található ikont a szűréshez! - Widgetek!! - Helyezzen néhány widgetet a kezdőképernyőre! - Varázsló letiltása - Most már eltávolíthatja a Varázslót a navigációs menüből! - NFC - Kapcsolókat lehet vezérelni NFC-n keresztül! - QR kód - Kapcsolók vezérlése QR kód (vagy vonalkód) segítségével! - Hangutasítások - Kapcsolj eszközöket a hangoddal! Állíts be hangutasításokat a Beállításokban és párosíts hozzájuk kapcsolókat. - Menő - Kapcsolók - Beállítások - Eltávolítás - Vegyes - Kész + + Beállítási Varázsló + Üdvözlünk + A Domoticz egy nagyon alacsony erőforrásigényű otthonautomatizálási rendszer, segítségével beállíthatod és nyomon követheted az eszközeid. + Kedvencek + Eszközeid közül kedvenceket adhatsz a kezdőképernyőre. Ehhez tartsd az ujjad az eszköz nevén! + Kezdőképernyő + Kezdőképernyődet a Beállításokban szabhatod saját ízlésedre! + Értesítések beállítása + Mostantól értesítést kaphatsz Android eszközödre! A Beállításokban testre szabhatod az értesítéseket + Több kiszolgáló használata + A Beállításokban több Domoticz szervert is konfigurálhatsz. + Geofencing + Kezdőképernyőjét a Beállításokban szabhatja saját ízlésére! + Android Wear + Megadhatod Android Wear eszközről vezérelhető kapcsolókat! + Android Auto + Jeleníts meg Domoticz értesítéseket közvetlenül az Android Auto eszközödön! + Grafikon + A Vegyes, Időjárás és Hőmérséklet historikus adatait grafikonokon nézheti meg. + Szűrők + Állapot alapján szűrheti eszközeit. Használja a jobb felső sarokban található ikont a szűréshez! + Widgetek!! + Helyezzen néhány widgetet a kezdőképernyőre! + Varázsló letiltása + Most már eltávolíthatja a Varázslót a navigációs menüből! + NFC + Kapcsolókat lehet vezérelni NFC-n keresztül! + QR kód + Kapcsolók vezérlése QR kód (vagy vonalkód) segítségével! + Hangutasítások + Kapcsolj eszközöket a hangoddal! Állíts be hangutasításokat a Beállításokban és párosíts hozzájuk kapcsolókat. + Menő + Kapcsolók + Beállítások + Eltávolítás + Vegyes + Kész diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2e73bd52b..0b10b13f4 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-it/strings_into.xml b/app/src/main/res/values-it/strings_into.xml deleted file mode 100644 index 759a605ac..000000000 --- a/app/src/main/res/values-it/strings_into.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - App di Domotica per controllare i dispositivi di casa e condurre una vita più intelligente - Controllare e monitorare i vostri dispositivi domestici come luci, interruttori, ventilatori, vari sensori/misuratori come temperatura, precipitazioni, vento, radiazione ultravioletta (UV), l\'utilizzo/produzione di energia elettrica, consumo gas, consumo di acqua e tanto altro è a portata di mano con il sistema di automazione più cool \"Domoticz – Home Automation\". L\'app consente di automatizzare ogni apparecchio a casa vostra e che può essere controllato tramite il dispositivo mobile da qualsiasi luogo. Spegnere o accendere le luci della camera da letto seduto in salotto. \"Domoticz - domotica\" app supporta NFC e consente di accendere l\'aria condizionata o altri apparecchi quando stai tornando a casa. Attraverso la geolocalizzazione l\'app può rilevare la tua posizione e di conseguenza gestire i dispositivi. -L\'app \"Domoticz\" ha una bella interfaccia utente con facili controlli utente. L\'app supporta anche i widget che aiutano a controllare il tutto direttamente dalla vostra \"home screen\" risparmiando tempo per accendere o spegnere i dispositivi. L\'app è perfetta per controllare il risparmio energetico.\"Domoticz\" supporta la funzionalità di lettura delle impronte digitali per garantire la sicurezza dei tuoi dispositivi. -Monitora il gas e il consumo elettrico dal tuo dispositivo mobile e configurane l\'utilizzo secondo le vostre esigenze e budget. L\'app è la soluzione migliore per pianificare il tuo budget mensile nei vari dispositivi. L\'app invia anche notifiche push su qualsiasi dispositivo mobile configurato per avvisando l\'utente su gli utilizzi e i consumi. - -************************** -CARATTERISTICHE chiave PREMIUM -************************** -- supporto NFC -- Azionamento interruttori tramite un tag NFC -- Multi geolocalizzazione, accendi le luci quando sei quasi a casa -- Android Wear, controllate la vostra casa dal polso -- widget, inserite i widget sulla vostra schermata Home -- più server configurabili, connettere più server di domoticz in una sola app -- Lettura delle impronte digitali per la sicurezza -- visualizzazioni personalizzate -- Talkback -- Notifiche -- Funzioni di allarme -L\'app \"Domoticz – Home Automation\" è compatibile con tutti gli smartphone Android, Tablet e Android Wear. Sii smart.! Configura più server per un utilizzo facile ed efficiente dell\'applicazione. Scarica l\'app di \"Domoticz\" e vivi una vita più smart.! - -************************** -SAY HELLO -************************** -siamo costantemente al lavoro per rendere questa app (Domoticz - Home Automation) migliore e più utile per tutti voi. Sentitevi liberi di inviarci e-mail per eventuali problemi/suggerimenti/domande o solo per dire Ciao. Se avete apprezzato qualche caratteristica dell\'app (Domoticz - Home Automation), votaci sul play store e condividi la tua esperienza con gli amici. - - diff --git a/app/src/main/res/values-it/strings_settings.xml b/app/src/main/res/values-it/strings_settings.xml index ea24a4974..068e51fb3 100644 --- a/app/src/main/res/values-it/strings_settings.xml +++ b/app/src/main/res/values-it/strings_settings.xml @@ -64,8 +64,8 @@ Blocca lo schemo sempre attivo Non bloccare lo schemo sempre attivo Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Interruttori Visualizza interruttori on/off Visualizza pulsanti on/off diff --git a/app/src/main/res/values-kab/strings.xml b/app/src/main/res/values-kab/strings.xml index 66805a0d5..e1be16f55 100644 --- a/app/src/main/res/values-kab/strings.xml +++ b/app/src/main/res/values-kab/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-kab/strings_into.xml b/app/src/main/res/values-kab/strings_into.xml deleted file mode 100644 index a1a37d962..000000000 --- a/app/src/main/res/values-kab/strings_into.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Asnas Home Automation iw senqed n wallalen imkiren i tudert tukist - Senqed u sefqed allalen imkiren inek am tafat,isnezgiyen,tisbuḥriyin,isektayen / aktay imeszli,am tazɣelt,agefur,aḍu,izenzaren ultraviolet (UΓ),aseqdec / afares n tazarurt,asadur n lgaz,asadur n waman,d ugar n waya ger ifasen inek d wayen yelhan degs Anagraw n Tanewwert \"Domoticz - Home Automation\".asnas agi yesnewwer yal allal deg waxxam-inek u tzemereḍ a tesenqedeḍ seg amafus di yal tama. -Sens naɣ siweɣ tiftilin n taxxamt ɣer tamesrit.Asnas agi «Domoticz - Home Automation» tesmegel NFC u akteǧǧ att siweɣ-eḍ AC naɣ allalen nniḍen ma ttikli ataweḍ-eḍ s axxam. -asnas «Domoticz - Home Automation» tesefrak NFC u tettaǧǧa-k attsiɣ-eḍ AC d wallalen nniḍen send attaweḍ-eḍ s axxam.s imzega n tamseɣnat tarakalt,asnas agi yezmer ak-id yef u ak-id yɛaggen asefrek n ibenkan. -asnas \"Domoticz\"ɣuṛes agrudem uqeddac i cebḥen s usenqed i sahlen.asnas agi yesefrak wedgets a kwen-yeǧǧen deg senqed seg wagdil n uẓayet aziraz,dayen akwen-yeǧǧen attdemes-eḍ akud innek deg asiɣi naɣ assensi n wallal.asnas agi ackkit iw demes n usadur n tzarurt,dayen ara ydemesen idrimen.illi-k d uḥṛic u lmmed asenqed s yiɣef iḍudan.asnas asenqad n ibenk awurman \"Domoticz\"yesefrak tasɣant n asiggez n iḍudan iw senked n taɣlist n wallal inek. -Ɛas asadur n lgaz d tazarurt n wallal inek u swel useqqdec-ines s issaren d tiɣussar inek.asnas agi d win yelhan iw sɣiwes n tiɣussar inek n waggur ɣer yal allalen nniḍen.asnas agi ittceggaɛ daɣen alɣu push ɣer yal allal aziraz yeswelen akken akwen-id ṭurrec iw seqddec d usadur. - -******************************** -TASKANIN TIGEJDANIN TIMEZWURA -******************************** -- Tannalt NFC -asenfal yers ɣef tiṛkkizin NFC -- Asektasideg (usgit),siɣ tafat mara tqaṛb-eḍ s axxam -- Android Siweḍ,senqed axxam-ik seg tasendert innek -- Widgets,erret widgets deg wagdil n warmas -- Tawila n uqeddac usgit,qqen ugar n iqeddacen domoticz ɣer s asnas -- Taɣllist n tarkit n talfaft -- Abeqqeḍ yesagen -- Timeseɣnatin n Talkbak -- Alɣuten -- Tasɣent n tagendwit -Asnas\"Domoticz - Home Automation\"yemṣaḍa akked meṛṛa smartphone,tifelwatin ed meṛṛa uraren Android.ḥṛec.swel ugar n iqeddacen iw seqdec afraray u amellay n wasnas.zdem asnas n usenqad amegzu \"Domoticz\" dderet tudert tamegzut.! - -************************ -INNI-D AZUL -************************ -Nqeddec yall ass iw akken asnas agi�Domoticz - Home Automation�asnas yelhan a ttestenfaɛm segs.ur ttkukru yara aru yaɣ-d tabratt taliktṛunit i-yistaqsiyen n wen / tumlint / ugur naɣ ma yella tebɣam ad innim azul.ma yella tḥemmel-eḍ taskant n -�Asnas Domoticz - Home Automation,�skazal-taɣ deg Play Store u bḍu akked imddukal-innek. - - - - diff --git a/app/src/main/res/values-kab/strings_settings.xml b/app/src/main/res/values-kab/strings_settings.xml index c04be8a70..c8af00eb8 100644 --- a/app/src/main/res/values-kab/strings_settings.xml +++ b/app/src/main/res/values-kab/strings_settings.xml @@ -64,8 +64,8 @@ Asekkweṛ yal-ass agdil deg Ur sekkweṛ ara agdil yal-ass seg Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Isenfalen Beqqeḍ isenfalen s usnegzi askar/aḥbas Beqqeḍ isnegziyen s taqefalt askar/aḥbas diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index a48e79f87..bc48567ba 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -130,4 +130,7 @@ Normaal Status Error + Gebruik demo-instellingen + Timer + Stel een specifieke timer in voor het automatisch verversen van je scherm (in seconden). diff --git a/app/src/main/res/values-nl/strings_into.xml b/app/src/main/res/values-nl/strings_into.xml deleted file mode 100644 index 2021939f7..000000000 --- a/app/src/main/res/values-nl/strings_into.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Huisautomatiserings app verbindt al je apparaten thuis om een efficiënter en slimmer leven te leven - Gebruik \"Domoticz\" om je huis te bedienen vanaf je telefoon. Zet je lichten aan wanneer je bijna thuis bent, of zorg dat de verwarming hoog staat wanneer dat nodig is. Met Domoticz schakel je gemakkelijk apparaten aan zoals zoals verlichting, schakelaars, ventilatoren en bekijk je alle gegevens/grafieken van diverse sensoren/meters zoals temperatuur, neerslag, wind, (UV) straling, gebruik/productie van elektriciteit, gasverbruik, waterverbruik en nog veel meer. Zet je tuin verlichting aan door middel van NFC tags in je woonkamer. - -Door middel van Geofencing kan de app je lokatie bepalen en aan de hand van deze gegevens je apparaten thuis bedienen. Zet bijvoorbeeld je lichten aan wanneer je in de straat rijdt. Houd je gas en elektriciteit consumptie goed in de gaten via je telefoon en stel notificaties in voor wanneer het verbruik te hoog word. - -\"Domoticz\" is zo makkelijk mogelijk gemaakt qua gebruik. Stel widgets in op je beginscherm van je telefoon zodat je zonder de app te openen al je apparaten aan en uit kan zetten. Verder kan je de beveiliging wat opschroeven door je vingerafdruk te gebruiken bij de beveiliging van de app. Op deze manier kan alleen jij je huis aansturen. - - -************************** -SLEUTELPUNTEN -************************** -- NFC Support - Zet schakelaren aan en uit via NFC tags -- Geofencing, zet je licht aan wanneer je in de buurt van je huis komt -- Android Wear, bestuur je huis vanaf je pols -- Widgets, zet widgets op je begin pagina van je telefoon -- Verbind met meerdere servers tegelijkertijd -- Beveiliging dmv Vingerafdruk -- Praat terug -- Notificaties -- Alarm Mogelijkheid - - \"Domoticz - Home Automation\" app werkt met Android telefoons, tablets en Android Wear horloges. Er is een aparte app in de store gezet voor Android TV. Wees Slim! Gebruik de app om tegen meerdere servers tegelijk te verbinden. Laat Domoticz je lichten automatisch aanzetten wanneer je in de buurt van je huis komt met Geofencing. Leef slimmer... - - -*********************** -CONTACT -*********************** -Wij zijn constant hard voor jullie aan het werk om deze \"Domoticz - Home Automation\" app steeds handiger en beter te maken. Stuur ons aub een email wanneer je suggesties hebt, tegen een probleem aanloopt. Ben je blij met deze Domoticz app? Geef ons dan een goede rating en deel het nieuws met je vrienden. - diff --git a/app/src/main/res/values-nl/strings_settings.xml b/app/src/main/res/values-nl/strings_settings.xml index 122b78b91..171d0c4e5 100644 --- a/app/src/main/res/values-nl/strings_settings.xml +++ b/app/src/main/res/values-nl/strings_settings.xml @@ -64,7 +64,7 @@ Houd het scherm altijd aan Scherm gaat automatisch uit volgens systeem instelling Automatisch verversen - Ververs de status van alle apparaten elke 5 seconden + Ververs de status van alle apparaten elke X seconden Ververs de status van alle apparaten niet automatisch Schakelaar weergave Aan/uit knoppen weergeven diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml index 01a27cf47..86a24bb83 100644 --- a/app/src/main/res/values-no/strings.xml +++ b/app/src/main/res/values-no/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-no/strings_into.xml b/app/src/main/res/values-no/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-no/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-no/strings_settings.xml b/app/src/main/res/values-no/strings_settings.xml index 5544b3b9e..86dfe5a37 100644 --- a/app/src/main/res/values-no/strings_settings.xml +++ b/app/src/main/res/values-no/strings_settings.xml @@ -64,8 +64,8 @@ Lås skjermen alltid på Ikke låse skjermen alltid på Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Brytere Vis brytere med av/på-bryter Vis brytere med på/av knapper diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index d721cf1c0..5a6152d67 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -47,15 +47,15 @@ Rozbrój Pełne oświetlenie Lampka nocna - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Wschód słońca + Zachód słońca + Teraz + Początek astronomicznego zmierzchu + Koniec astronomicznego zmierzchu + Początek zmierzchu cywilnego + Koniec zmierzchu cywilnego + Początek zmierzchu morskiego + Koniec zmierzchu morskiego Ostatnio widoczny Poziom sygnału Poziom baterii @@ -126,8 +126,11 @@ Kontynuować? Nie można usunąć domyślnego serwera Aby zmiany ustawień języka zadziałały wymagane jest ponowne uruchomienie aplikacji - All - Normal + Wszystkie + Normalny Status - Error + Błąd + Użyj ustawień demo + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-pl/strings_into.xml b/app/src/main/res/values-pl/strings_into.xml deleted file mode 100644 index fa8b4b7da..000000000 --- a/app/src/main/res/values-pl/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Aplikacja automatyki domowej do sterowania urządzeń domowych i prowadzenia bardziej inteligentnego życia - Kontroluj i monitoruj swoje domowe urządzenia takie jak oświetlenie, przełączniki, wentylatory, różne czujniki/mierniki takie jak temperatura, opady deszczu, wiatr, promieniowanie ultrafioletowe (UV), zużycie/produkcje energii elektrycznej, zużycie gazu, zużycie wody i wiele innych w zasięgu ręki fajnych i najfajniejszych z systemu automatyki \"Domoticz - Home Automation\". Aplikacja automatyzuje każde urządzenie w domu i pozwala kontrolować je z urządzenia mobilnego z każdego miejsca. Wyłącza lub włącza światła w sypialni lub salonie. Aplikacja \"Domoticz - Home Automation\" wspiera NFC i pozwala Ci włączyć zasilanie AC lub inne urządzenia kiedy dotrzesz do domu. Poprzez funkcję geo fencing aplikacja może wykryć Twoją lokalizację i odpowiednio alarmować Cię o zarządzanych urządzeniach. -Aplikacja \"Domoticz\" ma świetny interfejs użytkownika z łatwą kontrolą użytkowników. Aplikacja wspiera widżety pomagające Ci kontrolować z Twojego ekranu startowego urządzenia mobilnego zachowując Twój czas na włączanie i wyłaczanie urządzenia. Aplikacja jest perfekcyjna do oszczędzenia niepotrzebnego zużycia energii i oszczędzić pieniądze. Może być spersonalizowana i daje kontrolę w zasięgu ręki. Automatyczna aplikacja kontroli \"Domoticz\" wspiera funkcję linii papilarnych w celu bezpieczeństwa Twoich urządzeń. -Monitoruj gaz i zużycie energii elektrycznej z Twojego urządzenia mobilnego i konfiguruj zużycie jak chcesz i dostosuj do swojego budżetu. Aplikacja jest najlepsza do planowania miesięcznych budżetów na różnych urządzeniach. Aplikacja wysyła także powiadomienia do różnych skonfigurowanych mobilnych urządzeń aby alarmować Cię o zużyciu i konsumpcji. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - diff --git a/app/src/main/res/values-pl/strings_settings.xml b/app/src/main/res/values-pl/strings_settings.xml index a4fa03d16..a1e4d4633 100644 --- a/app/src/main/res/values-pl/strings_settings.xml +++ b/app/src/main/res/values-pl/strings_settings.xml @@ -64,8 +64,8 @@ Blokuj ekran aby był zawsze włączony Nie blokuj ekranu aby był zawsze włączony Auto-odświeżanie - Odśwież stan urządzenia co 5 sekund - Nie odświeżaj stanu urządzenia co 5 sekund + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Przełączniki Pokaż przełączniki z jednym suwakiem włącz/wyłącz Pokaż przełączniki z przyciskami włącz i wyłącz diff --git a/app/src/main/res/values-pl/strings_timer.xml b/app/src/main/res/values-pl/strings_timer.xml index f7a86722f..0a18ff188 100644 --- a/app/src/main/res/values-pl/strings_timer.xml +++ b/app/src/main/res/values-pl/strings_timer.xml @@ -58,9 +58,9 @@ Weekend Inne Plany czasu - First - Second - Third - Fourth - Last + Pierwszy + Drugi + Trzeci + Czwarty + Ostatni diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index ac29022cd..51a6c1f6f 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-pt/strings_into.xml b/app/src/main/res/values-pt/strings_into.xml deleted file mode 100644 index 0e5942340..000000000 --- a/app/src/main/res/values-pt/strings_into.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Aplicação de Domótica para controlar seus dispositivos em casa e levar uma vida mais inteligente - Controlar e monitorar seus dispositivos em casa como luzes, interruptores, ventiladores, vários sensores/medidores como temperatura, precipitação, vento, radiação ultravioleta (UV), gasto/produção de electricidade, o consumo de gás, o consumo de água e muito mais ao seu alcance com o sistema de automação mais mais porreiro \"Domoticz – automação residencial\". A aplicação automatiza cada aparelho em casa e pode controlá-lo através do dispositivo móvel de qualquer lugar. Acender e apagar as luzes do quarto sentado na sala de estar. \"Domoticz - domótica\" app oferece suporte a NFC e permite que alterne o ar condicionado ou outros aparelhos quando está perto de casa. Através de geo-localização a aplicação pode detetar a sua localização e alerta-o em conformidade com o gerenciamento dos dispositivos. -O app \"Domoticz\" tem uma ótima interface com controles de usuário fácil. O aplicativo também suporta widgets que ajuda a você o controle de sua tela de casa móvel diretamente economizando seu tempo para ligar ou desligar o dispositivo. O app é perfeito para conservar o consumo elétrico desnecessário, economizando o dinheiro. Ser personalizado e obter o seu controle na ponta dos seus dedos. O app de controlador de dispositivo automático \"Domoticz\" suporta o recurso de impressão de dedo para garantir a segurança dos seus dispositivos. -Monitorar o gás e consumo elétrico do dispositivo móvel e configure seu gasto conforme suas necessidades e orçamento. A aplicação é o melhor para planear o seu orçamento mensal ao longo de vários dispositivos, também envia a notificações para qualquer dispositivo móvel configurado para alertá-lo com os usos e consumos. - -CARACTERÍSTICAS de CHAVE PREMIUM * * * - suporte NFC - interruptores através de tags NFC - delimitação geográfica (múltiplo), vai acender quando está perto de casa - Android Wear, controlar a sua casa através do seu pulso - Widgets, colocar widgets no homescreen - Vários servidores, conectar vários servidores de domoticz com um app - Segurança com impressões digitais - modos de exibição personalizados - Talkback - notificações - alarme, Aplicação \"Domoticz – automação residencial\" é compatível com todos os smartphones Android, tablet e o Android Wears. Seja inteligente.! Configure vários servidores para uma utilização fácil e eficiente do aplicativo. Faça Download do controlador de dispositivo inteligente \"Domoticz\" e viva uma vida mais inteligente.! - -DIGA OLÁ * * * estamos constantemente trabalhando duro para fazer esta aplicação Domoticz - melhor e mais útil para si. Sinta-se livre para enviar-nos quaisquer consultas/sugestões/problemas, ou se você apenas quiser dizer Olá. Se gostou de qualquer característica da aplicação Domoticz, classifique-no na play store e compartilhe entre seus amigos. - - diff --git a/app/src/main/res/values-pt/strings_settings.xml b/app/src/main/res/values-pt/strings_settings.xml index 89ef8e9b0..584495737 100644 --- a/app/src/main/res/values-pt/strings_settings.xml +++ b/app/src/main/res/values-pt/strings_settings.xml @@ -64,8 +64,8 @@ Suspensão de ecrã desativada Suspensão de ecrã ativada Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Interruptor Mostrar interruptor com Botão alternado ligar/desligar Mostrar interruptores com botões de ligar/desligar diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 5ad68085f..9cba0b33b 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -27,7 +27,7 @@ is a premium feature, please buy the paid version to support the developers! Open navigation drawer Close navigation drawer - Please wait… + Vă rugăm aşteptaţi… Changelog On Off @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-ro/strings_cameras.xml b/app/src/main/res/values-ro/strings_cameras.xml index 07b1fc323..fb417ce96 100644 --- a/app/src/main/res/values-ro/strings_cameras.xml +++ b/app/src/main/res/values-ro/strings_cameras.xml @@ -1,6 +1,6 @@ - - Cameras + + Cameras diff --git a/app/src/main/res/values-ro/strings_dashboard.xml b/app/src/main/res/values-ro/strings_dashboard.xml index c2177ab34..f5f72845a 100644 --- a/app/src/main/res/values-ro/strings_dashboard.xml +++ b/app/src/main/res/values-ro/strings_dashboard.xml @@ -1,11 +1,11 @@ - - Dashboard - Usage - Today - Total - added to dashboard. - removed from dashboard. + + Dashboard + Usage + Today + Total + added to dashboard. + removed from dashboard. diff --git a/app/src/main/res/values-ro/strings_errors.xml b/app/src/main/res/values-ro/strings_errors.xml index 9c58bc2a4..9e6854e63 100644 --- a/app/src/main/res/values-ro/strings_errors.xml +++ b/app/src/main/res/values-ro/strings_errors.xml @@ -1,11 +1,11 @@ - - Invalid credentials - Timeout or no connection - Server error - Network error, status code %1$d - Parse error - Error: not connected to any network + + Invalid credentials + Timeout or no connection + Server error + Network error, status code %1$d + Parse error + Error: not connected to any network diff --git a/app/src/main/res/values-ro/strings_events.xml b/app/src/main/res/values-ro/strings_events.xml index baa6e396a..acbaaa70b 100644 --- a/app/src/main/res/values-ro/strings_events.xml +++ b/app/src/main/res/values-ro/strings_events.xml @@ -1,7 +1,7 @@ - - Events - This action is not supported yet! + + Events + This action is not supported yet! diff --git a/app/src/main/res/values-ro/strings_into.xml b/app/src/main/res/values-ro/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-ro/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-ro/strings_locations.xml b/app/src/main/res/values-ro/strings_locations.xml index 19c9847ad..2d2a8f427 100644 --- a/app/src/main/res/values-ro/strings_locations.xml +++ b/app/src/main/res/values-ro/strings_locations.xml @@ -21,45 +21,45 @@ ~ under the License. --> - - Add location - Edit location - Longitude - Latitude - Radius (meter) - Connected switch - Unable to get all switches, please try again - DEL - Delete - Location name - Current location - Manual - GET - Address - Unknown - N/A - Not a valid latitude or longitude - Starting Geofence service - Could not find location, please try again. - Google Play services unavailable. - No location found. - Geofencing - Enable Geofencing - Enable and config geofences - Enable notifications - Enable notifications for triggering events - Place: %s - "Entering %1$s" - Leaving %1$s - Entering one of the locations - Leaving one of the locations - Due to changes on Geofencing, please recreate your locations - No switch selected - For GeoFencing to have effect, a switch should be connected to an GeoFence - Connect one now? - Geofencing disabled since no geofences are enabled - Geofence service is not available now - App registered too many geofences - Too many PendingIntents provided - Unknown error + + Add location + Edit location + Longitude + Latitude + Radius (meter) + Connected switch + Unable to get all switches, please try again + DEL + Delete + Location name + Current location + Manual + GET + Address + Unknown + N/A + Not a valid latitude or longitude + Starting Geofence service + Could not find location, please try again. + Google Play services unavailable. + No location found. + Geofencing + Enable Geofencing + Enable and config geofences + Enable notifications + Enable notifications for triggering events + Place: %s + "Entering %1$s" + Leaving %1$s + Entering one of the locations + Leaving one of the locations + Due to changes on Geofencing, please recreate your locations + No switch selected + For GeoFencing to have effect, a switch should be connected to an GeoFence + Connect one now? + Geofencing disabled since no geofences are enabled + Geofence service is not available now + App registered too many geofences + Too many PendingIntents provided + Unknown error diff --git a/app/src/main/res/values-ro/strings_logs.xml b/app/src/main/res/values-ro/strings_logs.xml index 7a7733f7c..6271bda95 100644 --- a/app/src/main/res/values-ro/strings_logs.xml +++ b/app/src/main/res/values-ro/strings_logs.xml @@ -1,6 +1,6 @@ - - Logs + + Logs diff --git a/app/src/main/res/values-ro/strings_nfc.xml b/app/src/main/res/values-ro/strings_nfc.xml index ffe7e3f1c..22512261f 100644 --- a/app/src/main/res/values-ro/strings_nfc.xml +++ b/app/src/main/res/values-ro/strings_nfc.xml @@ -1,13 +1,13 @@ - NFC is not supported on this device - Register a NFC Tag - New NFC Tag found - Edit NFC Tag - Give this NFC a proper name. - NFC tag already registered. - Saved a New NFC Tag. - NFC - For NFC to have effect, a switch should be linked to an NFC Tag + NFC is not supported on this device + Register a NFC Tag + New NFC Tag found + Edit NFC Tag + Give this NFC a proper name. + NFC tag already registered. + Saved a New NFC Tag. + NFC + For NFC to have effect, a switch should be linked to an NFC Tag diff --git a/app/src/main/res/values-ro/strings_notifications.xml b/app/src/main/res/values-ro/strings_notifications.xml index 36e6f10ae..e7367cedd 100644 --- a/app/src/main/res/values-ro/strings_notifications.xml +++ b/app/src/main/res/values-ro/strings_notifications.xml @@ -1,11 +1,11 @@ - Priority - Emergency - High - Low - Very Low - All Systems - Systems + Priority + Emergency + High + Low + Very Low + All Systems + Systems diff --git a/app/src/main/res/values-ro/strings_permissions.xml b/app/src/main/res/values-ro/strings_permissions.xml index 9ad5fefad..57e03ebb6 100644 --- a/app/src/main/res/values-ro/strings_permissions.xml +++ b/app/src/main/res/values-ro/strings_permissions.xml @@ -1,13 +1,13 @@ - Permissions Denied - Permissions - Configure the Permissions for this app - These storage permissions are needed for saving cache file, settings and save snapshots from the camera. - These location permissions are needed for Geofencing and to get the Wifi SSID\'s around you! - These phone state permissions are needed for enabling notifications! - These camera permissions are needed for scanning QR Codes! - These audio permissions are needed for Voice Recognition! - These fingerprint permissions are needed for enabling Fingerprint Security! + Permissions Denied + Permissions + Configure the Permissions for this app + These storage permissions are needed for saving cache file, settings and save snapshots from the camera. + These location permissions are needed for Geofencing and to get the Wifi SSID\'s around you! + These phone state permissions are needed for enabling notifications! + These camera permissions are needed for scanning QR Codes! + These audio permissions are needed for Voice Recognition! + These fingerprint permissions are needed for enabling Fingerprint Security! diff --git a/app/src/main/res/values-ro/strings_plans.xml b/app/src/main/res/values-ro/strings_plans.xml index 0d5120a9d..b8b800a1c 100644 --- a/app/src/main/res/values-ro/strings_plans.xml +++ b/app/src/main/res/values-ro/strings_plans.xml @@ -1,11 +1,11 @@ - - Plans - - %1d device - %1d devices - %1d devices - + + Plans + + %1d device + %1d devices + %1d devices + diff --git a/app/src/main/res/values-ro/strings_qrcode.xml b/app/src/main/res/values-ro/strings_qrcode.xml index 98e8e4772..c613c42ff 100644 --- a/app/src/main/res/values-ro/strings_qrcode.xml +++ b/app/src/main/res/values-ro/strings_qrcode.xml @@ -1,19 +1,19 @@ - QR Code is not supported on this device - Register a QR Code - New QR Code found - Edit QR Code - Give this QR Code a proper name. - Scan a QR Code. - QR Code already registered. - Saved a New QR Code. - QR Code - New QR Code detected, please setup via settings. - QR Code disabled, please setup via settings. - For QR Code Scan to have effect, a switch should be linked to an QR Code - Access to the camera is needed for detection - QR Code dependencies cannot be downloaded due to low device storage - This application cannot run because it does not have the camera permission. The application will now exit. + QR Code is not supported on this device + Register a QR Code + New QR Code found + Edit QR Code + Give this QR Code a proper name. + Scan a QR Code. + QR Code already registered. + Saved a New QR Code. + QR Code + New QR Code detected, please setup via settings. + QR Code disabled, please setup via settings. + For QR Code Scan to have effect, a switch should be linked to an QR Code + Access to the camera is needed for detection + QR Code dependencies cannot be downloaded due to low device storage + This application cannot run because it does not have the camera permission. The application will now exit. diff --git a/app/src/main/res/values-ro/strings_scenes.xml b/app/src/main/res/values-ro/strings_scenes.xml index fdecaeb15..27ee3a272 100644 --- a/app/src/main/res/values-ro/strings_scenes.xml +++ b/app/src/main/res/values-ro/strings_scenes.xml @@ -1,6 +1,6 @@ - - Scenes + + Scenes diff --git a/app/src/main/res/values-ro/strings_server.xml b/app/src/main/res/values-ro/strings_server.xml index 26e05c969..6fe90c168 100644 --- a/app/src/main/res/values-ro/strings_server.xml +++ b/app/src/main/res/values-ro/strings_server.xml @@ -1,9 +1,9 @@ - Choose server - Don\'t save new server? - Server name must be unique - "Switching server to %1$s" - Can\'t disable the default server + Choose server + Don\'t save new server? + Server name must be unique + "Switching server to %1$s" + Can\'t disable the default server diff --git a/app/src/main/res/values-ro/strings_settings.xml b/app/src/main/res/values-ro/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-ro/strings_settings.xml +++ b/app/src/main/res/values-ro/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-ro/strings_speech.xml b/app/src/main/res/values-ro/strings_speech.xml index 5ab72e077..5b47a9449 100644 --- a/app/src/main/res/values-ro/strings_speech.xml +++ b/app/src/main/res/values-ro/strings_speech.xml @@ -1,15 +1,15 @@ - Speech is not supported on this device - Register a Speech Command - New Speech Command found - Edit Speech Command - Give this Speech Command a proper name. - Speech Command already registered. - Saved a New Speech Command. - Do a new voice command. - Speech - Speech Command disabled, please setup via settings. - For Speech Command to have effect, a switch should be linked + Speech is not supported on this device + Register a Speech Command + New Speech Command found + Edit Speech Command + Give this Speech Command a proper name. + Speech Command already registered. + Saved a New Speech Command. + Do a new voice command. + Speech + Speech Command disabled, please setup via settings. + For Speech Command to have effect, a switch should be linked diff --git a/app/src/main/res/values-ro/strings_switches.xml b/app/src/main/res/values-ro/strings_switches.xml index 50958886f..c8373214f 100644 --- a/app/src/main/res/values-ro/strings_switches.xml +++ b/app/src/main/res/values-ro/strings_switches.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Switches - N/A - IDX - 255 - Color set for - State set for - Could not set favorite - Could not find any logs to show - Could not change the color - Could not change the state - Could not show the timers - Could not show the notifications - "Setting level for switch: %1$s to %2$d" + + Switches + N/A + IDX + 255 + Color set for + State set for + Could not set favorite + Could not find any logs to show + Could not change the color + Could not change the state + Could not show the timers + Could not show the notifications + "Setting level for switch: %1$s to %2$d" diff --git a/app/src/main/res/values-ro/strings_temperature.xml b/app/src/main/res/values-ro/strings_temperature.xml index 129d20825..ec9a3963e 100644 --- a/app/src/main/res/values-ro/strings_temperature.xml +++ b/app/src/main/res/values-ro/strings_temperature.xml @@ -1,10 +1,10 @@ - - Temperature - Cancel override - Wind - Could not get log data for - Follow schedule + + Temperature + Cancel override + Wind + Could not get log data for + Follow schedule diff --git a/app/src/main/res/values-ro/strings_utilities.xml b/app/src/main/res/values-ro/strings_utilities.xml index d123a7e24..66b2e965e 100644 --- a/app/src/main/res/values-ro/strings_utilities.xml +++ b/app/src/main/res/values-ro/strings_utilities.xml @@ -1,7 +1,7 @@ - - Utilities - Set + + Utilities + Set diff --git a/app/src/main/res/values-ro/strings_vars.xml b/app/src/main/res/values-ro/strings_vars.xml index 2e4c2c1f1..388880025 100644 --- a/app/src/main/res/values-ro/strings_vars.xml +++ b/app/src/main/res/values-ro/strings_vars.xml @@ -1,8 +1,8 @@ - - User Variables - Input value is not valid - Failed to update user variable + + User Variables + Input value is not valid + Failed to update user variable diff --git a/app/src/main/res/values-ro/strings_weather.xml b/app/src/main/res/values-ro/strings_weather.xml index 9bc28a7eb..a41cd4d07 100644 --- a/app/src/main/res/values-ro/strings_weather.xml +++ b/app/src/main/res/values-ro/strings_weather.xml @@ -1,19 +1,19 @@ - - Weather - Dew point - Temp - Pressure - Chill - Direction - Hum - Speed - Forecast - Rain - Rain Rate - CO2 - CO2 Min - CO2 Max + + Weather + Dew point + Temp + Pressure + Chill + Direction + Hum + Speed + Forecast + Rain + Rain Rate + CO2 + CO2 Min + CO2 Max diff --git a/app/src/main/res/values-ro/strings_welcome.xml b/app/src/main/res/values-ro/strings_welcome.xml index 4563aa51f..9ac3f0924 100644 --- a/app/src/main/res/values-ro/strings_welcome.xml +++ b/app/src/main/res/values-ro/strings_welcome.xml @@ -1,55 +1,54 @@ - - Welcome - Domoticz is a Home Automation System that lets you monitor + + Welcome + Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device. - Swipe to the right or use the navigation buttons at the bottom to continue - The next page is for your Domoticz settings. - - You can specify a local and a remote server setting. + Swipe to the right or use the navigation buttons at the bottom to continue + The next page is for your Domoticz settings. + You can specify a local and a remote server setting. The local settings are for when you are connected to your home wifi network. Remote settings are used when not connected to your home wifi network or when connected to cellular data (2G, 3G, 4G etc). - Verifying your connection settings - Connection data incomplete or empty - URL should not start with http - Please correct the data on the previous page - Domoticz version - %1$d devices found - No wifi SSID\'s found - Select home SSID\'s - Add home SSID\'s - Server settings - Start screen - next - prev - finish - Server address - Protocol - Port - Username - Password - Directory - Remote - Local - Server Name - Different server address - Use different address for local connection - Advanced server settings - Only used for non-standard Domoticz servers - Local wifi SSID\'s - Local server address - Local protocol - Local port - Local directory (leave empty if not used) - Local username (leave empty if not used) - Local password (leave empty if not used) - - HTTP - HTTPS - + Verifying your connection settings + Connection data incomplete or empty + URL should not start with http + Please correct the data on the previous page + Domoticz version + %1$d devices found + No wifi SSID\'s found + Select home SSID\'s + Add home SSID\'s + Server settings + Start screen + next + prev + finish + Server address + Protocol + Port + Username + Password + Directory + Remote + Local + Server Name + Different server address + Use different address for local connection + Advanced server settings + Only used for non-standard Domoticz servers + Local wifi SSID\'s + Local server address + Local protocol + Local port + Local directory (leave empty if not used) + Local username (leave empty if not used) + Local password (leave empty if not used) + + HTTP + HTTPS + diff --git a/app/src/main/res/values-ro/strings_widgets.xml b/app/src/main/res/values-ro/strings_widgets.xml index d86c8b435..cda5dbed8 100644 --- a/app/src/main/res/values-ro/strings_widgets.xml +++ b/app/src/main/res/values-ro/strings_widgets.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Pick a device - Choose device - No security panel found under your switches - Failed to get devices - Failed to toggle device - "Switch device" - Loading... - GO - Background - Dark - Light - Dark Transparent - Light Transparent + + Pick a device + Choose device + No security panel found under your switches + Failed to get devices + Failed to toggle device + "Switch device" + Loading... + GO + Background + Dark + Light + Dark Transparent + Light Transparent diff --git a/app/src/main/res/values-ro/strings_wizard.xml b/app/src/main/res/values-ro/strings_wizard.xml index 2c5caaed8..3a064b003 100644 --- a/app/src/main/res/values-ro/strings_wizard.xml +++ b/app/src/main/res/values-ro/strings_wizard.xml @@ -21,42 +21,42 @@ ~ under the License. --> - - Welcome Wizard - Welcome - Domoticz is a very light weight home automation system that lets you monitor and configure various devices. - Favorites - You can add devices to the Dashboard by saving them as favorites. Long click an item to save them as favorite! - Startup screen - You can set your startup screen in the settings! - Setup Notifications - You can now receive Notifications on your Android device! Change the way how notifications behave in the settings - Using Multiple Servers - You can configure multiple Domoticz servers in the settings. - Geofencing - You can set your startup screen in the settings! - Android Wear - You can specify which switches you would like to control from your Android wear device! - Android Auto - Receive the Domoticz notifications right on your Android Auto device! - Graphs - You can see the history graph of an Utility, Weather or Temperature! - Filters - You can filter devices per status (on/off). Check the right upper menu icon for filtering! - Widgets!! - You can put some widgets on your home screen! - Disable Wizard - You can now remove this Wizard from the navigation menu! - NFC - You are able to toggle switches via NFC! - QR Code - Toggle switches by scanning a QR Code (or barcode)! - Speech Commands - Toggle switches with your voice! Configure speech commands via the settings screens and connect switches. - Nice - Switches - Settings - Remove - Utilities - Done + + Welcome Wizard + Welcome + Domoticz is a very light weight home automation system that lets you monitor and configure various devices. + Favorites + You can add devices to the Dashboard by saving them as favorites. Long click an item to save them as favorite! + Startup screen + You can set your startup screen in the settings! + Setup Notifications + You can now receive Notifications on your Android device! Change the way how notifications behave in the settings + Using Multiple Servers + You can configure multiple Domoticz servers in the settings. + Geofencing + You can set your startup screen in the settings! + Android Wear + You can specify which switches you would like to control from your Android wear device! + Android Auto + Receive the Domoticz notifications right on your Android Auto device! + Graphs + You can see the history graph of an Utility, Weather or Temperature! + Filters + You can filter devices per status (on/off). Check the right upper menu icon for filtering! + Widgets!! + You can put some widgets on your home screen! + Disable Wizard + You can now remove this Wizard from the navigation menu! + NFC + You are able to toggle switches via NFC! + QR Code + Toggle switches by scanning a QR Code (or barcode)! + Speech Commands + Toggle switches with your voice! Configure speech commands via the settings screens and connect switches. + Nice + Switches + Settings + Remove + Utilities + Done diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index fa00b89b5..abdd9c877 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -33,8 +33,8 @@ Выключен Закрыто Открыто - Lock - Unlock + Заблокировано + Разблокировано Журнал День Неделя @@ -45,17 +45,17 @@ Цвет Включить Выключить - Full light - Night light - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end - Civil twilight start - Civil twilight end - Nautical twilight start - Nautical twilight end + Полный свет + Ночной свет + Рассвет + Закат + Сейчас + Начало астрономических сумерек + Окончание астрономических сумерек + Начало сумерек + Окончание сумерек + Начало морских сумерек + Окончание морских сумерек Последнее посещение Уровень сигнала Уровень батареи @@ -63,7 +63,7 @@ Аппаратное обеспечение Температура Статус - RGB color or warm white + RGB цвет или теплый белый Уставка Установка минимального значения Минимальная температура, которую можно задать для термостата @@ -101,8 +101,8 @@ %1$s удалено Включение переключателя Выключение переключателя - Turning switch to night light - Turning switch to full light + Переключить в ночной свет + Переключить в полный свет Поднять занавески Опустить занавески Остановить занавески @@ -126,8 +126,11 @@ Продолжить? Не удается удалить сервер по умолчанию Перезагрузите устройство для вступления в силу языковых параметров - All - Normal - Status - Error + Все + Нормальный + Статус + Ошибка + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-ru/strings_actions.xml b/app/src/main/res/values-ru/strings_actions.xml index 8d3424606..8c9a6c739 100644 --- a/app/src/main/res/values-ru/strings_actions.xml +++ b/app/src/main/res/values-ru/strings_actions.xml @@ -28,6 +28,6 @@ Старт Пауза Отсканировать QR-код - Show paired devices + Показать подключенные устройства Распознавание речи diff --git a/app/src/main/res/values-ru/strings_bluetooth.xml b/app/src/main/res/values-ru/strings_bluetooth.xml index e8efb3b7d..a08fd94e5 100644 --- a/app/src/main/res/values-ru/strings_bluetooth.xml +++ b/app/src/main/res/values-ru/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + Bluetooth не поддерживается на этом устройстве + Подключить Bluetooth устройство + Новое Bluetooth устройство найдено + Редактировать Bluetooth устройство + Присвойте правильное имя Bluetooth устройству. + Проверьте список подключенных Bluetooth устройств. + Bluetooth устройство уже настроено в Domoticz. + Включите Bluetooth в настройках вашего устройства. + Bluetooth соединение сохранено. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Bluetooth автоматизация отключена, пожалуйста включите в настройках. + Для автоматизации Bluetooth устройств в Domoticz, переключатель должен привязан к Bluetooth diff --git a/app/src/main/res/values-ru/strings_cameras.xml b/app/src/main/res/values-ru/strings_cameras.xml index bbe109cd2..0b241cca7 100644 --- a/app/src/main/res/values-ru/strings_cameras.xml +++ b/app/src/main/res/values-ru/strings_cameras.xml @@ -1,6 +1,6 @@ - - Камеры + + Камеры diff --git a/app/src/main/res/values-ru/strings_dashboard.xml b/app/src/main/res/values-ru/strings_dashboard.xml index 82931ae61..d6bef408c 100644 --- a/app/src/main/res/values-ru/strings_dashboard.xml +++ b/app/src/main/res/values-ru/strings_dashboard.xml @@ -1,11 +1,11 @@ - - Панель управления - Использование - Сегодня - Всего - Добавлено в панель инструментов. - удалено из панели инструментов. + + Панель управления + Использование + Сегодня + Всего + Добавлено в панель инструментов. + удалено из панели инструментов. diff --git a/app/src/main/res/values-ru/strings_errors.xml b/app/src/main/res/values-ru/strings_errors.xml index 543ea11d7..b1cbceb48 100644 --- a/app/src/main/res/values-ru/strings_errors.xml +++ b/app/src/main/res/values-ru/strings_errors.xml @@ -1,11 +1,11 @@ - - Неверные учетные данные - Превышено время ожидания или нет соединения - Ошибка сервера - Ошибка сети, код статуса %1$d - Ошибка анализа - Ошибка: не подключен к сети + + Неверные учетные данные + Превышено время ожидания или нет соединения + Ошибка сервера + Ошибка сети, код статуса %1$d + Ошибка анализа + Ошибка: не подключен к сети diff --git a/app/src/main/res/values-ru/strings_events.xml b/app/src/main/res/values-ru/strings_events.xml index 9019b8ccc..85ea330eb 100644 --- a/app/src/main/res/values-ru/strings_events.xml +++ b/app/src/main/res/values-ru/strings_events.xml @@ -1,7 +1,7 @@ - - События - Это действие пока не поддерживается! + + События + Это действие пока не поддерживается! diff --git a/app/src/main/res/values-ru/strings_into.xml b/app/src/main/res/values-ru/strings_into.xml deleted file mode 100644 index 972b6e2fb..000000000 --- a/app/src/main/res/values-ru/strings_into.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Home Automation app для управления домашней техникой, чтобы сделать Ваш дом умнее - Управляйте и контролируйте устройства в вашем доме такие как: свет, выключатели, вентиляторы, различные датчики в том числе температуры, осадков, ветра, ультрафиолетового излучения, использование электроэнергии, расход газа, воды и гораздо больше при помощи самой крутой системы автоматизации «Domoticz - Home Automation». Приложение автоматизирует все устройства в вашем доме, и вы можете контролировать его через мобильное устройство из любого места. Включить или выключить свет в спальне, сидя в гостиной. «Domoticz - Home Automation» app поддерживает NFC и позволяет вам переключиться на AC или другие приборы, когда вы направляетесь домой. Через гео-позиционирование приложение может определить ваше местоположение и соответственно предупреждает вас об управлении устройствами. -Приложение «Domoticz» имеет отличный пользовательский интерфейс с легкими элементами управления. Приложение также поддерживает виджеты, которые помогают вам управлять с экрана вашего мобильного телефона, непосредственно экономя ваше время, чтобы включить или выключить устройство. Приложение идеально подходит для того чтобы избежать ненужное потребление электроэнергии, тем самым экономя деньги. «Domoticz» app поддерживает функцию входа посредством распознавания отпечатка пальца для обеспечения безопасности ваших устройств. -Следите за расходом газа и потреблением электроэнергии через ваше мобильное устройство и настройте их использование согласно вашим требованиям и бюджету. Приложение поможет планировать ваш ежемесячный бюджет исходя из расхода различными устройствами. Приложение также отправляет уведомления на любое настроенное мобильное устройство для предупреждения об использовании и потреблении энергии. - -************************** -Особенности Премиум версии -************************** - -- поддержка NFC - переключатели через NFC Теги -- геозонирование, включает свет когда вы почти дома -- Android Wear, поможет контролировать ваш дом движением руки -- виджеты, установите виджеты на ваш домашний экран -- конфигурация нескольких серверов, подключите несколько серверов domoticz через одно приложение -- доступа через распознавание отпечатка пальца -- улучшенная кастомизация -- функции Talkback -- уведомления -- будильник -Приложение «Domoticz - Home Automation» совместим с Android смартфонами, планшетами и любыми устройствами Android. Сделайте ваш дом умным! Настройте несколько серверов для легкого и эффективного использования приложения. Скачайте приложение «Domoticz» и живите умнее! - -************************** -Сказать привет -************************** - -Мы постоянно работаем над тем чтобы сделать «Domoticz - Home Automation» лучше и более полезным для вас. Пожалуйста, не стесняйтесь, напишите нам о любых предложениях, проблемах, или если вы просто хотите сказать привет. Если вы понравилась одна из функций «Domoticz - Home Automation» оцените нас на Play Store и перешлите информацию о нас вашим друзьям. - - diff --git a/app/src/main/res/values-ru/strings_locations.xml b/app/src/main/res/values-ru/strings_locations.xml index f304fd0bd..1266a8830 100644 --- a/app/src/main/res/values-ru/strings_locations.xml +++ b/app/src/main/res/values-ru/strings_locations.xml @@ -21,45 +21,45 @@ ~ under the License. --> - - Добавить местоположение - Изменить местоположение - Долгота - Широта - Радиус (в метрах) - Подключенный переключатель - Не удалось получить все переключатели, пожалуйста, попробуйте снова - DEL - Удалить - Имя местоположения - Текущее местоположение - Вручную - GET - Адрес - Неизвестно - Недоступно - Недопустимые широта и долгота - Запуск службы Geofence - Местоположение не найдено, пожалуйста, попробуйте снова. - Услуги Google Play недоступны. - Местоположение не найдено. - Geofencing - Включить Geofencing - Включить и настроить Geofencing - Включить уведомления - Включить уведомления для инициирования событий - Место: %s - "Ввод %1$s" - Оставляя %1$s - Ввод одного из мест - Оставляя одно место - Из-за изменений на Geofencing пожалуйста восстановите ваши места - Переключатель не выбран - Чтобы GeoFencing функционировал необходимо подключение к GeoFence - Подключить? - Geofencing отключено - Услуга геозонирования сейчас не доступна - Приложение зарегистрировало слишком много геозон - Получено слишком много PendingIntents - Неизвестная ошибка + + Добавить местоположение + Изменить местоположение + Долгота + Широта + Радиус (в метрах) + Подключенный переключатель + Не удалось получить все переключатели, пожалуйста, попробуйте снова + DEL + Удалить + Имя местоположения + Текущее местоположение + Вручную + GET + Адрес + Неизвестно + Недоступно + Недопустимые широта и долгота + Запуск службы Geofence + Местоположение не найдено, пожалуйста, попробуйте снова. + Услуги Google Play недоступны. + Местоположение не найдено. + Geofencing + Включить Geofencing + Включить и настроить Geofencing + Включить уведомления + Включить уведомления для инициирования событий + Место: %s + "Ввод %1$s" + Оставляя %1$s + Ввод одного из мест + Оставляя одно место + Из-за изменений на Geofencing пожалуйста восстановите ваши места + Переключатель не выбран + Чтобы GeoFencing функционировал необходимо подключение к GeoFence + Подключить? + Geofencing отключено + Услуга геозонирования сейчас не доступна + Приложение зарегистрировало слишком много геозон + Получено слишком много PendingIntents + Неизвестная ошибка diff --git a/app/src/main/res/values-ru/strings_logs.xml b/app/src/main/res/values-ru/strings_logs.xml index 6047662ac..526370db7 100644 --- a/app/src/main/res/values-ru/strings_logs.xml +++ b/app/src/main/res/values-ru/strings_logs.xml @@ -1,6 +1,6 @@ - - Журналы + + Журналы diff --git a/app/src/main/res/values-ru/strings_nfc.xml b/app/src/main/res/values-ru/strings_nfc.xml index cbb2afb23..8afde9cc9 100644 --- a/app/src/main/res/values-ru/strings_nfc.xml +++ b/app/src/main/res/values-ru/strings_nfc.xml @@ -1,13 +1,13 @@ - NFC не поддерживается на этом устройстве - Зарегистрируйте тег NFC - Найден новый тег NFC - Редактирование тега NFC - Присвойте имя NFC. - NFC тег уже зарегистрирован. - Новый тег NFC сохранен. - NFC - Для принятия NFC необходимо увязать переключатель с NFC тегом + NFC не поддерживается на этом устройстве + Зарегистрируйте тег NFC + Найден новый тег NFC + Редактирование тега NFC + Присвойте имя NFC. + NFC тег уже зарегистрирован. + Новый тег NFC сохранен. + NFC + Для принятия NFC необходимо увязать переключатель с NFC тегом diff --git a/app/src/main/res/values-ru/strings_notifications.xml b/app/src/main/res/values-ru/strings_notifications.xml index fe5402cd9..57bbef4e8 100644 --- a/app/src/main/res/values-ru/strings_notifications.xml +++ b/app/src/main/res/values-ru/strings_notifications.xml @@ -1,11 +1,11 @@ - Приоритет - Аварийный режим - Высокий - Низкий - Очень низкий - Все системы - Системы + Приоритет + Аварийный режим + Высокий + Низкий + Очень низкий + Все системы + Системы diff --git a/app/src/main/res/values-ru/strings_permissions.xml b/app/src/main/res/values-ru/strings_permissions.xml index 6f5caaded..0d5616bae 100644 --- a/app/src/main/res/values-ru/strings_permissions.xml +++ b/app/src/main/res/values-ru/strings_permissions.xml @@ -1,13 +1,13 @@ - Доступ запрещен - Права доступа - Настройте установки доступа для этого приложения - Эти установки доступа к хранению нужны для сохранения файла кэша, параметров и хранения снимков с камеры. - Эти разрешения на позиционирование необходимы для геозонирования и для доступа к Wifi SSID вокруг вас! - Для включения уведомлений необходим доступ к состоянию телефона! - Для сканирования QR-кодов необходим доступ к камере! - Для распознавания голоса необходим доступ к аудио устройствам! - Доступ к распознаванию отпечатков пальцев необходим для обеспечения безопасности входа в приложение! + Доступ запрещен + Права доступа + Настройте установки доступа для этого приложения + Эти установки доступа к хранению нужны для сохранения файла кэша, параметров и хранения снимков с камеры. + Эти разрешения на позиционирование необходимы для геозонирования и для доступа к Wifi SSID вокруг вас! + Для включения уведомлений необходим доступ к состоянию телефона! + Для сканирования QR-кодов необходим доступ к камере! + Для распознавания голоса необходим доступ к аудио устройствам! + Доступ к распознаванию отпечатков пальцев необходим для обеспечения безопасности входа в приложение! diff --git a/app/src/main/res/values-ru/strings_plans.xml b/app/src/main/res/values-ru/strings_plans.xml index cf50d5866..188d72bbc 100644 --- a/app/src/main/res/values-ru/strings_plans.xml +++ b/app/src/main/res/values-ru/strings_plans.xml @@ -1,12 +1,12 @@ - - Планы - - %d устройство - %d устройство - %1d devices - %1d устройство - + + Планы + + %d устройство + %d устройство + %1d devices + %1d устройство + diff --git a/app/src/main/res/values-ru/strings_qrcode.xml b/app/src/main/res/values-ru/strings_qrcode.xml index 03f18e54a..003f6bdf7 100644 --- a/app/src/main/res/values-ru/strings_qrcode.xml +++ b/app/src/main/res/values-ru/strings_qrcode.xml @@ -1,19 +1,19 @@ - QR-код не поддерживается на этом устройстве - Зарегистрировать QR-код - Найден новый QR-код - Редактировать QR код - Дайте имя этому QR коду. - Сканировать QR-код. - QR-код, уже зарегистрирован. - Новый QR-код сохранен. - QR-код - Обнаружен новый QR-код, пожалуйста настройте его. - QR-код отключен, пожалуйста настройте его. - Для применения QR Code Scan переключатель должен быть увязан с QR-кодом - Необходим доступ к камере для считывания штрих-кода - QR-код зависимости не могут быть загружены из-за нехватки памяти - Это приложение невозможно запустить, поскольку оно не имеет доступа к камере. Приложение завершит работу. + QR-код не поддерживается на этом устройстве + Зарегистрировать QR-код + Найден новый QR-код + Редактировать QR код + Дайте имя этому QR коду. + Сканировать QR-код. + QR-код, уже зарегистрирован. + Новый QR-код сохранен. + QR-код + Обнаружен новый QR-код, пожалуйста настройте его. + QR-код отключен, пожалуйста настройте его. + Для применения QR Code Scan переключатель должен быть увязан с QR-кодом + Необходим доступ к камере для считывания штрих-кода + QR-код зависимости не могут быть загружены из-за нехватки памяти + Это приложение невозможно запустить, поскольку оно не имеет доступа к камере. Приложение завершит работу. diff --git a/app/src/main/res/values-ru/strings_scenes.xml b/app/src/main/res/values-ru/strings_scenes.xml index 5cae7e6e5..1c9583082 100644 --- a/app/src/main/res/values-ru/strings_scenes.xml +++ b/app/src/main/res/values-ru/strings_scenes.xml @@ -1,6 +1,6 @@ - - Заставки + + Заставки diff --git a/app/src/main/res/values-ru/strings_security.xml b/app/src/main/res/values-ru/strings_security.xml index 9416ae84c..6670a4c25 100644 --- a/app/src/main/res/values-ru/strings_security.xml +++ b/app/src/main/res/values-ru/strings_security.xml @@ -27,10 +27,10 @@ Вкл дома Вкл не дома Введен неверный код! - You do not have the rights for this action! + У вас нет прав для данного действия! Не удалось изменить статус панели безопасности Неправильно введен пароль, пароль учетной записи domoticz является дублирующей системой при отказе распознавания ваших отпечатков пальцев...! Показать пароль - We need to make sure its you - Touch your finger on the fingerprint sensor to authorise your account. + Нам необходимо убедиться, что это Вы + Прикоснитесь к сканеру отпечатка пальца, для входа в аккаунт. diff --git a/app/src/main/res/values-ru/strings_server.xml b/app/src/main/res/values-ru/strings_server.xml index 0d538ae79..f4c4e15f2 100644 --- a/app/src/main/res/values-ru/strings_server.xml +++ b/app/src/main/res/values-ru/strings_server.xml @@ -1,9 +1,9 @@ - Выбрать сервер - Не сохранять новый сервер? - Имя сервера должно быть уникальным - "Переключение сервера на %1$s" - Не удается отключить сервер по умолчанию + Выбрать сервер + Не сохранять новый сервер? + Имя сервера должно быть уникальным + "Переключение сервера на %1$s" + Не удается отключить сервер по умолчанию diff --git a/app/src/main/res/values-ru/strings_settings.xml b/app/src/main/res/values-ru/strings_settings.xml index 2721547f5..c02ebc529 100644 --- a/app/src/main/res/values-ru/strings_settings.xml +++ b/app/src/main/res/values-ru/strings_settings.xml @@ -29,7 +29,7 @@ Android Wear Android Auto Сервер - Geofencing + Местоположение Информация Дополнительные опции Язык @@ -38,7 +38,7 @@ Отладка Экспорт/импорт параметров Оформление - Clock + Часы NFC соединения Безопасность Учётные записи @@ -46,16 +46,16 @@ Bluetooth Голосовое управление Сброс - Contribute + Сотрудничество Экран запуска Включить/отключить элементы - Sorting - Sort devices like sorted on the server - Custom sorting, drag and drop devices to sort them - Lock - Lock the current custom sorting (disable drag/drop) + Сортировка + Сортировка устройств как на сервере + Ручная сортировка, перемещайте для построения собственного списка + Заблокировать + Заблокировать ручную сортировку (выключить перемещение) Сортировать панель в алфавитном порядке Дополнительные данные на панели мониторинга Показать дополнительные данные на панели мониторинга @@ -64,16 +64,16 @@ Блокировка экрана всегда ВКЛ Не блокировать экран всегда ВКЛ Авто-обновление - Обновлять состояние устройства каждые 5 секунд - Не обновлять состояние устройства каждые 5 секунд + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Переключатели Показать выключатели с вкл/выкл переключателем Показать выключатели с Вкл/Выкл кнопкой Сетка панели Показать панель как список Показать панель как сетку - Clock - Show a clock on the dashboard + Часы + Показывать часы на панели устройств Android Wear элементы Выбрать Wear переключатель @@ -116,10 +116,10 @@ Настройка кодов QR Включить QR коды Включение функции QR-кодов - Setup Bluetooth devices + Настройка Bluetooth устройств Enable Bluetooth functionality - You can help make our translations better, and even add new languages to this app via our Crowdin project - Translations + Вы можете помочь улучшить перевод и добавить новые Языки в приложение с помощью Crowdin project + Переводы Настройка безопасности Ввод отпечатков пальцев на старте Отключить ввод отпечатков пальцев на старте @@ -178,7 +178,7 @@ Необходимо выбрать хотя бы один элемент Обновить сервер - "Could not check for version: %1$s" + "Невозможно проверить версию: %1$s" "Невозможно проверить наличие обновлений: %1$s" "Не удалось получить конфигурацию сервера Domoticz: %1$s" Доступно обновление сервера: %1$s до версии: %2$s diff --git a/app/src/main/res/values-ru/strings_speech.xml b/app/src/main/res/values-ru/strings_speech.xml index 6e59746e5..9609763aa 100644 --- a/app/src/main/res/values-ru/strings_speech.xml +++ b/app/src/main/res/values-ru/strings_speech.xml @@ -1,15 +1,15 @@ - Голосовые команды не поддерживаются на этом устройстве - Зарегистрировать речевую команду - Найдена новая команда речи - Редактирование команды речи - Дайте этой речевой команде подходящее имя. - Голосовая команда уже зарегистрирована. - Новая речевая команда записана. - Создать новую голосовую команду. - Голосовое управление - Голосовые команды отключены, пожалуйста настройте через меню установок. - Чтобы речевая команда сработала должен быть привязан переключатель + Голосовые команды не поддерживаются на этом устройстве + Зарегистрировать голосовую команду + Найдена новая голосовая команда + Редактирование голосовой команды + Присвойте голосовой команде соответствующее название. + Голосовая команда уже зарегистрирована. + Новая голосовая команда записана. + Создать новую голосовую команду. + Голосовое управление + Голосовые команды отключены, пожалуйста настройте через меню установок. + Чтобы речевая команда сработала должен быть привязан переключатель diff --git a/app/src/main/res/values-ru/strings_switches.xml b/app/src/main/res/values-ru/strings_switches.xml index 5c9a4d38d..a3cf30658 100644 --- a/app/src/main/res/values-ru/strings_switches.xml +++ b/app/src/main/res/values-ru/strings_switches.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Переключатели - Недоступно - IDX - 255 - Цвета для - Состояние включено для - Не удалось установить любимые - Не удалось найти какие-либо журналы - Не удалось изменить цвет - Не удалось изменить состояние - Не удалось показать таймеры - Не удаётся показать уведомления - "Установка уровня переключателя: %1$s для %2$d" + + Переключатели + Недоступно + IDX + 255 + Цвета для + Состояние включено для + Не удалось установить любимые + Не удалось найти какие-либо журналы + Не удалось изменить цвет + Не удалось изменить состояние + Не удалось показать таймеры + Не удаётся показать уведомления + "Установка уровня переключателя: %1$s для %2$d" diff --git a/app/src/main/res/values-ru/strings_temperature.xml b/app/src/main/res/values-ru/strings_temperature.xml index f5c791e69..cc91694d1 100644 --- a/app/src/main/res/values-ru/strings_temperature.xml +++ b/app/src/main/res/values-ru/strings_temperature.xml @@ -1,10 +1,10 @@ - - Температура - Отменить перезапись - Ветер - Не удалось получить данные журнала для - Следовать расписанию + + Температура + Отменить перезапись + Ветер + Не удалось получить данные журнала для + Следовать расписанию diff --git a/app/src/main/res/values-ru/strings_timer.xml b/app/src/main/res/values-ru/strings_timer.xml index a2e920c13..ee164baec 100644 --- a/app/src/main/res/values-ru/strings_timer.xml +++ b/app/src/main/res/values-ru/strings_timer.xml @@ -26,10 +26,10 @@ Тип Недоступно Перед закатом - После захода солнца + После заката Вовремя - Перед восходом солнца - После восхода солнца + Перед восходом + После восхода Фиксированная дата/время Нечетные числа Четные числа @@ -39,28 +39,28 @@ Ежемесячно (по будням) Ежегодно Ежегодно (по будням) - Before Sun at South - After Sun at South - Before Civil Twilight Start - After Civil Twilight Start - Before Civil Twilight End - After Civil Twilight End - Before Nautical Twilight Start - After Nautical Twilight Start - Before Nautical Twilight End - After Nautical Twilight End - Before Austronomical Twilight Start - After Austronomical Twilight Start - Before Austronomical Twilight End - After Austronomical Twilight End + До солнца на Юге + После солнца на Юге + До начала сумерек + После начала сумерек + До окончания сумерек + После окончания сумерек + До начала морских сумерек + После начала морских сумерек + До окончания морских сумерек + После окончания морских сумерек + До начала астрономических сумерек + После начала астрономических сумерек + До окончания астрономических сумерек + После окончания астрономических сумерек Ежедневно Рабочие дни Выходные - Иное + Другое Таймеры - First - Second - Third - Fourth - Last + Первый + Второй + Третий + Четвертый + Последний diff --git a/app/src/main/res/values-ru/strings_utilities.xml b/app/src/main/res/values-ru/strings_utilities.xml index f554667cc..bb5805956 100644 --- a/app/src/main/res/values-ru/strings_utilities.xml +++ b/app/src/main/res/values-ru/strings_utilities.xml @@ -1,7 +1,7 @@ - - Утилиты - Установить + + Утилиты + Установить diff --git a/app/src/main/res/values-ru/strings_vars.xml b/app/src/main/res/values-ru/strings_vars.xml index 24be34d9f..58c8368b5 100644 --- a/app/src/main/res/values-ru/strings_vars.xml +++ b/app/src/main/res/values-ru/strings_vars.xml @@ -1,8 +1,8 @@ - - Пользовательские переменные - Введено недопустимое значение - Не удалось обновить пользовательскую переменную + + Пользовательские переменные + Введено недопустимое значение + Не удалось обновить пользовательскую переменную diff --git a/app/src/main/res/values-ru/strings_weather.xml b/app/src/main/res/values-ru/strings_weather.xml index 3cb99149c..40dafa473 100644 --- a/app/src/main/res/values-ru/strings_weather.xml +++ b/app/src/main/res/values-ru/strings_weather.xml @@ -1,19 +1,19 @@ - - Погода - Точка росы - Температура - Давление - Холод - Направление - Влажность - Скорость - Прогноз - Дождь - Сила дождя - CO2 - CO2 мин - CO2 макс + + Погода + Точка росы + Температура + Давление + Холод + Направление + Влажность + Скорость + Прогноз + Дождь + Сила дождя + CO2 + CO2 мин + CO2 макс diff --git a/app/src/main/res/values-ru/strings_welcome.xml b/app/src/main/res/values-ru/strings_welcome.xml index 947d87622..249d48e58 100644 --- a/app/src/main/res/values-ru/strings_welcome.xml +++ b/app/src/main/res/values-ru/strings_welcome.xml @@ -1,51 +1,50 @@ - - Добро пожаловать - Domoticz это домашняя система автоматизации, которая позволяет контролировать и настраивать различные устройства, такие как: свет, переключатели, различные датчики такие как температуры, дождя, ветера, электричества, газа, воды и многое другое. Предупреждения/уведомления могут быть отправлены на любое мобильное устройство. - Проведите пальцем вправо или используйте кнопки перехода внизу для продолжения - Следующая страница предназначена для настройки Domoticz. - - Вы можете указать установки для локального и удаленного сервера. + + Добро пожаловать + Domoticz это домашняя система автоматизации, которая позволяет контролировать и настраивать различные устройства, такие как: свет, переключатели, различные датчики такие как температуры, дождя, ветера, электричества, газа, воды и многое другое. Предупреждения/уведомления могут быть отправлены на любое мобильное устройство. + Проведите пальцем вправо или используйте кнопки перехода внизу для продолжения + Следующая страница предназначена для настройки Domoticz. + Вы можете указать установки для локального и удаленного сервера. Локальные параметры предназначены для подключения через домашней wifi сеть. Параметры удаленного сервера используются, когда нет подключения через Вашу домашнюю wifi сеть или при подключении к сотовой сети (2G, 3G, 4G и т.д.). - Проверка настроек подключения - Данные подключения, неполные или пустые - URL-адрес не должен начинаться с http - Пожалуйста, исправьте данные на предыдущей странице - Версия Domoticz - Устройство %1$d не найдено - Не нейдено SSID wifi - Выберите домашний SSID - Добавьте домашние SSID - Параметры сервера - Начальный экран - следующий - предыдущий - Готово - Адрес сервера - Протокол - Порт - Имя пользователя - Пароль - Каталог - Удаленный - Локальный - Имя сервера - Адрес другого сервера - Используйте другой адрес для локального подключения - Дополнительные установки сервера - Используется только для нестандартных серверов Domoticz - Местные SSID wifi - Адрес локального сервера - Локальный протокол - Локальный порт - Локальный каталог (оставить пустым, если не используется) - Локальное имя пользователя (оставьте пустым если не используется) - Локальный пароль (оставить пустым если не используется) - - HTTP - HTTPS - + Проверка настроек подключения + Данные подключения, неполные или пустые + URL-адрес не должен начинаться с http + Пожалуйста, исправьте данные на предыдущей странице + Версия Domoticz + Устройство %1$d не найдено + Не нейдено SSID wifi + Выберите домашний SSID + Добавьте домашние SSID + Параметры сервера + Начальный экран + следующий + предыдущий + Готово + Адрес сервера + Протокол + Порт + Имя пользователя + Пароль + Каталог + Удаленный + Локальный + Имя сервера + Адрес другого сервера + Используйте другой адрес для локального подключения + Дополнительные установки сервера + Используется только для нестандартных серверов Domoticz + Местные SSID wifi + Адрес локального сервера + Локальный протокол + Локальный порт + Локальный каталог (оставить пустым, если не используется) + Локальное имя пользователя (оставьте пустым если не используется) + Локальный пароль (оставить пустым если не используется) + + HTTP + HTTPS + diff --git a/app/src/main/res/values-ru/strings_widgets.xml b/app/src/main/res/values-ru/strings_widgets.xml index cf77f824c..a32f41abc 100644 --- a/app/src/main/res/values-ru/strings_widgets.xml +++ b/app/src/main/res/values-ru/strings_widgets.xml @@ -21,18 +21,18 @@ ~ under the License. --> - - Выбрать устройство - Выбрать устройство - Не найдена панель безопасности - Не удалось получить устройства - Не удалось переключить устройство - "Переключить устройство" - Загрузка... - ПЕРЕЙТИ - Фон - Темно - Светло - Темный прозрачный - Светлый прозрачный + + Выбрать устройство + Выбрать устройство + Не найдена панель безопасности + Не удалось получить устройства + Не удалось переключить устройство + "Переключить устройство" + Загрузка... + ПЕРЕЙТИ + Фон + Темно + Светло + Темный прозрачный + Светлый прозрачный diff --git a/app/src/main/res/values-ru/strings_wizard.xml b/app/src/main/res/values-ru/strings_wizard.xml index 11f80a97f..b15d9e85e 100644 --- a/app/src/main/res/values-ru/strings_wizard.xml +++ b/app/src/main/res/values-ru/strings_wizard.xml @@ -21,42 +21,42 @@ ~ under the License. --> - - Установщик приветствия - Добро пожаловать - Domoticz является легковесной системой домашней автоматизации, которая позволяет контролировать и настраивать различные устройства. - Избранные - Устройства можно добавить на панель мониторинга, сохранив их как избранные. Долго нажмите на элемент, чтобы сохранить его как любимый! - Начальный экран - Вы можете установить начальный экран в настройках! - Настройка уведомлений - Теперь вы можете получать уведомления на Вашем устройстве! Изменить настройки уведомлений - Использование нескольких серверов - В настройках можно настроить несколько серверов Domoticz. - Geofencing - Вы можете установить начальный экран в настройках! - Android Wear - Вы можете указать, какие переключатели Вы хотите контроллировать через Android wear! - Android Auto - Получаете уведомления от Domoticz прямо на вашем устройстве Android авто! - Графики - Доступен график истории Утилит. Погоды или температуры! - Фильтры - Вы можете фильтровать устройства по состоянию (вкл. / выкл.). Для этого есть специальный значок в правом верхнем меню! - Виджеты!! - Вы можете поместить некоторые виджеты на Ваш стартовый экран! - Отключить мастер - Теперь вы можете удалить этот Мастер из меню навигации! - NFC - Вы можете изменить переключения через NFC! - QR-код - Переключите тумблеры сканируя QR-код (или штрихкод)! - Голосовые команды - Активируйте переключатели вашим голосом! Сконфигурируйте речевые команды через экраны настройки и подключите переключатели. - Отлично! - Переключатели - Настройки - Удалить - Утилиты - Готово + + Установщик приветствия + Добро пожаловать + Domoticz является легковесной системой домашней автоматизации, которая позволяет контролировать и настраивать различные устройства. + Избранные + Устройства можно добавить на панель мониторинга, сохранив их как избранные. Долго нажмите на элемент, чтобы сохранить его как любимый! + Начальный экран + Вы можете установить начальный экран в настройках! + Настройка уведомлений + Теперь вы можете получать уведомления на Вашем устройстве! Изменить настройки уведомлений + Использование нескольких серверов + В настройках можно настроить несколько серверов Domoticz. + Geofencing + Вы можете установить начальный экран в настройках! + Android Wear + Вы можете указать, какие переключатели Вы хотите контроллировать через Android wear! + Android Auto + Получаете уведомления от Domoticz прямо на вашем устройстве Android авто! + Графики + Доступен график истории Утилит. Погоды или температуры! + Фильтры + Вы можете фильтровать устройства по состоянию (вкл. / выкл.). Для этого есть специальный значок в правом верхнем меню! + Виджеты!! + Вы можете поместить некоторые виджеты на Ваш стартовый экран! + Отключить мастер + Теперь вы можете удалить этот Мастер из меню навигации! + NFC + Вы можете изменить переключения через NFC! + QR-код + Переключите тумблеры сканируя QR-код (или штрихкод)! + Голосовые команды + Активируйте переключатели вашим голосом! Сконфигурируйте речевые команды через экраны настройки и подключите переключатели. + Отлично! + Переключатели + Настройки + Удалить + Утилиты + Готово diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 35af5ae7e..4ad666166 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-sk/strings_into.xml b/app/src/main/res/values-sk/strings_into.xml deleted file mode 100644 index 39ecb933f..000000000 --- a/app/src/main/res/values-sk/strings_into.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Aplikácia pre ovládanie zariadení domácej automatizácie a \"smart\" život - Riadenie a monitorovanie domácich zariadení ako svetlá, spínače, ventilátory, rôzne senzory ako teplomery, zrážkomery, rýchlosť a smer vetra, senzory ultrafialového (UV) žiarenia, výrobu a využitie elektriny, spotreby plynu, spotreby vody a oveľa viac na dosah ruky s najviac najúžasnejší automatizačného systému \"Domoticz - domáca automatizácia\". Aplikácia automatizuje každý spotrebič v domácnosti a môžete ho ovládať prostredníctvom mobilného zariadenia z ľubovoľného miesta. Zapnite alebo vypnite svetlá v spálni z pohovky v obývacej izbe. \"Domoticz - domáca automatizácia\" aplikácia podporuje technológiu NFC a umožňuje spínanie spotrebičov pred Vašim príchodom domov. Prostredníctvom služby \"geo fencing\" môže zistiť vašu polohu a upozorňovať Vás s riadením zariadení. -Aplikácia \"Domoticz\" má výborné používateľské rozhranie a jednoduché užívateľské ovládanie. Aplikácia podporuje aj widgety, ktoré Vám pomáhajú kontrolovať zariadenia priamo z obrazovky mobilných zariadení a šetria váš čas na zapnutie alebo vypnutie zariadenia. Aplikácia je perfektná na šetrenie zbytočnej elektrickej spotreby, čím šetrí Vaše peniaze. Aplikácia \"Domoticz\" podporuje funkciu otlačkov prstov pre zaistitenie bezpečnosti Vašich zariadení. -Moniturujte spotrebu vody, plynu a elektrickej energie zo svojho mobilného zariadenia a nastavte spotreby podľa vašich požiadaviek a rozpočtu. Aplikáciu je najlepšia na plánovanie Vášho mesačného rozpočtu cez rôzne zariadenia. Aplikácia tiež odošle \"push\" oznámenia na akékoľvek nakonfigurované mobilné zariadenie a upozorní Vás na spotrebu a odber zariadení. -*** -KĽÚČOVÉ FUNKCIE PRÉMIOVEJ VERZIE -*** -- Podpora NFC - Páčkové prepínače cez NFC Tagy -- Geofencing (viacnásobné), zapnite svetlá keď prichádzate domov -- Zariadenie Android Wear, ovládajte Váš domov zo zápästia -- Widgety, widgety na Vašej obrazovke -- Konfigurácia viacerých serverov, pripojenie viacerých domoticz serverov s jednou aplikáciou -- Zabezpečenie opdtlačkom prstov -- Vlastné zobrazenia -- Talkback funkcie -- Notifikácie -- Alarmy - -\"Domoticz - domáca automatizácia\" je kompatibilný s všetkými Android smart telefónmi, Tabletmi a zariadeniami Android Wear. Buďte chytrí.! Konfigurujte viaceré servery pre jednoduché a účinné používanie aplikácie. Stiahnite si aplikáciu inteligentného automatického ovládača zariadení \"Domoticz\" a žite jednoduchší život! - *** -POVEDZ AHOJ -*** -Neustále pracujeme tvrdo na tom, aby bol Domoticz - Home Automation app lepší a užitočnejšie pre Vás. Prosím, neváhajte nás kontaktovať emailom s dotazmi, návrhmi, alemo problémami, alebo ak chcete len pozdraviť. Ak sa Vám páči nejaká z funkcií Domoticz - Home Automation app, ohodnodte nás na Google Play a zdieľate nás medzi priateľmi. - - diff --git a/app/src/main/res/values-sk/strings_settings.xml b/app/src/main/res/values-sk/strings_settings.xml index 8a91fbcb2..0ee027336 100644 --- a/app/src/main/res/values-sk/strings_settings.xml +++ b/app/src/main/res/values-sk/strings_settings.xml @@ -64,8 +64,8 @@ Vždy zamknúť obrazovku Nezamykať obrazovku Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Prepínače Zobraziť prepínače s on/off prepínačom Zobraziť prepínače s on/off tlačidlom diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index 0525a4f36..59a289391 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-sl/strings_into.xml b/app/src/main/res/values-sl/strings_into.xml deleted file mode 100644 index ffeb0a295..000000000 --- a/app/src/main/res/values-sl/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Aplikacija za nadzor domačih naprav, in s tem udobnejšega življenja - Nadzor in spremljanje vaših domačih naprav, kot so: luči, stikala, ventilatorji, razni senzorji/merilniki, kot so temperatura, padavine, veter, ultravijolično (UV) sevanje, poraba/proizvodnja električne energije, poraba plina, poraba vode. Vse to je bolj kot kdajkoli na dosegu, z najbolj kul avtomatizacijkim sistemom \"Domoticz – Avtomatizacija doma\". Aplikacija avtomatizira vsak aparat na vašem domu, do katerega lahko kadarkoli in kjerkoli dostopate preko mobilne naprave. Vključite ali izključite luči v spalniici ia vaše dnevne sobe. \"Domoticz - Avtomatizacija doma\" aplikacija, podpira tudi NFC in vam omogoča, da vklopite klimatsko ali katerokoli drugo naprave, ko so skoraj prispeli domov. Skozi geo lokacijo lahko aplikacija lahko zazna vašo lokacijo in vas ustrezno opozori z upravljanjem naprav. Aplikacija \"Domoticz\" je super uporabniški vmesnik z enostavno uporabno. -Aplikacija ima krasen vmesnik za enostavno uporabo. Uporablja tudi vtičnike, kateri omogočajo, da si stikala za vklop/izklop naprav nastavite neposredno na zaslon telefona. Aplikacija je kot nalašč za spremljanje nepotrebne porabe električne, s čimer se prihrani denar. Prilagoditev in nadzor na dosegu roke. Aplikacija \"Domoticz\" podpira prstni odtis, za zagotavljanje varnosti vaših naprav. -Spremljajte porabo plina in električne energije iz svoje mobilne naprave in nastavite svojo svoj porabo glede na vašepotrebe in proračun. Ap je najboljšia za načrtovanje vašega mesečnega proračuna prek različnih naprav. Aplikacija pošilja tudi \"push\" obvestila na vse konfigurirane naprava, da vas opozori o uporabi in porabi. - -*************************** - GLAVNE PREMIUM FUNKCIJE -*************************** -- NFC podporo - vklajplajte/izklapljajte stikala preko NFC -- Geofencing (več lokacij), vključi luči, ko ste skoraj doma -- podpora Android Wear, nadzor vašega doma iz zapestja -- vtičniki, na vašem domačem zaslonu -- podpora konfiguracije večim strežnikom, povežite več strežnikov Domoticz z eno aplikacijo -- ojačana varnost s prstnim odtisom -- pogledi po meri -- Talkback funkcije -- obvestila -- funkcija alarma -\"Domoticz – Avtomatizacija doma\" aplikacija je združljiva z vsemi Android pametnimi telefoni, tablicami in vse Android Wear napravami. Bodite učinkoviti.! Nastavite več strežnikov za enostavno in učinkovito uporabo aplikacije. Naložite aplikacijo za pametni avtomastki krmilnik \"Domoticz\" in živite preprostejše življenje.! - -************* -RECI ŽIVJO -************* -Nenehno se trdno trudimo, da za vas izboljšujemo Domoticz - Home Automation in ga delamo koristnejšega. Prosim pošljite nam email za vsa povpraševanja/predloge/težave ali če želite, le pozdrave. Če ste uživali v vseh funkcijah aplikacije Domoticz - Avtomatizacija doma, nas ocenite na \"Play store\" in delite s prijatelji. - - diff --git a/app/src/main/res/values-sl/strings_settings.xml b/app/src/main/res/values-sl/strings_settings.xml index 27c216b74..d0007bd59 100644 --- a/app/src/main/res/values-sl/strings_settings.xml +++ b/app/src/main/res/values-sl/strings_settings.xml @@ -64,8 +64,8 @@ Prečevanje zaklepanja zaslona Izklop preprečevanja zaklepanja Samodejna osvežitev - Osveži stanje naprave vsakih 5 min - Ne osvežuj stanja naprave vsakih 5 min + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Stikala Pokaži stikala z on/off stikali Pokaži stikala z on/off gumbi diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 5ad68085f..e6ba98888 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-sr/strings_into.xml b/app/src/main/res/values-sr/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-sr/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-sr/strings_settings.xml b/app/src/main/res/values-sr/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-sr/strings_settings.xml +++ b/app/src/main/res/values-sr/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 609be6dd8..d9ce27801 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -47,15 +47,15 @@ Avaktivera Fullt ljus Nattljus - Sunrise - Sunset - Now - Astronomical twilight start - Astronomical twilight end + Soluppgång + Solnedgång + Nu + Astronomisk skymning börjar + Astronomisk skymningen slutar Civil twilight start Civil twilight end - Nautical twilight start - Nautical twilight end + Nautisk skymning börjar + Nautisk skymning slutar Senast sedd Signalstyrka Batterinivå @@ -126,8 +126,11 @@ Vill du fortsätta? Kan inte ta bort standardserver För att verkställa språkändring krävs det att programmet startas om - All + Alla Normal Status - Error + Fel + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-sv/strings_actions.xml b/app/src/main/res/values-sv/strings_actions.xml index 3371c1dfc..3a66b99e2 100644 --- a/app/src/main/res/values-sv/strings_actions.xml +++ b/app/src/main/res/values-sv/strings_actions.xml @@ -28,6 +28,6 @@ Spela Pausa Skanna QR-kod - Show paired devices + Visa parade enheter Taligenkänning diff --git a/app/src/main/res/values-sv/strings_bluetooth.xml b/app/src/main/res/values-sv/strings_bluetooth.xml index e8efb3b7d..8d08131b4 100644 --- a/app/src/main/res/values-sv/strings_bluetooth.xml +++ b/app/src/main/res/values-sv/strings_bluetooth.xml @@ -21,16 +21,16 @@ ~ under the License. --> - Bluetooth is not supported on this device - Connect a bluetooth device - New bluetooth device found - Edit bluetooth device - Give this bluetooth device a proper name. - Check the list of paired bluetooth devices. - Bluetooth already configured on Domoticz. - Bluetooth needs to be turned on in your device settings. - Saved a new bluetooth device connection. + Denna enhet har inte stöd för Bluetooth + Anslut en Bluetooth-enhet + Ny Bluetooth-enhet hittas + Redigera Bluetooth-enhet + Ge denna Bluetooth ett namn. + Kontrollera listan över parade bluetooth-enheter. + Bluetooth är redan konfigurerat i Domoticz. + Bluetooth måste aktiveras i din enhets inställningar. + Sparade anslutningen till en ny Bluetooth-enhet. Bluetooth - Bluetooth automation disabled, please setup via settings. - For a bluetooth device to automate something in Domoticz, a switch should be linked to an bluetooth + Bluetooth-automation inaktiverad, vänligen ställ in via inställningar. + För att få en bluetooth-enhet att automatisera något i Domoticz måste en switch kopplas till en bluetooth diff --git a/app/src/main/res/values-sv/strings_into.xml b/app/src/main/res/values-sv/strings_into.xml deleted file mode 100644 index 8aeb38902..000000000 --- a/app/src/main/res/values-sv/strings_into.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Hem Automation app för att styra dina enheter och leva ett smartare liv - Styr och övervaka ditt hem med enheter som Lampor, Knappar, Fläktar, Olika sensorer/mätinstrument såsom temperatur, nederbörd, vind, ultraviolett (UV) strålning, användning/elproduktion, gasförbrukning, vattenförbrukning och mycket mer med det coolaste automationssystemet ”Domoticz – Home Automation”. -Programmet automatiserar varje intelligent apparat i hemmet och du kan styra dom via din mobila enhet var som helst. Tänd eller släck sovrumslamporna när du sitter i vardagsrummet till exempel. -”Domoticz - Home Automation” appen stöder NFC och låter dig Slå på AC eller andra apparater när du nästan är hemma. -Genom geofence funktionen i appen kan du identifiera din plats och ge dig korrekta aviseringar från dina enheter beroende på var du befinner dig. -Appen ”Domoticz” har ett bra användargränssnitt med lätta kontroller. -Appen har också stöd för widgets som hjälper dig hålla koll från mobilens startskärm direkt. Du sparar tid genom att slå på eller stänga av enheter direkt från Widgeten. -Appen är perfekt för att dra ner på onödig elförbrukning vilket sparar pengar. -Anpassa och få din kontroll direkt från dina fingertoppar. -”Domoticz” stöder fingeravtrycks funktion för att höja säkerheten på dina enheter. -Övervaka gas- och elförbrukning direkt från din mobila enhet och konfigurera användningen enligt dina önskemål och budget. -Med Appen kan du planera din månadsbudget för olika enheter. -Appen skickar också pushmeddelanden till alla konfigurerade mobila enheten och meddelar dig med användning och förbrukning. - -*********************** -PREMIUM FUNKTIONER -*********************** -- stöd för NFC -- Strömbrytare via NFC-taggar -- Geofencing (flera), Aktivera enheter när du är på väg hemåt -- Android Wear, kontrollera ditt hem från din handled -- Widgets, sätt widgets på din enhets hemskärm -- Flera server konfigurationer, anslut flera domoticz servrar med en app -- Fingeravtryck -- Anpassade vyer -- Talkback säkerhetsfunktioner -- Aviseringar -- Alarm funktioner - -”Domoticz – Home Automation” appen är kompatibel med alla Android Smarttelefoner, Surfplattor och alla Android Wear enheter. - -Var smart! -Konfigurera flera servrar för en enkel och effektiv användning av applikationen. - -Ladda ner appen smart automatisk enhet controller ”Domoticz” och leva ett smartare liv! - -*********************** -Säg Hej -*********************** -vi arbetar ständigt hårt på att göra Domoticz - Home Automation app bättre och mer användbar för dig. -Du får gärna maila oss för frågor/förslag/problem eller om du bara vill säga Hej. -Om du har haft någon erfarenhet av Domoticz - Home Automation app så Betygsätt oss gärna i play butiken och dela bland dina vänner. - diff --git a/app/src/main/res/values-sv/strings_security.xml b/app/src/main/res/values-sv/strings_security.xml index e1c6bbbdb..75853d77f 100644 --- a/app/src/main/res/values-sv/strings_security.xml +++ b/app/src/main/res/values-sv/strings_security.xml @@ -27,10 +27,10 @@ Aktivera hem Aktivera borta Fel kod inmatad! - You do not have the rights for this action! + Du har inte rättigheter för denna åtgärd! Kunde inte ändra säkerhetsstatus Fel lösenord angett, lösenordet för ditt domoticz-konto är redundans för ditt fingeravtryck...! Visa lösenord - We need to make sure its you - Touch your finger on the fingerprint sensor to authorise your account. + Vi behöver bekräfta att du är du + Rör med fingret på fingeravtrycksläsaren för att godkänna kontot. diff --git a/app/src/main/res/values-sv/strings_settings.xml b/app/src/main/res/values-sv/strings_settings.xml index 1a67f2fb7..0ee1f7e04 100644 --- a/app/src/main/res/values-sv/strings_settings.xml +++ b/app/src/main/res/values-sv/strings_settings.xml @@ -38,7 +38,7 @@ Felsökning Exportera/importera inställningar Tema - Clock + Klocka NFC-anslutningar Säkerhet Konton @@ -46,16 +46,16 @@ Bluetooth Röst Återställ - Contribute + Bidra Startskärm Aktivera/inaktivera objekt - Sorting - Sort devices like sorted on the server - Custom sorting, drag and drop devices to sort them - Lock - Lock the current custom sorting (disable drag/drop) + Sortering + Sortera enheter som på servern + Anpassad sortering, dra och släppa enheter att sortera dem + Lås + Lås den anpassade sorteringen (inaktivera dra och släpp) Sortera skrivbordet i bokstavsordning Utökad information på skrivbordet Visa utökad information på skrivbordet @@ -64,16 +64,16 @@ Lås skärmen till alltid på Lås inte skärmen till alltid på Uppdatera automatiskt - Uppdatera enhetsstatus var 5 sekund - Uppdatera inte enhetsstatus var 5 sekund + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Brytare Visa brytare med strömbrytare Visa brytare med knappbrytare Skrivbordsrutnät Visa skrivbordet som lista Visa skrivbordet som rutnät - Clock - Show a clock on the dashboard + Klocka + Visa klocka på instrumentpanelen Android Wear-anpassade objekt Välj Wear-brytare @@ -116,10 +116,10 @@ Ställ in QR-koder Aktivera QR-koder Aktivera QR-kodsfunktionen - Setup Bluetooth devices - Enable Bluetooth functionality - You can help make our translations better, and even add new languages to this app via our Crowdin project - Translations + Konfigurera Bluetooth-enheter + Aktivera Bluetooth-funktion + Du kan hjälpa till och göra våra översättningar bättre och även lägga till nya språk till denna app via vårt Crowdin projekt + Översättningar Konfigurera säkerhet Aktivera fingeravtryckskydd vid start Inaktivera fingeravtryck skydd vid start @@ -178,7 +178,7 @@ Du behöver minst en sak i menyn Uppdatera servern - "Could not check for version: %1$s" + "Kunde inte kontrollera för version: %1$s" "Kunde inte kontrollera uppdateringar: %1$s" "Kunde inte hämta Domoticz serverkonfiguration: %1$s" Serveruppdatering tillgänglig: %1$s version: %2$s diff --git a/app/src/main/res/values-sv/strings_timer.xml b/app/src/main/res/values-sv/strings_timer.xml index 0e77c546a..517f0f65d 100644 --- a/app/src/main/res/values-sv/strings_timer.xml +++ b/app/src/main/res/values-sv/strings_timer.xml @@ -39,8 +39,8 @@ Månadsvis (Veckodag) Årligen Årligen (Veckodag) - Before Sun at South - After Sun at South + Före solnedgång i syd + Efter solnedgång i syd Before Civil Twilight Start After Civil Twilight Start Before Civil Twilight End @@ -58,9 +58,9 @@ Helg Annan Timers - First - Second - Third - Fourth - Last + Första + Andra + Tredje + Fjärde + Sista diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 26986d9af..cfa6bbc1a 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-tr/strings_into.xml b/app/src/main/res/values-tr/strings_into.xml deleted file mode 100644 index 8aadaa0d4..000000000 --- a/app/src/main/res/values-tr/strings_into.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Ev cihazlarınızı kontrol etmek ve daha akıllı bir hayat sürmek için Ev Otomasyonu uygulaması - Kontrol etmek ve ev aygıtlarınızın ışıklar, anahtar, fanlar, çeşitli sensörler/metre sıcaklık, yağış, Rüzgar, ultraviyole (UV) ışınları, elektrik kullanımı/üretim, gaz tüketimi, su tüketimi gibi ve en havalı otomasyon sistemi \"Domoticz - ev otomasyon\" ile parmaklarınızın çok daha gibi izlemek. Belgili tanımlık app her aracı evinizde otomatikleştirir ve herhangi bir yere taşınabilir aygıttan aracılığıyla denetleyebilirsiniz. Kapatma veya oturan oturma odası yatak odası ışıkları açma. \"Domoticz - ev otomasyon\" app NFC destekler ve AC üzerinde geçiş yapmanızı sağlar veya diğer aletleri neredeyse erişmeye çalıştığınız zaman eve. Coğrafi özelliği eskrim üzerinden app konumunuzu tespit edebilen ve buna göre aygıtları yönetme ile uyarır. App \"Domoticz\" kolay kullanıcı denetimleri ile büyük bir kullanıcı arayüzü var. Belgili tanımlık app de kontrol mobil giriş ekranında doğrudan açmak veya cihazı kapatmak için zaman tasarrufu yardımcı olur widgets destekler. Belgili tanımlık app tasarruf böylece gereksiz elektrik tüketimini kaydetmek idealdir. Kişiselleştirilmiş olabilir ve kontrol senin fingertips olsun. Otomatik aygıt denetleyicisi app \"Domoticz\" senin aygıt güvenliğini sağlamak için parmak yazdırma özelliğini destekler. Gaz ve elektrik tüketimi mobil cihazınız üzerinden izlemek ve kullanım gereksinimleri ve bütçe göre yapılandırın. Belgili tanımlık app çeşitli cihazlar aylık bütçe planı en iyisi. Belgili tanımlık app da kullanımları ve tüketimler ile sizi uyarmak için yapılandırılmış herhangi bir mobil cihaz itme bildirim gönderir. Sigorta primi anahtar özellikleri *** - NFC destek - açma/kapatma düğmelerini yolu ile NFC tags - Geofencing (birden fazla), ışığını açmak zaman, neredeyse evde - Android giymek, birden çok sunucu geneli senin kol bileği - Widgets, sizin homescreen üzerinde widget koymak - evden kontrol, bir app birden çok domoticz sunucusuyla bağlantı - güvenlik - özel görünümler - Talkback özellikleri - bildirimleri parmak izi - Alarm özelliği \"Domoticz - ev otomasyon\" app Android akıllı telefonlar ile uyumlu , Tabletler ve Android giyer. Akıllı olun.! Uygulama kolay ve etkin kullanımı için birden çok sunucu yapılandırın. Download akıllı otomatik aygıt denetleyicisi app \"Domoticz\" ve daha akıllı bir hayat yaşamak.! DEMEK Merhaba *** sürekli bu Domoticz - Ev Otomasyonu app daha iyi yapmak için zor ve daha yararlı sizin için çalışıyoruz. Lütfen bize sorgular/öneriler/sorunu ya da sadece Merhaba demek istiyorum eğer e-posta çekinmeyin. Domoticz - Ev Otomasyonu uygulaması, herhangi bir özelliği keyif aldık bize oyun mağaza ve pay senin arkadaşlar arasında oran. - diff --git a/app/src/main/res/values-tr/strings_settings.xml b/app/src/main/res/values-tr/strings_settings.xml index a6aa1f419..8cb6df4f7 100644 --- a/app/src/main/res/values-tr/strings_settings.xml +++ b/app/src/main/res/values-tr/strings_settings.xml @@ -64,8 +64,8 @@ Ekranı herzaman kilitle Ekran açıkken kilitleme Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Anahtarlar Açma/kapama düğmesi ile anahtarları göster Açık / kapalı düğmeleri olan anahtarları göster diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index c86a5801c..d4985c530 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-uk/strings_into.xml b/app/src/main/res/values-uk/strings_into.xml deleted file mode 100644 index 050678fe6..000000000 --- a/app/src/main/res/values-uk/strings_into.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Додаток домашньої автоматизації, щоб контролювати ваші домашні пристрої і зробити життя простішим - Керуйте і контролюйте пристрою в вашому домі такі як: світло, вимикачі, вентилятори, різні датчики в тому числі температури, опадів, вітру, ультрафіолетового випромінювання, використання електроенергії, витрата газу, води і набагато більше за допомогою найкрутішою системи автоматизації «Domoticz - Home Automation ». Додаток автоматизує всі пристрої у вашому будинку, і ви можете контролювати його через мобільний пристрій з будь-якого місця. Включити або вимкнути світло в спальні, сидячи у вітальні. «Domoticz - Home Automation» app підтримує NFC і дозволяє вам переключитися на AC або інші прилади, коли ви прямуєте додому. Через гео-позиціонування додаток може визначити ваше місце розташування і відповідно попереджає вас про управління пристроями. -Додаток «Domoticz» має відмінний користувальницький інтерфейс з легкими елементами управління. Додаток також підтримує віджети, які допомагають вам керувати з екрану вашого мобільного телефону, безпосередньо заощаджуючи ваш час, щоб включити або вимкнути пристрій. Додаток ідеально підходить для того щоб уникнути непотрібне споживання електроенергії, тим самим заощаджуючи гроші. «Domoticz» app підтримує функцію входу за допомогою розпізнавання відбитку пальця для забезпечення безпеки ваших пристроїв. -Слідкуйте за витратою газу і споживанням електроенергії через ваш мобільний пристрій і налаштуйте їх використання відповідно до ваших вимог і бюджету. Додаток допоможе планувати ваш щомісячний бюджет виходячи з витрат різними пристроями. Додаток також отримувати сповіщення на будь-який налаштоване мобільний пристрій для попередження про використання та споживанні енергії. - -************************** -Особливості Преміум версії -************************** - -- підтримка NFC - перемикачі через NFC Теги -- геозонірованіе, вмикає світло коли ви майже вдома -- Android Wear, допоможе контролювати ваш будинок рухом руки -- віджети, встановіть віджети на ваш домашній екран -- конфігурація декількох серверів, підключіть кілька серверів domoticz через один додаток -- доступу через розпізнавання відбитка пальця -- поліпшена кастомизация -- функції Talkback -- повідомлення -- будильник -Додаток «Domoticz - Home Automation» сумісний з Android смартфонами, планшетами та будь-якими пристроями Android. Зробіть ваш будинок розумним! Налаштуйте кілька серверів для легкого і ефективного використання програми. Скачайте додаток «Domoticz» і живіть розумнішими! -  -************************** -Сказати привіт -************************** - -Ми постійно працюємо над тим щоб зробити «Domoticz - Home Automation» краще і більш корисним для вас. Будь ласка, не соромтеся, напишіть нам про будь-які пропозиції, проблеми, або якщо ви просто хочете сказати привіт. Якщо ви сподобалася одна з функцій «Domoticz - Home Automation» оціните нас на Play Store і перешліть інформацію про нас вашим друзям. - - diff --git a/app/src/main/res/values-uk/strings_settings.xml b/app/src/main/res/values-uk/strings_settings.xml index 27f2e7998..6207f545d 100644 --- a/app/src/main/res/values-uk/strings_settings.xml +++ b/app/src/main/res/values-uk/strings_settings.xml @@ -64,8 +64,8 @@ Блокування екрану коли ввімкнено \"Завжди включений\" Не блокувати екран коли ввімкнено \"Завжди включений\" Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Перемикачі Показати комутатори зі перемикач вкл/викл Показати комутатори зі кнопки включення/вимикання diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b7f647014..4a8e065da 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-zh-rCN/strings_into.xml b/app/src/main/res/values-zh-rCN/strings_into.xml deleted file mode 100644 index 6510b5c71..000000000 --- a/app/src/main/res/values-zh-rCN/strings_into.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 家庭自动化应用程序用来控制你的家用电器,使生活变得更智能 - 控制和监视您家里的设备,如灯、 开关、 风扇、 各种传感器/米像气温、 降雨量、 风力、 紫外线 (UV) 辐射、 电力使用/生产、 天然气消费,耗水量和更多在你的指尖与最酷的自动化系统\"Domoticz-家庭自动化\"。应用程序自动在你家里的每一样电器和你可以控制它的移动设备从任何地方通过。关闭或打开卧室的灯,坐在客厅里。\"Domoticz-家庭自动化\"应用程序支持 NFC 和允许您切换上交流或其他电器时你几乎达到首页。通过地理击剑功能应用程序可以检测你的位置,并相应地提醒您与管理设备。 -应用程序\"Domoticz\"有一个优秀用户界面使用简单的用户控件。应用程序还支持帮助你控制从您的手机主屏幕直接节省您的时间来打开或关闭设备的部件。该应用程序是完美,节省不必要的电力消耗,从而节省钱。进行个性化设置和获取您的控件在您的指尖。自动装置控制器应用程序\"Domoticz\"支持手指打印功能,以确保您的设备的安全。 -监测的天然气和电力消费从您的移动设备和配置它的使用,为您的需求和预算。该应用程序,最好是你每月的预算计划在各种设备。应用程序也将推式通知发送到任何配置移动设备的用法与消费向您发出警报。 - -高级的关键功能 * * *-NFC 支持-切换开关通过 NFC 标签-地理围墙 (多个),打开灯时你几乎在家里-Android 穿,控制你的家离你的手腕-小部件,放在主屏幕上的小部件-多个服务器配置、 连接与一个应用程序的多个 domoticz 服务器-指纹安全-自定义视图-对讲功能-通知-报警功能\"Domoticz-家庭自动化\"应用程序是兼容所有的安卓智能机平板电脑和所有 Android 的穿着。是聪明的。 !配置轻松和高效使用的应用程序的多个服务器。下载智能自动设备控制器应用程序\"Domoticz\",生活变得更聪明。 ! - -说你好 * * * 我们不断地为你工作努力使这个 Domoticz-首页自动化应用程序更好、 更有用。请随时以电子邮件与我们任何查询的建议/问题,或如果你只是想说你好。如果你有喜欢任何功能的 Domoticz-首页自动化的应用程序,率我们上播放存储之间和共享你的朋友。 - - diff --git a/app/src/main/res/values-zh-rCN/strings_settings.xml b/app/src/main/res/values-zh-rCN/strings_settings.xml index 863658122..d7a41447c 100644 --- a/app/src/main/res/values-zh-rCN/strings_settings.xml +++ b/app/src/main/res/values-zh-rCN/strings_settings.xml @@ -64,8 +64,8 @@ 保持屏幕开启 不保持屏幕开启 自动刷新 - 每5秒刷新一次设备状态 - 不要每5秒刷新一次设备状态 + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds 开关 在开关上显示开/关文字 在开关上显示开/关按钮 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index ea7ad4f7d..fd501d92b 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -130,4 +130,7 @@ Normal Status Error + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. diff --git a/app/src/main/res/values-zh/strings_into.xml b/app/src/main/res/values-zh/strings_into.xml deleted file mode 100644 index 4bb4abcf9..000000000 --- a/app/src/main/res/values-zh/strings_into.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Home Automation app to control your home devices and lead a smarter life - Control and monitor your home devices like lights, switches, fans, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more at your fingertips with the most coolest automation system \"Domoticz - Home Automation\". The app automates every appliance at your home and you can control it through the mobile device from any place. Turn off or on the bedroom lights sitting at living room. \"Domoticz - Home Automation\" app supports NFC and allows you to switch on the AC or other appliances when you are almost reaching home. Through geo fencing feature the app can detect your location and accordingly alerts you with the managing of the devices. -The app \"Domoticz\" has a great user interface with easy user controls. The app also supports widgets that helps you control from your mobile home screen directly saving your time to turn on or turn off the device. The app is perfect to save the unnecessary electric consumption thereby saving the money. Be personalized and get your control in your fingertips. The automatic device controller app \"Domoticz\" supports finger print feature to ensure the security of your devices. -Monitor the gas and electric consumption from your mobile device and configure its usage as per your requirements and budget. The app is the best to plan your monthly budget over various devices. The app also sends the push notification to any configured mobile device to alert you with the usages and consumptions. - -************************** -PREMIUM KEY FEATURES -************************** -- NFC Support - Toggle switches via NFC tags -- Geofencing (multiple), turn light on when your almost at home -- Android Wear, control your home from your wrist -- Widgets, put widgets on your homescreen -- Multiple server config, connect multiple domoticz servers with one app -- Fingerprint security -- Custom views -- Talkback features -- Notifications -- Alarm feature - \"Domoticz - Home Automation\" app is compatible with all the Android smartphones, Tablets and all the Android Wears. Be smart.! Configure multiple servers for an easy and efficient use of the application. Download the smart automatic device controller app \"Domoticz\" and live a smarter life.! - -*********************** -SAY HELLO -*********************** -We are constantly working hard on making this �Domoticz - Home Automation� app better and more useful for you. Please feel free to email us for any queries/suggestions/problems or if you just want to say hello. If you have enjoyed any feature of the �Domoticz - Home Automation� app, do rate us on play store and share among your friends. - - diff --git a/app/src/main/res/values-zh/strings_settings.xml b/app/src/main/res/values-zh/strings_settings.xml index f017fd829..f67f70aa4 100644 --- a/app/src/main/res/values-zh/strings_settings.xml +++ b/app/src/main/res/values-zh/strings_settings.xml @@ -64,8 +64,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 34edaa719..e9af20079 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -35,5 +35,9 @@ - + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6644da54e..5dc28643d 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -30,7 +30,7 @@ @color/button_dark_status #2A292F - #2A292F + #34333A #284B6B #284B6B diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 1a187d08f..05b905e46 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -40,4 +40,6 @@ 4.0sp 16dp + 0dp + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0708e0eda..e223b4d26 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,5 +149,7 @@ Normal Status Error - + Use demo setup + Refresh timer + Set a specific timer for the auto refresh in seconds. \ No newline at end of file diff --git a/app/src/main/res/values/strings_settings.xml b/app/src/main/res/values/strings_settings.xml index 7ab3fcc66..91cb94d2e 100644 --- a/app/src/main/res/values/strings_settings.xml +++ b/app/src/main/res/values/strings_settings.xml @@ -70,8 +70,8 @@ Lock the screen always On Don\'t lock the screen to always On Auto Refresh - Refresh the device state every 5 seconds - Don\'t refresh the device state every 5 seconds + Refresh the device state every couple of seconds + Don\'t refresh the device state every couple of seconds Switches Show switches with on/off switch Show switches with on/off buttons diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index dd5d4413b..746a669a9 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -48,6 +48,10 @@ @color/secondary_dark @color/primary + + @color/white + @color/white + @color/card_background_dark @color/material_drawer_dark_primary_text diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 4fdde5d0a..6bbc93606 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -63,6 +63,11 @@ android:summaryOff="@string/always_auto_refresh_off" android:summaryOn="@string/always_auto_refresh_on" android:title="@string/always_auto_refresh"/> + - - diff --git a/app/version.properties b/app/version.properties index c26827216..d5f81031c 100644 --- a/app/version.properties +++ b/app/version.properties @@ -1,4 +1,4 @@ -#Fri Jun 14 16:10:47 CEST 2019 -VERSION_BUILD=5916 -VERSION_PATCH=110 -VERSION_CODE=426 +#Tue Jul 30 09:42:06 CEST 2019 +VERSION_BUILD=6105 +VERSION_PATCH=125 +VERSION_CODE=441 diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/DevicesInfo.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/DevicesInfo.java index f0d11026d..c55af5175 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/DevicesInfo.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/DevicesInfo.java @@ -362,8 +362,7 @@ public boolean getStatusBoolean() { if (status.equalsIgnoreCase(DomoticzValues.Device.Blind.State.OFF) || status.equalsIgnoreCase(DomoticzValues.Device.Blind.State.CLOSED)) statusBoolean = false; else if ((status.equalsIgnoreCase(DomoticzValues.Device.Door.State.UNLOCKED) && switchTypeVal == DomoticzValues.Device.Type.Value.DOORLOCK) || - (status.equalsIgnoreCase(DomoticzValues.Device.Door.State.UNLOCKED) && switchTypeVal == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED) || - (status.equalsIgnoreCase(DomoticzValues.Device.Door.State.OPEN) && switchTypeVal == DomoticzValues.Device.Type.Value.BLINDINVERTED)) + (status.equalsIgnoreCase(DomoticzValues.Device.Door.State.UNLOCKED) && switchTypeVal == DomoticzValues.Device.Type.Value.DOORLOCKINVERTED)) statusBoolean = false; this.statusBoolean = statusBoolean; return statusBoolean; diff --git a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SessionUtil.java b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SessionUtil.java index 215f88f31..c04577184 100644 --- a/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SessionUtil.java +++ b/domoticzapi/src/main/java/nl/hnogames/domoticzapi/Utils/SessionUtil.java @@ -35,8 +35,11 @@ public class SessionUtil { private static final String SET_COOKIE_KEY = "Set-Cookie"; private static final String COOKIE_KEY = "Cookie"; - private static final String SESSION_COOKIE = "SID"; + private static final String OLD_SESSION_COOKIE = "DMZSID"; + private static final String NEW_SESSION_COOKIE = "DMZSID"; private static final String COOKIE_EXPIRE_KEY = "CookieExpire"; + private static final String PREF_SESSION_COOKIE = "SID"; + private static String SESSION_COOKIE = "SID"; private Context mContext; private SharedPreferences prefs; private SharedPreferences.Editor editor; @@ -48,7 +51,7 @@ public SessionUtil(Context mContext) { } public final void clearSessionCookie() { - editor.putString(SESSION_COOKIE, ""); + editor.putString(PREF_SESSION_COOKIE, ""); editor.commit(); } @@ -60,7 +63,10 @@ public final void clearSessionCookie() { */ public final void checkSessionCookie(Map headers) { if (headers.containsKey(SET_COOKIE_KEY) - && headers.get(SET_COOKIE_KEY).startsWith(SESSION_COOKIE)) { + && (headers.get(SET_COOKIE_KEY).startsWith(OLD_SESSION_COOKIE) || headers.get(SET_COOKIE_KEY).startsWith(NEW_SESSION_COOKIE))) { + if(headers.get(SET_COOKIE_KEY).startsWith(NEW_SESSION_COOKIE)) + SESSION_COOKIE = NEW_SESSION_COOKIE; + String cookie = headers.get(SET_COOKIE_KEY); String expires = ""; @@ -68,7 +74,7 @@ public final void checkSessionCookie(Map headers) { String[] splitCookie = cookie.split(";"); String[] splitSessionId = splitCookie[0].split("="); cookie = splitSessionId[1]; - editor.putString(SESSION_COOKIE, cookie); + editor.putString(PREF_SESSION_COOKIE, cookie); editor.commit(); for (String s : splitCookie) { @@ -107,7 +113,7 @@ public Calendar parseStringToDate(String expires) { * @param headers */ public final void addSessionCookie(Map headers) { - String sessionId = prefs.getString(SESSION_COOKIE, ""); + String sessionId = prefs.getString(PREF_SESSION_COOKIE, ""); String expires = prefs.getString(COOKIE_EXPIRE_KEY, ""); Calendar calExpired = parseStringToDate(expires); @@ -134,7 +140,7 @@ public final void addSessionCookie(Map headers) { * Get session cookie to headers if exists. */ public final String getSessionCookie() { - String sessionId = prefs.getString(SESSION_COOKIE, ""); + String sessionId = prefs.getString(PREF_SESSION_COOKIE, ""); String expires = prefs.getString(COOKIE_EXPIRE_KEY, ""); Calendar calExpired = parseStringToDate(expires); diff --git a/domoticzapi/version.properties b/domoticzapi/version.properties index 7c3ada2bf..cc81a3aa8 100644 --- a/domoticzapi/version.properties +++ b/domoticzapi/version.properties @@ -1,4 +1,4 @@ -#Fri Jun 14 16:10:47 CEST 2019 +#Tue Jul 30 09:42:07 CEST 2019 VERSION_BUILD=3675 -VERSION_PATCH=219 -VERSION_CODE=219 +VERSION_PATCH=229 +VERSION_CODE=229 diff --git a/libs/SeekArc_library/src/com/triggertrap/seekarc/SeekArc.java b/libs/SeekArc_library/src/com/triggertrap/seekarc/SeekArc.java index 3710228e6..5c3f247b5 100644 --- a/libs/SeekArc_library/src/com/triggertrap/seekarc/SeekArc.java +++ b/libs/SeekArc_library/src/com/triggertrap/seekarc/SeekArc.java @@ -167,10 +167,6 @@ public interface OnSeekArcChangeListener { * that occurred programmatically. * * @param seekArc The SeekArc whose progress has changed - * @param progress The current progress level. This will be in the range - * 0..max where max was set by - * {@link ProgressArc#setMax(int)}. (The default value for - * max is 100.) * @param fromUser True if the progress change was initiated by the user. */ void onProgressChanged(SeekArc seekArc, int progress, boolean fromUser); @@ -558,7 +554,6 @@ private void updateProgress(int progress, boolean fromUser) { * stops a touch gesture within the SeekArc. * * @param l The seek bar notification listener - * @see SeekArc.OnSeekBarChangeListener */ public void setOnSeekArcChangeListener(OnSeekArcChangeListener l) { mOnSeekArcChangeListener = l; diff --git a/materialList/build.gradle b/materialList/build.gradle index 9aa9d3f6c..bd7a7c40f 100644 --- a/materialList/build.gradle +++ b/materialList/build.gradle @@ -27,7 +27,7 @@ dependencies { implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.firebase:firebase-core:16.0.9' + implementation 'com.google.firebase:firebase-core:17.0.0' implementation 'com.google.firebase:firebase-crash:16.2.1' implementation 'com.nineoldandroids:library:2.4.0'