Skip to content
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
Expand Up @@ -3,6 +3,8 @@ package com.into.websoso.ui.noticeDetail
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.Html
import android.text.method.LinkMovementMethod
import androidx.activity.addCallback
import com.into.websoso.R
import com.into.websoso.common.ui.base.BaseActivity
Expand All @@ -20,6 +22,7 @@ class NoticeDetailActivity :

onBackButtonClick()
handleBackPressed()
setupHyperlink(noticeItem?.noticeContent)
}

private fun onBackButtonClick() {
Expand All @@ -34,6 +37,18 @@ class NoticeDetailActivity :
}
}

private fun setupHyperlink(noticeContent: String?) {
binding.tvNoticeDetailContent.apply {
movementMethod = LinkMovementMethod.getInstance()
text = noticeContent?.let { content ->
Html.fromHtml(
content,
Html.FROM_HTML_MODE_LEGACY,
)
}
}
}

companion object {
const val NOTICE_DETAIL_KEY = "NOTICE_DETAIL_KEY"

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_notice_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@
app:layout_constraintTop_toBottomOf="@id/tv_notice_detail_notice_date" />

<TextView
android:id="@+id/tv_notice_detail_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:paddingHorizontal="20dp"
android:scrollbars="vertical"
android:autoLink="web"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a: web 속성이 있나보군요 신기해라

android:text="@{noticeItem.noticeContent}"
android:textAppearance="@style/body2"
android:textColor="@color/black"
Expand Down