Skip to content

Commit

Permalink
Updated UI with a few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
1HazArd1 committed Feb 26, 2022
1 parent bc7ce78 commit 6c3e918
Show file tree
Hide file tree
Showing 19 changed files with 425 additions and 407 deletions.
6 changes: 6 additions & 0 deletions .idea/misc.xml

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.hazard.samarpan

import NgoSignup1
import NgoSignup1Fragment
import android.os.Bundle
import android.text.TextUtils
import android.view.LayoutInflater
Expand All @@ -17,19 +17,19 @@ import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase


class UserLoginFragment: Fragment() {
class LoginFragment: Fragment() {
private var itemView: View?=null
private var userSignUp: LinearLayout?=null
private var email: TextInputEditText?=null
private var password: TextInputEditText?=null
private var btnLogin: Button?=null

lateinit var ngoSignUp: TextView
private lateinit var ngoSignUp: TextView

private lateinit var registerAuth: FirebaseAuth

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
itemView =layoutInflater.inflate(R.layout.user_login_fragment,container,false)
itemView =layoutInflater.inflate(R.layout.login_fragment,container,false)

email=itemView?.findViewById(R.id.donor_email)
password=itemView?.findViewById(R.id.donor_password)
Expand All @@ -41,7 +41,7 @@ class UserLoginFragment: Fragment() {
registerAuth= Firebase.auth

ngoSignUp.setOnClickListener{
activity?.supportFragmentManager?.beginTransaction()?.replace(R.id.fragment_container1, NgoSignup1())?.addToBackStack(null)?.commit()
activity?.supportFragmentManager?.beginTransaction()?.replace(R.id.fragment_container1, NgoSignup1Fragment())?.addToBackStack(null)?.commit()
}

userSignUp?.setOnClickListener {
Expand Down Expand Up @@ -75,4 +75,5 @@ class UserLoginFragment: Fragment() {

return itemView
}

}
2 changes: 1 addition & 1 deletion app/src/main/java/com/hazard/samarpan/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MainActivity : AppCompatActivity() {
}

private fun addFragment() {
val userSignInLayout=UserLoginFragment()
val userSignInLayout=LoginFragment()
supportFragmentManager.beginTransaction().add(R.id.fragment_container1,userSignInLayout).commit()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import com.hazard.samarpan.NgoSignup2
import com.hazard.samarpan.NgoSignup2Fragment
import com.hazard.samarpan.R

class NgoSignup1 : Fragment() {
class NgoSignup1Fragment : Fragment() {

lateinit var nextBtn: Button

Expand All @@ -21,7 +21,9 @@ class NgoSignup1 : Fragment() {
nextBtn = v.findViewById(R.id.btn_ngosignup1_next)
nextBtn.setOnClickListener {
activity?.supportFragmentManager?.beginTransaction()
?.replace(R.id.fragment_container1, NgoSignup2())?.addToBackStack(null)?.commit()
?.replace(R.id.fragment_container1,
NgoSignup2Fragment()
)?.addToBackStack(null)?.commit()
}

return v
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class NgoSignup2 extends Fragment {
public class NgoSignup2Fragment extends Fragment {

@Nullable
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UserRegisterFragment: Fragment(){
registerAuth= Firebase.auth

btnSignIn?.setOnClickListener {
val userLogin=UserLoginFragment()
val userLogin=LoginFragment()
activity?.supportFragmentManager?.beginTransaction()?.replace(R.id.fragment_container1,userLogin)?.commit()
}
btnRegister?.setOnClickListener{
Expand Down Expand Up @@ -90,6 +90,7 @@ class UserRegisterFragment: Fragment(){
}
return itemView
}

override fun onStart() {
super.onStart()
// check if the user is signed in then don't open login or register page directly send to the required activity
Expand Down
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"/>
<corners android:radius="25dp"/>
<solid android:color="@color/theme_button_color"/>
</shape>
5 changes: 0 additions & 5 deletions app/src/main/res/drawable/login_facebook.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/drawable/twitter_icon.xml

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/font/bungee.xml

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/font/zeyada.xml

This file was deleted.

2 changes: 2 additions & 0 deletions app/src/main/res/layout/dropdown_menu_popup_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:fontFamily="@font/roboto"
android:textColor="@color/theme_text_color_body"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceSubtitle1"
Expand Down
151 changes: 151 additions & 0 deletions app/src/main/res/layout/login_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!--Logo of the application will be added here-->
<ImageView
android:id="@+id/loginImage"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_margin="30dp"
android:src="@drawable/ic_launcher_foreground" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical"
android:padding="30dp">

<!--TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:text="@string/userLoginQuote"
android:textColor="@color/black"
android:textSize="15sp" /-->


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/tv_signIn_login"
android:textColor="@color/theme_text_color_bold"
android:textSize="18sp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/et_email"
app:hintTextColor="@color/theme_text_color_body">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/donor_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/theme_text_color_body"
android:textCursorDrawable="@null" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:hint="@string/et_password"
app:hintTextColor="@color/theme_text_color_body"
app:passwordToggleEnabled="true">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/donor_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textColor="@color/theme_text_color_body"
android:textCursorDrawable="@null" />

</com.google.android.material.textfield.TextInputLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:fontFamily="@font/roboto"
android:text="@string/btn_forgotPass_login"
android:textColor="@color/theme_text_color_body" />

<Button
android:id="@+id/userLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_design"
android:elevation="35dp"
android:text="Login"
android:textAllCaps="false"
android:textColor="@color/theme_button_text"
android:textStyle="bold" />


<LinearLayout
android:id="@+id/userSignUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:padding="5dp"
android:text="Don\'t have an account?"
android:textColor="@color/theme_text_color_body" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:padding="5dp"
android:text="Register"
android:textColor="@color/theme_text_color_bold"
android:textStyle="bold" />

</LinearLayout>

<TextView
android:id="@+id/tv_login_registerasngo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:fontFamily="@font/roboto"
android:text="@string/btn_ngoRegister_login"
android:textColor="@color/theme_text_color_body" />

<!--com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:elevation="35dp"
android:layout_gravity="center"
/-->

</LinearLayout>
</LinearLayout>
</LinearLayout>
Loading

0 comments on commit 6c3e918

Please sign in to comment.