WIP sign up
This commit is contained in:
parent
9e8fed5dab
commit
ef83b93fa6
64
.idea/navEditor.xml
generated
64
.idea/navEditor.xml
generated
@ -386,6 +386,70 @@
|
||||
</LayoutPositions>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sign_up_navigation.xml">
|
||||
<value>
|
||||
<LayoutPositions>
|
||||
<option name="myPositions">
|
||||
<map>
|
||||
<entry key="getCodeFragment">
|
||||
<value>
|
||||
<LayoutPositions>
|
||||
<option name="myPosition">
|
||||
<Point>
|
||||
<option name="x" value="-299" />
|
||||
<option name="y" value="-98" />
|
||||
</Point>
|
||||
</option>
|
||||
<option name="myPositions">
|
||||
<map>
|
||||
<entry key="action_getCodeFragment_to_validateCodeFragment">
|
||||
<value>
|
||||
<LayoutPositions />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</LayoutPositions>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="makeAccountFragment">
|
||||
<value>
|
||||
<LayoutPositions>
|
||||
<option name="myPosition">
|
||||
<Point>
|
||||
<option name="x" value="177" />
|
||||
<option name="y" value="-93" />
|
||||
</Point>
|
||||
</option>
|
||||
</LayoutPositions>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="validateCodeFragment">
|
||||
<value>
|
||||
<LayoutPositions>
|
||||
<option name="myPosition">
|
||||
<Point>
|
||||
<option name="x" value="-46" />
|
||||
<option name="y" value="-95" />
|
||||
</Point>
|
||||
</option>
|
||||
<option name="myPositions">
|
||||
<map>
|
||||
<entry key="action_validateCodeFragment_to_makeAccountFragment">
|
||||
<value>
|
||||
<LayoutPositions />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</LayoutPositions>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</LayoutPositions>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
<activity android:name=".drafts.ui.DraftsActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||
<activity android:name=".about.AboutActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||
<activity android:name=".images.picture_viewer.ui.PictureViewerActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||
<activity android:name=".sign_up.ui.SignUpActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||
</application>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@ -13,7 +13,10 @@ class RetrofitClient @Inject constructor(private val authenticationInterceptor:
|
||||
companion object {
|
||||
// These urls don't need auth header
|
||||
val excludedUrlsFromAuthentication = listOf(
|
||||
"/api/LogIn"
|
||||
"/api/LogIn",
|
||||
"/api/signUp/get_code",
|
||||
"/api/signUp/validate_code",
|
||||
"/api/signUp/sign_up_with_code"
|
||||
)
|
||||
const val BASE_URL = "${BuildConfig.backend}/api/"
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import com.isolaatti.R
|
||||
import com.isolaatti.common.IsolaattiBaseActivity
|
||||
import com.isolaatti.databinding.ActivityLoginBinding
|
||||
import com.isolaatti.home.HomeActivity
|
||||
import com.isolaatti.sign_up.ui.SignUpActivity
|
||||
import com.isolaatti.utils.Resource
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@ -87,6 +88,10 @@ class LogInActivity: AppCompatActivity() {
|
||||
openForgotPassword()
|
||||
}
|
||||
|
||||
viewBinding.signUpBtn.setOnClickListener {
|
||||
SignUpActivity.startActivity(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun openForgotPassword() {
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.isolaatti.sign_up.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.isolaatti.databinding.FragmentGetCodeBinding
|
||||
|
||||
class GetCodeFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentGetCodeBinding
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = FragmentGetCodeBinding.inflate(inflater)
|
||||
return binding.root
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.isolaatti.sign_up.ui
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
class MakeAccountFragment : Fragment() {
|
||||
}
|
||||
26
app/src/main/java/com/isolaatti/sign_up/ui/SignUpActivity.kt
Normal file
26
app/src/main/java/com/isolaatti/sign_up/ui/SignUpActivity.kt
Normal file
@ -0,0 +1,26 @@
|
||||
package com.isolaatti.sign_up.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.app.ActivityCompat
|
||||
import com.isolaatti.databinding.ActivitySignUpBinding
|
||||
|
||||
class SignUpActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivitySignUpBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
binding = ActivitySignUpBinding.inflate(layoutInflater)
|
||||
|
||||
setContentView(binding.root)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun startActivity(context: Context) {
|
||||
context.startActivity(Intent(context, SignUpActivity::class.java))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.isolaatti.sign_up.ui
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
class ValidateCodeFragment : Fragment() {
|
||||
}
|
||||
14
app/src/main/res/layout/activity_sign_up.xml
Normal file
14
app/src/main/res/layout/activity_sign_up.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/sign_up_navigation"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
65
app/src/main/res/layout/fragment_get_code.xml
Normal file
65
app/src/main/res/layout/fragment_get_code.xml
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/brand"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginTop="30dp"
|
||||
style="@style/toolbar_text"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:textSize="28sp"
|
||||
android:text="@string/sign_up"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/get_code_info"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginHorizontal="16dp"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/already_have_a_code"
|
||||
android:layout_marginTop="4dp"
|
||||
style="@style/Widget.Material3.Button.TextButton"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/textInputOutlinedStyle"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:hint="@string/email">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:text="@string/send"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/fragment_make_account.xml
Normal file
6
app/src/main/res/layout/fragment_make_account.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/fragment_validate_code.xml
Normal file
6
app/src/main/res/layout/fragment_validate_code.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
28
app/src/main/res/navigation/sign_up_navigation.xml
Normal file
28
app/src/main/res/navigation/sign_up_navigation.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sign_up_navigation"
|
||||
app:startDestination="@id/getCodeFragment">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/makeAccountFragment"
|
||||
android:name="com.isolaatti.sign_up.ui.MakeAccountFragment"
|
||||
android:label="MakeAccountFragment" />
|
||||
<fragment
|
||||
android:id="@+id/getCodeFragment"
|
||||
android:name="com.isolaatti.sign_up.ui.GetCodeFragment"
|
||||
android:label="GetCodeFragment" >
|
||||
<action
|
||||
android:id="@+id/action_getCodeFragment_to_validateCodeFragment"
|
||||
app:destination="@id/validateCodeFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/validateCodeFragment"
|
||||
android:name="com.isolaatti.sign_up.ui.ValidateCodeFragment"
|
||||
android:label="ValidateCodeFragment" >
|
||||
<action
|
||||
android:id="@+id/action_validateCodeFragment_to_makeAccountFragment"
|
||||
app:destination="@id/makeAccountFragment" />
|
||||
</fragment>
|
||||
<action android:id="@+id/action_global_validateCodeFragment" app:destination="@id/validateCodeFragment"/>
|
||||
</navigation>
|
||||
@ -88,4 +88,7 @@
|
||||
<string name="change_profile_photo">Change profile photo</string>
|
||||
<string name="profile_photo">Profile photo</string>
|
||||
<string name="remove_photo">Remove photo</string>
|
||||
<string name="get_code_info">The first step to create an account is to provide your email address. We will send a code that you will need to enter in the next step.</string>
|
||||
<string name="send">Send</string>
|
||||
<string name="already_have_a_code">Already have a code?</string>
|
||||
</resources>
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
<item name="android:fontFamily">@font/zen_dots_regular</item>
|
||||
<item name="android:textSize">30sp</item>
|
||||
|
||||
<item name="android:textColor">@color/purple</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogTransparent" parent="@style/Theme.Isolaatti">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user