Commit d6936eaf4f17b427827d77d9bc18862f207fdfec
1 parent
e1ca8d32
Init the Android Project
Showing
21 changed files
with
215 additions
and
0 deletions
Show diff stats
app/src/androidTest/java/fr/utbm/lo53/p2017/positionningapp/ExampleInstrumentedTest.java
0 → 100644
1 | +package fr.utbm.lo53.p2017.positionningapp; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.support.test.InstrumentationRegistry; | ||
5 | +import android.support.test.runner.AndroidJUnit4; | ||
6 | + | ||
7 | +import org.junit.Test; | ||
8 | +import org.junit.runner.RunWith; | ||
9 | + | ||
10 | +import static org.junit.Assert.*; | ||
11 | + | ||
12 | +/** | ||
13 | + * Instrumentation test, which will execute on an Android device. | ||
14 | + * | ||
15 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
16 | + */ | ||
17 | +@RunWith(AndroidJUnit4.class) | ||
18 | +public class ExampleInstrumentedTest { | ||
19 | + @Test | ||
20 | + public void useAppContext() throws Exception { | ||
21 | + // Context of the app under test. | ||
22 | + Context appContext = InstrumentationRegistry.getTargetContext(); | ||
23 | + | ||
24 | + assertEquals("fr.utbm.lo53.p2017.positionningapp", appContext.getPackageName()); | ||
25 | + } | ||
26 | +} |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + package="fr.utbm.lo53.p2017.positionningapp"> | ||
4 | + | ||
5 | + <application | ||
6 | + android:allowBackup="true" | ||
7 | + android:icon="@mipmap/ic_launcher" | ||
8 | + android:label="@string/app_name" | ||
9 | + android:roundIcon="@mipmap/ic_launcher_round" | ||
10 | + android:supportsRtl="true" | ||
11 | + android:theme="@style/AppTheme"> | ||
12 | + <activity | ||
13 | + android:name=".Calibration" | ||
14 | + android:label="@string/app_name" | ||
15 | + android:theme="@style/AppTheme.NoActionBar"> | ||
16 | + <intent-filter> | ||
17 | + <action android:name="android.intent.action.MAIN" /> | ||
18 | + | ||
19 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
20 | + </intent-filter> | ||
21 | + </activity> | ||
22 | + </application> | ||
23 | + | ||
24 | +</manifest> | ||
0 | \ No newline at end of file | 25 | \ No newline at end of file |
app/src/main/java/fr/utbm/lo53/p2017/positionningapp/Calibration.java
0 → 100644
1 | +package fr.utbm.lo53.p2017.positionningapp; | ||
2 | + | ||
3 | +import android.os.Bundle; | ||
4 | +import android.support.design.widget.FloatingActionButton; | ||
5 | +import android.support.design.widget.Snackbar; | ||
6 | +import android.support.v7.app.AppCompatActivity; | ||
7 | +import android.support.v7.widget.Toolbar; | ||
8 | +import android.view.View; | ||
9 | +import android.view.Menu; | ||
10 | +import android.view.MenuItem; | ||
11 | + | ||
12 | +public class Calibration extends AppCompatActivity { | ||
13 | + | ||
14 | + @Override | ||
15 | + protected void onCreate(Bundle savedInstanceState) { | ||
16 | + super.onCreate(savedInstanceState); | ||
17 | + setContentView(R.layout.activity_calibration); | ||
18 | + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
19 | + setSupportActionBar(toolbar); | ||
20 | + | ||
21 | + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); | ||
22 | + fab.setOnClickListener(new View.OnClickListener() { | ||
23 | + @Override | ||
24 | + public void onClick(View view) { | ||
25 | + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) | ||
26 | + .setAction("Action", null).show(); | ||
27 | + } | ||
28 | + }); | ||
29 | + } | ||
30 | + | ||
31 | + @Override | ||
32 | + public boolean onCreateOptionsMenu(Menu menu) { | ||
33 | + // Inflate the menu; this adds items to the action bar if it is present. | ||
34 | + getMenuInflater().inflate(R.menu.menu_calibration, menu); | ||
35 | + return true; | ||
36 | + } | ||
37 | + | ||
38 | + @Override | ||
39 | + public boolean onOptionsItemSelected(MenuItem item) { | ||
40 | + // Handle action bar item clicks here. The action bar will | ||
41 | + // automatically handle clicks on the Home/Up button, so long | ||
42 | + // as you specify a parent activity in AndroidManifest.xml. | ||
43 | + int id = item.getItemId(); | ||
44 | + | ||
45 | + //noinspection SimplifiableIfStatement | ||
46 | + if (id == R.id.action_settings) { | ||
47 | + return true; | ||
48 | + } | ||
49 | + | ||
50 | + return super.onOptionsItemSelected(item); | ||
51 | + } | ||
52 | +} |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + tools:context="fr.utbm.lo53.p2017.positionningapp.Calibration"> | ||
8 | + | ||
9 | + <android.support.design.widget.AppBarLayout | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="wrap_content" | ||
12 | + android:theme="@style/AppTheme.AppBarOverlay"> | ||
13 | + | ||
14 | + <android.support.v7.widget.Toolbar | ||
15 | + android:id="@+id/toolbar" | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="?attr/actionBarSize" | ||
18 | + android:background="?attr/colorPrimary" | ||
19 | + app:popupTheme="@style/AppTheme.PopupOverlay" /> | ||
20 | + | ||
21 | + </android.support.design.widget.AppBarLayout> | ||
22 | + | ||
23 | + <include layout="@layout/content_calibration" /> | ||
24 | + | ||
25 | + <android.support.design.widget.FloatingActionButton | ||
26 | + android:id="@+id/fab" | ||
27 | + android:layout_width="wrap_content" | ||
28 | + android:layout_height="wrap_content" | ||
29 | + android:layout_gravity="bottom|end" | ||
30 | + android:layout_margin="@dimen/fab_margin" | ||
31 | + app:srcCompat="@android:drawable/ic_dialog_email" /> | ||
32 | + | ||
33 | +</android.support.design.widget.CoordinatorLayout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
8 | + tools:context="fr.utbm.lo53.p2017.positionningapp.Calibration" | ||
9 | + tools:showIn="@layout/activity_calibration"> | ||
10 | + | ||
11 | + <TextView | ||
12 | + android:layout_width="wrap_content" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + android:text="Hello World!" | ||
15 | + app:layout_constraintBottom_toBottomOf="parent" | ||
16 | + app:layout_constraintLeft_toLeftOf="parent" | ||
17 | + app:layout_constraintRight_toRightOf="parent" | ||
18 | + app:layout_constraintTop_toTopOf="parent" /> | ||
19 | + | ||
20 | +</android.support.constraint.ConstraintLayout> |
1 | +<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + tools:context="fr.utbm.lo53.p2017.positionningapp.Calibration"> | ||
5 | + <item | ||
6 | + android:id="@+id/action_settings" | ||
7 | + android:orderInCategory="100" | ||
8 | + android:title="@string/action_settings" | ||
9 | + app:showAsAction="never" /> | ||
10 | +</menu> |
3.34 KB
4.11 KB
2.15 KB
2.5 KB
4.73 KB
5.97 KB
7.54 KB
9.82 KB
10.2 KB
14.4 KB
1 | +<resources> | ||
2 | + | ||
3 | + <!-- Base application theme. --> | ||
4 | + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
5 | + <!-- Customize your theme here. --> | ||
6 | + <item name="colorPrimary">@color/colorPrimary</item> | ||
7 | + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
8 | + <item name="colorAccent">@color/colorAccent</item> | ||
9 | + </style> | ||
10 | + | ||
11 | + <style name="AppTheme.NoActionBar"> | ||
12 | + <item name="windowActionBar">false</item> | ||
13 | + <item name="windowNoTitle">true</item> | ||
14 | + </style> | ||
15 | + | ||
16 | + <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> | ||
17 | + | ||
18 | + <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> | ||
19 | + | ||
20 | +</resources> |
app/src/test/java/fr/utbm/lo53/p2017/positionningapp/ExampleUnitTest.java
0 → 100644
1 | +package fr.utbm.lo53.p2017.positionningapp; | ||
2 | + | ||
3 | +import org.junit.Test; | ||
4 | + | ||
5 | +import static org.junit.Assert.*; | ||
6 | + | ||
7 | +/** | ||
8 | + * Example local unit test, which will execute on the development machine (host). | ||
9 | + * | ||
10 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
11 | + */ | ||
12 | +public class ExampleUnitTest { | ||
13 | + @Test | ||
14 | + public void addition_isCorrect() throws Exception { | ||
15 | + assertEquals(4, 2 + 2); | ||
16 | + } | ||
17 | +} | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |