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

[refactor] 코드 리팩토링 #408

Merged
merged 2 commits into from
Jun 28, 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,4 +1,4 @@
package com.hyeeyoung.wishboard.domain.di
package com.hyeeyoung.wishboard.di

import com.google.gson.Gson
import com.google.gson.GsonBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.hyeeyoung.wishboard.domain.di
package com.hyeeyoung.wishboard.di

import com.hyeeyoung.wishboard.data.repositories.*
import com.hyeeyoung.wishboard.domain.repositories.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.hyeeyoung.wishboard.domain.di
package com.hyeeyoung.wishboard.di

import com.hyeeyoung.wishboard.data.services.retrofit.*
import dagger.Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package com.hyeeyoung.wishboard.presentation.sign.screens

import android.content.Intent
import android.os.Bundle
import android.text.Spannable
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.View
import androidx.core.content.res.ResourcesCompat
import androidx.core.text.set
import androidx.core.text.toSpannable
import androidx.hilt.navigation.fragment.hiltNavGraphViewModels
import androidx.navigation.fragment.findNavController
import com.hyeeyoung.wishboard.R
Expand Down Expand Up @@ -49,8 +50,6 @@ class SignUpPasswordFragment :
}

private fun initializeView() {
binding.signTerm.movementMethod = LinkMovementMethod.getInstance()

val clickableSpanTerms = object : ClickableSpan() {
override fun onClick(widget: View) {
moveWebViewActivity(
Expand All @@ -68,11 +67,15 @@ class SignUpPasswordFragment :
}
}

(binding.signTerm.text as? Spannable)?.apply {
setSpan(clickableSpanTerms, 5, 9, Spannable.SPAN_INCLUSIVE_INCLUSIVE)
setSpan(ForegroundColorSpan(ResourcesCompat.getColor(resources, R.color.green_700, null)), 5, 9, Spannable.SPAN_INCLUSIVE_INCLUSIVE)
setSpan(clickableSpanPersonalInfo, 11, 20, Spannable.SPAN_INCLUSIVE_INCLUSIVE)
setSpan(ForegroundColorSpan(ResourcesCompat.getColor(resources, R.color.green_700, null)), 11, 20, Spannable.SPAN_INCLUSIVE_INCLUSIVE)
with(binding.signTerm) {
movementMethod = LinkMovementMethod.getInstance()
val spannable = text.toSpannable()
spannable[5..9] = clickableSpanTerms
spannable[5..9] =
ForegroundColorSpan(ResourcesCompat.getColor(resources, R.color.green_700, null))
spannable[11..20] = clickableSpanPersonalInfo
spannable[11..20] =
ForegroundColorSpan(ResourcesCompat.getColor(resources, R.color.green_700, null))
}
}

Expand Down