Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/BDBD-269' into stage/san…
Browse files Browse the repository at this point in the history
…dbox
  • Loading branch information
minseonglove committed Jul 1, 2022
2 parents 5a02d4e + 378aad5 commit e51eb41
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
package com.fakedevelopers.bidderbidder

import android.app.Application
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class HiltApplication : Application() {

override fun onCreate() {
super.onCreate()
Logger.addLogAdapter(AndroidLogAdapter())
}

fun setPartialTextColor(text: CharSequence, colorId: Int, start: Int, end: Int) =
SpannableStringBuilder(text).apply {
setSpan(
ForegroundColorSpan(applicationContext.getColor(colorId)),
start,
end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.fakedevelopers.bidderbidder.ui.login_type

import android.os.Bundle
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.navigation.fragment.findNavController
import com.fakedevelopers.bidderbidder.HiltApplication
import com.fakedevelopers.bidderbidder.R
import com.fakedevelopers.bidderbidder.databinding.FragmentLoginTypeBinding

Expand All @@ -35,15 +33,20 @@ class LoginTypeFragment : Fragment() {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val sp = SpannableStringBuilder(getString(R.string.logintype_welcometext)).apply {
setSpan(
ForegroundColorSpan(requireActivity().getColor(R.color.bidderbidder_primary)),
(requireContext().applicationContext as HiltApplication).let {
binding.textviewLogintypeWelcometext.text = it.setPartialTextColor(
binding.textviewLogintypeWelcometext.text,
R.color.bidderbidder_primary,
0,
4,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
4
)
binding.textViewLogintypeRegistration.text = it.setPartialTextColor(
binding.textViewLogintypeRegistration.text,
R.color.bidderbidder_primary,
0,
binding.textViewLogintypeRegistration.text.indexOf('?') + 1
)
}
binding.textviewLogintypeWelcometext.text = sp
binding.buttonLogintypeCommon.layoutLoginType.setOnClickListener {
findNavController().navigate(R.id.action_loginTypeFragment_to_loginFragment)
}
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
android:ems="10"
android:hint="@string/login_id"
android:text="@={vm.email}"
android:textSize="@dimen/login_edittext_text_size"
android:textColorHint="@color/edit_text_hint"
tools:ignore="TextContrastCheck" />
android:textSize="@dimen/login_edittext_text_size"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
Expand All @@ -70,22 +70,24 @@
android:layout_height="match_parent"
android:ems="10"
android:hint="@string/login_password"
android:inputType="textPassword"
android:text="@={vm.passwd}"
android:textSize="@dimen/login_edittext_text_size"
android:textColorHint="@color/edit_text_hint"
tools:ignore="TextContrastCheck" />
android:textSize="@dimen/login_edittext_text_size"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck" />
</com.google.android.material.textfield.TextInputLayout>

<include
android:id="@+id/include_login_signin"
layout="@layout/include_long_button"
android:layout_width="0dp"
android:layout_height="@dimen/long_button_height"
android:layout_marginBottom="@dimen/login_bottom_margin"
app:buttonText="@{@string/login_signin}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.75" />

<TextView
android:id="@+id/textview_login_registration"
Expand Down
19 changes: 9 additions & 10 deletions app/src/main/res/layout/fragment_login_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:text="BDBD"
android:textColor="@color/bidderbidder_primary"
android:textSize="@dimen/login_type_logo_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.15" />

<TextView
android:id="@+id/textview_logintype_welcometext"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/login_type_title_margin"
android:text="@string/logintype_welcometext"
android:textSize="@dimen/login_type_title_text_size"
android:textColor="@android:color/black"
android:textSize="@dimen/login_type_title_text_size"
app:layout_constraintBottom_toTopOf="@+id/button_logintype_kakao"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -47,7 +48,6 @@
app:buttonIcon="@{@drawable/login_type_kakao}"
app:layout_constraintBottom_toTopOf="@+id/button_logintype_naver"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.75"
app:layout_constraintStart_toStartOf="parent"
app:textColor="@{@color/kakao_text}"
app:titleText="@{@string/logintype_kakaologin}" />
Expand Down Expand Up @@ -76,7 +76,6 @@
app:buttonIcon="@{@drawable/login_type_apple}"
app:layout_constraintBottom_toTopOf="@+id/button_logintype_common"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.25"
app:layout_constraintStart_toStartOf="parent"
app:textColor="@{@color/white}"
app:titleText="@{@string/logintype_applelogin}" />
Expand All @@ -86,26 +85,26 @@
layout="@layout/include_login_type_button"
android:layout_width="0dp"
android:layout_height="@dimen/login_type_button_height"
android:layout_marginBottom="@dimen/login_type_bottom_margin"
app:backgroundColor="@{@color/common_login_background}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.25"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.8"
app:textColor="@{@color/black}"
app:titleText="@{@string/logintype_commonlogin}" />

<TextView
android:id="@+id/textView_logintype_registration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/login_type_button_margin"
android:text="@string/logintype_registration"
android:textSize="@dimen/login_type_registration_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_logintype_common" />
app:layout_constraintTop_toBottomOf="@+id/button_logintype_common"
app:layout_constraintVertical_bias="0.2" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
31 changes: 14 additions & 17 deletions app/src/main/res/values-hdpi/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<resources>
<dimen name="fragment_horizontal_margin">32dp</dimen>
<dimen name="fragment_vertical_margin">32dp</dimen>
<dimen name="fragment_horizontal_margin">24dp</dimen>
<dimen name="fragment_vertical_margin">24dp</dimen>
<!-- related to common -->
<dimen name="long_button_height">48dp</dimen>
<dimen name="long_button_text_size">12sp</dimen>
<dimen name="long_button_height">36dp</dimen>
<dimen name="long_button_text_size">10sp</dimen>
<dimen name="long_button_corner">5dp</dimen>
<dimen name="small_text_button_size">10sp</dimen>
<!-- related to loginType -->
<dimen name="login_type_layout_horizontal_margin">32dp</dimen>
<dimen name="login_type_layout_vertical_margin">32dp</dimen>
<dimen name="login_type_layout_horizontal_margin">24dp</dimen>
<dimen name="login_type_layout_vertical_margin">24dp</dimen>
<dimen name="login_type_title_margin">8dp</dimen>
<dimen name="login_type_button_corner">5dp</dimen>
<dimen name="login_type_button_margin">8dp</dimen>
<dimen name="login_type_button_text_size">12sp</dimen>
<dimen name="login_type_button_text_size">10sp</dimen>
<dimen name="login_type_button_image_margin_start">20dp</dimen>
<dimen name="login_type_button_height">40dp</dimen>
<dimen name="login_type_bottom_margin">106dp</dimen>
<dimen name="login_type_top_margin">72dp</dimen>
<dimen name="login_type_title_text_size">18sp</dimen>
<dimen name="login_type_registration_text_size">10sp</dimen>
<dimen name="login_type_logo_size">32sp</dimen>
<dimen name="login_type_button_height">36dp</dimen>
<dimen name="login_type_title_text_size">16sp</dimen>
<dimen name="login_type_registration_text_size">9sp</dimen>
<dimen name="login_type_logo_size">28sp</dimen>
<!-- related to login -->
<dimen name="login_text_button_margin">8dp</dimen>
<dimen name="login_bottom_margin">120dp</dimen>
<dimen name="login_password_to_signin_margin">56dp</dimen>
<dimen name="login_edittext_height">48dp</dimen>
<dimen name="login_edittext_height">44dp</dimen>
<dimen name="login_edittext_id_margin">12dp</dimen>
<dimen name="login_edittext_text_size">12sp</dimen>
<dimen name="login_logo_size">60sp</dimen>
<dimen name="login_edittext_text_size">10sp</dimen>
<dimen name="login_logo_size">56sp</dimen>
<!-- related to productRegistration -->
<dimen name="product_registration_margin_vertical">12dp</dimen>
<dimen name="product_registration_margin_horizontal">8dp</dimen>
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/res/values-mdpi/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
<dimen name="login_type_title_margin">8dp</dimen>
<dimen name="login_type_button_corner">5dp</dimen>
<dimen name="login_type_button_margin">8dp</dimen>
<dimen name="login_type_button_text_size">12sp</dimen>
<dimen name="login_type_button_text_size">11sp</dimen>
<dimen name="login_type_button_image_margin_start">20dp</dimen>
<dimen name="login_type_button_height">40dp</dimen>
<dimen name="login_type_bottom_margin">106dp</dimen>
<dimen name="login_type_top_margin">72dp</dimen>
<dimen name="login_type_title_text_size">18sp</dimen>
<dimen name="login_type_registration_text_size">10sp</dimen>
<dimen name="login_type_registration_text_size">9sp</dimen>
<dimen name="login_type_logo_size">32sp</dimen>
<!-- related to login -->
<dimen name="login_text_button_margin">8dp</dimen>
<dimen name="login_bottom_margin">120dp</dimen>
<dimen name="login_password_to_signin_margin">56dp</dimen>
<dimen name="login_edittext_height">48dp</dimen>
<dimen name="login_edittext_id_margin">12dp</dimen>
Expand Down
28 changes: 13 additions & 15 deletions app/src/main/res/values-xhdpi/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<resources>
<dimen name="fragment_horizontal_margin">32dp</dimen>
<dimen name="fragment_vertical_margin">32dp</dimen>
<dimen name="fragment_horizontal_margin">28dp</dimen>
<dimen name="fragment_vertical_margin">28dp</dimen>
<!-- related to common -->
<dimen name="long_button_height">56dp</dimen>
<dimen name="long_button_text_size">14sp</dimen>
<dimen name="long_button_height">40dp</dimen>
<dimen name="long_button_text_size">12sp</dimen>
<dimen name="long_button_corner">5dp</dimen>
<dimen name="small_text_button_size">10sp</dimen>
<!-- related to loginType -->
<dimen name="login_type_layout_horizontal_margin">32dp</dimen>
<dimen name="login_type_layout_vertical_margin">32dp</dimen>
<dimen name="login_type_layout_horizontal_margin">28dp</dimen>
<dimen name="login_type_layout_vertical_margin">28dp</dimen>
<dimen name="login_type_title_margin">8dp</dimen>
<dimen name="login_type_button_corner">5dp</dimen>
<dimen name="login_type_button_margin">8dp</dimen>
<dimen name="login_type_button_text_size">14sp</dimen>
<dimen name="login_type_button_text_size">12sp</dimen>
<dimen name="login_type_button_image_margin_start">24dp</dimen>
<dimen name="login_type_button_height">48dp</dimen>
<dimen name="login_type_bottom_margin">106dp</dimen>
<dimen name="login_type_top_margin">72dp</dimen>
<dimen name="login_type_title_text_size">22sp</dimen>
<dimen name="login_type_registration_text_size">12sp</dimen>
<dimen name="login_type_button_height">40dp</dimen>
<dimen name="login_type_title_text_size">18sp</dimen>
<dimen name="login_type_registration_text_size">10sp</dimen>
<dimen name="login_type_logo_size">32sp</dimen>
<!-- related to login -->
<dimen name="login_text_button_margin">8dp</dimen>
<dimen name="login_bottom_margin">136dp</dimen>
<dimen name="login_password_to_signin_margin">64dp</dimen>
<dimen name="login_edittext_height">56dp</dimen>
<dimen name="login_edittext_height">48dp</dimen>
<dimen name="login_edittext_id_margin">16dp</dimen>
<dimen name="login_edittext_text_size">12sp</dimen>
<dimen name="login_logo_size">60sp</dimen>
<dimen name="login_logo_size">58sp</dimen>
<!-- related to productRegistration -->
<dimen name="product_registration_margin_vertical">12dp</dimen>
<dimen name="product_registration_margin_horizontal">8dp</dimen>
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/res/values-xxhdpi/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<dimen name="fragment_horizontal_margin">32dp</dimen>
<dimen name="fragment_vertical_margin">32dp</dimen>
<!-- related to common -->
<dimen name="long_button_height">56dp</dimen>
<dimen name="long_button_height">48dp</dimen>
<dimen name="long_button_text_size">14sp</dimen>
<dimen name="long_button_corner">5dp</dimen>
<dimen name="small_text_button_size">10sp</dimen>
Expand All @@ -15,17 +15,15 @@
<dimen name="login_type_button_text_size">14sp</dimen>
<dimen name="login_type_button_image_margin_start">24dp</dimen>
<dimen name="login_type_button_height">48dp</dimen>
<dimen name="login_type_bottom_margin">106dp</dimen>
<dimen name="login_type_top_margin">72dp</dimen>
<dimen name="login_type_title_text_size">22sp</dimen>
<dimen name="login_type_registration_text_size">12sp</dimen>
<dimen name="login_type_registration_text_size">11sp</dimen>
<dimen name="login_type_logo_size">36sp</dimen>
<!-- related to login -->
<dimen name="login_text_button_margin">8dp</dimen>
<dimen name="login_bottom_margin">168dp</dimen>
<dimen name="login_password_to_signin_margin">80dp</dimen>
<dimen name="login_edittext_height">56dp</dimen>
<dimen name="login_edittext_id_margin">16dp</dimen>
<dimen name="login_edittext_text_size">16sp</dimen>
<dimen name="login_edittext_text_size">14sp</dimen>
<dimen name="login_logo_size">60sp</dimen>
<!-- related to productRegistration -->
<dimen name="product_registration_margin_vertical">12dp</dimen>
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<dimen name="fragment_horizontal_margin">32dp</dimen>
<dimen name="fragment_vertical_margin">32dp</dimen>
<!-- related to common -->
<dimen name="long_button_height">56dp</dimen>
<dimen name="long_button_height">48dp</dimen>
<dimen name="long_button_text_size">14sp</dimen>
<dimen name="long_button_corner">5dp</dimen>
<dimen name="small_text_button_size">10sp</dimen>
Expand All @@ -15,17 +15,15 @@
<dimen name="login_type_button_text_size">14sp</dimen>
<dimen name="login_type_button_image_margin_start">24dp</dimen>
<dimen name="login_type_button_height">48dp</dimen>
<dimen name="login_type_bottom_margin">106dp</dimen>
<dimen name="login_type_top_margin">72dp</dimen>
<dimen name="login_type_title_text_size">22sp</dimen>
<dimen name="login_type_registration_text_size">12sp</dimen>
<dimen name="login_type_registration_text_size">11sp</dimen>
<dimen name="login_type_logo_size">36sp</dimen>
<!-- related to login -->
<dimen name="login_text_button_margin">8dp</dimen>
<dimen name="login_bottom_margin">168dp</dimen>
<dimen name="login_password_to_signin_margin">80dp</dimen>
<dimen name="login_edittext_height">56dp</dimen>
<dimen name="login_edittext_id_margin">16dp</dimen>
<dimen name="login_edittext_text_size">12sp</dimen>
<dimen name="login_edittext_text_size">14sp</dimen>
<dimen name="login_logo_size">60sp</dimen>
<!-- related to productRegistration -->
<dimen name="product_registration_margin_vertical">12dp</dimen>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<string name="logintype_naverlogin">네이버로 로그인</string>
<string name="logintype_applelogin">Apple로 로그인</string>
<string name="logintype_commonlogin">이메일로 로그인</string>
<string name="logintype_registration"><u>회원가입 하기</u></string>
<string name="logintype_registration">비더비더가 처음이라면? <u>회원가입 하기</u></string>
<!-- Strings related to login -->
<string name="login_id">아이디</string>
<string name="login_password">비밀번호</string>
Expand Down

0 comments on commit e51eb41

Please sign in to comment.