Merge pull request #21 from ClaytonWWilson/aaron-branch

Added Code page and restructured the button flow
This commit is contained in:
DreamCoder23 2020-09-30 17:41:19 -07:00 committed by GitHub
commit 5f05c8bc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 210 additions and 92 deletions

View File

@ -34,6 +34,7 @@
<activity android:name="com.example.listify.ui.LoginPage" /> <activity android:name="com.example.listify.ui.LoginPage" />
<activity android:name="com.example.listify.ui.ForgotPasswordPage" /> <activity android:name="com.example.listify.ui.ForgotPasswordPage" />
<activity android:name="com.example.listify.ui.ResetPasswordPage" /> <activity android:name="com.example.listify.ui.ResetPasswordPage" />
<activity android:name="com.example.listify.ui.CodePage" />
</application> </application>
</manifest> </manifest>

View File

@ -0,0 +1,39 @@
package com.example.listify.ui;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.listify.R;
import androidx.appcompat.app.AppCompatActivity;
public class CodePage extends AppCompatActivity {
private Button button1; //Reset password page button
private Button button2; //Cancel button
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_code);
button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(CodePage.this, ResetPasswordPage.class);
startActivity(intent);
}
});
button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(CodePage.this, LoginPage.class);
startActivity(intent);
}
});
}
}

View File

@ -10,18 +10,18 @@ import com.example.listify.R;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
public class ForgotPasswordPage extends AppCompatActivity { public class ForgotPasswordPage extends AppCompatActivity {
private Button button; private Button button1; //Code page button
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forgotpswd); setContentView(R.layout.activity_forgotpswd);
button = (Button) findViewById(R.id.button4); button1 = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() { button1.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(ForgotPasswordPage.this, ResetPasswordPage.class); Intent intent = new Intent(ForgotPasswordPage.this, CodePage.class);
startActivity(intent); startActivity(intent);
} }
}); });

View File

@ -6,24 +6,45 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import com.example.listify.R; import com.example.listify.R;
import com.example.listify.MainActivity;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
public class LoginPage extends AppCompatActivity { public class LoginPage extends AppCompatActivity {
private Button button; private Button button1; //Sign up page button
private Button button2; //Forgot password button
private Button button3; //Log in button
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
button = (Button) findViewById(R.id.button3); button1 = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() { button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginPage.this, SignupPage.class);
startActivity(intent);
}
});
button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(LoginPage.this, ForgotPasswordPage.class); Intent intent = new Intent(LoginPage.this, ForgotPasswordPage.class);
startActivity(intent); startActivity(intent);
} }
}); });
button3 = (Button) findViewById(R.id.button3);
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginPage.this, MainActivity.class);
startActivity(intent);
}
});
} }
} }

View File

@ -6,23 +6,22 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import com.example.listify.R; import com.example.listify.R;
import com.example.listify.MainActivity;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
public class ResetPasswordPage extends AppCompatActivity { public class ResetPasswordPage extends AppCompatActivity {
private Button button; private Button button1; //Log in page button
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_resetpswd); setContentView(R.layout.activity_resetpswd);
button = (Button) findViewById(R.id.button5); button1 = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() { button1.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(ResetPasswordPage.this, MainActivity.class); Intent intent = new Intent(ResetPasswordPage.this, LoginPage.class);
startActivity(intent); startActivity(intent);
} }
}); });

View File

@ -6,22 +6,33 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import com.example.listify.R; import com.example.listify.R;
import com.example.listify.MainActivity;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
public class SignupPage extends AppCompatActivity { public class SignupPage extends AppCompatActivity {
private Button button; private Button button1; //Log in page button
private Button button2; //Sign up button
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup); setContentView(R.layout.activity_signup);
button = (Button) findViewById(R.id.button2); button1 = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() { button1.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(SignupPage.this, com.example.listify.ui.LoginPage.class); Intent intent = new Intent(SignupPage.this, LoginPage.class);
startActivity(intent);
}
});
button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(SignupPage.this, MainActivity.class);
startActivity(intent); startActivity(intent);
} }
}); });

