Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

닉네임 UI #98

Merged
merged 5 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/light_gray" />
<corners android:radius="@dimen/login_radius" />

<solid android:color="@color/key" />
<corners android:radius="@dimen/btn_radius" />
</shape>
17 changes: 17 additions & 0 deletions android/core/ui/src/main/res/drawable/et_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="@color/light_gray" />
<corners android:radius="@dimen/btn_radius" />
<stroke android:width="1.5dp" android:color="@color/on_surface" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/light_gray" />
<corners android:radius="@dimen/btn_radius" />
<stroke android:width="0.5dp" android:color="@color/on_surface_variant" />
</shape>
</item>
</selector>
2 changes: 1 addition & 1 deletion android/core/ui/src/main/res/drawable/ic_logo.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion android/core/ui/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Base.Theme.CatchyTape" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/primary</item>
<item name="android:statusBarColor">@color/surface</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowBackground">@color/surface</item>
Expand Down
1 change: 1 addition & 0 deletions android/core/ui/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="key">#FFBB2649</color>
<color name="key_variant">#FFF5D4DC</color>
<color name="light_gray">#FFF5F5F5</color>

<color name="primary">#FFBB2649</color>
Expand Down
4 changes: 3 additions & 1 deletion android/core/ui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
<dimen name="login_icon_margin_vertical">168dp</dimen>

<dimen name="btn_height">50dp</dimen>
<dimen name="login_radius">10dp</dimen>
<dimen name="btn_radius">10dp</dimen>

<dimen name="et_height">50dp</dimen>
</resources>
7 changes: 0 additions & 7 deletions android/core/ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="google_login">구글로 로그인</string>
<string name="signup_complete">가입 완료</string>
<string name="write_nickname">닉네임을 입력하세요</string>

<string name="home">홈</string>
<string name="search">검색</string>
<string name="playlist">재생목록</string>
Expand Down Expand Up @@ -33,7 +29,4 @@
<string name="title">제목</string>
<string name="genre">장르</string>
<string name="description">설명</string>

<string name="google_account_login">구글계정으로 로그인</string>

</resources>
22 changes: 21 additions & 1 deletion android/core/ui/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="Base.Theme.CatchyTape" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/primary</item>
<item name="android:statusBarColor">@color/surface</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowBackground">@color/surface</item>
Expand Down Expand Up @@ -38,4 +40,22 @@
<item name="navigationIconTint">@color/on_surface</item>
</style>

<style name="Button" parent="Widget.AppCompat.Button">
<item name="android:textSize">14sp</item>
<item name="android:background">@drawable/btn_background</item>
<item name="android:layout_height">@dimen/btn_height</item>
<item name="android:layout_marginHorizontal">@dimen/margin_horizontal</item>
</style>

<style name="EditText" parent="Widget.AppCompat.EditText">
<item name="android:textSize">14sp</item>
<item name="android:layout_height">@dimen/et_height</item>
<item name="android:background">@drawable/et_background</item>
<item name="android:paddingHorizontal">@dimen/margin_horizontal</item>
<item name="android:layout_marginHorizontal">@dimen/margin_horizontal</item>
<item name="android:textColorHint">@color/on_surface_variant</item>
<item name="android:textColor">@color/surface_bright</item>
<item name="android:textCursorDrawable">@color/black</item>
<item name="android:textColorHighlight">@color/key_variant</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.ohdodok.catchytape.feature.login
import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.ohdodok.catchytape.core.ui.BaseFragment
import com.ohdodok.catchytape.feature.login.databinding.FragmentLoginBinding
import dagger.hilt.android.AndroidEntryPoint
Expand All @@ -15,5 +16,10 @@ class LoginFragment : BaseFragment<FragmentLoginBinding>(R.layout.fragment_login
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.viewModel = viewModel

// TODO : Nickname Fragment Test 를 위한 코드로 추후 변경 해야함
binding.btnGoogleLogin.setOnClickListener {
findNavController().navigate(R.id.action_login_fragment_to_nickname_fragment)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ohdodok.catchytape.feature.login

import android.os.Bundle
import android.view.View
import androidx.navigation.fragment.findNavController
import com.ohdodok.catchytape.core.ui.BaseFragment
import com.ohdodok.catchytape.feature.login.databinding.FragmentNicknameBinding
import dagger.hilt.android.AndroidEntryPoint
Expand All @@ -11,5 +12,12 @@ class NicknameFragment : BaseFragment<FragmentNicknameBinding>(R.layout.fragment

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setUpAppbar()
}

private fun setUpAppbar() {
binding.tbNickname.setNavigationOnClickListener {
findNavController().popBackStack()
}
youlalala marked this conversation as resolved.
Show resolved Hide resolved
}
}
10 changes: 2 additions & 8 deletions android/feature/login/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">


<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
Expand All @@ -25,7 +24,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


<ImageView
android:id="@+id/iv_logo"
android:layout_width="wrap_content"
Expand All @@ -35,15 +33,12 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />


<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_google_login"
style="@style/TitleSmall"
style="@style/Button"
android:layout_width="0dp"
android:layout_height="@dimen/btn_height"
android:layout_marginHorizontal="@dimen/margin_horizontal"
android:layout_marginBottom="@dimen/extra_large"
android:background="@drawable/btn_login"
android:backgroundTint="@color/light_gray"
android:drawableStart="@drawable/ic_google"
android:paddingHorizontal="@dimen/margin_horizontal"
android:text="@string/google_account_login"
Expand All @@ -52,7 +47,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
35 changes: 35 additions & 0 deletions android/feature/login/src/main/res/layout/fragment_nickname.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,41 @@
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_arrow_back" />

<TextView
android:id="@+id/tv_nickname_title"
style="@style/TitleLarge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/margin_horizontal"
android:layout_marginTop="@dimen/medium"
android:text="@string/nickname_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tb_nickname" />

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/et_nickname"
style="@style/EditText"
android:layout_width="0dp"
android:layout_marginTop="@dimen/medium"
android:hint="@string/nickname"
android:inputType="text"
app:endIconMode="clear_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_nickname_title" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start"
style="@style/Button"
android:layout_width="0dp"
android:layout_marginBottom="@dimen/extra_large"
android:text="@string/start"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
android:id="@+id/login_fragment"
android:name="com.ohdodok.catchytape.feature.login.LoginFragment"
android:label="login"
tools:layout="@layout/fragment_login"/>
tools:layout="@layout/fragment_login">

<action
android:id="@+id/action_login_fragment_to_nickname_fragment"
app:destination="@id/nickname_fragment" />
</fragment>

<fragment
android:id="@+id/nickname_fragment"
Expand Down
9 changes: 9 additions & 0 deletions android/feature/login/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Login Fragment-->
<string name="google_account_login">구글계정으로 로그인</string>

<!-- Nickname Fragment-->
<string name="nickname_title">사용하실 닉네임을\n입력해주세요 :)</string>
<string name="start">시작하기</string>
</resources>
Loading