Skip to content

Commit

Permalink
[FEATURE] #38 : ManageFragment에 Screen, Dialog 보여지는 로직 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Oct 23, 2023
1 parent 75dba23 commit 1c7c72e
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.ComposeView
import androidx.fragment.app.Fragment
import com.wap.designsystem.WappTheme
import com.wap.wapp.core.commmon.extensions.showToast
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.feature.manage.code.ManageCodeDialog
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class ManageFragment : Fragment() {

private lateinit var composeView: ComposeView
Expand All @@ -25,7 +34,24 @@ class ManageFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
composeView.setContent {
WappTheme {}
var isShowDialog by rememberSaveable { mutableStateOf(false) }

WappTheme {
ManageScreen(
showManageCodeDialog = { isShowDialog = true },
)

if (isShowDialog) {
ManageCodeDialog(
onDismissRequest = { isShowDialog = false },
showToast = { throwable ->
requireContext().showToast(
throwable.toSupportingText(),
)
},
)
}
}
}
}
}

0 comments on commit 1c7c72e

Please sign in to comment.