View File

@ -2,16 +2,13 @@ package com.example.listify.ui.home;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView;
import android.view.ViewGroup;
import android.view.LayoutInflater;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.example.listify.R; import com.example.listify.R;

View File

@ -0,0 +1,48 @@
<?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/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Submit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextNumber" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:text="Cancel"
app:layout_constraintStart_toStartOf="@+id/button1"
app:layout_constraintTop_toBottomOf="@+id/button1" />
<EditText
android:id="@+id/editTextNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:ems="10"
android:hint="Code"
android:inputType="number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="31dp"
android:layout_marginTop="260dp"
android:text="Please enter the 6-digit code from the email sent to you."
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<Button <Button
android:id="@+id/button4" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="31dp" android:layout_marginTop="31dp"

View File

@ -10,54 +10,62 @@
android:id="@+id/button3" android:id="@+id/button3"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="53dp"
android:text="Log in" android:text="Log in"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPassword" /> app:layout_constraintTop_toBottomOf="@+id/button2" />
<EditText <Button
android:id="@+id/editTextTextPersonName" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginTop="274dp"
android:layout_marginRight="8dp"
android:layout_marginTop="20dp"
android:ems="10"
android:hint="Username or email"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="@+id/textView3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<EditText
android:id="@+id/editTextTextPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
app:layout_constraintStart_toStartOf="@+id/editTextTextPersonName"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:text="Log in"
app:layout_constraintBottom_toTopOf="@+id/textView3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="324dp"
android:text="New to Listify? Click here to sign up." android:text="New to Listify? Click here to sign up."
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="72dp"
android:text="Forgot password? Click here."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName" />
<EditText
android:id="@+id/editTextTextPersonName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:ems="10"
android:hint="Username or email"
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="@+id/editTextTextPassword"
app:layout_constraintTop_toBottomOf="@+id/button1" />
<EditText
android:id="@+id/editTextTextPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
app:layout_constraintBottom_toTopOf="@+id/button2"
app:layout_constraintStart_toStartOf="@+id/button2" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="26dp"
android:text="Log in"
app:layout_constraintBottom_toTopOf="@+id/button1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<Button <Button
android:id="@+id/button5" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"

View File

@ -16,18 +16,15 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPassword" /> app:layout_constraintTop_toBottomOf="@+id/editTextTextPassword" />
<EditText <Button
android:id="@+id/editTextTextPersonName" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="32dp" android:layout_marginStart="18dp"
android:layout_marginStart="32dp" android:layout_marginTop="288dp"
android:layout_marginTop="20dp" android:text="Already have an account? Click here to log in."
android:ems="10" app:layout_constraintStart_toStartOf="parent"
android:hint="Email" app:layout_constraintTop_toTopOf="parent" />
android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="@+id/textView3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<EditText <EditText
android:id="@+id/editTextTextEmailAddress" android:id="@+id/editTextTextEmailAddress"
@ -51,29 +48,26 @@
app:layout_constraintStart_toStartOf="@+id/editTextTextEmailAddress" app:layout_constraintStart_toStartOf="@+id/editTextTextEmailAddress"
app:layout_constraintTop_toBottomOf="@+id/editTextTextEmailAddress" /> app:layout_constraintTop_toBottomOf="@+id/editTextTextEmailAddress" />
<EditText
android:id="@+id/editTextTextPersonName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:ems="10"
android:hint="Email"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button1" />
<TextView <TextView
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="24dp"
android:layout_marginEnd="86dp"
android:layout_marginLeft="86dp"
android:layout_marginRight="86dp"
android:layout_marginStart="86dp"
android:text="Sign up" android:text="Sign up"
app:layout_constraintBottom_toTopOf="@+id/textView3" app:layout_constraintBottom_toTopOf="@+id/button1"
app:layout_constraintEnd_toEndOf="@+id/textView3" app:layout_constraintEnd_toEndOf="@+id/button1"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="@+id/button1" />
app:layout_constraintStart_toStartOf="@+id/editTextTextPersonName" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="324dp"
android:text="Already have an account? Click here to log in."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>