Commit 5d132752 authored by Lucas Braz Cunha's avatar Lucas Braz Cunha

Issue AGILE#153: Initial layout done

Signed-off-by: Lucas Braz Cunha's avatarLucas B. Cunha <lbc16@inf.ufpr.br>
parent 1bb25906
......@@ -118,7 +118,7 @@ public class HomeActivity extends AppCompatActivity implements HomeView,
drawerHamburger.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawer.openDrawer(Gravity.LEFT);
drawer.openDrawer(Gravity.START);
}
});
......@@ -149,8 +149,10 @@ 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);
}
}
@Override
......
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;
public class SchedulesActivity extends AppCompatActivity {
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
//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;
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="59dp"
......@@ -34,8 +33,8 @@
android:layout_marginTop="24dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="15dp"
android:gravity="left"
android:text="Buscar Agendamentos"
android:gravity="start"
android:text="@string/schedules_search"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="16sp"
android:textStyle="bold"
......@@ -57,7 +56,6 @@
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="14sp"
android:textStyle="normal|bold"
android:layout_below="@id/tv_schedules_title"
android:typeface="normal"/>
<Spinner
android:id="@+id/spnr_scheduling_sector"
......@@ -109,7 +107,7 @@
android:layout_below="@id/ll_schedules_fields"
android:layout_marginTop="10dp"
android:layout_marginStart="10dp"
android:gravity="left"
android:gravity="start"
android:orientation="horizontal">
<Button
......@@ -117,16 +115,17 @@
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="@drawable/green_button_shape"
android:text="Buscar" />
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="@android:color/transparent"
android:textColor="@color/colorRed"
android:text="Limpar Campos" />
android:text="@string/reset_fields" />
</LinearLayout>
......@@ -142,7 +141,6 @@
android:layout_below="@id/ll_schedules_buttons"/>
</RelativeLayout>
<ProgressBar
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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: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:layout_toEndOf="@id/tv_schedules_list_date"
android:id="@+id/tv_schedules_list_date_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_schedules_list_date_content" />
<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"
android:layout_below="@id/tv_schedules_list_date"/>
<TextView
android:id="@+id/tv_schedules_list_location_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_schedules_list_date"
android:layout_toEndOf="@id/tv_schedules_list_location"/>
</LinearLayout>
<TextView
android:id="@+id/tv_schedules_list_type"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorBlack"
android:text="@string/schedules_list_type"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/tv_schedules_list_date_content"
android:layout_marginStart="29dp" />
<TextView
android:id="@+id/tv_schedules_list_type_content"
android:layout_width="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:maxLines="1"
android:layout_toEndOf="@id/tv_schedules_list_type"/>
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>
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
......@@ -151,4 +151,7 @@
<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>
</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