diff --git a/app/src/main/java/com/futo/circles/ui/sign_in/LogInFragment.kt b/app/src/main/java/com/futo/circles/ui/sign_in/LogInFragment.kt new file mode 100644 index 0000000000000000000000000000000000000000..f018606d29c172d03b1c9b8c42f16b1e8e428e02 --- /dev/null +++ b/app/src/main/java/com/futo/circles/ui/sign_in/LogInFragment.kt @@ -0,0 +1,30 @@ +package com.futo.circles.ui.sign_in + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import androidx.navigation.fragment.findNavController +import by.kirich1409.viewbindingdelegate.viewBinding +import com.futo.circles.R +import com.futo.circles.databinding.LogInFragmentBinding +import org.koin.androidx.viewmodel.ext.android.viewModel + +class LogInFragment : Fragment(R.layout.log_in_fragment) { + + companion object { + fun newInstance() = LogInFragment() + } + + private val viewModel by viewModel<LogInViewModel>() + private val binding: LogInFragmentBinding by viewBinding() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.btnSignUp.setOnClickListener { navigateToSignUp() } + } + + private fun navigateToSignUp() { + findNavController().navigate(LogInFragmentDirections.actionLogInFragmentToSignUpFragment()) + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/futo/circles/ui/sign_in/LogInViewModel.kt b/app/src/main/java/com/futo/circles/ui/sign_in/LogInViewModel.kt new file mode 100644 index 0000000000000000000000000000000000000000..5071f2bfff7204ac2ca8e74f91c4d66c5d0587b2 --- /dev/null +++ b/app/src/main/java/com/futo/circles/ui/sign_in/LogInViewModel.kt @@ -0,0 +1,7 @@ +package com.futo.circles.ui.sign_in + +import androidx.lifecycle.ViewModel + +class LogInViewModel : ViewModel() { + // TODO: Implement the ViewModel +} \ No newline at end of file diff --git a/app/src/main/res/layout/log_in_fragment.xml b/app/src/main/res/layout/log_in_fragment.xml new file mode 100644 index 0000000000000000000000000000000000000000..a5bc07af7af2b0a77a2bc229f4e6579feb8d44f2 --- /dev/null +++ b/app/src/main/res/layout/log_in_fragment.xml @@ -0,0 +1,161 @@ +<?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:animateLayoutChanges="true" + android:layout_height="match_parent" + tools:context=".ui.sign_in.LogInFragment"> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineStart" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_begin="36dp" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineEnd" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_end="36dp" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineTop" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_begin="24dp" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineBottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_end="24dp" /> + + <com.futo.circles.ui.view.CirclesLogoView + android:id="@+id/ivLogo" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintBottom_toTopOf="@id/tvKombucha" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toTopOf="@id/guidelineTop" /> + + <TextView + android:id="@+id/tvKombucha" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/kombucha_social" + android:textAlignment="center" + android:textAppearance="@style/headline" + app:layout_constraintBottom_toTopOf="@id/tvCircles" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/ivLogo" + app:layout_constraintVertical_bias="0.0" + app:layout_constraintVertical_chainStyle="packed" /> + + <TextView + android:id="@+id/tvCircles" + style="@style/title0" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/app_name" + android:textAlignment="center" + app:layout_constraintBottom_toTopOf="@id/tilUserName" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/tvKombucha" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/tilUserName" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:hint="@string/username" + app:layout_constraintBottom_toTopOf="@id/tilPassword" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/tvCircles"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:inputType="text" + android:maxLines="1" + android:padding="12dp" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/tilPassword" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + android:hint="@string/password" + app:layout_constraintBottom_toTopOf="@id/tvAdvancedOptions" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/tilUserName" + app:passwordToggleEnabled="true"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textPassword" + android:padding="8dp" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.futo.circles.ui.view.AdvancedOptionsView + android:id="@+id/tvAdvancedOptions" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + app:layout_constraintBottom_toTopOf="@id/btnLogin" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/tilPassword" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btnLogin" + style="@style/LoginButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/log_in" + android:layout_marginBottom="100dp" + app:layout_constraintBottom_toTopOf="@+id/textView" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" + app:layout_constraintTop_toBottomOf="@id/tvAdvancedOptions" /> + + <TextView + android:id="@+id/textView" + style="@style/body" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/not_a_member" + android:textAlignment="center" + app:layout_constraintBottom_toTopOf="@id/btnSignUp" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btnSignUp" + style="@style/LoginButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/sign_up" + app:layout_constraintBottom_toBottomOf="@id/guidelineBottom" + app:layout_constraintEnd_toEndOf="@id/guidelineEnd" + app:layout_constraintStart_toStartOf="@id/guidelineStart" /> + + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file