François Gautrais vor 8 Jahren
Ursprung
Commit
501a4b408c

+ 149 - 11
app/src/main/java/app/brest/testmin3d/ARActivity.java

@@ -1,24 +1,32 @@
 package app.brest.testmin3d;
 import android.app.Activity;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.graphics.PixelFormat;
 import android.hardware.Camera;
 import android.media.MediaPlayer;
 import android.os.Bundle;
+import android.os.Handler;
+import android.support.v7.app.AlertDialog;
 import android.util.Log;
 import android.view.View;
+import android.view.ViewTreeObserver;
 import android.view.WindowManager;
 import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
+import android.widget.ImageView;
 import android.widget.MediaController;
+import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.VideoView;
 
 import org.w3c.dom.Text;
 
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -58,12 +66,24 @@ public class ARActivity extends RendererActivity
     protected boolean isPausing=false;
     protected static GPSPoint mLocation;
     protected static boolean mLocationUpdated=false;
+    protected TextView mTvDistance;
+    protected TextView mTvAngle;
+    protected TextView mTvGPS;
+    protected RelativeLayout mRlRoot;
+    protected ImageView mIvWhite;
+    protected ImageView mIvRed;
+    protected ImageView mIvGreen;
+    protected ImageView mIvNone;
+    protected int mViewWidth;
+    protected int mViewHeight;
+    protected boolean mDetect=false;
+    protected boolean mInArea=false;
     private Game mGame;
 
+    private Handler mCustomHandler = new Handler();
 
     public void init()
     {
-        setContentView(R.layout.activity_main);
         setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
 
 
@@ -80,8 +100,8 @@ public class ARActivity extends RendererActivity
         mOkButton.setVisibility(View.INVISIBLE);
         if(cameraPreviewLayout.getChildCount()<2)
         {
+            cameraPreviewLayout.addView(_glSurfaceView,0);
             cameraPreviewLayout.addView(mImageSurfaceView,0);
-            cameraPreviewLayout.addView(_glSurfaceView,1);
         }
 
     }
@@ -140,6 +160,62 @@ public class ARActivity extends RendererActivity
                         );
     }
 
