Skip to content

Commit

Permalink
[feat/#45] toast -> defaultToast 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kkk5474096 committed Jan 25, 2024
1 parent 4c137fa commit 91fd4ff
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.teumteum.base.BindingFragment
import com.teumteum.base.component.appbar.AppBarLayout
import com.teumteum.base.component.appbar.AppBarMenu
import com.teumteum.base.databinding.LayoutCommonAppbarBinding
import com.teumteum.base.util.extension.toast
import com.teumteum.base.util.extension.defaultToast
import com.teumteum.domain.enumSet.EnumTopic
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.FragmentHomeBinding
Expand Down Expand Up @@ -121,7 +121,7 @@ class HomeFragment :
}

is GroupListUiState.Failure -> {
requireActivity().toast(it.msg)
requireActivity().defaultToast(it.msg)
}

else -> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ButtonDefaults
import com.google.accompanist.pager.HorizontalPager
import androidx.compose.runtime.Composable
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import coil.compose.rememberAsyncImagePainter
import com.google.accompanist.pager.ExperimentalPagerApi
import com.google.accompanist.pager.HorizontalPager
import com.google.accompanist.pager.rememberPagerState
import com.teumteum.base.BindingActivity
import com.teumteum.base.component.compose.TeumDivider
Expand All @@ -58,17 +58,14 @@ import com.teumteum.base.component.compose.TmMarginVerticalSpacer
import com.teumteum.base.component.compose.TmScaffold
import com.teumteum.base.component.compose.theme.TmTypo
import com.teumteum.base.component.compose.theme.TmtmColorPalette
import com.teumteum.base.util.extension.toast
import com.teumteum.domain.entity.Friend
import com.teumteum.teumteum.R
import com.teumteum.teumteum.presentation.MainActivity
import com.teumteum.teumteum.presentation.group.join.JoinFriendListActivity
import com.teumteum.teumteum.presentation.group.join.check.GroupMeetCheckActivity
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json



@OptIn(ExperimentalPagerApi::class)
@Composable
fun MoimConfirm(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.animation.ObjectAnimator
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
Expand All @@ -13,15 +12,12 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import com.teumteum.base.BindingFragment
import com.teumteum.base.component.compose.theme.TeumTeumTheme
import com.teumteum.base.util.extension.toast
import com.teumteum.base.util.extension.defaultToast
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.FragmentMoimBinding
import com.teumteum.teumteum.presentation.MainActivity
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch


class MoimFragment :
BindingFragment<FragmentMoimBinding>(R.layout.fragment_moim) {
Expand Down Expand Up @@ -116,13 +112,13 @@ class MoimFragment :
viewModel.screenState.flowWithLifecycle(lifecycle)
.onEach {
when(it) {
ScreenState.Failure -> { context?.toast("모임 신청에 오류가 발생했습니다") }
ScreenState.Server -> { context?.toast("서버 통신에 실패했습니다") }
ScreenState.Failure -> { context?.defaultToast("모임 신청에 오류가 발생했습니다") }
ScreenState.Server -> { context?.defaultToast("서버 통신에 실패했습니다") }
ScreenState.Create -> {
viewModel.getUserId()
}
ScreenState.CancelSuccess -> {
context?.toast("모임 취소를 완료했습니다")
context?.defaultToast("모임 취소를 완료했습니다")
val navController = findNavController()
navController.popBackStack()
viewModel.initializeState()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
package com.teumteum.teumteum.presentation.mypage.editCard

import android.app.Activity
import android.app.ProgressDialog.show
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.View
import androidx.activity.OnBackPressedCallback
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import com.teumteum.base.BindingFragment
import com.teumteum.base.util.extension.toast
import com.teumteum.base.util.extension.defaultToast
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.FragmentEditCardBinding
import com.teumteum.teumteum.presentation.MainActivity
import com.teumteum.teumteum.presentation.moim.MoimViewModel
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.EditCardViewModel
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.MyPageViewModel
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.SheetEvent
Expand All @@ -31,12 +23,9 @@ import com.teumteum.teumteum.presentation.signup.area.PreferredAreaFragment
import com.teumteum.teumteum.presentation.signup.community.CommunityFragment
import com.teumteum.teumteum.presentation.signup.job.CurrentJobFragment
import com.teumteum.teumteum.presentation.signup.job.ReadyJobFragment
import com.teumteum.teumteum.presentation.signup.mbti.GetMbtiFragment
import com.teumteum.teumteum.presentation.signup.modal.AreaModalBottomSheet
import com.teumteum.teumteum.presentation.signup.modal.MbtiModalBottomSheet
import com.teumteum.teumteum.presentation.signup.modal.SingleModalAdapter
import com.teumteum.teumteum.presentation.signup.modal.SingleModalBottomSheet
import com.teumteum.teumteum.util.SignupUtils
import com.teumteum.teumteum.util.SignupUtils.JOB_DESIGN
import com.teumteum.teumteum.util.SignupUtils.JOB_DESIGN_LIST
import com.teumteum.teumteum.util.SignupUtils.JOB_DEVELOPMENT
Expand Down Expand Up @@ -129,8 +118,8 @@ class EditCardFragment: BindingFragment<FragmentEditCardBinding>(R.layout.fragme
}
resultLauncher.launch(intent)
}
SheetEvent.Error -> { context?.toast("서버 통신에 오류가 발생했습니다") }
SheetEvent.Success -> {context?.toast("정보 수정이 완료되었습니다")}
SheetEvent.Error -> { context?.defaultToast("서버 통신에 오류가 발생했습니다") }
SheetEvent.Success -> {context?.defaultToast("정보 수정이 완료되었습니다")}
else -> {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import com.teumteum.base.BindingFragment
import com.teumteum.base.util.extension.toast
import com.teumteum.base.util.extension.defaultToast
import com.teumteum.teumteum.R
import com.teumteum.teumteum.databinding.FragmentSettingBinding
import com.teumteum.teumteum.presentation.MainActivity
Expand Down Expand Up @@ -61,7 +61,7 @@ class SettingFragment: BindingFragment<FragmentSettingBinding>(R.layout.fragment
viewModel.updateSettingStatus(SettingStatus.DEFAULT)
}
SettingStatus.ERROR -> {
requireActivity().toast("서버 통신 에러")
requireActivity().defaultToast("서버 통신 에러")
}
else -> {}
}
Expand Down

0 comments on commit 91fd4ff

Please sign in to comment.