Skip to content

Commit

Permalink
Merge pull request #12 from Diversion2k22/modification
Browse files Browse the repository at this point in the history
UI modification
  • Loading branch information
1HazArd1 authored Feb 21, 2022
2 parents 6ce33ba + 269c02b commit f0d85ac
Show file tree
Hide file tree
Showing 18 changed files with 207 additions and 125 deletions.
123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions app/src/main/java/com/hazard/samarpan/UserLoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import android.widget.LinearLayout
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.google.android.material.textfield.TextInputEditText
Expand All @@ -17,8 +17,7 @@ import com.google.firebase.ktx.Firebase

class UserLoginFragment: Fragment() {
private var itemView: View?=null

private var userSignUp: TextView?=null
private var userSignUp: LinearLayout?=null
private var email: TextInputEditText?=null
private var password: TextInputEditText?=null
private var btnLogin: Button?=null
Expand Down Expand Up @@ -55,10 +54,10 @@ class UserLoginFragment: Fragment() {

if(task.isSuccessful){
// logic for navigating to the dashboard
Toast.makeText(activity,"Logged in Successfully", Toast.LENGTH_LONG).show()
Toast.makeText(activity,"Logged in Successfully", Toast.LENGTH_SHORT).show()
}
else{
Toast.makeText(activity,task.exception!!.message.toString(), Toast.LENGTH_LONG).show()
Toast.makeText(activity,task.exception!!.message.toString(), Toast.LENGTH_SHORT).show()
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/hazard/samarpan/UserRegisterFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ class UserRegisterFragment: Fragment(){
btnRegister?.setOnClickListener{
val mail=email?.text.toString().trim()
val pass=password?.text.toString().trim()
if(TextUtils.isEmpty(mail) || TextUtils.isEmpty(pass)){
if(TextUtils.isEmpty(mail)){
email?.error = "Email cannot be empty"
}
if(TextUtils.isEmpty(pass)){
password?.error = "Password cannot be empty"
}
if (!(mail.matches(emailPattern.toRegex()))) {
Expand All @@ -68,7 +70,7 @@ class UserRegisterFragment: Fragment(){

//if registration is done successfully
if(task.isSuccessful){
Toast.makeText(activity,"You were registered successfully.", Toast.LENGTH_LONG).show()
Toast.makeText(activity,"You were registered successfully.", Toast.LENGTH_SHORT).show()
/* add the intent to go to the main dashboard of the application and also add finish() so that
if the user presses back after registration they don't go back to the registration page
it basically clears all the previous activities
Expand Down
22 changes: 0 additions & 22 deletions app/src/main/res/drawable/login_background.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/drawable/login_button.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@color/yellow"/>
<solid android:color="@color/theme_button_color"/>
</shape>
Binary file added app/src/main/res/font/righteous.ttf
Binary file not shown.
7 changes: 7 additions & 0 deletions app/src/main/res/font/roboto.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Roboto"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>
Binary file added app/src/main/res/font/roboto_medium.ttf
Binary file not shown.
Loading

0 comments on commit f0d85ac

Please sign in to comment.