+    private Runnable updateTimerThread = new Runnable() {
+
+        public void run() {
+            mCustomHandler.postDelayed(this, 10);
+        }
+
+    };
+
+    protected long mLedPeriode=0;
+    protected long mLedLastTick=0;
+    protected boolean mLedState=false;
+    protected void updateLed(boolean detected,  double dist)
+    {
+        //si detecte
+        if(detected)
+        {
+            mIvWhite.getHandler().post(new Runnable() { public void run() {mIvWhite.setVisibility(View.VISIBLE);}});
+            mIvGreen.getHandler().post(new Runnable() { public void run() {mIvGreen.setVisibility(View.VISIBLE);}});
+            mIvRed.getHandler().post(new Runnable() { public void run() {mIvRed.setVisibility(View.INVISIBLE);}});
+            mInArea=mDetect=true;
+        }
+        //si dans une zone
+        else if(dist>=0)
+        {
+            if(dist<5) mLedPeriode=5;
+            else if(dist>=5 && dist<50) mLedPeriode=(int)((dist-4)*10);
+            else mLedPeriode=500;
+            if(System.currentTimeMillis()>mLedLastTick+mLedPeriode)
+            {
+                mLedLastTick=System.currentTimeMillis();
+                if(mLedState)
+                {
+                    mLedState=false;
+                    mIvWhite.getHandler().post(new Runnable() { public void run() {mIvWhite.setVisibility(View.INVISIBLE);}});
+                }else
+                {
+                    mLedState=true;
+                    mIvWhite.getHandler().post(new Runnable() { public void run() {mIvWhite.setVisibility(View.VISIBLE);}});
+                }
+            }
+
+            mIvGreen.getHandler().post(new Runnable() { public void run() {mIvGreen.setVisibility(View.INVISIBLE);}});
+            mIvRed.getHandler().post(new Runnable() { public void run() {mIvRed.setVisibility(View.VISIBLE);}});
+            mInArea=true;
+            mDetect=false;
+        }
+        //si rien
+        else
+        {
+            mIvWhite.getHandler().post(new Runnable() { public void run() {mIvWhite.setVisibility(View.INVISIBLE);}});
+            mIvGreen.getHandler().post(new Runnable() { public void run() {mIvGreen.setVisibility(View.INVISIBLE);}});
+            mIvRed.getHandler().post(new Runnable() { public void run() {mIvRed.setVisibility(View.INVISIBLE);}});
+            mInArea=mDetect=false;
+        }
+    }
+
     protected boolean updateSceneResource()
     {
 
@@ -147,12 +223,14 @@ public class ARActivity extends RendererActivity
         final TextView tv = (TextView) findViewById(R.id.text_detected);
         final TextView tv2 = (TextView)findViewById(R.id.text_place);
         String toDisplay ="Detetected \n";
+        boolean detected = false;
        // String dete = "Detected:\n";
         scene.clear();
         for (int i = 0; i < res.size(); i++) {
             Resource rr = res.get(i).getResource();
             Place p = res.get(i).getPlace();
             if(rr!=null) {
+                detected=true;
                 toDisplay += "\t" + rr.getName() + " \n";
                 //dete += "\t" + rr.getName() + "\n";
                 Object3d oo = rr.get3DModel(this);
@@ -175,19 +253,27 @@ public class ARActivity extends RendererActivity
             }
         }
 
+        updateLed(detected, mGame.getResourcesNextToPlayerDistDouble());
+
+
         final String td = toDisplay;
-        mAngle.getHandler().post(new Runnable() {
+        /*mAngle.getHandler().post(new Runnable() {
             public void run() {
                 tv2.setText(td);
             }
-        });
+        });*/
 
-        final String dete2 = mGame.getResourcesNextToPlayer2();
+        final String dete2 = mGame.getResourcesNextToPlayerDist();
         tv.getHandler().post(new Runnable() {
             public void run() {
                 tv.setText(dete2);
             }
         });
+        mTvDistance.getHandler().post(new Runnable() {
+            public void run() {
+                mTvDistance.setText(dete2);
+            }
+        });
 
 
         return scene.numChildren()>0;
@@ -200,16 +286,65 @@ public class ARActivity extends RendererActivity
         startActivity(intent);
     }
 
+    protected void moveView(View v, int x, int y, int w, int h)
+    {
+        RelativeLayout.LayoutParams l = new RelativeLayout.LayoutParams(w, h);
+        l.leftMargin = x;
+        l.topMargin = y;
+        v.setLayoutParams(l);
+    }
+
+
      @Override
     protected void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
         //mGame = (Game) getIntent().getSerializableExtra("game");
         mGame = Game.game();
         mGame.newSensorManager(this);
+        mTvDistance=(TextView)findViewById(R.id.tv_distance);
+        mTvAngle=(TextView)findViewById(R.id.tv_angle);
+        mTvGPS=(TextView)findViewById(R.id.tv_gps);
+        mRlRoot=(RelativeLayout) findViewById(R.id.rl_root);
+        mIvWhite=(ImageView)findViewById(R.id.iv_white);
+        mIvRed=(ImageView)findViewById(R.id.iv_red);
+        mIvGreen=(ImageView)findViewById(R.id.iv_green);
+        mIvNone=(ImageView)findViewById(R.id.iv_none);
+
+
+
+        ViewTreeObserver vto = mRlRoot.getViewTreeObserver();
+        vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                mRlRoot.getViewTreeObserver().removeGlobalOnLayoutListener(this);
+                int w =mViewWidth  = mRlRoot.getMeasuredWidth();
+                int h =mViewHeight = mRlRoot.getMeasuredHeight();
+
+                mTvGPS.setTextSize((int)(h*0.121f/6));
+                mTvGPS.setText("N ?°\nE ?°");
+                mTvAngle.setTextSize((int)(h*0.121f/6));
+                mTvDistance.setTextSize((int)(h*0.046f/1.8));
+
+                moveView(mTvAngle, (int)(0.03*w), (int)(0.864f*h), (int)(0.291f*w), (int)(0.121*h ));
+                moveView(mTvGPS, w-(int)(0.297f*w), (int)(0.875f*h),(int)(0.291f*w), (int)(0.121*h));
+                moveView(mTvDistance, w-mTvDistance.getWidth()-(int)(0.359f*w), (int)(0.038f*h), mTvGPS.getWidth(), (int)(0.121*h));
+
+                moveView(mIvNone, (int)(w/4.0), 0, (int)(w/2.0), (int)(0.06f*h));
+                moveView(mIvWhite, (int)(w*0.269), (int)(0.034*h), (int)(w*0.03333), (int)(0.02286f*h));
+                moveView(mIvRed, (int)(w*0.702), (int)(0.034*h), (int)(w*0.03333), (int)(0.02286f*h));
+                moveView(mIvGreen, (int)(w*0.702), (int)(0.034*h), (int)(w*0.03333), (int)(0.02286f*h));
+            }
+        });
+
 
 
+        Log.e("_________", "MrlRoot="+mIvRed.getWidth()+" et "+mIvRed.getHeight());
+        int w = mRlRoot.getWidth();
+        int h = mRlRoot.getHeight();
+
 
     }
 
