Skip to content

Commit

Permalink
Merge pull request #490 from domoticz/alpha-development
Browse files Browse the repository at this point in the history
Alpha development
galadril authored Oct 19, 2018
2 parents 2dee65c + 805cca3 commit 9fefc19
Showing 721 changed files with 6,291 additions and 4,610 deletions.
19 changes: 13 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -45,13 +45,21 @@ android {
throw new GradleException("Could not read version.properties!")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
incremental = false;
}

//noinspection GroovyAssignabilityCheck
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
abortOnError false
}
}
}
@@ -139,7 +147,6 @@ repositories {
}
}


allprojects {
repositories {
jcenter()
@@ -181,20 +188,20 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.android.volley:volley:1.1.0'
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
implementation 'com.larswerkman:lobsterpicker:1.0.1'

implementation 'com.github.zurche:plain-pie:v0.2.2'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation 'com.github.zurche:plain-pie:v0.2.9'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

implementation 'com.github.dexafree:MaterialList:v3.2.2'
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.github.jd-alexander:LikeButton:0.2.3'
implementation 'jp.wasabeef:recyclerview-animators:2.2.4'
implementation 'jp.wasabeef:recyclerview-animators:2.3.0'
implementation 'com.github.javiersantos:PiracyChecker:1.1'
implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'

implementation("com.mikepenz:materialdrawer:6.0.9@aar") {
transitive = true
}
@@ -205,9 +212,9 @@ dependencies {
implementation 'com.github.k0shk0sh:PermissionHelper:1.1.0'
implementation 'com.github.zagum:SpeechRecognitionView:1.0.2'
implementation 'com.afollestad:digitus:0.3.0'
implementation "com.github.skydoves:colorpickerview:2.0.1"

implementation project(':libs:MemorizingTrustManager')

implementation project(path: ':materialIntro_library')
implementation project(path: ':SeekArc_library')
implementation project(path: ':domoticzapi')
313 changes: 172 additions & 141 deletions app/src/debug/AndroidManifest.xml

Large diffs are not rendered by default.

311 changes: 171 additions & 140 deletions app/src/main/AndroidManifest.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@
package nl.hnogames.domoticz.Adapters;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
@@ -73,9 +73,13 @@ public DataObjectHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewTy
.inflate(R.layout.camera_row, parent, false);

if (mSharedPrefs.darkThemeEnabled()) {
((android.support.v7.widget.CardView) view.findViewById(R.id.row_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F"));
if ((view.findViewById(R.id.card_global_wrapper)) != null)
view.findViewById(R.id.card_global_wrapper).setBackgroundColor(ContextCompat.getColor(mContext, R.color.card_background_dark));
if ((view.findViewById(R.id.row_wrapper)) != null)
(view.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(mContext, R.color.card_background_dark));
if ((view.findViewById(R.id.row_global_wrapper)) != null)
(view.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(mContext, R.color.card_background_dark));
}

return new DataObjectHolder(view);
}

107 changes: 55 additions & 52 deletions app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.support.design.chip.Chip;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@@ -35,7 +35,6 @@
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Filter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
@@ -78,7 +77,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Data

public ArrayList<DevicesInfo> data = null;
public ArrayList<DevicesInfo> filteredData = null;
private boolean showAsList = false;
private boolean showAsList;
private Domoticz domoticz;
private Context context;
private switchesClickListener listener;
@@ -98,7 +97,6 @@ public DashboardAdapter(Context context,

this.context = context;
domoticz = new Domoticz(context, AppController.getInstance().getRequestQueue());

mConfigInfo = serverUtil.getActiveServer().getConfigInfo(context);
this.listener = listener;

@@ -149,33 +147,19 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
.inflate(R.layout.dashboard_row, parent, false);

if (mSharedPrefs.darkThemeEnabled()) {
((android.support.v7.widget.CardView) row.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F"));
if ((row.findViewById(R.id.card_global_wrapper)) != null)
row.findViewById(R.id.card_global_wrapper).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark));
if ((row.findViewById(R.id.row_wrapper)) != null)
(row.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.drawable.bordershadowdark));
(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.background_dark));
if ((row.findViewById(R.id.day_button)) != null)
(row.findViewById(R.id.day_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.year_button)) != null)
(row.findViewById(R.id.year_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.month_button)) != null)
(row.findViewById(R.id.month_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.week_button)) != null)
(row.findViewById(R.id.week_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.log_button)) != null)
(row.findViewById(R.id.log_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.timer_button)) != null)
(row.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
if ((row.findViewById(R.id.notifications_button)) != null)
(row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
(row.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark));
if ((row.findViewById(R.id.on_button)) != null)
(row.findViewById(R.id.on_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark));
(row.findViewById(R.id.on_button)).setBackgroundColor(ContextCompat.getColor(context, R.color.button_dark));
if ((row.findViewById(R.id.off_button)) != null)
(row.findViewById(R.id.off_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark));
(row.findViewById(R.id.off_button)).setBackgroundColor(ContextCompat.getColor(context, R.color.button_dark));
if ((row.findViewById(R.id.color_button)) != null)
(row.findViewById(R.id.color_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
(row.findViewById(R.id.color_button)).setBackgroundColor(ContextCompat.getColor(context, R.color.button_dark_status));
}

return new DataObjectHolder(row);
}

@@ -187,8 +171,9 @@ public void onBindViewHolder(DataObjectHolder holder, final int position) {
if (!this.mSharedPrefs.darkThemeEnabled()) {
holder.pieView.setInnerBackgroundColor(ContextCompat.getColor(context, R.color.white));
holder.pieView.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.pieView.setPercentageTextSize(17);
}
holder.pieView.setPercentageTextSize(16);
holder.pieView.setPercentageBackgroundColor(ContextCompat.getColor(context, R.color.material_orange_600));

setSwitchRowData(extendedStatusInfo, holder);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@@ -204,6 +189,12 @@ public boolean onLongClick(View v) {
return true;
}
});
holder.infoIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onItemLongClicked(position);
}
});
}
}

