Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha development #490

Merged
merged 50 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e531b31
Merge pull request #489 from domoticz/beta-development
galadril Oct 5, 2018
2b7535f
Experimental, working on a new way of navigating
Oct 9, 2018
65d84f5
Working on a new material view on the app
galadril Oct 9, 2018
d00de9f
Updates for the new design
galadril Oct 10, 2018
362eafe
Fixed crash with PhoneConnectionUtil
Oct 10, 2018
ca8e4ef
Set alert dialog styles for light theme
Oct 10, 2018
2a35cbb
Rework some themes for dark version
Oct 10, 2018
5d6ecb5
Fix build errors
Oct 10, 2018
6ef7153
Work in progress on the dark theme
Oct 10, 2018
19c1e64
Code format/cleanup
Oct 10, 2018
2bacad0
Improve dark theme on sidebar navigation
Oct 10, 2018
f25a769
Improving the color of the actionbar on dark theme
Oct 10, 2018
480f531
Improved the text styling
Oct 10, 2018
39748df
update version
galadril Oct 11, 2018
0677a45
Fix issue with widgets
Oct 11, 2018
204f3de
Changed the look and feel for the PieView
Oct 11, 2018
1e030ce
Use native BottomNavigationView from design library
Oct 11, 2018
22b111f
Changed the buttons to style OutlinedButton
Oct 11, 2018
fff24ce
Fix issue with the like device icon
Oct 11, 2018
de18201
Get description field from api
Oct 11, 2018
e13da48
Adding a small icon to indicate more info
Oct 11, 2018
bac7ef9
Refactored some layouts
Oct 11, 2018
75698a7
Reworking the settings pages
Oct 11, 2018
601dcf4
Reworking some dark dialogs
galadril Oct 11, 2018
151976b
Improve the setup screens
Oct 12, 2018
5e2962b
Improve the dashboard buttons
Oct 12, 2018
a372565
Move back to the info icon on the card
Oct 12, 2018
7e2a72e
Working on RGB/WW switches with different dialogs #466
Oct 12, 2018
4cd516e
Fixed a crash report on utilities (with chip)
Oct 12, 2018
b45db26
Fixed a dashboard layout alignment
Oct 12, 2018
b18449e
Rework the style of blinds
Oct 12, 2018
ed7d872
Implement doorlock inverted #477
Oct 12, 2018
57824f6
Improve the layout for events row
Oct 12, 2018
73d6dd3
Fix font color on widgets
Oct 12, 2018
a4af746
Update app/src/main/res/layout/log_all_buttons.xml
Oct 12, 2018
7be0aac
Refresh translations from Crowdin
Oct 12, 2018
ed9c85e
Clear active search on page changed
Oct 15, 2018
5ec86f1
Fix the switch with Doorlock Inverted
Oct 15, 2018
e3e522d
Implemented a button for night light and full light on the info dialo…
Oct 15, 2018
870ba98
Working on the ww color api calls
Oct 15, 2018
8331d91
Finish the WW color picker #466
galadril Oct 15, 2018
abe07da
Fix the no-data error layout
galadril Oct 15, 2018
aa7540b
remove unused library
galadril Oct 15, 2018
e2add4f
Fixed overlapping issue with Ads #485
galadril Oct 16, 2018
94b280f
Update version for beta
galadril Oct 16, 2018
2a1448a
Fix layout issue with the info button
Oct 18, 2018
9a3202a
Quicky fixed a crash report from the last beta
Oct 18, 2018
bc16475
Fix issues with the camera share image fab button
Oct 19, 2018
c549f2a
Various fixes/cleanup
Oct 19, 2018
805cca3
Fix OOTT with the latest Domoticz ui changes
Oct 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 13 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -139,7 +147,6 @@ repositories {
}
}


allprojects {
repositories {
jcenter()
Expand Down Expand Up @@ -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
}
Expand All @@ -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')
Expand Down
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
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
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
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}

Expand All @@ -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() {
Expand All @@ -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);
}
});
}
}

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
Loading