Commit 4f7b0a84 authored by Lucas Braz Cunha's avatar Lucas Braz Cunha

Merge branch 'check_schedules' into 'develop'

Check schedules

See merge request !16
parents 8e7761f8 3ed09781
......@@ -37,4 +37,5 @@ dependencies {
compile 'com.prolificinteractive:material-calendarview:1.4.3'
compile 'com.android.support:recyclerview-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
......@@ -174,11 +174,13 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
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
......@@ -231,7 +233,11 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
case R.id.nav_schedule:
intent = new Intent(this, CitizenListActivity.class);
startActivity(intent);
break;
return true;
case R.id.nav_check_schedules:
intent = new Intent(this, SchedulesActivity.class);
startActivity(intent);
return true;
case R.id.nav_dependants:
intent = new Intent(this, DependentsListActivity.class);
startActivity(intent);
......@@ -259,6 +265,7 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
snackbar.show();
}
}
}
}
......
package br.ufpr.c3sl.agendador.agendador;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.view.menu.MenuBuilder;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import br.ufpr.c3sl.agendador.agendador.helpers.ObscuredSharedPreferences;
import br.ufpr.c3sl.agendador.agendador.helpers.UserPhotoHelper;
public class SchedulesActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private NavigationView navigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_schedules);
//fazer parecido com o agendador antigo e colocar uma string que diz quantos dias faltam
//arrumar os spinners pra terem duas coisas - ????
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_schedules);
Toolbar toolbar = (Toolbar) findViewById(R.id.agendador_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
ObscuredSharedPreferences osb = ObscuredSharedPreferences.getPrefs(this, "Agendador", Context.MODE_PRIVATE);
String citizenName = osb.getString("name", null);
String citizenCity = osb.getString("city.name", null);
MenuBuilder menuBuilder;
final DrawerLayout drawer;
ActionMenuView actionMenuView = (ActionMenuView) toolbar.findViewById(R.id.agendador_toolbar_menu);
menuBuilder = (MenuBuilder) actionMenuView.getMenu();
//noinspection RestrictedApi
menuBuilder.setCallback(new MenuBuilder.Callback() {
@Override
public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {
return onOptionsItemSelected(item);
}
@Override
public void onMenuModeChange(MenuBuilder menu) {
}
});
ImageView drawerHamburger = (ImageView) toolbar.findViewById(R.id.img_toolbar_hamburger);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
navigationView = (NavigationView) findViewById(R.id.home_navigation_view);
View headerView = navigationView.getHeaderView(0);
ImageView drawerProfilePicture = (ImageView) headerView.findViewById(R.id.img_drawerheader_citizen_photo);
UserPhotoHelper userPhotoHelper = new UserPhotoHelper(getBaseContext());
TextView drawerCitizenName = (TextView) headerView.findViewById(R.id.tv_drawerheader_citizen_name);
TextView drawerCityName = (TextView) headerView.findViewById(R.id.tv_drawerheader_city_name);
drawerCitizenName.setText(citizenName);
drawerCityName.setText(citizenCity);
if(userPhotoHelper.existsPhoto()){
userPhotoHelper.updateImgView(drawerProfilePicture, userPhotoHelper.getPhotoFileUri());
}
drawerHamburger.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawer.openDrawer(Gravity.START);
}
});
navigationView.setCheckedItem(R.id.nav_check_schedules);
navigationView.setNavigationItemSelectedListener(this);
}
@Override
protected void onResume() {
super.onResume();
navigationView.setCheckedItem(R.id.nav_check_schedules);
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Intent intent;
switch (item.getItemId()) {
case R.id.nav_my_info:
intent = new Intent(this, AccountActivity.class);
startActivity(intent);
return true;
case R.id.nav_schedule:
intent = new Intent(this, TermActivity.class);
startActivity(intent);
return true;
case R.id.nav_check_schedules:
return true;
default:
}
return false;
}
}
......@@ -371,8 +371,13 @@ public class SchedulingActivity extends AppCompatActivity implements SchedulingV
startActivity(intent);
break;
case R.id.nav_schedule:
//do nothing.
break;
intent = new Intent(this, TermActivity.class);
item.setChecked(false);
startActivity(intent);
case R.id.nav_check_schedules:
intent = new Intent(this, SchedulesActivity.class);
startActivity(intent);
return true;
default:
break;
}
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/appbar_schedules"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/home_navigation_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_drawer_header"
app:menu="@menu/activity_home_drawer" />
</android.support.v4.widget.DrawerLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/toolbar"/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_schedules" />
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="59dp"
android:background="@color/colorGray"
android:orientation="vertical">
<TextView
android:id="@+id/tv_homeact_welcome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:text="@string/check_schedules"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:typeface="normal" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tv_homeact_welcome"
android:background="@color/colorWhite">
<TextView
android:id="@+id/tv_schedules_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="15dp"
android:gravity="start"
android:text="@string/schedules_search"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="16sp"
android:textStyle="bold"
android:typeface="normal" />
<LinearLayout
android:id="@+id/ll_schedules_fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_schedules_title"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_gravity="start"
android:text="@string/schedules_sector"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:typeface="normal"/>
<Spinner
android:id="@+id/spnr_scheduling_sector"
android:layout_marginEnd="35dp"
android:layout_marginStart="14dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_gravity="start"
android:text="@string/schedules_type"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:typeface="normal"/>
<Spinner
android:id="@+id/spnr_scheduling_type"
android:layout_marginEnd="35dp"
android:layout_marginStart="14dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_gravity="start"
android:text="@string/schedules_location"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:typeface="normal"/>
<Spinner
android:id="@+id/spnr_scheduling_location"
android:layout_marginEnd="35dp"
android:layout_marginStart="14dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_gravity="start"
android:text="@string/schedules_citizen"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:typeface="normal"/>
<Spinner
android:id="@+id/spnr_scheduling_citizen"
android:layout_marginEnd="35dp"
android:layout_marginStart="14dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_schedules_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_schedules_fields"
android:layout_marginTop="10dp"
android:layout_marginStart="10dp"
android:gravity="start"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="@drawable/green_button_shape"
android:text="@string/schedules_search_button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:padding="5dp"
android:background="@drawable/gray_container_shape"
android:textColor="@color/colorRed"
android:text="@string/reset_fields" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_schedules"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorGray"
android:layout_marginTop="20dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_below="@id/ll_schedules_buttons"/>
</RelativeLayout>
<ProgressBar
android:id="@+id/pb_scheduling"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminate="true"
android:visibility="invisible" />
</RelativeLayout>
\ No newline at end of file
......@@ -28,7 +28,7 @@
android:background="@color/colorWhite">
<LinearLayout
android:id="@+id/ll_scheduling_fields"
android:id="@+id/ll_schedules_fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_schedules_list_date"
android:layout_width="wrap_content"
android:text="@string/schedules_list_date"
android:textColor="@color/colorBlack"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_schedules_list_date_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_schedules_list_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/schedules_list_location"
android:textColor="@color/colorBlack"/>
<TextView
android:id="@+id/tv_schedules_list_location_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_schedules_list_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorBlack"
android:text="@string/schedules_list_type" />
<TextView
android:id="@+id/tv_schedules_list_type_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -143,6 +143,18 @@
<item>Sex</item>
<item>Sáb</item>
</string-array>
<string name="schedules_date">Atendimentos marcados</string>
<string name="schedules_list_date">Data:</string>
<string name="schedules_list_location">Local:</string>
<string name="schedules_list_type">Tipo de Atendimento:</string>
<string name="schedules_search">Buscar Agendamentos</string>
<string name="schedules_search_button">Buscar</string>
<string name="reset_fields">Limpar Campos</string>
<string name="schedules_sector">1.Setor</string>
<string name="schedules_type">2.Tipo</string>
<string name="schedules_location">3.Local de atendimento</string>
<string name="schedules_citizen">Cidadão</string>
<string name="scheduling_available_date">Datas disponíveis</string>
<string name="highlight_date_accessibility">Círculo ao redor de uma data demonstra que ela está disponível para agendamento</string>
<string name="scheduling_dependent_hint">Selecione um cidadão</string>
......
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