@@ -254,6 +245,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
case DomoticzValues.Device.Type.Value.ON_OFF:
case DomoticzValues.Device.Type.Value.MEDIAPLAYER:
case DomoticzValues.Device.Type.Value.DOORLOCK:
case DomoticzValues.Device.Type.Value.DOORLOCKINVERTED:
case DomoticzValues.Device.Type.Value.DOORCONTACT:
switch (mDeviceInfo.getSwitchType()) {
case DomoticzValues.Device.Type.Name.SECURITY:
@@ -308,7 +300,8 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
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)) {
if (mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.RGB) ||
mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) {
if (mSharedPrefs.showSwitchesAsButtons()) {
setButtons(holder, Buttons.DIMMER_BUTTONS);
setDimmerOnOffButtonRowData(mDeviceInfo, holder, true);
@@ -507,7 +500,7 @@ private void setSecurityPanelSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHo
holder.buttonOn.setText(context.getString(R.string.button_arm));

if (mSharedPrefs.darkThemeEnabled())
holder.buttonOn.setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark));
holder.buttonOn.setBackgroundColor(ContextCompat.getColor(context, R.color.button_dark));
else
holder.buttonOn.setBackground(ContextCompat.getDrawable(context, R.drawable.button_on));

@@ -1692,6 +1685,14 @@ public void setButtons(DataObjectHolder holder, int button) {
holder.signal_level.setVisibility(View.GONE);
holder.switch_battery_level.setVisibility(View.GONE);
}
if (!mSharedPrefs.showExtraData()) {
holder.infoIcon.setVisibility(View.GONE);
} else {
if (showAsList) {
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) holder.iconRow.getLayoutParams();
p.leftMargin = -15;
}
}

