Skip to content
Snippets Groups Projects
Commit 77308d1d authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Partie 6 non terminée

parent ba4d9483
Branches
No related tags found
No related merge requests found
......@@ -13,7 +13,6 @@
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
......
......@@ -6,6 +6,7 @@
<entry key="..\:/Git/application-android-iut/app/src/main/res/layout-land/activity_main.xml" value="0.19635416666666666" />
<entry key="..\:/Git/application-android-iut/app/src/main/res/layout/activity_main.xml" value="0.176" />
<entry key="..\:/Git/application-android-iut/app/src/main/res/layout/activity_num_table.xml" value="0.264" />
<entry key="..\:/Git/application-android-iut/app/src/main/res/layout/fragment_frag_vertical_layout.xml" value="0.2" />
<entry key="..\:/Z IUT Orsay/AndroidStudioProjects/Pizzeria/app/src/main/res/layout-land/activity_main.xml" value="0.1" />
<entry key="..\:/Z IUT Orsay/AndroidStudioProjects/Pizzeria/app/src/main/res/layout/activity_main.xml" value="0.2" />
</map>
......
......@@ -25,6 +25,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'com.slprojects.pizzeria'
}
dependencies {
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.slprojects.pizzeria" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
......
package com.slprojects.pizzeria;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class FragVerticalLayout extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.activity_main, container, false);
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import static com.slprojects.pizzeria.NumTable.numTable;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
......@@ -25,6 +26,11 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
@Override
protected void onCreate(Bundle savedInstanceState) {
FragVerticalLayout frag = new FragVerticalLayout();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.add(R.id.fragment_vertical_layout, frag);
transaction.commit();
Log.i("onCreate", "MainActivity");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
......@@ -32,6 +38,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
// On récupère le num de la table
numTable = intent.getIntExtra(NumTable.numTable, 1);
TextView textView = findViewById(R.id.textNumTable);
String numTableText = textView.getText().toString() + numTable;
textView.setText(numTableText);
......
......@@ -35,6 +35,7 @@ public class NumTable extends AppCompatActivity implements View.OnClickListener
@Override
public void finish() {
// On va créer l'intent pour passer numTable
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("numTable", Integer.parseInt(input.getText().toString()));
startActivity(intent);
......
......@@ -6,101 +6,5 @@
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/textNumTable"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Numéro de la table: "
app:layout_constraintBottom_toTopOf="@+id/napolitaine"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/napolitaine"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="NAPOLITAINE"
app:layout_constraintBottom_toTopOf="@+id/royale"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textNumTable" />
<Button
android:id="@+id/royale"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="ROYALE"
app:layout_constraintBottom_toTopOf="@+id/quatreFromages"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/napolitaine" />
<Button
android:id="@+id/quatreFromages"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="QUATRE FROMAGES"
app:layout_constraintBottom_toTopOf="@+id/montagnarde"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/royale" />
<Button
android:id="@+id/montagnarde"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="MONTAGNARDE"
app:layout_constraintBottom_toTopOf="@+id/raclette"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/quatreFromages" />
<Button
android:id="@+id/raclette"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="RACLETTE"
app:layout_constraintBottom_toTopOf="@+id/hawaii"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/montagnarde" />
<Button
android:id="@+id/hawaii"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="HAWAII"
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/raclette" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="424dp"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hawaii"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteX="1dp">
<Button
android:id="@+id/pannaCotta"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="5dp"
android:text="PANNA COTTA" />
<Button
android:id="@+id/tiramisu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="5dp"
android:text="TIRAMISU" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_vertical_layout"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragVerticalLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textNumTable"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Numéro de la table: "
app:layout_constraintBottom_toTopOf="@+id/napolitaine"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/napolitaine"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="NAPOLITAINE"
app:layout_constraintBottom_toTopOf="@+id/royale"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textNumTable" />
<Button
android:id="@+id/royale"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="ROYALE"
app:layout_constraintBottom_toTopOf="@+id/quatreFromages"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/napolitaine" />
<Button
android:id="@+id/quatreFromages"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="QUATRE FROMAGES"
app:layout_constraintBottom_toTopOf="@+id/montagnarde"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/royale" />
<Button
android:id="@+id/montagnarde"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="MONTAGNARDE"
app:layout_constraintBottom_toTopOf="@+id/raclette"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/quatreFromages" />
<Button
android:id="@+id/raclette"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="RACLETTE"
app:layout_constraintBottom_toTopOf="@+id/hawaii"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/montagnarde" />
<Button
android:id="@+id/hawaii"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="HAWAII"
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/raclette" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="424dp"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hawaii"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteX="1dp">
<Button
android:id="@+id/pannaCotta"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="5dp"
android:text="PANNA COTTA" />
<Button
android:id="@+id/tiramisu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="5dp"
android:text="TIRAMISU" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
\ No newline at end of file
<resources>
<string name="app_name">Pizzeria</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment