-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #556 from domoticz/alpha-development
Alpha development
- Loading branch information
Showing
28 changed files
with
719 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
app/src/main/java/nl/hnogames/domoticz/Fragments/Error.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
70
app/src/main/java/nl/hnogames/domoticz/Fragments/Loading.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.