diff --git a/Frontend/app/build.gradle b/Frontend/app/build.gradle index da7844e258aac378fbc5d28759f849ee1face46f..899c8b60bd093d33ba7aae2c261f8271586485dd 100644 --- a/Frontend/app/build.gradle +++ b/Frontend/app/build.gradle @@ -27,6 +27,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' diff --git a/Frontend/app/src/main/AndroidManifest.xml b/Frontend/app/src/main/AndroidManifest.xml index dc52ae7fff2c3a007fbccf6a9fcdc5eaba8617d6..d8947a8bc6a7236e7261f919763af0c6fc1ae7e2 100644 --- a/Frontend/app/src/main/AndroidManifest.xml +++ b/Frontend/app/src/main/AndroidManifest.xml @@ -10,12 +10,13 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - <activity android:name=".Lost_PW"></activity> + <activity android:name=".New_PW_Screen" /> + <activity android:name=".Lost_PW" /> <activity android:name=".Register_Screen" /> <activity android:name=".Start_Screen" android:configChanges="orientation" - android:screenOrientation="sensorPortrait" + android:screenOrientation="portrait" tools:ignore="LockedOrientationActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> diff --git a/Frontend/app/src/main/java/com/example/mobileapp/Lost_PW.java b/Frontend/app/src/main/java/com/example/mobileapp/Lost_PW.java index 6bddb22bf45aa94788d5051a14e333b6fb7af6df..db3918b82414f9ec7f42da05ef5786c3bdb5f64f 100644 --- a/Frontend/app/src/main/java/com/example/mobileapp/Lost_PW.java +++ b/Frontend/app/src/main/java/com/example/mobileapp/Lost_PW.java @@ -2,58 +2,78 @@ package com.example.mobileapp; import androidx.appcompat.app.AppCompatActivity; + import android.content.Intent; import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; + import android.os.Bundle; -import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.material.textfield.TextInputLayout; -import org.w3c.dom.Text; public class Lost_PW extends AppCompatActivity { - private ImageView back_button; - private TextView input_email; - private Button send_email; - private EditText email_ph; - private TextView notification; + private TextInputLayout textInputEmail; + private TextInputLayout textInputCode; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.lost_pw); - back_button = (ImageView)findViewById(R.id.back_button); - send_email = (Button)findViewById(R.id.btnSendEmail); - input_email = (TextView)findViewById(R.id.email_stuck); - email_ph = (EditText)findViewById(R.id.email_ph); - notification = (TextView)findViewById(R.id.email_notification); - - back_button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(Lost_PW.this, Start_Screen.class)); - } - }); - - - /** - * Makes the inputEmail not click and changeable again. So the user - * knows to witch e-mail the reset code was send. - */ - send_email.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - email_ph.setVisibility(View.GONE); - input_email.setVisibility(View.VISIBLE); - input_email.setText(email_ph.getText()); - notification.setText("E-Mail was send"); - } - }); + textInputEmail = findViewById(R.id.text_input_email); + textInputCode = findViewById(R.id.text_input_reset_code); + + } + + private boolean validateEmail() { + String emailInput = textInputEmail.getEditText().getText().toString().trim(); + if (emailInput.isEmpty()) { + textInputEmail.setError("Field cannot be empty"); + return false; + } else { + textInputEmail.setError(null); + + return true; + } } + private boolean validateCode() { + String codeInput = textInputCode.getEditText().getText().toString(); + if (codeInput.isEmpty()) { + textInputCode.setError("Field cannot be empty"); + return false; + } else if (codeInput.length()!=6) { + textInputCode.setError("Code is to short"); + return false; + } else { + textInputCode.setError(null); + return true; + } + } + + public void resetPW (View v) { + if (!validateEmail() || (!validateCode())) { + return; + } else { + startActivity(new Intent(Lost_PW.this, New_PW_Screen.class)); + } + + } + + public void sendEmail(View v) { + if (!validateEmail()) { + return; + } + textInputEmail.setEnabled(false); + textInputEmail.setEndIconVisible(false); + Toast.makeText(this, "Sending E-Mail ...", Toast.LENGTH_SHORT).show(); + } + + public void backButton(View view) { + finish(); + } } diff --git a/Frontend/app/src/main/java/com/example/mobileapp/New_PW_Screen.java b/Frontend/app/src/main/java/com/example/mobileapp/New_PW_Screen.java new file mode 100644 index 0000000000000000000000000000000000000000..a251d7549f53c0d33b21759354bdd2b236a43097 --- /dev/null +++ b/Frontend/app/src/main/java/com/example/mobileapp/New_PW_Screen.java @@ -0,0 +1,20 @@ +package com.example.mobileapp; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; +import android.view.View; + +public class New_PW_Screen extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.new_pw_screen); + } + + public void backButton(View view) { + finish(); + } + +} diff --git a/Frontend/app/src/main/java/com/example/mobileapp/Register_Screen.java b/Frontend/app/src/main/java/com/example/mobileapp/Register_Screen.java index 0fc930a8f1ae8a7c7e63d309635d8487f83d5675..64e618d48c33e72d65ddf744a6f2f7706a836491 100644 --- a/Frontend/app/src/main/java/com/example/mobileapp/Register_Screen.java +++ b/Frontend/app/src/main/java/com/example/mobileapp/Register_Screen.java @@ -2,46 +2,105 @@ package com.example.mobileapp; import androidx.appcompat.app.AppCompatActivity; + import android.content.Intent; import android.os.Bundle; import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; +import android.widget.Toast; -public class Register_Screen extends AppCompatActivity { +import com.google.android.material.textfield.TextInputLayout; - private EditText name; - private EditText email; - private EditText pw; - private EditText pw_confirm; - private Button register; +public class Register_Screen extends AppCompatActivity { - private ImageView back_button; + private TextInputLayout textInputEmail; + private TextInputLayout textInputName; + private TextInputLayout textInputPW; + private TextInputLayout textInputPWConfirm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.register_screen); - name = (EditText)findViewById(R.id.email_ph); - email = (EditText)findViewById(R.id.editText2); - pw = (EditText)findViewById(R.id.editText3); - pw_confirm = (EditText)findViewById(R.id.editText4); - register = (Button)findViewById(R.id.btnRegister); - back_button = (ImageView)findViewById(R.id.back_button); + textInputEmail = findViewById(R.id.text_input_email); + textInputName = findViewById(R.id.text_input_name); + textInputPW = findViewById(R.id.text_input_pw); + textInputPWConfirm = findViewById(R.id.text_input_pw_confirm); + + } + + + private boolean validateEmail() { + String emailInput = textInputEmail.getEditText().getText().toString().trim(); + + if (emailInput.isEmpty()) { + textInputEmail.setError("Field cannot be empty"); + return false; + } else { + textInputEmail.setError(null); + + return true; + } + } + + private boolean validateName() { + String nameInput = textInputName.getEditText().getText().toString().trim(); + + if (nameInput.isEmpty()) { + textInputName.setError("Field cannot be empty"); + return false; + } else { + textInputName.setError(null); - back_button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent back_to_start = new Intent(Register_Screen.this - , Start_Screen.class); - startActivity(back_to_start); - } - }); + return true; + } + } + + private boolean validatePW() { + String pwInput = textInputPW.getEditText().getText().toString().trim(); + + + + if (pwInput.isEmpty()) { + textInputPW.setError("Field cannot be empty"); + return false; + } else { + textInputPW.setError(null); + + return true; + } + } + + + private boolean confirmPW() { + String pwInput = textInputPW.getEditText().getText().toString().trim(); + String secondPWInput = textInputPWConfirm.getEditText().getText().toString().trim(); + if (secondPWInput.isEmpty() ) { + textInputPWConfirm.setError("Field cannot be empty"); + return false; + } else if (!pwInput.equals(secondPWInput)) { + textInputPWConfirm.setError("The Password doesn´t match"); + return false; + } + else { + textInputPWConfirm.setError(null); + return true; + } } + public void backButton(View view) { + finish(); + } + + public void register(View view) { + if (!validateEmail() | !validateName() | !validatePW() | !confirmPW()) { + return; + } else { + Toast.makeText(this, "Registrierung erfolgreich", Toast.LENGTH_SHORT).show(); + startActivity(new Intent(Register_Screen.this, Start_Screen.class)); + } + } } diff --git a/Frontend/app/src/main/java/com/example/mobileapp/Start_Screen.java b/Frontend/app/src/main/java/com/example/mobileapp/Start_Screen.java index acefebb657df0e91830fb0c4549b712210bb8e49..fbcb1f9d7ab9e026fd997542cfe3b2b21efb1b3d 100644 --- a/Frontend/app/src/main/java/com/example/mobileapp/Start_Screen.java +++ b/Frontend/app/src/main/java/com/example/mobileapp/Start_Screen.java @@ -4,17 +4,14 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.material.textfield.TextInputLayout; public class Start_Screen extends AppCompatActivity { - private TextView register; - private Button login; - private TextView pw_lost; - private EditText email; - private EditText password; + private TextInputLayout textInputEmail; + private TextInputLayout textInputPW; @@ -23,45 +20,51 @@ public class Start_Screen extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - register = (TextView)findViewById(R.id.textView4); - login = (Button)findViewById(R.id.btnLogin); - pw_lost = (TextView)findViewById(R.id.textView2); + textInputEmail = findViewById(R.id.text_input_email); + textInputPW = findViewById(R.id.text_input_pw); - email = (EditText)findViewById(R.id.email_ph); - password = (EditText)findViewById(R.id.editText2); + } + private boolean validateEmail () { + String emailInput = textInputEmail.getEditText().getText().toString().trim(); + if(emailInput.isEmpty()) { + textInputEmail.setError("Field cannot be empty"); + return false; + } else { + textInputEmail.setError(null); - /** - * Opens Register Screen - */ - register.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(Start_Screen.this, Register_Screen.class)); + return true; } - }); + } - pw_lost.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(Start_Screen.this, Lost_PW.class)); - } - }); + public void forgotPW (View v) { + startActivity(new Intent(Start_Screen.this, Lost_PW.class)); + } + public void joinNow (View v) { + startActivity(new Intent(Start_Screen.this, Register_Screen.class)); + } + + private boolean validatePW () { + String pwInput = textInputPW.getEditText().getText().toString().trim(); + + if(pwInput.isEmpty()) { + textInputPW.setError("Field cannot be empty"); + return false; + } else { + textInputPW.setError(null); - /** - * Testusage for wrong PW/E-Mail input, has to be connected to our DB - */ - login.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - email.setError("Username or PW wrong"); - password.setError("Username or PW wrong"); + return true; } - }); + } + public void login (View v) { + if (!validateEmail() | !validatePW()) { + return; + } + Toast.makeText(this, "Logging in ...", Toast.LENGTH_SHORT).show(); } /** diff --git a/Frontend/app/src/main/res/layout/activity_main.xml b/Frontend/app/src/main/res/layout/activity_main.xml index 42c2f85c100fb2b8fdc64a73cca4555fefd7ea8f..b49663f703427e47f40d47cb6493ce8195ecbd21 100644 --- a/Frontend/app/src/main/res/layout/activity_main.xml +++ b/Frontend/app/src/main/res/layout/activity_main.xml @@ -1,182 +1,128 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<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="match_parent" android:layout_height="match_parent" android:background="#141412" + android:orientation="vertical" + android:layout_gravity="center_horizontal" tools:context=".Start_Screen"> - - <View - android:id="@+id/view5" - android:layout_width="1dp" - android:layout_height="35dp" - android:layout_marginTop="51dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toEndOf="@+id/view2" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view2" - app:layout_constraintTop_toBottomOf="@+id/titlescreen_title" - app:layout_constraintVertical_bias="1.0" /> - - <View - android:id="@+id/view2" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/titlescreen_title" - app:layout_constraintVertical_bias="0.247" /> - - <View - android:id="@+id/view4" - - android:layout_width="1dp" - android:layout_height="35dp" - android:layout_marginBottom="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="@+id/view6" - app:layout_constraintEnd_toEndOf="@+id/view6" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view6" - app:layout_constraintTop_toBottomOf="@+id/view2" - app:layout_constraintVertical_bias="1.0" /> - - <View - android:id="@+id/view6" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/view2" - app:layout_constraintVertical_bias="0.185" /> - - <Button - android:id="@+id/btnLogin" - android:layout_width="271dp" - android:layout_height="39dp" - android:background="@drawable/btn_rounded" - android:text="Log In" - android:textAppearance="@style/TextAppearance.AppCompat.Small" - android:textColor="#141412" - android:textFontWeight="900" - android:textSize="20dp" - - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.725" /> - <TextView - android:id="@+id/titlescreen_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="124dp" + android:layout_gravity="center_horizontal" + + android:layout_marginTop="120dp" android:fontFamily="@font/msyi" android:letterSpacing="0.10" android:text="PECUNIA" android:textColor="#C5B358" - android:textSize="70dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <EditText - android:id="@+id/email_ph" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="E-Mail" - android:paddingLeft="10dp" + android:textSize="70dp" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_email" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - android:textColor="#C5B358" - android:inputType="textEmailAddress" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintStart_toEndOf="@+id/view5" /> - - <EditText - android:id="@+id/editText2" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="Password" - android:paddingLeft="10dp" + app:errorEnabled="true" + app:startIconDrawable="@drawable/ic_action_name" + app:startIconTint="#C5B358" + app:endIconMode="clear_text" + app:endIconTint="#C5B358" + android:layout_marginTop="70dp" + android:paddingLeft="40dp" + android:paddingRight="40dp" + > + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="E-Mail" + android:inputType="textEmailAddress" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_pw" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - android:textColor="#C5B358" - android:inputType="textPassword" - app:layout_constraintBottom_toTopOf="@+id/view6" - app:layout_constraintStart_toEndOf="@+id/view4" /> + app:errorEnabled="true" + app:passwordToggleEnabled="true" + app:passwordToggleTint="#C5B358" + app:startIconDrawable="@drawable/pw_icon" + app:startIconTint="#C5B358" + android:layout_marginTop="10dp" + android:paddingLeft="40dp" + android:paddingRight="40dp"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Password" + android:inputType="textPassword" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> <TextView - android:id="@+id/textView2" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Forgot your Password?" android:textColor="#C5B358" + android:layout_marginTop="20dp" + android:layout_gravity="center_horizontal" android:textSize="20dp" android:clickable="true" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.637" /> + android:onClick="forgotPW" + /> - <TextView - android:id="@+id/textView4" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Join now" - android:textColor="#C5B358" + <Button + android:layout_width="270dp" + android:layout_height="40dp" + android:background="@drawable/btn_rounded" + android:text="Log In" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="#141414" + android:layout_marginTop="30dp" + android:layout_gravity="center_horizontal" android:textSize="20dp" - android:clickable="true" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/btnLogin" - app:layout_constraintHorizontal_bias="0.903" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.801" /> + android:onClick="login"/> - <TextView - android:id="@+id/textView3" - android:layout_width="wrap_content" + + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="Not a Member?" - android:textColor="#716528" - android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/textView4" - app:layout_constraintHorizontal_bias="0.692" - app:layout_constraintStart_toStartOf="@+id/btnLogin" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.801" /> - - <ImageView - android:id="@+id/email_icon" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toStartOf="@+id/view5" - app:srcCompat="@drawable/ic_action_name" /> - - <ImageView - android:id="@+id/imageView3" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:layout_constraintBottom_toTopOf="@+id/view6" - app:layout_constraintEnd_toStartOf="@+id/editText2" - app:srcCompat="@drawable/pw_icon" /> - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file + android:orientation="horizontal" + android:layout_marginTop="30dp"> + + <TextView + + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="end" + android:layout_weight="1" + android:textColor="#716528" + android:textSize="20dp" + android:text="Not a Member?"/> + + <TextView + + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="start" + android:paddingLeft="5dp" + android:textColor="#C5B358" + android:layout_weight="1" + android:textSize="20dp" + android:text="Join now!" + android:clickable="true" + android:onClick="joinNow"/> + + </LinearLayout> +</LinearLayout> + diff --git a/Frontend/app/src/main/res/layout/lost_pw.xml b/Frontend/app/src/main/res/layout/lost_pw.xml index e1200bc09c6b753d3de17f4c8471a1cd6b0d92a8..a91a2ccb12731ec8e4c568c4acb68dbcffe663ca 100644 --- a/Frontend/app/src/main/res/layout/lost_pw.xml +++ b/Frontend/app/src/main/res/layout/lost_pw.xml @@ -1,223 +1,117 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<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:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#141412" + android:gravity="center_horizontal" tools:context=".Lost_PW"> - <View - android:id="@+id/view" - android:layout_width="150dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.501" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.697" /> - - <View - android:id="@+id/view3" - android:layout_width="150dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.501" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.627" /> - - <Button - android:id="@+id/btnSendEmail" - android:layout_width="271dp" - android:layout_height="39dp" - android:background="@drawable/btn_rounded" - android:text="Send E-Mail" - android:textAppearance="@style/TextAppearance.AppCompat.Small" - android:textColor="#141412" - android:textFontWeight="900" - android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.466" /> - - <Button - android:id="@+id/btnResetPW" - android:layout_width="271dp" - android:layout_height="39dp" - android:background="@drawable/btn_rounded" - android:text="Reset Password" - android:textAppearance="@style/TextAppearance.AppCompat.Small" - android:textColor="#141412" - android:textFontWeight="900" - android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.783" /> - - <TextView - android:id="@+id/email_stuck" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:inputType="textEmailAddress" - android:paddingLeft="10dp" - android:textColor="#C5B358" - android:textSize="20dp" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintStart_toEndOf="@+id/email_icon2" /> - - - <EditText - android:id="@+id/email_ph" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="E-Mail" - android:inputType="textEmailAddress" - android:paddingLeft="10dp" - android:textColor="#C5B358" - android:textColorHint="#716528" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintStart_toEndOf="@+id/email_icon2" /> - - - - <ImageView - android:id="@+id/email_icon2" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toStartOf="@+id/view5" - app:srcCompat="@drawable/ic_action_name" /> - <ImageView - android:id="@+id/back_button" android:layout_width="40dp" android:layout_height="40dp" - android:layout_marginStart="40dp" android:layout_marginLeft="40dp" android:layout_marginTop="40dp" + android:layout_gravity="left" android:src="@drawable/back_button" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <View - android:id="@+id/view5" - android:layout_width="1dp" - android:layout_height="35dp" - android:layout_marginTop="51dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toEndOf="@+id/view2" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view2" - app:layout_constraintTop_toBottomOf="@+id/titlescreen_title" - app:layout_constraintVertical_bias="1.0" /> - - <View - android:id="@+id/view11" - android:layout_width="1dp" - android:layout_height="50dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/view" - app:layout_constraintTop_toBottomOf="@+id/view3" - app:layout_constraintVertical_bias="0.0" /> - - <View - android:id="@+id/view12" - android:layout_width="1dp" - android:layout_height="50dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view" - app:layout_constraintEnd_toEndOf="@+id/view" - app:layout_constraintHorizontal_bias="1.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/view3" - app:layout_constraintVertical_bias="0.0" /> - - <View - android:id="@+id/view2" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.38" /> + android:clickable="true" + android:onClick="backButton"/> + <TextView - android:id="@+id/description_one" - android:layout_width="284dp" - android:layout_height="62dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="30dp" android:text="Type in your E-Mail adress to receive a reset code" android:textColor="#C5B358" + android:textSize="20dp"/> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_email" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColorHint="#716528" + app:errorEnabled="true" + app:startIconDrawable="@drawable/ic_action_name" + app:startIconTint="#C5B358" + app:endIconMode="clear_text" + app:endIconTint="#C5B358" + + android:paddingLeft="40dp" + android:paddingRight="40dp" + > + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="E-Mail" + android:inputType="textEmailAddress" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + <Button + android:layout_width="270dp" + android:layout_height="40dp" + android:background="@drawable/btn_rounded" + android:text="Send E-Mail" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="#141414" + android:layout_marginTop="30dp" + android:layout_gravity="center_horizontal" android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.215" /> + android:onClick="sendEmail"/> + + + <TextView - android:id="@+id/description_two" + android:layout_width="271dp" android:layout_height="31dp" android:text="Type in your 6 digit reset code" android:textColor="#C5B358" - android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.572" /> - - <EditText - android:id="@+id/editText6" - android:layout_width="107dp" - android:layout_height="43dp" - android:background="@null" - android:ems="10" - android:gravity="center" - android:hint="Code" - android:textColor="#C5B358" - android:letterSpacing="0.10" - android:inputType="number" - android:textColorHint="#716528" - android:textSize="20dp" - app:layout_constraintBottom_toTopOf="@+id/view" - app:layout_constraintEnd_toStartOf="@+id/view12" - app:layout_constraintStart_toEndOf="@+id/view11" - app:layout_constraintTop_toBottomOf="@+id/view3" /> + android:layout_marginTop="30dp" + android:textSize="20dp" /> - <TextView - android:id="@+id/email_notification" - android:layout_width="wrap_content" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_reset_code" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="12dp" + android:textColorHint="#716528" + app:errorEnabled="true" + android:layout_marginTop="30dp" + android:paddingLeft="120dp" + android:paddingRight="120dp" + > + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Code" + android:maxLength="6" + android:gravity="center_horizontal" + android:inputType="number" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + <Button + android:layout_width="270dp" + android:layout_height="40dp" + android:background="@drawable/btn_rounded" + android:text="Reset Password" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="#141414" + android:layout_marginTop="30dp" + android:layout_gravity="center_horizontal" + android:textSize="20dp" + android:onClick="resetPW"/> - android:layout_marginLeft="12dp" - android:layout_marginTop="8dp" - android:textColor="#716528" - app:layout_constraintStart_toStartOf="@+id/email_stuck" - app:layout_constraintTop_toBottomOf="@+id/view2" /> -</androidx.constraintlayout.widget.ConstraintLayout> +</LinearLayout> diff --git a/Frontend/app/src/main/res/layout/new_pw_screen.xml b/Frontend/app/src/main/res/layout/new_pw_screen.xml new file mode 100644 index 0000000000000000000000000000000000000000..32781f150cb47c0e0b1b092d264e82d57aba7dfd --- /dev/null +++ b/Frontend/app/src/main/res/layout/new_pw_screen.xml @@ -0,0 +1,84 @@ +<?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="match_parent" + android:layout_height="match_parent" + android:background="#141412" + android:orientation="vertical" + + tools:context=".New_PW_Screen"> + + <ImageView + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginLeft="40dp" + android:layout_marginTop="40dp" + + android:layout_gravity="left" + android:src="@drawable/back_button" + android:clickable="true" + android:onClick="backButton"/> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_pw" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColorHint="#716528" + app:errorEnabled="true" + app:passwordToggleEnabled="true" + app:passwordToggleTint="#C5B358" + app:startIconDrawable="@drawable/pw_icon" + app:startIconTint="#C5B358" + android:layout_marginTop="180dp" + android:paddingLeft="40dp" + android:paddingRight="40dp"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="New Password" + android:inputType="textPassword" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_pw_confirm" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColorHint="#716528" + app:errorEnabled="true" + app:passwordToggleEnabled="true" + app:passwordToggleTint="#C5B358" + app:startIconDrawable="@drawable/pw_icon" + app:startIconTint="#C5B358" + android:layout_marginTop="10dp" + android:paddingLeft="40dp" + android:paddingRight="40dp"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Confirm new Password" + android:inputType="textPassword" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + <Button + android:layout_width="270dp" + android:layout_height="40dp" + android:background="@drawable/btn_rounded" + android:text="Reset" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="#141414" + android:layout_marginTop="30dp" + android:layout_gravity="center_horizontal" + android:textSize="20dp" + android:onClick="backButton"/> + +</LinearLayout> \ No newline at end of file diff --git a/Frontend/app/src/main/res/layout/register_screen.xml b/Frontend/app/src/main/res/layout/register_screen.xml index 33c88ec48aea475fbd7bb08608b7f9d940ca0edb..0fd1ac813f5495c6baf6f3332e7268cfa23899f9 100644 --- a/Frontend/app/src/main/res/layout/register_screen.xml +++ b/Frontend/app/src/main/res/layout/register_screen.xml @@ -1,238 +1,147 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<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="match_parent" android:layout_height="match_parent" android:background="#141412" + android:orientation="vertical" + android:layout_gravity="center_horizontal" tools:context=".Register_Screen"> - <View - android:id="@+id/view5" - android:layout_width="1dp" - android:layout_height="35dp" - android:layout_marginTop="51dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toEndOf="@+id/view2" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view2" - app:layout_constraintTop_toBottomOf="@+id/titlescreen_title" - app:layout_constraintVertical_bias="1.0" /> - - <View - android:id="@+id/view2" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/titlescreen_title" - app:layout_constraintVertical_bias="0.247" /> - - <View - android:id="@+id/view4" - - android:layout_width="1dp" - android:layout_height="35dp" - android:layout_marginBottom="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="@+id/view6" - app:layout_constraintEnd_toEndOf="@+id/view6" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view6" - app:layout_constraintTop_toBottomOf="@+id/view2" - app:layout_constraintVertical_bias="1.0" /> - - <View - android:id="@+id/view6" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/view2" - app:layout_constraintVertical_bias="0.185" /> + <ImageView + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginLeft="40dp" + android:layout_marginTop="40dp" - <Button - android:id="@+id/btnRegister" - android:layout_width="271dp" - android:layout_height="39dp" - android:background="@drawable/btn_rounded" - android:text="Register" - android:textAppearance="@style/TextAppearance.AppCompat.Small" - android:textColor="#141412" - android:textFontWeight="900" - android:textSize="20dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.856" /> + android:layout_gravity="left" + android:src="@drawable/back_button" + android:clickable="true" + android:onClick="backButton"/> <TextView - android:id="@+id/titlescreen_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="124dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="40dp" android:fontFamily="@font/msyi" android:letterSpacing="0.10" android:text="PECUNIA" android:textColor="#C5B358" - android:textSize="70dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <EditText - android:id="@+id/email_ph" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="Full Name" - android:paddingLeft="10dp" + android:textSize="70dp" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - android:textColor="#C5B358" - android:inputType="text" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintStart_toEndOf="@+id/view5" /> - - <EditText - android:id="@+id/editText2" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="E-Mail" - android:paddingLeft="10dp" + app:errorEnabled="true" + app:startIconDrawable="@drawable/person_icon" + app:startIconTint="#C5B358" + app:endIconMode="clear_text" + app:endIconTint="#C5B358" + android:layout_marginTop="70dp" + android:paddingLeft="40dp" + android:paddingRight="40dp" + > + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Full Name" + android:inputType="text" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_email" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - android:textColor="#C5B358" - android:inputType="textEmailAddress" - app:layout_constraintBottom_toTopOf="@+id/view6" - app:layout_constraintStart_toEndOf="@+id/view4" /> - - <ImageView - android:id="@+id/email_icon" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:layout_constraintBottom_toTopOf="@+id/view6" - app:layout_constraintEnd_toStartOf="@+id/view4" - app:srcCompat="@drawable/ic_action_name" /> - - <ImageView - android:id="@+id/imageView3" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:layout_constraintBottom_toTopOf="@+id/view8" - app:layout_constraintEnd_toStartOf="@+id/editText3" - app:srcCompat="@drawable/pw_icon" /> - - <View - android:id="@+id/view7" - android:layout_width="1dp" - android:layout_height="35dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view8" - app:layout_constraintEnd_toEndOf="@+id/view8" - app:layout_constraintHorizontal_bias="0.11" - app:layout_constraintStart_toStartOf="@+id/view8" /> - - <View - android:id="@+id/view8" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.495" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/view6" - app:layout_constraintVertical_bias="0.231" /> - - <EditText - android:id="@+id/editText3" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="Password" - android:paddingLeft="10dp" + app:errorEnabled="true" + app:startIconDrawable="@drawable/ic_action_name" + app:startIconTint="#C5B358" + app:endIconMode="clear_text" + app:endIconTint="#C5B358" + android:layout_marginTop="10dp" + android:paddingLeft="40dp" + android:paddingRight="40dp" + > + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="E-Mail" + android:inputType="textEmailAddress" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_pw" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - android:textColor="#C5B358" - android:inputType="textPassword" - app:layout_constraintBottom_toTopOf="@+id/view8" - app:layout_constraintStart_toEndOf="@+id/view7" /> - - <ImageView - android:id="@+id/imageView2" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - android:src="@drawable/person_icon" - app:layout_constraintBottom_toTopOf="@+id/view2" - app:layout_constraintEnd_toStartOf="@+id/email_ph" /> - - <View - android:id="@+id/view9" - android:layout_width="1dp" - android:layout_height="35dp" - android:background="#C5B358" - app:layout_constraintBottom_toTopOf="@+id/view10" - app:layout_constraintEnd_toEndOf="@+id/view10" - app:layout_constraintHorizontal_bias="0.113" - app:layout_constraintStart_toStartOf="@+id/view10" /> - - <View - android:id="@+id/view10" - android:layout_width="300dp" - android:layout_height="1dp" - android:background="#C5B358" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.486" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/view8" - app:layout_constraintVertical_bias="0.289" /> - - <EditText - android:id="@+id/editText4" - android:layout_width="265dp" - android:layout_height="34dp" - android:background="@null" - android:ems="10" - android:hint="Confirm Password" - android:inputType="textPassword" - android:paddingLeft="10dp" - android:textColor="#C5B358" + app:errorEnabled="true" + app:passwordToggleEnabled="true" + app:passwordToggleTint="#C5B358" + app:startIconDrawable="@drawable/pw_icon" + app:startIconTint="#C5B358" + android:layout_marginTop="10dp" + android:paddingLeft="40dp" + android:paddingRight="40dp"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Password" + android:inputType="textPassword" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> + + + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/text_input_pw_confirm" + android:layout_width="match_parent" + android:layout_height="wrap_content" android:textColorHint="#716528" - app:layout_constraintBottom_toTopOf="@+id/view10" - app:layout_constraintStart_toEndOf="@+id/view9" /> + app:errorEnabled="true" + app:passwordToggleEnabled="true" + app:passwordToggleTint="#C5B358" + app:startIconDrawable="@drawable/pw_icon" + app:startIconTint="#C5B358" + android:layout_marginTop="10dp" + android:paddingLeft="40dp" + android:paddingRight="40dp"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="#C5B358" + android:hint="Confirm Password" + android:inputType="textPassword" + android:textColor="#C5B358" /> + </com.google.android.material.textfield.TextInputLayout> - <ImageView - android:id="@+id/imageView4" - android:layout_width="34dp" - android:layout_height="34dp" - android:padding="6dp" - app:srcCompat="@drawable/pw_icon" - app:layout_constraintBottom_toTopOf="@+id/view10" - app:layout_constraintEnd_toStartOf="@+id/editText4" /> - <ImageView - android:id="@+id/back_button" - android:layout_width="40dp" + + <Button + android:layout_width="270dp" android:layout_height="40dp" - android:layout_marginStart="40dp" - android:layout_marginLeft="40dp" - android:layout_marginTop="40dp" - android:src="@drawable/back_button" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + android:background="@drawable/btn_rounded" + android:text="Register" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="#141414" + android:layout_marginTop="30dp" + android:layout_gravity="center_horizontal" + android:textSize="20dp" + android:onClick="register"/> + +</LinearLayout> -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file