switch (button) {
case Buttons.SWITCH:
@@ -1810,40 +1811,42 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder {

TextView switch_name, signal_level, switch_status, switch_battery_level, switch_dimmer_level;
Switch onOffSwitch, dimmerOnOffSwitch;
ImageButton buttonUp, buttonDown, buttonStop;
Button buttonOn, buttonLog, buttonTimer, buttonColor, buttonSetStatus, buttonSet, buttonOff;
ImageView buttonUp, buttonDown, buttonStop;
Button buttonOn, buttonColor, buttonSetStatus, buttonSet, buttonOff;
Chip buttonLog, buttonTimer;
Boolean isProtected;
ImageView iconRow, iconMode;
SeekBar dimmer;
Spinner spSelector;
LinearLayout extraPanel;
PieView pieView;
ImageView infoIcon;

public DataObjectHolder(View itemView) {
super(itemView);

extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel);
pieView = (PieView) itemView.findViewById(R.id.pieView);
buttonOn = (Button) itemView.findViewById(R.id.on_button);
buttonOff = (Button) itemView.findViewById(R.id.off_button);
onOffSwitch = (Switch) itemView.findViewById(R.id.switch_button);
signal_level = (TextView) itemView.findViewById(R.id.switch_signal_level);
iconRow = (ImageView) itemView.findViewById(R.id.rowIcon);
switch_name = (TextView) itemView.findViewById(R.id.switch_name);
switch_battery_level = (TextView) itemView.findViewById(R.id.switch_battery_level);

switch_dimmer_level = (TextView) itemView.findViewById(R.id.switch_dimmer_level);
dimmerOnOffSwitch = (Switch) itemView.findViewById(R.id.switch_dimmer_switch);
dimmer = (SeekBar) itemView.findViewById(R.id.switch_dimmer);
spSelector = (Spinner) itemView.findViewById(R.id.spSelector);
buttonColor = (Button) itemView.findViewById(R.id.color_button);
buttonLog = (Button) itemView.findViewById(R.id.log_button);
buttonTimer = (Button) itemView.findViewById(R.id.timer_button);
buttonUp = (ImageButton) itemView.findViewById(R.id.switch_button_up);
buttonStop = (ImageButton) itemView.findViewById(R.id.switch_button_stop);
buttonDown = (ImageButton) itemView.findViewById(R.id.switch_button_down);
buttonSet = (Button) itemView.findViewById(R.id.set_button);
buttonSetStatus = (Button) itemView.findViewById(R.id.set_button);
extraPanel = itemView.findViewById(R.id.extra_panel);
pieView = itemView.findViewById(R.id.pieView);
buttonOn = itemView.findViewById(R.id.on_button);
buttonOff = itemView.findViewById(R.id.off_button);
onOffSwitch = itemView.findViewById(R.id.switch_button);
signal_level = itemView.findViewById(R.id.switch_signal_level);
iconRow = itemView.findViewById(R.id.rowIcon);
switch_name = itemView.findViewById(R.id.switch_name);
switch_battery_level = itemView.findViewById(R.id.switch_battery_level);
infoIcon = itemView.findViewById(R.id.widget_info_icon);
switch_dimmer_level = itemView.findViewById(R.id.switch_dimmer_level);
dimmerOnOffSwitch = itemView.findViewById(R.id.switch_dimmer_switch);
dimmer = itemView.findViewById(R.id.switch_dimmer);
spSelector = itemView.findViewById(R.id.spSelector);
buttonColor = itemView.findViewById(R.id.color_button);
buttonLog = itemView.findViewById(R.id.log_button);
buttonTimer = itemView.findViewById(R.id.timer_button);
buttonUp = itemView.findViewById(R.id.switch_button_up);
buttonStop = itemView.findViewById(R.id.switch_button_stop);
buttonDown = itemView.findViewById(R.id.switch_button_down);
buttonSet = itemView.findViewById(R.id.set_button);
buttonSetStatus = itemView.findViewById(R.id.set_button);

if (buttonLog != null)
buttonLog.setVisibility(View.GONE);
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@
package nl.hnogames.domoticz.Adapters;

import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@@ -85,11 +84,12 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
.inflate(R.layout.event_row_default, parent, false);

if (mSharedPrefs.darkThemeEnabled()) {
((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F"));
if ((view.findViewById(R.id.card_global_wrapper)) != null)
view.findViewById(R.id.card_global_wrapper).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark));
if ((view.findViewById(R.id.row_wrapper)) != null)
(view.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.drawable.bordershadowdark));
(view.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.color.card_background_dark));
if ((view.findViewById(R.id.row_global_wrapper)) != null)
(view.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.background_dark));
(view.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.card_background_dark));
}

return new DataObjectHolder(view);
@@ -155,11 +155,10 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder

public DataObjectHolder(View itemView) {
super(itemView);
name = (TextView) itemView.findViewById(R.id.logs_name);
message = (TextView) itemView.findViewById(R.id.logs_message);
iconRow = (ImageView) itemView.findViewById(R.id.rowIcon);
buttonON = (Switch) itemView.findViewById(R.id.switch_button);

name = itemView.findViewById(R.id.logs_name);
message = itemView.findViewById(R.id.logs_message);
iconRow = itemView.findViewById(R.id.rowIcon);
buttonON = itemView.findViewById(R.id.switch_button);
itemView.setOnClickListener(this);
}

Loading

0 comments on commit 9fefc19

Please sign in to comment.