Commit a0f9df02 authored by Lucas Braz Cunha's avatar Lucas Braz Cunha

Merge branch 'list_update_dependents' into 'develop'

List update dependents

See merge request !14
parents 64c6218e e7fe7333
......@@ -29,13 +29,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity"></activity>
<activity android:name=".HomeActivity"></activity>
<activity android:name=".CepActivity"></activity>
<activity android:name=".CepNotFoundActivity"></activity>
<activity android:name=".SignupActivity"></activity>
<activity android:name=".AccountActivity"></activity>
<activity android:name=".ForgotPasswordActivity"></activity>
<activity android:name=".LoginActivity" />
<activity android:name=".HomeActivity" />
<activity android:name=".CepActivity" />
<activity android:name=".CepNotFoundActivity" />
<activity android:name=".SignUpActivity" />
<activity android:name=".AccountActivity" />
<activity android:name=".ForgotPasswordActivity" />
<activity android:name=".DependentsListActivity" />
<service
android:name=".services.ImageUpdateService"
......@@ -52,7 +53,9 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity android:name=".CitizenActivity" />
<activity android:name=".ScheduleConfirmationActivity"></activity>
<activity android:name=".ScheduleConfirmationActivity" />
<activity android:name=".DependentUpdateActivity" />
<activity android:name=".NewDependentActivity"/>
</application>
</manifest>
\ No newline at end of file
......@@ -13,6 +13,7 @@ import android.widget.TextView;
import br.ufpr.c3sl.agendador.agendador.helpers.Mask;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionErrorDialog;
import br.ufpr.c3sl.agendador.agendador.presenters.CepPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.CepView;
/**
......@@ -34,6 +35,8 @@ public class CepActivity extends AppCompatActivity implements CepView {
presenter = new CepPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new CepPresenter(this);
}
setContentView(R.layout.activity_cep);
......
......@@ -8,6 +8,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import br.ufpr.c3sl.agendador.agendador.presenters.CepNotFoundPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.CepNotFoundView;
/**
......@@ -27,6 +28,8 @@ public class CepNotFoundActivity extends AppCompatActivity implements CepNotFoun
presenter = new CepNotFoundPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new CepNotFoundPresenter(this);
}
setContentView(R.layout.activity_cep_not_found);
......
......@@ -15,13 +15,13 @@ import android.widget.ProgressBar;
import java.util.List;
import br.ufpr.c3sl.agendador.agendador.helpers.adapters.CitizensArrayAdapter;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionErrorDialog;
import br.ufpr.c3sl.agendador.agendador.helpers.Utils;
import br.ufpr.c3sl.agendador.agendador.helpers.listeners.CitizensItemListener;
import br.ufpr.c3sl.agendador.agendador.models.CitizenCompact;
import br.ufpr.c3sl.agendador.agendador.helpers.adapters.CitizensArrayAdapter;
import br.ufpr.c3sl.agendador.agendador.helpers.listeners.RecyclerViewItemListener;
import br.ufpr.c3sl.agendador.agendador.models.UserOutput;
import br.ufpr.c3sl.agendador.agendador.presenters.CitizensPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.CitizenView;
......@@ -45,14 +45,17 @@ public class CitizenActivity extends AppCompatActivity implements CitizenView{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_citizen);
if (savedInstanceState == null) {
citizensPresenter = new CitizensPresenter(this);
} else {
}
else{
citizensPresenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(citizensPresenter == null){
citizensPresenter = new CitizensPresenter(this);
}
}
setContentView(R.layout.activity_citizen);
pb_citizen = (ProgressBar) findViewById(R.id.pb_citizenact);
......@@ -66,8 +69,8 @@ public class CitizenActivity extends AppCompatActivity implements CitizenView{
rv_citizens.setVisibility(View.INVISIBLE);
rv_citizens.addOnItemTouchListener(new CitizensItemListener(getApplicationContext(), rv_citizens,
new CitizensItemListener.RecyclerTouchListener() {
rv_citizens.addOnItemTouchListener(new RecyclerViewItemListener(getApplicationContext(), rv_citizens,
new RecyclerViewItemListener.RecyclerTouchListener() {
public void onClickItem(View v, int position) {
Intent intent = new Intent(CitizenActivity.this, TermActivity.class);
Bundle bundle = new Bundle();
......@@ -82,14 +85,17 @@ public class CitizenActivity extends AppCompatActivity implements CitizenView{
}
}));
}
@Override
protected void onResume() {
super.onResume();
citizensPresenter.bindView(this);
citizensPresenter.requestCitizens();
if(citizens == null)
citizensPresenter.requestCitizens();
}
@Override
......@@ -105,9 +111,10 @@ public class CitizenActivity extends AppCompatActivity implements CitizenView{
}
public void showLayout(boolean enabled) {
rv_citizens.setAdapter(new CitizensArrayAdapter(this, citizens));
rv_citizens.setVisibility(View.VISIBLE);
if(enabled){
rv_citizens.setAdapter(new CitizensArrayAdapter(this, citizens));
rv_citizens.setVisibility(View.VISIBLE);
}
}
public void successfulCitizens(List<CitizenCompact> citizens) {
......@@ -158,5 +165,4 @@ public class CitizenActivity extends AppCompatActivity implements CitizenView{
}
}
package br.ufpr.c3sl.agendador.agendador;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Toast;
import java.io.IOException;
import java.util.List;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionErrorDialog;
import br.ufpr.c3sl.agendador.agendador.helpers.UserImgHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.Utils;
import br.ufpr.c3sl.agendador.agendador.helpers.adapters.DependentsArrayAdapter;
import br.ufpr.c3sl.agendador.agendador.helpers.listeners.RecyclerViewItemListener;
import br.ufpr.c3sl.agendador.agendador.models.Dependent;
import br.ufpr.c3sl.agendador.agendador.models.FullDependent;
import br.ufpr.c3sl.agendador.agendador.presenters.DependentsListPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.DependentsListView;
/**
* Created by Lucas B. Cunha on 08/08/17.
*/
public class DependentsListActivity extends AppCompatActivity implements DependentsListView {
private DependentsListPresenter presenter;
private ProgressBar pb_dependents;
private RecyclerView rv_dependents;
private ConnectionFailureDialog dg_connection_failure;
private List<Dependent> dependents;
private boolean updateList;
private static final int DEPENDENT_UPDATE_CODE = 1;
private static final int NEW_DEPENDENT_CODE = 2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
presenter = new DependentsListPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new DependentsListPresenter(this);
}
setContentView(R.layout.activity_dependents_list);
FloatingActionButton fabNewDependent = (FloatingActionButton) findViewById(R.id.fab_new_dependent);
pb_dependents = (ProgressBar) findViewById(R.id.pb_dependentact);
rv_dependents = (RecyclerView) findViewById(R.id.rv_dependents);
RecyclerView.LayoutManager layout = new LinearLayoutManager(this,
LinearLayoutManager.VERTICAL, false);
rv_dependents.setLayoutManager(layout);
rv_dependents.setVisibility(View.INVISIBLE);
rv_dependents.addOnItemTouchListener(new RecyclerViewItemListener(getApplicationContext(), rv_dependents,
new RecyclerViewItemListener.RecyclerTouchListener() {
public void onClickItem(View v, int position) {
presenter.requestDependentInfo(dependents.get(position).getId());
}
public void onLongClickItem(View v, int position) {
//Do nothing
}
}));
fabNewDependent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(DependentsListActivity.this, NewDependentActivity.class);
startActivityForResult(intent, NEW_DEPENDENT_CODE);
}
});
}
public void successfulDependents(List<Dependent> dependents) {
this.dependents = dependents;
updateList = false;
showLayout(true);
}
public void onDependentReceived(FullDependent dependent){
Intent intent = new Intent(DependentsListActivity.this, DependentUpdateActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable(Utils.CITIZEN, dependent);
intent.putExtra(Utils.CITIZEN_BUNDLE, bundle);
startActivityForResult(intent, DEPENDENT_UPDATE_CODE);
}
public void onRequestFailure(){
Bundle bundle = new Bundle();
if(dg_connection_failure == null){
dg_connection_failure = new ConnectionFailureDialog();
}
bundle.putString(ConnectionErrorDialog.DIALOG_MESSAGE, getString(R.string.dialog_term_error));
dg_connection_failure.setArguments(bundle);
dg_connection_failure.show(getFragmentManager(), ConnectionErrorDialog.DIALOG_CONNECTION_ERROR);
}
@Override
public void afterSuccessfulPicture(Bitmap bitmap, long id){
// TODO: 17/04/17 user messages & error warning
UserImgHelper userImgHelper = new UserImgHelper(getBaseContext());
try {
userImgHelper.saveBitmap(bitmap, Utils.USR_PICT_FILE_NAME, id);
} catch (IOException e) {
Toast.makeText(this, "Ocorreu um problema ao atualizar sua foto de perfil", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
}
public void afterPictureFailed(){
// TODO: 17/04/17 user messages & error warning
Toast.makeText(this, "Ocorreu um problema ao carregar a foto", Toast.LENGTH_SHORT).show();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode){
case DEPENDENT_UPDATE_CODE:
break;
case NEW_DEPENDENT_CODE:
if(resultCode == Activity.RESULT_OK){
updateList = true;
}
/* do nothing
if (resultCode == Activity.RESULT_CANCELED) {
//Write your code if there's no result
}*/
break;
default:
break;
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
protected void onResume() {
super.onResume();
presenter.bindView(this);
if(dependents == null || updateList)
presenter.requestDependents();
}
@Override
protected void onPause() {
super.onPause();
presenter.unbindView();
}
@Override
public void onSaveInstanceState(Bundle outState) {
PresenterManager.getInstance().savePresenter(presenter, outState);
super.onSaveInstanceState(outState);
}
private void showLayout(boolean enabled) {
if(enabled){
rv_dependents.setAdapter(new DependentsArrayAdapter(dependents, this));
rv_dependents.setVisibility(View.VISIBLE);
}
}
public void setProgressBar(boolean enabled) {
if (enabled) {
pb_dependents.setVisibility(View.VISIBLE);
rv_dependents.setVisibility(View.INVISIBLE);
} else {
pb_dependents.setVisibility(View.INVISIBLE);
rv_dependents.setVisibility(View.VISIBLE);
}
}
public static class ConnectionFailureDialog extends DialogFragment {
public static final String DIALOG_MESSAGE_KEY = "message";
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(getArguments().getString(DIALOG_MESSAGE_KEY))
.setTitle(getString(R.string.warningDialog_title))
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dismiss();
}
});
return builder.create();
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
Activity activity = getActivity();
activity.onBackPressed();
}
}
}
......@@ -9,6 +9,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import br.ufpr.c3sl.agendador.agendador.presenters.ForgotPasswordPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.ForgotPasswordView;
/**
......@@ -32,6 +33,8 @@ public class ForgotPasswordActivity extends AppCompatActivity implements ForgotP
presenter = new ForgotPasswordPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new ForgotPasswordPresenter(this);
}
setContentView(R.layout.activity_login);
......
......@@ -31,8 +31,10 @@ import android.widget.TextView;
import android.widget.Toast;
import br.ufpr.c3sl.agendador.agendador.helpers.ObscuredSharedPreferences;
import br.ufpr.c3sl.agendador.agendador.helpers.UserPhotoHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.UserImgHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.Utils;
import br.ufpr.c3sl.agendador.agendador.presenters.HomePresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.HomeView;
/**
......@@ -47,13 +49,15 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
private DrawerLayout drawer;
private NavigationView navigationView;
private TextView tv_presentation;
private ConfirmationDialog confirmationDialog;
private UserImgHelper userImgHelper;
private ImageView drawerProfilePicture;
private Snackbar snackbar;
public static String SHOW_SCHEDULE_SNACKBAR = "snack_bar";
private long id;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -61,6 +65,8 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
presenter = new HomePresenter(this);
}else{
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new HomePresenter(this);
}
setContentView(R.layout.activity_home);
......@@ -71,7 +77,7 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
ObscuredSharedPreferences osb = ObscuredSharedPreferences.getPrefs(this, "Agendador", Context.MODE_PRIVATE);
String citizenName = osb.getString("name", null);
String citizenCity = osb.getString("city.name", null);
id = osb.getLong("id", 0);
ActionMenuView actionMenuView = (ActionMenuView) toolbar.findViewById(R.id.agendador_toolbar_menu);
menuBuilder = (MenuBuilder) actionMenuView.getMenu();
//noinspection RestrictedApi
......@@ -100,9 +106,9 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
View headerView = navigationView.getHeaderView(0);
ImageView drawerProfilePicture = (ImageView) headerView.findViewById(R.id.img_drawerheader_citizen_photo);
drawerProfilePicture = (ImageView) headerView.findViewById(R.id.img_drawerheader_citizen_photo);
UserPhotoHelper userPhotoHelper = new UserPhotoHelper(getBaseContext());
userImgHelper = new UserImgHelper(getBaseContext());
TextView drawerCitizenName = (TextView) headerView.findViewById(R.id.tv_drawerheader_citizen_name);
......@@ -112,8 +118,8 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
drawerCityName.setText(citizenCity);
if(userPhotoHelper.existsPhoto()){
userPhotoHelper.updateImgView(drawerProfilePicture, userPhotoHelper.getPhotoFileUri());
if(userImgHelper.existsPhoto(Utils.USR_PICT_FILE_NAME, id)){
drawerProfilePicture.setImageBitmap(userImgHelper.getRoundBitmap(userImgHelper.getFileUri(Utils.USR_PICT_FILE_NAME, id)));
}
drawerHamburger.setOnClickListener(new View.OnClickListener() {
......@@ -168,8 +174,16 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
protected void onResume() {
super.onResume();
presenter.bindView(this);
MenuItem item = navigationView.getMenu().findItem(R.id.nav_my_info);
item.setChecked(false);
int size = navigationView.getMenu().size();
for (int i = 0; i < size; i++) {
navigationView.getMenu().getItem(i).setChecked(false);
}
if(userImgHelper.existsPhoto(Utils.USR_PICT_FILE_NAME, id)){
drawerProfilePicture.setImageBitmap(userImgHelper.getRoundBitmap(userImgHelper.getFileUri(Utils.USR_PICT_FILE_NAME, id)));
}else{
drawerProfilePicture.setImageBitmap(null);
}
}
@Override
......@@ -223,6 +237,10 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
intent = new Intent(this, CitizenActivity.class);
startActivity(intent);
break;
case R.id.nav_dependants:
intent = new Intent(this, DependentsListActivity.class);
startActivity(intent);
break;
default:
break;
}
......
......@@ -11,6 +11,7 @@ import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextWatcher;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -23,8 +24,10 @@ import java.io.IOException;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionChecker;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionErrorDialog;
import br.ufpr.c3sl.agendador.agendador.helpers.Mask;
import br.ufpr.c3sl.agendador.agendador.helpers.UserPhotoHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.UserImgHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.Utils;
import br.ufpr.c3sl.agendador.agendador.presenters.LoginPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.LoginView;
/**
......@@ -50,6 +53,8 @@ public class LoginActivity extends AppCompatActivity implements LoginView {
presenter = new LoginPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new LoginPresenter(this);
}
setContentView(R.layout.activity_login);
......@@ -203,11 +208,12 @@ public class LoginActivity extends AppCompatActivity implements LoginView {
}
@Override
public void afterSuccessfulPhoto(Bitmap bitmap, String uid){
public void afterSuccessfulPhoto(Bitmap bitmap, long id){
// TODO: 17/04/17 user messages & error warning
UserPhotoHelper userPhotoHelper = new UserPhotoHelper(getBaseContext(), uid);
UserImgHelper userImgHelper = new UserImgHelper(getBaseContext());
try {
userPhotoHelper.saveBitmap(bitmap);
userImgHelper.saveBitmap(bitmap, Utils.USR_PICT_FILE_NAME, id);
} catch (IOException e) {
Toast.makeText(this, "Ocorreu um problema ao atualizar sua foto de perfil", Toast.LENGTH_SHORT).show();
e.printStackTrace();
......
......@@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import br.ufpr.c3sl.agendador.agendador.presenters.MainPresenter;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.views.MainView;
public class MainActivity extends AppCompatActivity implements MainView {
......@@ -17,6 +18,8 @@ public class MainActivity extends AppCompatActivity implements MainView {
presenter = new MainPresenter(this);
} else {
presenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(presenter == null)
presenter = new MainPresenter(this);
}
setContentView(R.layout.activity_main);
......
......@@ -15,7 +15,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
......@@ -31,11 +30,12 @@ import java.util.Locale;
import br.ufpr.c3sl.agendador.agendador.helpers.ConnectionErrorDialog;
import br.ufpr.c3sl.agendador.agendador.helpers.ObscuredSharedPreferences;
import br.ufpr.c3sl.agendador.agendador.helpers.UserPhotoHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.UserImgHelper;
import br.ufpr.c3sl.agendador.agendador.helpers.Utils;
import br.ufpr.c3sl.agendador.agendador.models.CitizenCompact;
import br.ufpr.c3sl.agendador.agendador.models.ScheduleConfirmation;
import br.ufpr.c3sl.agendador.agendador.models.UserOutput;
import br.ufpr.c3sl.agendador.agendador.presenters.PresenterManager;
import br.ufpr.c3sl.agendador.agendador.presenters.ScheduleConfirmationPresenter;
import br.ufpr.c3sl.agendador.agendador.views.ScheduleConfirmationView;
......@@ -62,6 +62,8 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
private static final String EXIT_CONFIRMATION_DIALOG_TAG = "exit_dialog";
private long id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -69,6 +71,8 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
scheduleConfirmationPresenter = new ScheduleConfirmationPresenter(getBaseContext());
}else{
scheduleConfirmationPresenter = PresenterManager.getInstance().restorePresenter(savedInstanceState);
if(scheduleConfirmationPresenter == null)
scheduleConfirmationPresenter = new ScheduleConfirmationPresenter(this);
}
setContentView(R.layout.activity_schedule_confirmation);
......@@ -87,6 +91,7 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
ObscuredSharedPreferences osb = ObscuredSharedPreferences.getPrefs(this, "Agendador", Context.MODE_PRIVATE);
String citizenName = osb.getString("name", null);
String citizenCity = osb.getString("city.name", null);
id = osb.getLong("id", 0);
ActionMenuView actionMenuView = (ActionMenuView) toolbar.findViewById(R.id.agendador_toolbar_menu);
menuBuilder = (MenuBuilder) actionMenuView.getMenu();
......@@ -118,7 +123,7 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
ImageView drawerProfilePicture = (ImageView) headerView.findViewById(R.id.img_drawerheader_citizen_photo);
UserPhotoHelper userPhotoHelper = new UserPhotoHelper(getBaseContext());
UserImgHelper userImgHelper = new UserImgHelper(getBaseContext());
TextView drawerCitizenName = (TextView) headerView.findViewById(R.id.tv_drawerheader_citizen_name);
......@@ -128,8 +133,8 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
drawerCityName.setText(citizenCity);
if(userPhotoHelper.existsPhoto()){
userPhotoHelper.updateImgView(drawerProfilePicture, userPhotoHelper.getPhotoFileUri());
if(userImgHelper.existsPhoto(Utils.USR_PICT_FILE_NAME, id)){
drawerProfilePicture.setImageBitmap(userImgHelper.getRoundBitmap(userImgHelper.getFileUri(Utils.USR_PICT_FILE_NAME, id)));
}
drawerHamburger.setOnClickListener(new View.OnClickListener() {
......@@ -152,7 +157,7 @@ public class ScheduleConfirmationActivity extends AppCompatActivity implements S
tv_sector.setText(sectorName);
tv_citizen.setText(citizen.getName());
tv_citizen.setText(citizen.getmName());
tv_location.setText(locationName);
tv_type.setText(typeName);
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy - HH:mm", Locale.getDefault());
......