Skip to content

Commit

Permalink
rest init update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Corgi committed Feb 5, 2024
1 parent 1819c4d commit b01635b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
21 changes: 0 additions & 21 deletions app/src/main/java/com/notation/campusnote/LoginActivity.kt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}")}
}
}
}
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit b01635b

Please sign in to comment.