Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/team-MUMENT/MUMENT-AOS i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
lhb8106 committed Apr 2, 2023
2 parents 9de9070 + f311acd commit d014948
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,22 @@ class ProfileSettingActivity :
//뒤로가기 클릭 리스너
private fun backBtnListener() {
binding.ivProfileBack.setOnClickListener {
finish()
backBtnEvent()
}
}

//뒤로가기
private fun backBtnEvent() {
val isCheckMypage = intent.getIntExtra("checkMyPage", 0)
if (isCheckMypage == 0) {
val intent = Intent(this, LogInActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(intent)
}
finish()
}


private fun nickNameDupNetwork() {
val nickname = binding.etNickname.text.toString().trim()
viewModel.nickNameDupCheck(nickname)
Expand Down Expand Up @@ -346,4 +358,8 @@ class ProfileSettingActivity :
mainHomeNavigatorProvider.profileSettingToMain()
}

override fun onBackPressed() {
super.onBackPressed()
backBtnEvent()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class MyPageActivity : BaseActivity<ActivityMyPageBinding>(ActivityMyPageBinding
override fun onStart() {
super.onStart()
myPageViewModel.userInfo()
getVersionInfo()
}

override fun onResume() {
super.onResume()
getVersionInfo()
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -92,18 +92,7 @@ class MyPageActivity : BaseActivity<ActivityMyPageBinding>(ActivityMyPageBinding
}

private fun linkNetwork() {
myPageViewModel.getWebView("mypage","")
myPageViewModel.getWebViewEntity.observe(this) {
/*
faq = it.faq.toString()
appInfo = it.appInfo.toString()
introduction = it.introduction.toString()
license = it.license.toString()
Log.e("TEST1111111", "$appInfo")
*/
}
myPageViewModel.getWebView("mypage", "")
}

//각 웹뷰로 이동
Expand All @@ -120,7 +109,11 @@ class MyPageActivity : BaseActivity<ActivityMyPageBinding>(ActivityMyPageBinding
clAppInfo.setOnClickListener { initIntent(myPageViewModel?.appInfo ?: "") }

//뮤멘트 소개
clIntroduceMument.setOnClickListener { initIntent(myPageViewModel?.introduction ?: "") }
clIntroduceMument.setOnClickListener {
initIntent(
myPageViewModel?.introduction ?: ""
)
}

//오픈라이선스
clOpenSource.setOnClickListener { initIntent(myPageViewModel?.license ?: "") }
Expand Down Expand Up @@ -200,7 +193,7 @@ class MyPageActivity : BaseActivity<ActivityMyPageBinding>(ActivityMyPageBinding

private fun getVersionInfo() {
val presentVersionInfo = packageManager.getPackageInfo(packageName, 0)
myPageViewModel.getWebView("version","AOS")
myPageViewModel.getWebView("version", "AOS")
myPageViewModel.getWebViewEntity.observe(this) {
val recentVersionInfo = it.version.toString()
binding.tvMyPageVersionInfo.text = String.format(
Expand All @@ -210,6 +203,7 @@ class MyPageActivity : BaseActivity<ActivityMyPageBinding>(ActivityMyPageBinding
recentVersionInfo
)
)
Log.e("mypageRececntVersionInfo", recentVersionInfo)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class MyPageViewModel @Inject constructor(
private val logOutUseCase: LogOutUseCase
) : ViewModel() {

var faq : String? = ""
var appInfo : String? = ""
var faq: String? = ""
var appInfo: String? = ""
var introduction: String? = ""
var license: String? = ""

Expand Down Expand Up @@ -223,15 +223,15 @@ class MyPageViewModel @Inject constructor(
}

//webview link
fun getWebView(page: String,os:String) {
fun getWebView(page: String, os: String) {
viewModelScope.launch {
kotlin.runCatching {
getWebViewUseCase.getWebView(page,os).let {
getWebViewUseCase.getWebView(page, os).let {
_getWebViewEntity.value = it
if(page == "mypage") {
if (page == "mypage" && os == "") {
faq = it?.faq.toString()
appInfo = it?.appInfo.toString()
introduction = it?.appInfo.toString()
introduction = it?.introduction.toString()
license = it?.license.toString()

}
Expand Down

0 comments on commit d014948

Please sign in to comment.