Commit ecd8a26727d53c3d15cc90823cbb4c8738a82253

Authored by JLo'w
1 parent de609a9d

Petites corrections et suppression mdp après log

PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java
@@ -2,7 +2,6 @@ package com.example.app_10p5; @@ -2,7 +2,6 @@ package com.example.app_10p5;
2 2
3 import android.content.Intent; 3 import android.content.Intent;
4 import android.os.Bundle; 4 import android.os.Bundle;
5 -import android.os.SystemClock;  
6 import android.support.design.widget.TabLayout; 5 import android.support.design.widget.TabLayout;
7 import android.support.v4.app.FragmentActivity; 6 import android.support.v4.app.FragmentActivity;
8 import android.support.v4.view.ViewPager; 7 import android.support.v4.view.ViewPager;
@@ -54,8 +53,7 @@ public class MainActivite extends FragmentActivity implements ASyncResponse { @@ -54,8 +53,7 @@ public class MainActivite extends FragmentActivity implements ASyncResponse {
54 tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); 53 tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
55 54
56 final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); 55 final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
57 - final PagerAdapter adapter = new PagerAdapter  
58 - (getSupportFragmentManager(), tabLayout.getTabCount()); 56 + final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
59 viewPager.setAdapter(adapter); 57 viewPager.setAdapter(adapter);
60 viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); 58 viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
61 tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { 59 tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@@ -67,7 +65,7 @@ public class MainActivite extends FragmentActivity implements ASyncResponse { @@ -67,7 +65,7 @@ public class MainActivite extends FragmentActivity implements ASyncResponse {
67 else{ 65 else{
68 viewPager.setCurrentItem(tab.getPosition()); //Empeche un bug graphique 66 viewPager.setCurrentItem(tab.getPosition()); //Empeche un bug graphique
69 viewPager.setCurrentItem(0); 67 viewPager.setCurrentItem(0);
70 - Toast.makeText(MainActivite.this, "Veuillez vous connecter biatche.", Toast.LENGTH_LONG).show(); 68 + Toast.makeText(MainActivite.this, "Veuillez vous connecter.", Toast.LENGTH_LONG).show();
71 } 69 }
72 } 70 }
73 71
@@ -266,6 +264,8 @@ public class MainActivite extends FragmentActivity implements ASyncResponse { @@ -266,6 +264,8 @@ public class MainActivite extends FragmentActivity implements ASyncResponse {
266 mDroit = output.getInt("droit"); 264 mDroit = output.getInt("droit");
267 mUser = output.get("login").toString(); 265 mUser = output.get("login").toString();
268 Toast.makeText(this, "Bonjour " + mUser + " vous êtes bien connecté pour " + EXPIRATION / (1000 * 60) + " minutes.", Toast.LENGTH_LONG).show(); 266 Toast.makeText(this, "Bonjour " + mUser + " vous êtes bien connecté pour " + EXPIRATION / (1000 * 60) + " minutes.", Toast.LENGTH_LONG).show();
  267 + EditText coUser = (EditText) findViewById(R.id.connection_password);
  268 + coUser.setText("");
269 final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); 269 final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
270 viewPager.setCurrentItem(1); 270 viewPager.setCurrentItem(1);
271 } 271 }