Skip to content

Commit

Permalink
Merge pull request #556 from domoticz/alpha-development
Browse files Browse the repository at this point in the history
Alpha development
  • Loading branch information
galadril committed Oct 21, 2019
2 parents 7c44221 + 6b1e867 commit b562d35
Show file tree
Hide file tree
Showing 28 changed files with 719 additions and 378 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
- Device: [e.g. Xiaomi Mix 3]
- OS: [e.g. Android 9.0]
- Domoticz system version [e.g. 4.18545]
- Domoticz app version [e.g. 0.1.142]

**Additional context**
Add any other context about the problem here.
35 changes: 23 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apply plugin: 'com.android.application'


android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion "29.0.2"

def versionPropsFile = file('version.properties')

Expand Down Expand Up @@ -38,7 +38,7 @@ android {
versionCode version_Code
versionName "${versionMajor}.${versionMinor}.${versionPatch} (${versionBuild})"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
multiDexEnabled true
wearAppUnbundled true
}
Expand All @@ -50,6 +50,18 @@ android {
incremental = false;
}

bundle {
language {
enableSplit = false
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}

//noinspection GroovyAssignabilityCheck
buildTypes {
release {
Expand Down Expand Up @@ -161,20 +173,20 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.biometric:biometric:1.0.0-alpha04'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.biometric:biometric:1.0.0-rc01'
implementation 'com.google.android.material:material:1.1.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.annotation:annotation:1.1.0'

implementation "com.google.firebase:firebase-core:17.1.0"
implementation "com.google.firebase:firebase-core:17.2.0"
implementation "com.google.firebase:firebase-crash:16.2.1"
implementation "com.google.firebase:firebase-perf:19.0.0"
implementation "com.google.firebase:firebase-perf:19.0.1"
implementation "com.google.firebase:firebase-messaging:20.0.0"
implementation "com.google.firebase:firebase-ads:18.1.1"
implementation "com.google.firebase:firebase-ads:18.2.0"
implementation "com.crashlytics.sdk.android:crashlytics:2.10.1"

implementation "com.google.android.gms:play-services-analytics:17.0.0"
Expand All @@ -183,7 +195,7 @@ dependencies {
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.1.1"
implementation "com.google.android.gms:play-services-ads:18.2.0"
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
implementation "com.github.nisrulz:recyclerviewhelper:27.1.1"

Expand Down Expand Up @@ -238,7 +250,6 @@ buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
Expand Down
23 changes: 22 additions & 1 deletion app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,28 @@ public void onError(Exception error) {

@Override
public void onError(Exception error) {
errorHandling(error, coordinatorLayout);
mDomoticz.checkLogin_oldMethod(new LoginReceiver() {
@Override
public void OnReceive(LoginInfo mLoginInfo) {
mDomoticz.getCameras(new CameraReceiver() {
@Override
public void OnReceiveCameras(ArrayList<CameraInfo> Cameras) {
successHandling(Cameras.toString(), false);
SerializableManager.saveSerializable(context, Cameras, "Cameras");
createListView(Cameras);
}

@Override
public void onError(Exception error) {
errorHandling(error, coordinatorLayout);
}
});
}
@Override
public void onError(Exception error) {
errorHandling(error, coordinatorLayout);
}
});
}
});
}
Expand Down
92 changes: 92 additions & 0 deletions app/src/main/java/nl/hnogames/domoticz/Fragments/Error.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (C) 2015 Domoticz - Mark Heinis
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package nl.hnogames.domoticz.Fragments;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;

import com.google.android.material.snackbar.Snackbar;

import java.util.ArrayList;

import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import hugo.weaving.DebugLog;
import jp.wasabeef.recyclerview.adapters.SlideInBottomAnimationAdapter;
import nl.hnogames.domoticz.Adapters.EventsAdapter;
import nl.hnogames.domoticz.Interfaces.DomoticzFragmentListener;
import nl.hnogames.domoticz.Interfaces.EventsClickListener;
import nl.hnogames.domoticz.MainActivity;
import nl.hnogames.domoticz.R;
import nl.hnogames.domoticz.Utils.SerializableManager;
import nl.hnogames.domoticz.Utils.UsefulBits;
import nl.hnogames.domoticz.app.DomoticzRecyclerFragment;
import nl.hnogames.domoticzapi.Containers.EventInfo;
import nl.hnogames.domoticzapi.Containers.UserInfo;
import nl.hnogames.domoticzapi.DomoticzValues;
import nl.hnogames.domoticzapi.Interfaces.EventReceiver;
import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver;
import nl.hnogames.domoticzapi.Utils.PhoneConnectionUtil;

public class Error extends DomoticzRecyclerFragment implements DomoticzFragmentListener {
private Context mContext;

@Override
public void onConnectionFailed() {}

@Override
@DebugLog
public void onAttach(Context context) {
super.onAttach(context);
onAttachFragment(this);
mContext = context;
}

@Override
public void onActivityCreated(Bundle savedInstanceState) {
onAttachFragment(this);
super.onActivityCreated(savedInstanceState);
}

@Override
@DebugLog
public void onConnectionOk() {
super.showSpinner(true);
if (getActivity() instanceof MainActivity) {
if(((MainActivity) getActivity()).configException != null)
errorHandling(((MainActivity) getActivity()).configException);
}
}

@Override
@DebugLog
public void errorHandling(Exception error) {
if (error != null) {
// Let's check if were still attached to an activity
if (isAdded()) {
if (mSwipeRefreshLayout != null)
mSwipeRefreshLayout.setRefreshing(false);
super.errorHandling(error);
}
}
}
}
70 changes: 70 additions & 0 deletions app/src/main/java/nl/hnogames/domoticz/Fragments/Loading.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright (C) 2015 Domoticz - Mark Heinis
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package nl.hnogames.domoticz.Fragments;

import android.content.Context;
import android.os.Bundle;

import hugo.weaving.DebugLog;
import nl.hnogames.domoticz.Interfaces.DomoticzFragmentListener;
import nl.hnogames.domoticz.MainActivity;
import nl.hnogames.domoticz.app.DomoticzRecyclerFragment;

public class Loading extends DomoticzRecyclerFragment implements DomoticzFragmentListener {

@Override
public void onConnectionFailed() {}

@Override
@DebugLog
public void onAttach(Context context) {
super.onAttach(context);
onAttachFragment(this);
}

@Override
public void onActivityCreated(Bundle savedInstanceState) {
onAttachFragment(this);
super.onActivityCreated(savedInstanceState);
}

@Override
@DebugLog
public void onConnectionOk() {
super.showSpinner(true);
if (mSwipeRefreshLayout != null)
mSwipeRefreshLayout.setRefreshing(true);
}

@Override
@DebugLog
public void errorHandling(Exception error) {
if (error != null) {
// Let's check if were still attached to an activity
if (isAdded()) {
if (mSwipeRefreshLayout != null)
mSwipeRefreshLayout.setRefreshing(false);
super.errorHandling(error);
}
}
}
}
10 changes: 5 additions & 5 deletions app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void onActionClicked(View view, Card card) {
@Override
@DebugLog
public void onActionClicked(View view, Card card) {
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches");
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches", true);
}
}))
.addAction(R.id.right_text_button, new TextViewAction(context)
Expand Down Expand Up @@ -596,7 +596,7 @@ public void onActionClicked(View view, Card card) {
@Override
@DebugLog
public void onActionClicked(View view, Card card) {
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities");
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities", true);
}
}))
.addAction(R.id.right_text_button, new TextViewAction(context)
Expand Down Expand Up @@ -629,7 +629,7 @@ public void onActionClicked(View view, Card card) {
@Override
@DebugLog
public void onActionClicked(View view, Card card) {
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches");
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches", true);
}
}))
.addAction(R.id.right_text_button, new TextViewAction(context)
Expand Down Expand Up @@ -699,7 +699,7 @@ 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");
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard", true);
}
}))
.addAction(R.id.right_text_button, new TextViewAction(context)
Expand All @@ -712,7 +712,7 @@ 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");
((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard", true);
}
}))
.endConfig()
Expand Down
Loading

0 comments on commit b562d35

Please sign in to comment.