Compare commits

..

3 Commits

@ -5,10 +5,10 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.Button import android.widget.Button
import android.widget.EditText import android.widget.EditText
import android.widget.ImageButton
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.mathseduc.controllers.ControllerPlayer import com.example.mathseduc.controllers.ControllerPlayer
import org.mindrot.jbcrypt.BCrypt
class ConnexionPlayerActivity : AppCompatActivity() { class ConnexionPlayerActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -37,12 +37,13 @@ class ConnexionPlayerActivity : AppCompatActivity() {
} }
} }
val btnReturn = findViewById<Button>(R.id.btnReturn) val btnReturn = findViewById<ImageButton>(R.id.btnReturn)
val btnRegister = findViewById<Button>(R.id.registerButton) val btnRegister = findViewById<Button>(R.id.registerButton)
btnReturn.setOnClickListener { btnReturn.setOnClickListener {
val intent = Intent(this, MainActivity::class.java) val intent = Intent(this, MainActivity::class.java)
startActivity(intent) startActivity(intent)
//finish();
} }
btnRegister.setOnClickListener { btnRegister.setOnClickListener {
@ -57,19 +58,22 @@ class ConnexionPlayerActivity : AppCompatActivity() {
val etNickname = dialogView.findViewById<EditText>(R.id.nickname) val etNickname = dialogView.findViewById<EditText>(R.id.nickname)
val etPassword = dialogView.findViewById<EditText>(R.id.password) val etPassword = dialogView.findViewById<EditText>(R.id.password)
val btnSave = dialogView.findViewById<Button>(R.id.buttonSave)
val btnDismiss = dialogView.findViewById<Button>(R.id.buttonDismiss)
builder.setView(dialogView) val dialog = builder.setView(dialogView).create()
.setTitle("Créer son compte")
.setPositiveButton("Enregistrer") { dialog, which -> btnSave.setOnClickListener {
val nickname = etNickname.text.toString() val nickname = etNickname.text.toString()
val password = etPassword.text.toString() val password = etPassword.text.toString()
// Faites quelque chose avec le nom d'utilisateur et le mot de passe // Faites quelque chose avec le nom d'utilisateur et le mot de passe
} dialog.dismiss()
.setNegativeButton("Fermer") { dialog, which -> }
dialog.dismiss()
} btnDismiss.setOnClickListener {
dialog.dismiss()
}
val dialog = builder.create()
dialog.show() dialog.show()
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

@ -5,17 +5,31 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ConnexionPlayerActivity"> tools:context=".ConnexionPlayerActivity">
<!--<Button
<Button
android:id="@+id/btnReturn" android:id="@+id/btnReturn"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="60dp" android:layout_height="100dp"
android:layout_gravity="start"
android:layout_marginTop="16dp"
android:text="@string/fleche"
android:background="@android:color/transparent"
android:textSize="70sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.051"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />-->
<ImageButton
android:id="@+id/btnReturn"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="start" android:layout_gravity="start"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:backgroundTint="@color/grey" android:background="@drawable/arrow_small"
android:text="@string/retour" android:scaleType="center"
android:contentDescription="@string/retour"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.948" app:layout_constraintHorizontal_bias="0.030"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -38,7 +52,7 @@
android:fontFamily="@font/math_educ_font" android:fontFamily="@font/math_educ_font"
android:text="@string/connexion" android:text="@string/connexion"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="40sp" /> android:textSize="50sp" />
<!--<TextView <!--<TextView
android:id="@+id/errorTextView" android:id="@+id/errorTextView"
@ -83,7 +97,7 @@
android:layout_height="55dp" android:layout_height="55dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:backgroundTint="@color/blue" android:backgroundTint="@color/turquoise"
android:text="@string/se_connecter" /> android:text="@string/se_connecter" />
<Button <Button

@ -6,12 +6,8 @@
android:layout_width="350dp" android:layout_width="350dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" 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" android:background="@drawable/rounded_corner"
tools:ignore="MissingConstraints"> android:layout_gravity="center">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -61,22 +57,34 @@
android:autofillHints="" android:autofillHints=""
tools:ignore="RtlSymmetry" /> tools:ignore="RtlSymmetry" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end"
android:layout_marginTop="15dp">
<Button <Button
android:id="@+id/loginButton" android:id="@+id/buttonDismiss"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_marginTop="13dp" android:layout_marginEnd="10dp"
android:backgroundTint="@color/blue" android:backgroundTint="@color/blackgrey"
android:text="@string/enregistrer" /> android:text="@string/fermer"
android:textColor="@color/white"
style="?android:attr/buttonBarButtonStyle" />
<Button <Button
android:id="@+id/registerButton" android:id="@+id/buttonSave"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_gravity="center" android:layout_marginEnd="15dp"
android:layout_marginTop="1dp" android:backgroundTint="@color/blue"
android:backgroundTint="@color/blackgrey" android:text="@string/enregistrer"
android:text="@string/fermer" /> android:textColor="@color/white"
style="?android:attr/buttonBarButtonStyle" />
</LinearLayout> </LinearLayout>
</LinearLayout>

@ -13,4 +13,6 @@
<color name="blue">#0d6efd</color> <color name="blue">#0d6efd</color>
<color name="red">#FF0000</color> <color name="red">#FF0000</color>
<color name="blackgrey">#5c636a</color> <color name="blackgrey">#5c636a</color>
<color name="cyan">#00FFFF</color>
<color name="turquoise">#40E0D0</color>
</resources> </resources>

@ -18,6 +18,7 @@
<string name="creer_compte">Créer son compte</string> <string name="creer_compte">Créer son compte</string>
<string name="fermer">Fermer</string> <string name="fermer">Fermer</string>
<string name="enregistrer">Enregistrer</string> <string name="enregistrer">Enregistrer</string>
<string name="fleche"></string>
<string-array name="difficulty_array"> <string-array name="difficulty_array">
<item>Facile</item> <item>Facile</item>

@ -14,5 +14,6 @@
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/background</item> <item name="android:windowBackground">@drawable/background</item>
<!--<item name="android:fontFamily">@font/math_educ_font</item> --> <!--<item name="android:fontFamily">@font/math_educ_font</item> -->
<item name="android:homeAsUpIndicator"></item>
</style> </style>
</resources> </resources>
Loading…
Cancel
Save