Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeptitGeek committed Nov 5, 2017
1 parent 8d58912 commit cc73401
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 23 deletions.
Binary file removed apk/GladysBetaV0.4.3.apk
Binary file not shown.
Binary file added apk/GladysBetaV1.4.5.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.4.3"
versionName "1.4.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
case 2:

String multilevelValueNull = context.getString(R.string.value) + " " + context.getString(R.string.empty);
String multilevelValue = context.getString(R.string.value) + " " + results.get(position).getLastValue().toString();

((MultilevelViewHolder) holder).device_multilevel_name.setText(results.get(position).getDevicetypeName());
((MultilevelViewHolder) holder).device_multilevel_room.setText(results.get(position).getRoomName());

if (results.get(position).getLastValue() == null) {
((MultilevelViewHolder) holder).device_multilevel_value_text.setText(multilevelValueNull);
} else {
String multilevelValue = context.getString(R.string.value) + " " + results.get(position).getLastValue().toString();
((MultilevelViewHolder) holder).device_multilevel_value_text.setText(multilevelValue);
}

Expand Down Expand Up @@ -145,14 +145,13 @@ public void onStopTrackingTouch(SeekBar seekBar) {

default:

String sensorValue = results.get(position).getLastValue().toString() + " " + results.get(position).getUnit();

((SensorViewHolder) holder).device_sensor_name.setText(results.get(position).getDevicetypeName());
((SensorViewHolder) holder).device_sensor_room.setText(results.get(position).getRoomName());

if(results.get(position).getLastValue() == null) {
((SensorViewHolder) holder).device_sensor_value.setText("0");
}else {
String sensorValue = results.get(position).getLastValue().toString() + " " + results.get(position).getUnit();
((SensorViewHolder) holder).device_sensor_value.setText(sensorValue);
}

Expand Down
30 changes: 20 additions & 10 deletions app/src/main/java/com/gladysinc/gladys/AlarmFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ public void onResponse(Call<List<Alarm>> call, Response<List<Alarm>> response) {

@Override
public void onFailure(Call<List<Alarm>> call, Throwable t) {
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down Expand Up @@ -504,8 +506,10 @@ public void onResponse(Call<Alarm> call, Response<Alarm> response) {

@Override
public void onFailure(Call<Alarm> call, Throwable t) {
if (getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down Expand Up @@ -541,8 +545,10 @@ public void onResponse(Call<Alarm> call, Response<Alarm> response) {

@Override
public void onFailure(Call<Alarm> call, Throwable t) {
if (getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down Expand Up @@ -579,8 +585,10 @@ public void onResponse(Call<Alarm> call, Response<Alarm> response) {

@Override
public void onFailure(Call<Alarm> call, Throwable t) {
if (getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down Expand Up @@ -723,8 +731,10 @@ public void onResponse(Call<Void> call, Response<Void> response) {
}
@Override
public void onFailure(Call<Void> call, Throwable t) {
if (getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/gladysinc/gladys/BrainFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void onResponse(Call<List<BrainSentences>> call, Response<List<BrainSente

@Override
public void onFailure(Call<List<BrainSentences>> call, Throwable t) {
if (!t.getMessage().equalsIgnoreCase("Socket closed")) {
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/com/gladysinc/gladys/DashboardFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down Expand Up @@ -190,7 +191,8 @@ public void onResponse(Call<List<DevicetypeByRoom>> call, Response<List<Devicety

@Override
public void onFailure(Call<List<DevicetypeByRoom>> call, Throwable t) {
if(!t.getMessage().equalsIgnoreCase("Socket closed")){

if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
Expand Down Expand Up @@ -240,8 +242,10 @@ public void onResponse(Call<Void> call,Response<Void> response) {
}
@Override
public void onFailure(Call<Void> call,Throwable t) {
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/gladysinc/gladys/RoomsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void onResponse(Call<List<DevicetypeByRoom>> call, Response<List<Devicety

@Override
public void onFailure(Call<List<DevicetypeByRoom>> call, Throwable t) {
if(!t.getMessage().equalsIgnoreCase("Socket closed")){
if(!Objects.equals(t.getMessage(), "java.net.SocketTimeoutException")){
if(getActivity() != null){
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/com/gladysinc/gladys/TimelineFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down Expand Up @@ -106,7 +105,6 @@ public void getAllEvents() {
public void onResponse(Call<List<Event>> call, Response<List<Event>> response) {

List<Event> TimelineData = response.body();
Log.d("Timeline", "Salut");

if(TimelineData != null){
save_data = new SaveData(TimelineFragment.this);
Expand All @@ -126,7 +124,6 @@ public void onFailure(Call<List<Event>> call, Throwable t) {
Snackbar.make(getActivity().findViewById(R.id.layout), getActivity().getString(R.string.error) + " " + "6", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
get_data_progress.setVisible(false);
Log.d("Timeline", String.valueOf(t));
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<string name="negative_button">Annuler</string>
<string name="new_object">Nouveau</string>
<string name="no_data">Aucune donnée !</string>
<string name="number_version">Gladys Beta 0.4.3</string>
<string name="number_version">Gladys Beta 1.4.5</string>
<string name="okhttp">https://github.com/square/okhttp</string>
<string name="open_source_license">Licenses open source</string>
<string name="port">Port</string>
Expand Down

0 comments on commit cc73401

Please sign in to comment.