Skip to content

Commit

Permalink
[fix] #99 Fix Error
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-j0y committed Mar 6, 2022
1 parent 9c519a3 commit ef81032
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 99 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.navigation.findNavController
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.infraandroid.util.ImageRound
import com.example.infraandroid.R
import com.example.infraandroid.category.model.IdeaListInfo
import com.example.infraandroid.category.model.ResponseLookUpAllProjectData
import com.example.infraandroid.databinding.ItemIdeaListRecyclerviewBinding

Expand All @@ -33,16 +31,9 @@ class IdeaListAdapter(): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val binding:ItemIdeaListRecyclerviewBinding
): RecyclerView.ViewHolder(binding.root){
fun onBind(ideaListInfo: ResponseLookUpAllProjectData.Result){
// binding.projectCategoryTitle.text = ideaListInfo.
// binding.projectCategoryTextView.text = ideaListInfo.projectCategory
// binding.hashTagOne.text = ideaListInfo.hashTagOne
// binding.hashTagTwo.text = ideaListInfo.hashTagTwo

ImageRound.roundAll(binding.projectImageView, 36f)
binding.projectList = ideaListInfo
// Glide.with(itemView)
// .load(ideaListInfo.projectImg)
// .into(binding.projectImageView)

itemView.setOnClickListener {
it.findNavController().navigate(R.id.action_idea_list_fragment_to_categoryViewIdeaFragment)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package com.example.infraandroid.category.view.fragment

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.findNavController
import com.example.infraandroid.R
import com.example.infraandroid.category.model.IdeaListInfo
import com.example.infraandroid.category.model.ResponseLookUpAllProjectData
import com.example.infraandroid.category.view.adapter.IdeaListAdapter
import com.example.infraandroid.databinding.FragmentIdeaListBinding
Expand Down
126 changes: 63 additions & 63 deletions app/src/main/java/com/example/infraandroid/id/view/LoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ class LoginFragment : BaseFragment<FragmentLoginBinding>(R.layout.fragment_login
it.findNavController().navigate(R.id.action_login_fragment_to_sign_up_first_fragment)
}

binding.loginGoogleIv.setOnClickListener {
oneTapClient.beginSignIn(signInRequest)
.addOnSuccessListener(requireActivity()) { result ->
try {
startIntentSenderForResult(
result.pendingIntent.intentSender, REQ_ONE_TAP,
null, 0, 0, 0, null)
} catch (e: IntentSender.SendIntentException) {
Log.e(TAG, "Couldn't start One Tap UI: ${e.localizedMessage}")
}
}
.addOnFailureListener(requireActivity()) { e ->
// No saved credentials found. Launch the One Tap sign-up flow, or
// do nothing and continue presenting the signed-out UI.
Log.d(TAG, e.localizedMessage)
}
}
// binding.loginGoogleIv.setOnClickListener {
// oneTapClient.beginSignIn(signInRequest)
// .addOnSuccessListener(requireActivity()) { result ->
// try {
// startIntentSenderForResult(
// result.pendingIntent.intentSender, REQ_ONE_TAP,
// null, 0, 0, 0, null)
// } catch (e: IntentSender.SendIntentException) {
// Log.e(TAG, "Couldn't start One Tap UI: ${e.localizedMessage}")
// }
// }
// .addOnFailureListener(requireActivity()) { e ->
// // No saved credentials found. Launch the One Tap sign-up flow, or
// // do nothing and continue presenting the signed-out UI.
// Log.d(TAG, e.localizedMessage)
// }
// }

// 네이버 아이디로 로그인
// val naver_client_id = "WWSmSMIYeWU77c_0uql8"
Expand Down Expand Up @@ -187,51 +187,51 @@ class LoginFragment : BaseFragment<FragmentLoginBinding>(R.layout.fragment_login
// }
// }

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

when (requestCode) {
REQ_ONE_TAP -> {
try {
val credential = oneTapClient.getSignInCredentialFromIntent(data)
val idToken = credential.googleIdToken
val username = credential.id
val password = credential.password
when {
idToken != null -> {
// Got an ID token from Google. Use it to authenticate
// with your backend.
Log.d(TAG, "Got ID token.")
}
password != null -> {
// Got a saved username and password. Use them to authenticate
// with your backend.
Log.d(TAG, "Got password.")
}
else -> {
// Shouldn't happen.
Log.d(TAG, "No ID token or password!")
}
}
} catch (e: ApiException) {
when (e.statusCode) {
CommonStatusCodes.CANCELED -> {
Log.d(TAG, "One-tap dialog was closed.")
// Don't re-prompt the user.
showOneTapUI = false
}
CommonStatusCodes.NETWORK_ERROR -> {
Log.d(TAG, "One-tap encountered a network error.")
// Try again or just ignore.
}
else -> {
Log.d(TAG, "Couldn't get credential from result." +
" (${e.localizedMessage})")
}
}
}
}
}
}
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// super.onActivityResult(requestCode, resultCode, data)
//
// when (requestCode) {
// REQ_ONE_TAP -> {
// try {
// val credential = oneTapClient.getSignInCredentialFromIntent(data)
// val idToken = credential.googleIdToken
// val username = credential.id
// val password = credential.password
// when {
// idToken != null -> {
// // Got an ID token from Google. Use it to authenticate
// // with your backend.
// Log.d(TAG, "Got ID token.")
// }
// password != null -> {
// // Got a saved username and password. Use them to authenticate
// // with your backend.
// Log.d(TAG, "Got password.")
// }
// else -> {
// // Shouldn't happen.
// Log.d(TAG, "No ID token or password!")
// }
// }
// } catch (e: ApiException) {
// when (e.statusCode) {
// CommonStatusCodes.CANCELED -> {
// Log.d(TAG, "One-tap dialog was closed.")
// // Don't re-prompt the user.
// showOneTapUI = false
// }
// CommonStatusCodes.NETWORK_ERROR -> {
// Log.d(TAG, "One-tap encountered a network error.")
// // Try again or just ignore.
// }
// else -> {
// Log.d(TAG, "Couldn't get credential from result." +
// " (${e.localizedMessage})")
// }
// }
// }
// }
// }
// }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.infraandroid.myinfo.teammembereval.model

import com.google.gson.annotations.SerializedName

data class RequestJoinedUserData(
@SerializedName("pj_num")
val projectIdx : Int
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.example.infraandroid.myinfo.teammembereval.model

import com.google.gson.annotations.SerializedName

data class ResponseJoinedUserData(
val isSuccess: Boolean,
val code: Int,
val message: String,
val result: ArrayList<Result>,
){
data class Result(
@SerializedName("user_nickname")
val nickName : String,
@SerializedName("user_prPhoto")
val profileImg : String,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.infraandroid.myinfo.teammembereval.model

import retrofit2.Call
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Query

interface TeamMemberService {
@POST("/project/team?")
fun lookUpAllJoinedUser(
@Header("X-ACCESS-TOKEN") jwt: String,
@Query("user_id") user_id : String
): Call<ResponseJoinedUserData>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.infraandroid.util

import android.annotation.SuppressLint
import android.content.res.ColorStateList
import android.graphics.Color
import android.widget.ImageView
import android.widget.TextView
import androidx.core.view.isGone
Expand Down Expand Up @@ -43,15 +45,14 @@ object BindingConversions {
}
}

@SuppressLint("ResourceAsColor")
@JvmStatic
@BindingAdapter("deadline")
fun setDeadlineText(textView: TextView, comment: String){
textView.text = comment
when(comment){
"마감" -> textView.setTextColor(R.color.infra_gray_v)
"마감임박!" -> textView.setTextColor(R.color.infra_purple_a)
"모집중!" -> textView.setTextColor(R.color.infra_skyblue_a)
"마감" -> textView.setTextColor(Color.parseColor("#8F8F8F"))
"마감임박" -> textView.setTextColor(Color.parseColor("#9277F8"))
"모집중" -> textView.setTextColor(Color.parseColor("#4B8EFF"))
}
}
}
10 changes: 5 additions & 5 deletions app/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<com.nhn.android.naverlogin.ui.view.OAuthLoginButton
android:id="@+id/buttonOAuthLoginImg"
android:src="@drawable/ic_naver"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- <com.nhn.android.naverlogin.ui.view.OAuthLoginButton-->
<!-- android:id="@+id/buttonOAuthLoginImg"-->
<!-- android:src="@drawable/ic_naver"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content" />-->

<TextView
android:id="@+id/login_naver_tv"
Expand Down

0 comments on commit ef81032

Please sign in to comment.