Skip to content

Commit

Permalink
feat : Edit Text 스타일 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
youlalala committed Nov 15, 2023
1 parent f8b492a commit cbbcb07
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 13 deletions.
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>
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
2 changes: 2 additions & 0 deletions android/core/ui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@

<dimen name="btn_height">50dp</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>
15 changes: 14 additions & 1 deletion android/core/ui/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +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 @@ -45,4 +46,16 @@
<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 @@ -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()
}
}
}
13 changes: 8 additions & 5 deletions android/feature/login/src/main/res/layout/fragment_nickname.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tb_nickname" />

<TextView
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/et_nickname"
style="@style/EditText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/margin_horizontal"
app:layout_constraintBottom_toBottomOf="@id/btn_start"
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_toTopOf="@id/tv_nickname_title" />
app:layout_constraintTop_toBottomOf="@id/tv_nickname_title" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_start"
Expand Down
5 changes: 5 additions & 0 deletions android/feature/login/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?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="nickname">닉네임</string>
<string name="start">시작하기</string>
</resources>

0 comments on commit cbbcb07

Please sign in to comment.