Skip to content

Commit

Permalink
Merge pull request #46 from junjange/feature/register
Browse files Browse the repository at this point in the history
로그인 화면
  • Loading branch information
junjange authored Jul 14, 2024
2 parents 9180143 + 9521f46 commit 13d1d9b
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 0 deletions.
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
tools:targetApi="31">
<activity
android:name=".presentation.ui.MainActivity"
android:exported="false" />
<activity
android:name=".presentation.ui.register.RegisterActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.woowacourse.friendogly.presentation.ui

import android.content.Context
import android.content.Intent
import android.view.View
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
Expand Down Expand Up @@ -64,4 +66,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(R.layout.activity_main) {
showToastMessage(e.message.toString())
}
}

companion object {
fun getIntent(context: Context): Intent {
return Intent(context, MainActivity::class.java)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.woowacourse.friendogly.presentation.ui.register

import androidx.activity.viewModels
import com.woowacourse.friendogly.R
import com.woowacourse.friendogly.databinding.ActivityRegisterBinding
import com.woowacourse.friendogly.presentation.base.BaseActivity
import com.woowacourse.friendogly.presentation.base.observeEvent
import com.woowacourse.friendogly.presentation.ui.MainActivity

class RegisterActivity : BaseActivity<ActivityRegisterBinding>(R.layout.activity_register) {
private val viewModel: RegisterViewModel by viewModels()

override fun initCreateView() {
binding.vm = viewModel
initObserve()
}

private fun initObserve() {
viewModel.navigateAction.observeEvent(this) { action ->
when (action) {
is RegisterNavigationAction.NavigateToKakaoLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}

is RegisterNavigationAction.NavigateToGoogleLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.woowacourse.friendogly.presentation.ui.register

sealed interface RegisterNavigationAction {
data object NavigateToKakaoLogin : RegisterNavigationAction

data object NavigateToGoogleLogin : RegisterNavigationAction
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.woowacourse.friendogly.presentation.ui.register

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.woowacourse.friendogly.presentation.base.BaseViewModel
import com.woowacourse.friendogly.presentation.base.Event
import com.woowacourse.friendogly.presentation.base.emit

class RegisterViewModel : BaseViewModel() {
private val _navigateAction: MutableLiveData<Event<RegisterNavigationAction>> =
MutableLiveData(null)
val navigateAction: LiveData<Event<RegisterNavigationAction>> get() = _navigateAction

fun executeKakaoLogin() {
_navigateAction.emit(RegisterNavigationAction.NavigateToKakaoLogin)
}

fun executeGoogleLogin() {
_navigateAction.emit(RegisterNavigationAction.NavigateToGoogleLogin)
}
}
Binary file added android/app/src/main/res/drawable/img_dog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions android/app/src/main/res/drawable/img_google_register.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="328dp"
android:height="57dp"
android:viewportWidth="328"
android:viewportHeight="57">
<path
android:pathData="M10,0L318,0A10,10 0,0 1,328 10L328,47A10,10 0,0 1,318 57L10,57A10,10 0,0 1,0 47L0,10A10,10 0,0 1,10 0z"
android:fillColor="#F6F6F6"/>
<group>
<clip-path
android:pathData="M85.5,19.5h18v18h-18z"/>
<path
android:pathData="M103.5,28.7C103.5,28.09 103.44,27.47 103.33,26.86H94.68V30.34H99.62C99.52,30.89 99.31,31.42 98.99,31.88C98.68,32.35 98.27,32.75 97.79,33.06V35.32H100.76C102.5,33.75 103.5,31.44 103.5,28.7L103.5,28.7Z"
android:fillColor="#3E82F1"
android:fillType="evenOdd"/>
<path
android:pathData="M94.68,37.5C97.16,37.5 99.24,36.69 100.76,35.32L97.79,33.06C96.97,33.6 95.92,33.92 94.68,33.92C92.29,33.92 90.27,32.34 89.55,30.21H86.48V32.54C87.24,34.03 88.41,35.29 89.86,36.16C91.31,37.04 92.98,37.5 94.68,37.5Z"
android:fillColor="#32A753"
android:fillType="evenOdd"/>
<path
android:pathData="M89.55,30.21C89.16,29.1 89.16,27.9 89.55,26.79V24.46H86.48C85.83,25.71 85.5,27.1 85.5,28.5C85.5,29.9 85.83,31.29 86.48,32.54L89.55,30.21Z"
android:fillColor="#F9BB00"
android:fillType="evenOdd"/>
<path
android:pathData="M94.68,23.08C96.03,23.08 97.24,23.53 98.19,24.43L100.83,21.84C99.24,20.39 97.16,19.5 94.69,19.5C92.98,19.5 91.31,19.96 89.86,20.84C88.42,21.71 87.24,22.97 86.48,24.46L89.55,26.79C90.27,24.66 92.29,23.08 94.69,23.08H94.68Z"
android:fillColor="#E74133"
android:fillType="evenOdd"/>
</group>
<path
android:pathData="M124.43,28.32H119.12V29.68H122.96C122.63,31.73 120.75,33.19 118.83,33.27C116.39,33.27 114.47,31.27 114.47,28.72C114.47,26.2 116.39,24.2 118.83,24.2C121.28,24.2 122.48,26.26 122.48,26.26L123.73,25.59C123.73,25.59 122.21,22.77 118.83,22.77C115.57,22.77 113.06,25.41 113.06,28.72C113.06,32.05 115.57,34.69 118.83,34.69C121.64,34.63 124.07,32.47 124.42,29.62C124.42,29.62 124.5,28.72 124.43,28.32ZM130.15,33.2C128.6,33.2 127.29,31.84 127.29,30.08C127.29,28.31 128.6,26.96 130.15,26.96C131.69,26.96 133.01,28.31 133.01,30.08C133.01,31.84 131.69,33.2 130.15,33.2ZM125.89,30.08C125.89,32.53 127.75,34.61 130.15,34.61C132.57,34.61 134.42,32.53 134.42,30.08C134.42,27.62 132.57,25.54 130.15,25.54C127.75,25.54 125.89,27.62 125.89,30.08ZM140.12,33.2C138.57,33.2 137.26,31.84 137.26,30.08C137.26,28.31 138.57,26.96 140.12,26.96C141.65,26.96 142.98,28.31 142.98,30.08C142.98,31.84 141.65,33.2 140.12,33.2ZM135.86,30.08C135.86,32.53 137.72,34.61 140.12,34.61C142.54,34.61 144.39,32.53 144.39,30.08C144.39,27.62 142.54,25.54 140.12,25.54C137.72,25.54 135.86,27.62 135.86,30.08ZM150.1,33.24C148.58,33.24 147.26,31.89 147.26,30.13C147.26,28.39 148.58,27.06 150.1,27.06C151.61,27.06 152.92,28.39 152.92,30.13C152.92,31.89 151.61,33.24 150.1,33.24ZM145.83,30.13C145.83,32.58 147.7,34.64 150.09,34.64C151.02,34.64 152.26,34.1 152.98,32.9V34.15C152.97,36.04 151.53,37.27 150.09,37.27C149.21,37.27 148.33,36.8 147.8,35.96L146.58,36.74C147.35,37.89 148.65,38.66 150.09,38.66C152.47,38.66 154.38,36.74 154.39,34.13V25.57H152.98V27.32C152.31,26.02 151.02,25.64 150.09,25.62C147.7,25.62 145.83,27.7 145.83,30.13ZM156.4,22.56V34.56H157.81V22.56H156.4ZM166.26,29.25H160.77C161.12,27.91 162.29,26.98 163.56,26.98C164.82,26.98 165.89,27.92 166.26,29.25ZM159.3,30.08C159.3,32.53 161.16,34.6 163.56,34.6C166.08,34.6 167.2,32.56 167.2,32.56L165.91,31.97C165.91,31.97 165.14,33.19 163.56,33.19C162.18,33.19 160.95,32.08 160.72,30.58H167.73C167.73,30.58 167.88,29.19 167.25,27.97C167.22,27.89 166.12,25.56 163.56,25.56C161.16,25.56 159.3,27.62 159.3,30.08ZM169.09,32.84V34.04H181.88V32.84H176.18V30.32H180.68V29.12H172.12V27.01H180.34V22.61H170.63V23.81H178.88V25.84H170.66V30.32H174.72V32.84H169.09ZM190.43,22.79V25.22C190.43,27.91 188.86,30.61 186.68,31.62L187.58,32.84C189.24,32 190.56,30.29 191.2,28.23C191.85,30.16 193.12,31.76 194.73,32.55L195.61,31.38C193.45,30.4 191.92,27.81 191.92,25.22V22.79H190.43ZM196.89,35.76H198.36V21.59H196.89V35.76ZM201.07,22.56V23.76H204.16V24.13C204.16,26.08 202.83,27.92 200.65,28.68L201.44,29.81C203.07,29.24 204.28,28.04 204.91,26.52C205.52,27.91 206.68,29.03 208.25,29.57L208.99,28.4C206.88,27.67 205.63,25.96 205.63,24.13V23.76H208.65V22.56H201.07ZM202.51,32.04H210.27V35.75H211.76V30.82H202.51V32.04ZM210.27,30.12H211.76V26.5H213.77V25.25H211.76V21.62H210.27V30.12ZM224.17,21.62V35.75H225.63V28.58H227.87V27.35H225.63V21.62H224.17ZM214.65,25.03H222.96V23.83H219.6V21.81H218.09V23.83H214.65V25.03ZM215.4,29.36C215.4,31.3 216.86,32.64 218.85,32.64C220.86,32.64 222.33,31.3 222.33,29.36C222.33,27.44 220.86,26.1 218.85,26.1C216.86,26.1 215.4,27.44 215.4,29.36ZM216.8,29.36C216.8,28.16 217.68,27.32 218.85,27.32C220.04,27.32 220.94,28.16 220.94,29.36C220.94,30.6 220.04,31.43 218.85,31.43C217.68,31.43 216.8,30.6 216.8,29.36ZM238.89,21.6V35.73H240.37V21.6H238.89ZM228.88,31.99L229.66,33.16C234.45,30.82 236.21,27.25 236.21,23.11H229.55V24.31H234.72C234.43,27.62 232.6,30.18 228.88,31.99Z"
android:fillColor="#1B202C"/>
</vector>
21 changes: 21 additions & 0 deletions android/app/src/main/res/drawable/img_kakao_register.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="328dp"
android:height="57dp"
android:viewportWidth="328"
android:viewportHeight="57">
<path
android:pathData="M10,0L318,0A10,10 0,0 1,328 10L328,47A10,10 0,0 1,318 57L10,57A10,10 0,0 1,0 47L0,10A10,10 0,0 1,10 0z"
android:fillColor="#FEE500"/>
<group>
<clip-path
android:pathData="M78.5,19.5h18v18h-18z"/>
<path
android:pathData="M87.5,20C82.79,20 78.5,23.22 78.5,27.18C78.5,29.65 80.06,31.83 82.43,33.12L81.43,36.89C81.34,37.23 81.71,37.49 82,37.3L86.37,34.31C86.74,34.35 87.12,34.37 87.5,34.37C92.47,34.37 96.5,31.15 96.5,27.18C96.5,23.22 92.47,20 87.5,20Z"
android:fillColor="#000000"
android:fillAlpha="0.902"
android:fillType="evenOdd"/>
</group>
<path
android:pathData="M113.59,23.04H107.21V24.24H112.13C112.09,25.06 111.96,25.83 111.75,26.56L106.49,26.92L106.69,28.2L111.3,27.75C110.47,29.56 108.95,31.08 106.41,32.32L107.21,33.48C112.31,30.92 113.59,27.22 113.59,23.04ZM115.75,35.73H117.22V28.48H119.41V27.25H117.22V21.59H115.75V35.73ZM127.57,23.04H121.19V24.24H126.12C126.07,25.06 125.94,25.83 125.74,26.56L120.47,26.92L120.68,28.2L125.29,27.75C124.46,29.56 122.93,31.08 120.39,32.32L121.19,33.48C126.29,30.92 127.57,27.22 127.57,23.04ZM129.74,35.73H131.21V28.48H133.4V27.25H131.21V21.59H129.74V35.73ZM140.66,22.5C137.69,22.5 135.51,23.97 135.51,26.24C135.51,28.32 137.34,29.73 139.93,29.96V32.77H134.29V33.99H147.08V32.77H141.38V29.96C144.01,29.75 145.85,28.32 145.85,26.24C145.85,23.97 143.67,22.5 140.66,22.5ZM136.93,26.24C136.93,24.68 138.5,23.67 140.66,23.67C142.84,23.67 144.39,24.68 144.39,26.24C144.39,27.81 142.84,28.8 140.66,28.8C138.5,28.8 136.93,27.81 136.93,26.24ZM148.28,29.2V30.39H161.03V29.2H155.37V27.83H159.58V26.69H151.4V25.43H159.13V24.31H151.4V23.12H159.5V21.97H149.93V27.83H153.91V29.2H148.28ZM149.7,32.71H157.93V35.75H159.42V31.52H149.7V32.71ZM168.63,22.47C165.7,22.47 163.48,24.04 163.48,26.4C163.48,28.77 165.7,30.36 168.63,30.36C171.59,30.36 173.82,28.77 173.82,26.4C173.82,24.04 171.59,22.47 168.63,22.47ZM162.26,33.92H175.05V32.69H162.26V33.92ZM164.89,26.4C164.89,24.76 166.49,23.67 168.63,23.67C170.81,23.67 172.39,24.76 172.39,26.4C172.39,28.07 170.81,29.16 168.63,29.16C166.49,29.16 164.89,28.07 164.89,26.4ZM176.25,32.84V34.04H189.03V32.84H183.34V30.32H187.83V29.12H179.27V27.01H187.5V22.61H177.78V23.81H186.04V25.84H177.82V30.32H181.88V32.84H176.25ZM197.58,22.79V25.22C197.58,27.91 196.02,30.61 193.84,31.62L194.74,32.84C196.4,32 197.71,30.29 198.35,28.23C199.01,30.16 200.27,31.76 201.89,32.55L202.77,31.38C200.61,30.4 199.07,27.81 199.07,25.22V22.79H197.58ZM204.05,35.76H205.52V21.59H204.05V35.76ZM208.23,22.56V23.76H211.31V24.13C211.31,26.08 209.99,27.92 207.81,28.68L208.59,29.81C210.23,29.24 211.44,28.04 212.07,26.52C212.67,27.91 213.84,29.03 215.41,29.57L216.15,28.4C214.03,27.67 212.79,25.96 212.79,24.13V23.76H215.81V22.56H208.23ZM209.66,32.04H217.43V35.75H218.91V30.82H209.66V32.04ZM217.43,30.12H218.91V26.5H220.93V25.25H218.91V21.62H217.43V30.12ZM231.33,21.62V35.75H232.79V28.58H235.02V27.35H232.79V21.62H231.33ZM221.81,25.03H230.11V23.83H226.75V21.81H225.25V23.83H221.81V25.03ZM222.56,29.36C222.56,31.3 224.02,32.64 226,32.64C228.02,32.64 229.49,31.3 229.49,29.36C229.49,27.44 228.02,26.1 226,26.1C224.02,26.1 222.56,27.44 222.56,29.36ZM223.95,29.36C223.95,28.16 224.83,27.32 226,27.32C227.2,27.32 228.1,28.16 228.1,29.36C228.1,30.6 227.2,31.43 226,31.43C224.83,31.43 223.95,30.6 223.95,29.36ZM246.05,21.6V35.73H247.52V21.6H246.05ZM236.03,31.99L236.82,33.16C241.6,30.82 243.36,27.25 243.36,23.11H236.71V24.31H241.87C241.59,27.62 239.76,30.18 236.03,31.99Z"
android:fillColor="#000000"/>
</vector>
77 changes: 77 additions & 0 deletions android/app/src/main/res/layout/activity_register.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<data>

<variable
name="vm"
type="com.woowacourse.friendogly.presentation.ui.register.RegisterViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/register_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".presentation.ui.register.RegisterActivity">

<ImageView
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="200dp"
android:src="@drawable/img_dog"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_register_title"
style="@style/Theme.AppCompat.TextView.Regular.Gray07.Size16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/register_now"
app:layout_constraintBottom_toTopOf="@+id/ib_kakao_register"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageButton
android:id="@+id/ib_kakao_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="24dp"
android:adjustViewBounds="true"
android:onClick="@{() -> vm.executeKakaoLogin()}"
android:padding="0dp"
android:scaleType="fitCenter"
android:src="@drawable/img_kakao_register"
app:layout_constraintBottom_toTopOf="@+id/ib_google_register"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageButton
android:id="@+id/ib_google_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="24dp"
android:adjustViewBounds="true"
android:onClick="@{() -> vm.executeGoogleLogin()}"
android:padding="0dp"
android:scaleType="fitCenter"
android:src="@drawable/img_google_register"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
3 changes: 3 additions & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<resources>
<string name="app_name">friendogly</string>

<!--회원가입 화면-->
<string name="register_now">간편하게 로그인 할래요</string>

<!--홈화면-->
<string name="on_back_pressed_Message">뒤로가기 버튼을\n한번 더 누르면 종료됩니다.</string>

Expand Down

0 comments on commit 13d1d9b

Please sign in to comment.