From b01635b8a8b61aca5d4c630475f511e9946aa8cc Mon Sep 17 00:00:00 2001 From: Dev-Corgi Date: Mon, 5 Feb 2024 17:45:28 +0900 Subject: [PATCH] rest init update --- .../com/notation/campusnote/LoginActivity.kt | 21 ------------------- .../campusnote/signUp/SignUpActivity.kt | 11 ++-------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/notation/campusnote/LoginActivity.kt b/app/src/main/java/com/notation/campusnote/LoginActivity.kt index 626f6c59..954a0404 100644 --- a/app/src/main/java/com/notation/campusnote/LoginActivity.kt +++ b/app/src/main/java/com/notation/campusnote/LoginActivity.kt @@ -1,20 +1,15 @@ package com.notation.campusnote -import android.content.Intent import android.os.Bundle import android.util.Log import androidx.appcompat.app.AppCompatActivity import com.notation.campusnote.databinding.ActivityLoginBinding import com.kakao.sdk.auth.model.OAuthToken import com.kakao.sdk.user.UserApiClient -import com.notation.campusnote.sharedPreference.MyPreferences -import com.notation.campusnote.signUp.SignUpActivity class LoginActivity :AppCompatActivity(){ private val TAG = "KakaoLoginExample" private lateinit var binding: ActivityLoginBinding - - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityLoginBinding.inflate(layoutInflater) @@ -42,25 +37,9 @@ class LoginActivity :AppCompatActivity(){ Log.e(TAG, "카카오톡으로 로그인 실패", error) // 특정 상황(취소 등)에 대한 처리 추가 - } else if (token != null) { Log.i(TAG, "카카오톡으로 로그인 성공 ${token.accessToken}") // 성공적인 로그인 처리 추가 - - val myPreferences = MyPreferences(this) - - UserApiClient.instance.me { user, error -> - if (error != null) { - Log.e(TAG, "사용자 정보 요청 실패", error) - } - else if (user != null) { - Log.i(TAG, "사용자 정보 요청 성공" + - "\n프로필사진: ${user.kakaoAccount?.profile?.thumbnailImageUrl}") - myPreferences.saveClientId(token.accessToken) - myPreferences.saveProfilePic(user.kakaoAccount?.profile?.thumbnailImageUrl) - startActivity(Intent(this, SignUpActivity::class.java)) - } - } } } } else { diff --git a/app/src/main/java/com/notation/campusnote/signUp/SignUpActivity.kt b/app/src/main/java/com/notation/campusnote/signUp/SignUpActivity.kt index ac81dd9a..17460772 100644 --- a/app/src/main/java/com/notation/campusnote/signUp/SignUpActivity.kt +++ b/app/src/main/java/com/notation/campusnote/signUp/SignUpActivity.kt @@ -2,14 +2,11 @@ package com.notation.campusnote.signUp import androidx.appcompat.app.AppCompatActivity import android.os.Bundle -import android.util.Log import android.view.View import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.notation.campusnote.ApiService.Datas.SignUpData import com.notation.campusnote.R import com.notation.campusnote.databinding.ActivitySignUpBinding -import com.notation.campusnote.sharedPreference.MyPreferences interface OnFragmentInteractionListener { fun onFragmentInteraction(isFinalFragment: Boolean) @@ -52,10 +49,6 @@ class SignUpActivity : AppCompatActivity(), OnFragmentInteractionListener { 4 -> { // 여기에 완료 버튼이 눌렸을 때의 로직을 구현합니다. // 예: 데이터 저장, 결과 화면으로 전환 등 - Log.d("REST 테스팅","시작!") - var myPreferences = MyPreferences(this) - var signUpData = SignUpData("string","string","string","string", "string") - var output = RestHelper.postKakaosignUp(signUpData){result -> Log.d("REST 테스팅", "최종 output : ${result}")} } } } @@ -100,14 +93,14 @@ class SignUpActivity : AppCompatActivity(), OnFragmentInteractionListener { text = "완료" //setBackgroundColor(ContextCompat.getColor(context, R.color.black)) // 또는 배경을 drawable 리소스로 설정하는 경우 - background = ContextCompat.getDrawable(context, R.drawable.sign_up_done_btn_background) + background = ContextCompat.getDrawable(context, R.drawable.sign_up_done_btn_background) } } else { binding.signUpNextBtn.apply { text = "다음" //setBackgroundColor(ContextCompat.getColor(context, R.color.your_original_color)) // 또는 배경을 drawable 리소스로 설정하는 경우 - background = ContextCompat.getDrawable(context, R.drawable.sign_up_next_btn_background) + background = ContextCompat.getDrawable(context, R.drawable.sign_up_next_btn_background) } } }