feat : style page Connexion et lien entre page

androidCompose
Maxence GUITARD 1 year ago
parent 5975fe39de
commit 1c5d2276ef

@ -11,8 +11,9 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
var btnSolo = findViewById<Button>(R.id.btnSolo) val btnSolo = findViewById<Button>(R.id.btnSolo)
var btnMulti = findViewById<Button>(R.id.btnMulti) val btnMulti = findViewById<Button>(R.id.btnMulti)
val btnConnexion = findViewById<Button>(R.id.btnConnexion)
btnSolo.setOnClickListener { btnSolo.setOnClickListener {
// Traitement pour le bouton Solo // Traitement pour le bouton Solo
@ -23,5 +24,10 @@ class MainActivity : AppCompatActivity() {
val intent = Intent(this, MultiActivity::class.java) val intent = Intent(this, MultiActivity::class.java)
startActivity(intent) startActivity(intent)
} }
btnConnexion.setOnClickListener{
val intent = Intent(this, ConnexionPlayerActivity::class.java)
startActivity(intent)
}
} }
} }

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="10dp" />
<stroke android:width="1dp"
android:color="@color/grey"/>
</shape>

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<Button
android:id="@+id/btnReturn"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_gravity="start"
android:layout_marginTop="16dp"
android:backgroundTint="@color/grey"
android:text="@string/retour"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.948"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="15dp"
android:fontFamily="@font/math_educ_font"
android:text="@string/connexion"
android:textColor="@color/white"
android:textSize="40sp"/>
<!--<TextView
android:id="@+id/errorTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:text=""
android:textAlignment="center"
android:textColor="@android:color/holo_red_dark"
android:textSize="20sp" /> -->
<EditText
android:id="@+id/nickname"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
android:hint="@string/nom_d_utilisateur"
android:layout_gravity="center_horizontal"
android:paddingStart="8dp"
android:inputType="text"
android:minHeight="50dp"
android:autofillHints=""
tools:ignore="RtlSymmetry" />
<EditText
android:id="@+id/password"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/rounded_corner"
android:layout_gravity="center_horizontal"
android:hint="@string/mot_de_passe"
android:inputType="textPassword"
android:minHeight="50dp"
android:paddingStart="8dp"
android:autofillHints=""
tools:ignore="RtlSymmetry" />
<Button
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="13dp"
android:backgroundTint="@color/blue"
android:text="@string/se_connecter" />
<Button
android:id="@+id/registerButton"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="3dp"
android:backgroundTint="@color/blue"
android:text="@string/s_inscrire" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -3,9 +3,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
tools:context=".MainActivity" tools:context=".MainActivity">
android:gravity="center">
<ImageView <ImageView
android:id="@+id/background_image" android:id="@+id/background_image"

@ -19,22 +19,24 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="50dp" android:layout_height="50dp"
android:fontFamily="@font/math_educ_font"
android:layout_marginTop="30dp"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/math_educ_font"
android:text="@string/listLobbies" android:text="@string/listLobbies"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="40sp" /> android:textSize="40sp"
tools:ignore="TextSizeCheck" />
<Button <Button
android:id="@+id/btnAddLobby" android:id="@+id/btnAddLobby"
android:layout_width="140dp" android:layout_width="140dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_marginTop="5dp"
android:backgroundTint="@color/blue"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="5dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:text="@string/addLobby" /> android:backgroundTint="@color/blue"
android:text="@string/addLobby"
tools:ignore="TextSizeCheck" />
<include layout="@layout/header_list_lobby" /> <include layout="@layout/header_list_lobby" />

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/rounded_corner"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="15dp"
android:paddingTop="2dp"
android:fontFamily="@font/math_educ_font"
android:text="@string/creer_compte"
android:textColor="@color/black"
android:textSize="40sp"/>
<!--<TextView
android:id="@+id/errorTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:text=""
android:textAlignment="center"
android:textColor="@android:color/holo_red_dark"
android:textSize="20sp" /> -->
<EditText
android:id="@+id/nickname"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
android:hint="@string/nom_d_utilisateur"
android:layout_gravity="center_horizontal"
android:paddingStart="8dp"
android:inputType="text"
android:minHeight="50dp"
android:autofillHints=""
tools:ignore="RtlSymmetry" />
<EditText
android:id="@+id/password"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:background="@drawable/rounded_corner"
android:layout_gravity="center_horizontal"
android:hint="@string/mot_de_passe"
android:inputType="textPassword"
android:minHeight="50dp"
android:paddingStart="8dp"
android:autofillHints=""
tools:ignore="RtlSymmetry" />
<Button
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="55dp"
android:layout_marginTop="13dp"
android:backgroundTint="@color/blue"
android:text="@string/enregistrer" />
<Button
android:id="@+id/registerButton"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="1dp"
android:backgroundTint="@color/blackgrey"
android:text="@string/fermer" />
</LinearLayout>

@ -11,4 +11,5 @@
<color name="orange">#FFA500</color> <color name="orange">#FFA500</color>
<color name="grey">#8C92AC</color> <color name="grey">#8C92AC</color>
<color name="blue">#0d6efd</color> <color name="blue">#0d6efd</color>
<color name="blackgrey">#5c636a</color>
</resources> </resources>

@ -11,6 +11,13 @@
<string name="listLobbies">Liste des lobbies</string> <string name="listLobbies">Liste des lobbies</string>
<string name="difficulty_prompt">Selectionne la difficulty</string> <string name="difficulty_prompt">Selectionne la difficulty</string>
<string name="chapter_prompt">Selectionne un chapter</string> <string name="chapter_prompt">Selectionne un chapter</string>
<string name="se_connecter">Se connecter</string>
<string name="mot_de_passe">Mot de passe</string>
<string name="s_inscrire">S\'inscrire</string>
<string name="nom_d_utilisateur">Nom d\'utilisateur</string>
<string name="creer_compte">Créer son compte</string>
<string name="fermer">Fermer</string>
<string name="enregistrer">Enregistrer</string>
<string-array name="difficulty_array"> <string-array name="difficulty_array">
<item>Facile</item> <item>Facile</item>

@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.MathsEduc" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.MathsEduc" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item> <item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorPrimaryVariant">@color/purple_700</item>

Loading…
Cancel
Save