Commit bfce719a authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Add layout for home


Signed-off-by: Bruno Freitas Tissei's avatarBruno Freitas Tissei <bft15@inf.ufpr.br>
parent d987ff5a
......@@ -29,6 +29,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
......@@ -5,7 +5,6 @@ import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar;
......@@ -13,8 +12,6 @@ import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -28,7 +25,7 @@ import br.ufpr.c3sl.agendador.agendador.views.HomeView;
public class HomeActivity extends AppCompatActivity implements HomeView, NavigationView.OnNavigationItemSelectedListener {
private ActionMenuView actionMenuView;
private ImageView drawerHamburger;
private TextView drawerCitizenName, drawerCitizenType, drawerCityName;
private TextView drawerCitizenName, drawerCityName;
private ObscuredSharedPreferences osb;
@Override
......@@ -53,7 +50,6 @@ public class HomeActivity extends AppCompatActivity implements HomeView, Navigat
drawer.openDrawer(Gravity.LEFT);
drawerCitizenName = (TextView) drawer.findViewById(R.id.tv_drawerheader_citizen_name);
drawerCitizenType = (TextView) drawer.findViewById(R.id.tv_drawerheader_citizen);
drawerCityName = (TextView) drawer.findViewById(R.id.tv_drawerheader_city_name);
drawerCitizenName.setText(osb.getString("name", null));
......
......@@ -42,7 +42,6 @@ public class AccountOutput {
}
public UserOutput getmCitizen() {
Log.d("aaaaaaaa", " ".concat(this.mProvider));
return mCitizen;
}
}
......
......@@ -13,7 +13,6 @@ import br.ufpr.c3sl.agendador.agendador.models.AccountOutput;
import br.ufpr.c3sl.agendador.agendador.network.ApiEndpoints;
import br.ufpr.c3sl.agendador.agendador.network.ApiUtils;
import br.ufpr.c3sl.agendador.agendador.models.Account;
import br.ufpr.c3sl.agendador.agendador.models.UserOutput;
import br.ufpr.c3sl.agendador.agendador.views.LoginView;
import okhttp3.Headers;
import retrofit2.Call;
......@@ -27,9 +26,11 @@ import retrofit2.Response;
public class LoginPresenter extends BasePresenter<LoginView> {
private ObscuredSharedPreferences osb;
private Context context;
private LoginPresenter loginPresenter;
public LoginPresenter(Context context) {
this.context = context;
loginPresenter = this;
}
@Override
......@@ -71,10 +72,11 @@ public class LoginPresenter extends BasePresenter<LoginView> {
switch (status) {
case 401:
view().setWrongPassword(true);
loginPresenter.view().setWrongPassword(true);
break;
case 200:
onSuccessfulLogin(accountOutput, headers);
Intent intent = new Intent(context, HomeActivity.class);
context.startActivity(intent);
break;
......@@ -85,7 +87,7 @@ public class LoginPresenter extends BasePresenter<LoginView> {
@Override
public void onFailure(Call<AccountOutput> call, Throwable t) {
view().setNoConnection(true);
loginPresenter.view().setNoConnection(true);
}
});
}
......
<?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
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="75dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorGray">
<TextView
android:text="Bem vindo Nome do Cidadão"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:typeface="normal"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="16sp"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:textStyle="normal|bold" />
<LinearLayout
android:layout_marginTop="12dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite">
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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