Commit 58306e25 authored by Lucas Braz Cunha's avatar Lucas Braz Cunha
Browse files

Layout fix & minor bug fix on schedulesHistoryActivity


Signed-off-by: Lucas Braz Cunha's avatarLucas B. Cunha <lbc16@inf.ufpr.br>
parent 338c2033
...@@ -188,17 +188,17 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -188,17 +188,17 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
sp_situation = (Spinner) findViewById(R.id.spnr_history_situation); sp_situation = (Spinner) findViewById(R.id.spnr_history_situation);
sp_situation.setEnabled(false); sp_situation.setEnabled(false);
final String[] sector = {"", getResources().getString(R.string.spinner_sector_hint)}; final String[] sector = {"", getResources().getString(R.string.spinner_no_filter)};
HintAdapter sectorAdapter = new HintAdapter(this, android.R.layout.simple_list_item_1, sector); HintAdapter sectorAdapter = new HintAdapter(this, android.R.layout.simple_list_item_1, sector);
sp_sector.setAdapter(sectorAdapter); sp_sector.setAdapter(sectorAdapter);
sp_sector.setSelection(sectorAdapter.getCount()); sp_sector.setSelection(sectorAdapter.getCount());
final String[] types = {"", getResources().getString(R.string.spinner_type_hint)}; final String[] types = {"", getResources().getString(R.string.spinner_no_filter)};
HintAdapter adapterType = new HintAdapter(this, android.R.layout.simple_list_item_1, types); HintAdapter adapterType = new HintAdapter(this, android.R.layout.simple_list_item_1, types);
sp_serviceType.setAdapter(adapterType); sp_serviceType.setAdapter(adapterType);
sp_serviceType.setSelection(adapterType.getCount()); sp_serviceType.setSelection(adapterType.getCount());
final String[] locations = {"", getResources().getString(R.string.spinner_place_hint)}; final String[] locations = {"", getResources().getString(R.string.spinner_no_filter)};
HintAdapter adapterLocation = new HintAdapter(this, android.R.layout.simple_list_item_1, locations); HintAdapter adapterLocation = new HintAdapter(this, android.R.layout.simple_list_item_1, locations);
sp_servicePlaces.setAdapter(adapterLocation); sp_servicePlaces.setAdapter(adapterLocation);
sp_servicePlaces.setSelection(adapterLocation.getCount()); sp_servicePlaces.setSelection(adapterLocation.getCount());
...@@ -237,7 +237,8 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -237,7 +237,8 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
bt_clear.setOnClickListener(new View.OnClickListener() { bt_clear.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
onSuccessfulSectorRequest(filters); if(filters != null)
onSuccessfulSectorRequest(filters);
} }
}); });
...@@ -782,7 +783,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -782,7 +783,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
String[] servicePlacesNamesArray; String[] servicePlacesNamesArray;
String[] situationNamesArray; String[] situationNamesArray;
if(filters.getSectors().size() > 0){ if(filters.getSectors() != null && filters.getSectors().size() > 0){
sectorsNamesArray = new String[filters.getSectors().size() + 1]; sectorsNamesArray = new String[filters.getSectors().size() + 1];
sectorsIdArray = new long[filters.getSectors().size() + 1]; sectorsIdArray = new long[filters.getSectors().size() + 1];
...@@ -802,7 +803,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -802,7 +803,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
sectorsIdArray[0] = -1; sectorsIdArray[0] = -1;
} }
if(filters.getServiceTypes().size() > 0){ if(filters.getServiceTypes() != null && filters.getServiceTypes().size() > 0){
serviceTypesNamesArray = new String[filters.getServiceTypes().size() + 1]; serviceTypesNamesArray = new String[filters.getServiceTypes().size() + 1];
serviceTypesIdArray = new long[filters.getServiceTypes().size() + 1]; serviceTypesIdArray = new long[filters.getServiceTypes().size() + 1];
...@@ -821,7 +822,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -821,7 +822,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
serviceTypesIdArray[0] = -1; serviceTypesIdArray[0] = -1;
} }
if(filters.getServicePlaces().size() > 0){ if(filters.getServicePlaces() != null && filters.getServicePlaces().size() > 0){
servicePlacesNamesArray = new String[filters.getServicePlaces().size() + 1]; servicePlacesNamesArray = new String[filters.getServicePlaces().size() + 1];
servicePlacesIdArray = new long[filters.getServicePlaces().size() + 1]; servicePlacesIdArray = new long[filters.getServicePlaces().size() + 1];
...@@ -841,7 +842,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig ...@@ -841,7 +842,7 @@ public class SchedulesHistoryActivity extends AppCompatActivity implements Navig
} }
if(filters.getSituationList().size() > 0){ if(filters.getServicePlaces() != null && filters.getServicePlaces().size() > 0){
situationNamesArray = new String[filters.getSituationList().size() + 1]; situationNamesArray = new String[filters.getSituationList().size() + 1];
situationIdArray = new long[filters.getSituationList().size() + 1]; situationIdArray = new long[filters.getSituationList().size() + 1];
......
...@@ -14,8 +14,8 @@ import retrofit2.converter.gson.GsonConverterFactory; ...@@ -14,8 +14,8 @@ import retrofit2.converter.gson.GsonConverterFactory;
*/ */
public abstract class ApiUtils { public abstract class ApiUtils {
public static final String BASE_URL = "http://10.0.2.2:3000/v1/"; // public static final String BASE_URL = "http://10.0.2.2:3000/v1/";
// public static final String BASE_URL = "http://newcastle.c3sl.ufpr.br/develop/v1/"; public static final String BASE_URL = "http://newcastle.c3sl.ufpr.br/develop/v1/";
public static ApiEndpoints request(final Map<String, String> header) { public static ApiEndpoints request(final Map<String, String> header) {
OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
......
...@@ -62,6 +62,9 @@ public class SchedulesHistoryPresenter extends BasePresenter<SchedulesHistoryAct ...@@ -62,6 +62,9 @@ public class SchedulesHistoryPresenter extends BasePresenter<SchedulesHistoryAct
default: default:
Log.e("Server response", getClass().getName() + ": ERRO:" + status); Log.e("Server response", getClass().getName() + ": ERRO:" + status);
presenter.view().setConnectionError(true); presenter.view().setConnectionError(true);
presenter.view().setProgressBar(false);
presenter.view().enableSpinners(false);
presenter.view().enableButtons(false);
break; break;
} }
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="@color/disabled_red_text" />
<item android:color="@color/enabled_red_text" />
</selector>
\ No newline at end of file
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:padding="5dp" android:padding="5dp"
android:background="@drawable/gray_container_shape" android:background="@drawable/gray_container_shape"
android:textColor="@color/colorRed" android:textColor="@drawable/red_text_color"
android:text="@string/reset_fields" /> android:text="@string/reset_fields" />
</LinearLayout> </LinearLayout>
......
...@@ -3,15 +3,13 @@ ...@@ -3,15 +3,13 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/btn_edit_account"
android:title="Editar"
android:icon="@drawable/ic_edit_account"
app:showAsAction="ifRoom"/>
<item android:id="@+id/btn_sync_account" <item android:id="@+id/btn_sync_account"
android:title="Sincronizar" android:title="@string/menu_sync"
android:icon="@android:drawable/stat_notify_sync_noanim" android:icon="@android:drawable/stat_notify_sync_noanim"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item android:id="@+id/configuration_actionbtn" <item android:id="@+id/btn_edit_account"
android:title="Configurações" android:title="@string/menu_edit"
app:showAsAction="never"/> android:icon="@drawable/ic_edit_account"
app:showAsAction="ifRoom"/>
</menu> </menu>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/bt_edit_dependent" <item android:id="@+id/bt_edit_dependent"
android:title="Editar" android:title="@string/menu_edit"
android:icon="@drawable/ic_edit_account" android:icon="@drawable/ic_edit_account"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
</menu> </menu>
\ No newline at end of file
...@@ -4,15 +4,12 @@ ...@@ -4,15 +4,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/notification_actionbtn" <item android:id="@+id/notification_actionbtn"
android:title="Notificações" android:title="@string/menu_notifications"
android:icon="@drawable/ic_notification_bell" android:icon="@drawable/ic_notification_bell"
app:showAsAction="always"/> app:showAsAction="always"/>
<item android:id="@+id/logout_actionbtn" <item android:id="@+id/logout_actionbtn"
android:title="Sair" android:title="@string/menu_sign_out"
android:icon="@drawable/ic_logout" android:icon="@drawable/ic_logout"
app:showAsAction="always"/> app:showAsAction="ifRoom"/>
<item android:id="@+id/configuration_actionbtn"
android:title="Configurações"
app:showAsAction="never"/>
</menu> </menu>
\ No newline at end of file
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<color name="colorGray">#EEEEED</color> <color name="colorGray">#EEEEED</color>
<color name="colorBlack">#2B2B2B</color> <color name="colorBlack">#2B2B2B</color>
<color name="colorRed">#E73C3B</color> <color name="colorRed">#E73C3B</color>
<color name="enabled_red_text">#E73C3B</color>
<color name="disabled_red_text">#e8b3b2</color>
<color name="colorGreen">#92BF28</color> <color name="colorGreen">#92BF28</color>
<color name="colorWhite">#ffffff</color> <color name="colorWhite">#ffffff</color>
<color name="colorDisabled">#aaaaaa</color> <color name="colorDisabled">#aaaaaa</color>
......
...@@ -199,5 +199,9 @@ ...@@ -199,5 +199,9 @@
<string name="calendar_header_hour">%s , %s %s - %s</string> <string name="calendar_header_hour">%s , %s %s - %s</string>
<string name="calendar_header_basic">%s , %s %s</string> <string name="calendar_header_basic">%s , %s %s</string>
<string name="schedule_confirmation_situation">6.Situação:</string> <string name="schedule_confirmation_situation">6.Situação:</string>
<string name="menu_notifications">Notificações</string>
<string name="menu_sign_out">Sair</string>
<string name="menu_edit">Editar</string>
<string name="menu_sync">Sincronizar</string>
</resources> </resources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment