Skip to content

Commit

Permalink
[feature] #306 - 로그인 유도 Dialog 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hansh0101 committed Jun 22, 2022
1 parent af1eba6 commit 165879b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/src/main/java/co/kr/bemyplan/util/CustomDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.widget.TextView
import androidx.annotation.LayoutRes
import co.kr.bemyplan.R

class CustomDialog(context: Context, val title: String, val content: String) {
class CustomDialog(val context: Context, val title: String, val content: String) {
private val dialog = Dialog(context)
private lateinit var onClickedListener: ButtonClickListener

Expand Down Expand Up @@ -76,4 +76,19 @@ class CustomDialog(context: Context, val title: String, val content: String) {
dialog.dismiss()
}
}

fun showLoginDialog() {
dialog.setContentView(R.layout.dialog_yes_no)
dialog.findViewById<TextView>(R.id.tv_content).text = "로그인이 필요한 서비스입니다.\n로그인 하시겠습니까?"
dialog.window?.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
dialog.window?.setBackgroundDrawableResource(R.drawable.inset_horizontal_24)
dialog.show()
dialog.findViewById<TextView>(R.id.tv_yes).setOnClickListener {
onClickedListener.onClicked(1)
dialog.dismiss()
}
}
}

0 comments on commit 165879b

Please sign in to comment.