@@ -259,11 +394,12 @@ public class ARActivity extends RendererActivity
             });
 
         }
-        mAngle.getHandler().post(new Runnable() {
+        mTvAngle.getHandler().post(new Runnable() {
             public void run() {
-                mAngle.setText("Angle X: "+mGame.getPlayer().getOrientation()+"°\n Angle Y: "+
-                                mGame.getPlayer().getOrientationY()
-                                +"\n Angle Z: "+mGame.getPlayer().getOrientationZ()+"°");
+                NumberFormat formatter = new DecimalFormat("#0.0");
+                mTvAngle.setText("X : "+formatter.format(mGame.getPlayer().getOrientation())+"°\nY : "+
+                        formatter.format(mGame.getPlayer().getOrientationY())
+                                +"°\nZ : "+formatter.format(mGame.getPlayer().getOrientationZ())+"°");
             }
         });
 
@@ -308,10 +444,12 @@ public class ARActivity extends RendererActivity
     {
         if(mLocationUpdated) {
             final GPSPoint gps = mLocation;
-            mGps.getHandler().post(new Runnable() {
+            mTvGPS.getHandler().post(new Runnable() {
 
                 public void run() {
-                    mGps.setText("Latitude: " + gps.getX() + "°\n Longitude: " + gps.getY() + "\n");
+
+                    NumberFormat formatter = new DecimalFormat("#0.0000000");
+                    mTvGPS.setText("N "+formatter.format(gps.getX()) + "°\nE " + formatter.format(gps.getY()) + "°\n");
                 }
             });
             mLocationUpdated=false;

+ 6 - 2
app/src/main/java/app/brest/testmin3d/NewMenuActivity.java

@@ -3,6 +3,7 @@ package app.brest.testmin3d;
 import android.animation.ObjectAnimator;
 import android.app.Activity;
 import android.content.Intent;
+import android.content.res.Resources;
 import android.graphics.Point;
 import android.graphics.Typeface;
 import android.graphics.drawable.Drawable;
@@ -11,6 +12,7 @@ import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.text.Layout;
 import android.util.Log;
+import android.util.TypedValue;
 import android.view.Display;
 import android.view.View;
 import android.view.ViewGroup;
@@ -61,7 +63,7 @@ public class NewMenuActivity extends Activity implements View.OnClickListener{
         moveView(mBMap, w4-2*w/3, 2*h4,w,h);
         moveView(mBOptions, 2*w4-w/3, 2*h4,w,h);
         moveView(mBSend, 0, mHeight-100, mWidth, 100);
-        mBMenu.setTextSize(28);
+        mBMenu.setTextSize(30);
         mBMenu.setTypeface(null,Typeface.BOLD);
         sendVisibility();
 
@@ -155,7 +157,9 @@ public class NewMenuActivity extends Activity implements View.OnClickListener{
         mBMenu = newButton("Menu Principal");
 
         mBSend = newButton("Envoyer les données");
-        moveView(mBMenu, 0, 0, mWidth, mHeight/8);
+        Resources r = getResources();
+        float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 70, r.getDisplayMetrics());
+        moveView(mBMenu, 0, 0, mWidth, (int)px);
         //mBSend = newButton("Envoyer");
 
 

+ 6 - 2
app/src/main/java/app/brest/testmin3d/ViewerActivity.java

@@ -62,12 +62,15 @@ public class ViewerActivity extends RendererActivity {
         }
 
         VideoView m_c = (VideoView)findViewById(R.id.vv_media);
+        Button title = (Button)findViewById(R.id.b_title);
         m_c.setVisibility(View.INVISIBLE);
         if(mResource != null && !getIntent().hasExtra("information") && !getIntent().hasExtra("map"))
         {
+            title.setText(mResource.getTitle());
             if(mResource.getType().compareTo("Image")==0)
             {
                 int id = getResources().getIdentifier(mResource.getName(),"drawable", getPackageName());
+
                 mImageView.setImageResource(id);
                 mAttacher = new PhotoViewAttacher(mImageView);
             }
@@ -90,17 +93,18 @@ public class ViewerActivity extends RendererActivity {
         } else if(getIntent().hasExtra("map") )
         {
             int id = getResources().getIdentifier(getIntent().getStringExtra("map"),"drawable", getPackageName());
+            title.setText("Carte");
             mImageView.setImageResource(id);
             mAttacher = new PhotoViewAttacher(mImageView);
             mButton.setVisibility(View.INVISIBLE);
-            mFrameLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
         }
         else if(mResource != null && getIntent().hasExtra("information"))
         {
+            title.setText(mResource.getTitle());
             mButton.setVisibility(View.INVISIBLE);
             mText.setVisibility(View.VISIBLE);
             mText.setText(mResource.getComment());
-            mFrameLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
+            //mFrameLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
         }
 
 

+ 28 - 5
app/src/main/java/app/brest/utils/app/brest/game/Game.java

@@ -15,6 +15,8 @@ import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
 import java.util.ArrayList;
 
 import app.brest.testmin3d.ARActivity;
@@ -316,7 +318,7 @@ public class Game  implements Serializable {
                     r.add(new LocatedResource(
                             mResources.getResourceLeftByName(mCurrentStageAreas.get(i).getResourceName()),
                             mCurrentStageAreas.get(i).getPlace(0)
-                            ));
+                    ));
                 }
             }
         }
@@ -324,22 +326,43 @@ public class Game  implements Serializable {
     }
 
 
-    public String getResourcesNextToPlayer2()
+    public String getResourcesNextToPlayerDist()
     {
         String str = "Detected\n";
+        double min=1000000000;
         ArrayList<Resource> r = new ArrayList<Resource>();
         for(int i=0; i<mCurrentStageAreas.size(); i++)
         {
             //probleme de GPS..
             if(mCurrentStageAreas.get(i).isOnArea(mPlayer))
             {
+                if(mCurrentStageAreas.get(i).getDistanceToNextPlace(mPlayer)<min)
+                    min=mCurrentStageAreas.get(i).getDistanceToNextPlace(mPlayer);
 
-                if(i<mCurrentStageAreas.size())
-                    str+="\t" +mCurrentStageAreas.get(i).getResourceName()+" "+ mCurrentStageAreas.get(i).getDistanceToNextPlace(mPlayer)+" m\n";
+            }
+        }
+        if(min>10000000) return " ";
+        NumberFormat formatter = new DecimalFormat("#0.0");
+        return formatter.format(min)+" m";
+    }
+
+    public double getResourcesNextToPlayerDistDouble()
+    {
+        double min=1000000000;
+        ArrayList<Resource> r = new ArrayList<Resource>();
+        for(int i=0; i<mCurrentStageAreas.size(); i++)
+        {
+            //probleme de GPS..
+            if(mCurrentStageAreas.get(i).isOnArea(mPlayer))
+            {
+                if(mCurrentStageAreas.get(i).getDistanceToNextPlace(mPlayer)<min)
+                    min=mCurrentStageAreas.get(i).getDistanceToNextPlace(mPlayer);
 
             }
         }
-        return str;
+        if(min>10000000) return -1;
+        return min;
+
     }
 
 

BIN
app/src/main/res/drawable/ar_green.png


BIN
app/src/main/res/drawable/ar_none.png


BIN
app/src/main/res/drawable/ar_red.png


BIN
app/src/main/res/drawable/ar_skin.png


BIN
app/src/main/res/drawable/ar_white.png


BIN
app/src/main/res/drawable/title.png


+ 12 - 0
app/src/main/res/layout/activity_end.xml

@@ -21,4 +21,16 @@
         android:textColor="#33b5e5"
         android:textSize="60dp"
         android:textStyle="bold" />
+
+    <Button
+        android:layout_width="match_parent"
+        android:layout_height="70dp"
+        android:text="FIN !"
+        android:id="@+id/button8"
+        android:layout_alignParentTop="true"
+        android:layout_centerHorizontal="true"
+        android:background="@drawable/title"
+        android:textColor="@color/dull_4"
+        android:textSize="30dp"
+        android:textStyle="bold" />
 </RelativeLayout>

+ 82 - 5
app/src/main/res/layout/activity_main.xml

@@ -6,7 +6,7 @@
     tools:context=".ARActivity"
     android:baselineAligned="false"
     android:weightSum="1"
-    android:background="@drawable/background">
+    android:background="@color/dull_1">
 
     <Button
         android:layout_width="wrap_content"
@@ -37,7 +37,8 @@
         <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_gravity="center">
+            android:layout_gravity="center"
+            android:id="@+id/rl_root">
 
             <TextView
                 android:layout_width="match_parent"
@@ -49,7 +50,8 @@
                 android:textColor="#33b5e5"
                 android:layout_centerVertical="true"
                 android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true" />
+                android:layout_alignParentStart="true"
+                android:visibility="invisible" />
 
             <TextView
                 android:layout_width="match_parent"
@@ -61,7 +63,8 @@
                 android:textColor="#33b5e5"
                 android:layout_alignBottom="@+id/text_place"
                 android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true" />
+                android:layout_alignParentStart="true"
+                android:visibility="invisible" />
 
             <TextView
                 android:layout_width="match_parent"
@@ -75,7 +78,8 @@
                 android:textColor="#33b5e5"
                 android:layout_below="@+id/text_place"
                 android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true" />
+                android:layout_alignParentStart="true"
+                android:visibility="invisible" />
 
             <TextView
                 android:layout_width="match_parent"
@@ -89,7 +93,80 @@
                 android:textColor="#33b5e5"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentLeft="true"
+                android:layout_alignParentStart="true"
+                android:visibility="invisible" />
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/iv_none"
+                android:background="@drawable/ar_none"
+                android:scaleType="fitCenter"
+                android:visibility="visible" />
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/iv_white"
+                android:background="@drawable/ar_white"
+                android:visibility="visible" />
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/iv_red"
+                android:background="@drawable/ar_red"
+                android:visibility="visible" />
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/iv_green"
+                android:background="@drawable/ar_green"
+                android:visibility="visible" />
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/iv_skin"
+                android:scaleType="fitCenter"
+                android:background="@drawable/ar_skin"
+                android:visibility="visible" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="   X : 185.3°\n   Y : 242.1°\n   Z : 46.3"
+                android:id="@+id/tv_angle"
+                android:textColor="@color/dull_5"
+                android:singleLine="false"
+                android:textSize="12dp"
+                android:layout_alignParentBottom="true"
+                android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="48.12345678° \n-1.12345678° "
+                android:id="@+id/tv_gps"
+                android:textColor="@color/dull_5"
+                android:textSize="12dp"
+                android:layout_alignBottom="@+id/tv_angle"
+                android:layout_alignParentRight="true"
+                android:layout_alignParentEnd="true" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="28.3 m"
+                android:id="@+id/tv_distance"
+                android:textColor="@color/dull_5"
+                android:layout_alignParentTop="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginTop="23dp" />
+
         </RelativeLayout>
 
     </FrameLayout>

+ 12 - 0
app/src/main/res/layout/activity_resource_list.xml

@@ -13,6 +13,17 @@
     <!-- This FrameLayout insets its children based on system windows using
          android:fitsSystemWindows. -->
 
+    <Button
+        android:layout_width="match_parent"
+        android:layout_height="70dp"
+        android:text="Inventaire"
+        android:id="@+id/button5"
+        android:layout_gravity="center_horizontal"
+        android:background="@drawable/title"
+        android:textColor="@color/dull_4"
+        android:textStyle="bold"
+        android:textSize="30dp" />
+
     <LinearLayout
         android:orientation="vertical"
         android:layout_width="match_parent"
@@ -20,4 +31,5 @@
         android:id="@+id/list_layout">
 
     </LinearLayout>
+
 </LinearLayout>

+ 13 - 1
app/src/main/res/layout/activity_settings.xml

@@ -17,7 +17,19 @@
             android:id="@+id/root_layout"
             android:layout_above="@+id/button3"
             android:layout_alignParentTop="true"
-            android:measureWithLargestChild="false" />
+            android:measureWithLargestChild="false" >
+
+            <Button
+                android:layout_width="match_parent"
+                android:layout_height="70dp"
+                android:text="Options"
+                android:id="@+id/button7"
+                android:layout_gravity="center_horizontal"
+                android:background="@drawable/title"
+                android:textStyle="bold"
+                android:textSize="30dp"
+                android:textColor="@color/dull_4" />
+        </LinearLayout>
 
         <Button
             android:layout_width="match_parent"

+ 31 - 18
app/src/main/res/layout/activity_transfer.xml

@@ -15,11 +15,23 @@
         android:layout_width="match_parent"
         android:layout_height="60dp"
         android:id="@+id/pb_bar"
-        android:layout_centerVertical="true"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentEnd="true"
         android:max="100"
-        android:progress="20" />
+        android:progress="20"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentStart="true"
+        android:layout_marginBottom="196dp" />
+
+    <ImageButton
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/ib_logo"
+        android:src="@drawable/send"
+        android:scaleType="fitCenter"
+        android:clickable="false"
+        android:background="@null"
+        android:layout_alignParentBottom="true"
+        android:layout_centerHorizontal="true" />
 
     <TextView
         android:layout_width="wrap_content"
@@ -27,25 +39,26 @@
         android:textAppearance="?android:attr/textAppearanceLarge"
         android:text="Envoi des données au professeur"
         android:id="@+id/textView"
-        android:layout_above="@+id/pb_bar"
-        android:layout_centerHorizontal="true"
-        android:layout_marginBottom="73dp"
+        android:layout_marginBottom="47dp"
         android:textColor="#33b5e5"
         android:textSize="25dp"
         android:textStyle="bold"
         android:singleLine="false"
-        android:gravity="center_horizontal" />
+        android:gravity="center_horizontal"
+        android:layout_above="@+id/pb_bar"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentStart="true" />
 
-    <ImageButton
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:id="@+id/ib_logo"
-        android:layout_below="@+id/pb_bar"
+    <Button
+        android:layout_width="match_parent"
+        android:layout_height="70dp"
+        android:text="Envoi"
+        android:id="@+id/button6"
+        android:layout_alignParentTop="true"
         android:layout_centerHorizontal="true"
-        android:layout_marginTop="75dp"
-        android:src="@drawable/send"
-        android:scaleType="fitCenter"
-        android:clickable="false"
-        android:background="@null"/>
+        android:background="@drawable/title"
+        android:textSize="30dp"
+        android:textColor="@color/dull_4"
+        android:textStyle="bold" />
 
 </RelativeLayout>

+ 15 - 1
app/src/main/res/layout/activity_viewer.xml

@@ -15,6 +15,19 @@
     <Button
         android:layout_width="match_parent"
         android:layout_height="70dp"
+        android:text="Carte"
+        android:id="@+id/b_title"
+        android:layout_alignParentBottom="false"
+        android:layout_centerHorizontal="true"
+        android:layout_alignParentTop="true"
+        android:textColor="@color/dull_4"
+        android:textSize="30dp"
+        android:textStyle="bold"
+        android:background="@drawable/title" />
+
+    <Button
+        android:layout_width="match_parent"
+        android:layout_height="60dp"
         android:text="Informations"
         android:id="@+id/button_info"
         android:layout_alignParentBottom="true"
@@ -29,7 +42,8 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_above="@+id/button_info"
-        android:id="@+id/frame_viewer">
+        android:id="@+id/frame_viewer"
+        android:layout_below="@+id/b_title">
 
         <ImageView
             android:layout_width="fill_parent"

+ 2 - 0
app/src/main/res/values/dimens.xml

@@ -3,4 +3,6 @@
     <dimen name="activity_horizontal_margin">16dp</dimen>
     <dimen name="activity_vertical_margin">16dp</dimen>
     <dimen name="fab_margin">16dp</dimen>
+    <dimen name="title_height">70dp</dimen>
+    <dimen name="title_text_size">30dp</dimen>
 </resources>