diff --git a/app/src/main/java/com/example/infraandroid/MainActivity.kt b/app/src/main/java/com/example/infraandroid/MainActivity.kt index 8317d14..66eceb9 100644 --- a/app/src/main/java/com/example/infraandroid/MainActivity.kt +++ b/app/src/main/java/com/example/infraandroid/MainActivity.kt @@ -10,6 +10,7 @@ import com.example.infraandroid.databinding.ActivityMainBinding import android.view.View import android.widget.Toast +import androidx.fragment.app.FragmentManager import com.google.android.material.snackbar.Snackbar import com.kakao.sdk.common.util.Utility @@ -42,12 +43,9 @@ class MainActivity : AppCompatActivity() { } } - // 바텀 네비게이션 뷰와 네비게이션을 묶어준다 NavigationUI.setupWithNavController(mBinding.myBottomNav, navController) - - val keyHash = Utility.getKeyHash(this) - Log.d("해시키", keyHash) + supportFragmentManager.popBackStack(R.id.splashFragment, FragmentManager.POP_BACK_STACK_INCLUSIVE) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { @@ -58,4 +56,6 @@ class MainActivity : AppCompatActivity() { var displayMetrics = resources.displayMetrics return Math.round(value * displayMetrics.density) } + + } \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/chat/view/ChatFragment.kt b/app/src/main/java/com/example/infraandroid/chat/view/ChatFragment.kt index 3855bc4..46d34c6 100644 --- a/app/src/main/java/com/example/infraandroid/chat/view/ChatFragment.kt +++ b/app/src/main/java/com/example/infraandroid/chat/view/ChatFragment.kt @@ -211,10 +211,10 @@ class ChatFragment : Fragment() { } mBinding!!.inputMessageEdittext.setText("") } - val bottomSheetDialogFragment = ChatMoreMenuBottomSheetFragment() - mBinding!!.chatMoreMenuOpenButton.setOnClickListener { - activity?.supportFragmentManager?.let { it1 -> bottomSheetDialogFragment.show(it1, bottomSheetDialogFragment.tag) } - } +// val bottomSheetDialogFragment = ChatMoreMenuBottomSheetFragment() +// mBinding!!.chatMoreMenuOpenButton.setOnClickListener { +// activity?.supportFragmentManager?.let { it1 -> bottomSheetDialogFragment.show(it1, bottomSheetDialogFragment.tag) } +// } mBinding?.backToChatListButton?.setOnClickListener { it.findNavController().navigate(R.id.action_chat_fragment_to_chatting_room_list_fragment) diff --git a/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectFragment.kt b/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectFragment.kt index 7b19e26..45ba23d 100644 --- a/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectFragment.kt +++ b/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectFragment.kt @@ -22,14 +22,18 @@ import android.widget.Toast import androidx.annotation.RequiresApi import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat +import androidx.core.view.isGone import androidx.core.view.isVisible import androidx.databinding.DataBindingUtil import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider +import androidx.navigation.NavArgs import androidx.navigation.findNavController import androidx.navigation.fragment.findNavController +import androidx.navigation.fragment.navArgs import com.example.infraandroid.R +import com.example.infraandroid.category.view.fragment.CategoryViewIdeaFragmentArgs import com.example.infraandroid.databinding.FragmentCreateProjectBinding import com.example.infraandroid.home.model.ResponseCreateProjectData import com.example.infraandroid.home.viewmodel.CreateProjectViewModel @@ -109,6 +113,7 @@ class CreateProjectFragment : Fragment() { val projectMakingStart = mBinding?.setProjectStartDateTextView val projectMakingEnd = mBinding?.projectEndMakingDateEditTextView val addFileButton = mBinding?.addFileTextView + val args: CreateProjectFragmentArgs by navArgs() viewModel?.hashTag?.observe(viewLifecycleOwner, Observer{ when(it.size){ @@ -198,6 +203,15 @@ class CreateProjectFragment : Fragment() { it.findNavController().navigate(R.id.action_createProjectFragment_to_home_fragment) } + // 사진 지우기 + mBinding?.photoImageView?.setOnClickListener { + mBinding?.addFileTextView?.isVisible = true + mBinding?.photoImageView?.isGone = true + mBinding?.photoBackgroundView?.isGone = true + mBinding?.deletePhotoImageView?.isGone = true + mediaPath = null + } + // 완료 버튼 눌렀을 때 프로젝트 생성 완료 mBinding?.completeTextView?.setOnClickListener { @@ -216,9 +230,9 @@ class CreateProjectFragment : Fragment() { val jsonString = "{\"user_id\" : \""+ InfraApplication.prefs.getString("userId", "null")+"\"," + "\"pj_header\" : \"" + mBinding?.titleEditText?.text.toString() + "\"," + - "\"pj_categoryName\" : \"개발\"," + + "\"pj_categoryName\" : \""+args.category+"\"," + "\"pj_content\" : \""+ mBinding?.projectContentEditText?.text.toString() +"\"," + - "\"pj_subCategoryName\" : \"APP\"," + + "\"pj_subCategoryName\" : \""+args.categoryDetail+"\"," + "\"pj_progress\" : \""+ mBinding?.descriptionEditText?.text.toString() +"\"," + "\"pj_startTerm\" : "+ startTermString +"," + "\"pj_endTerm\" : "+ endTermString +"," + @@ -278,6 +292,11 @@ class CreateProjectFragment : Fragment() { ImageDecoder.decodeBitmap(source) //imageView.setImageBitmap(bitmap) } + mBinding?.photoImageView?.isVisible = true + mBinding?.addFileTextView?.isGone = true + mBinding?.photoBackgroundView?.isVisible = true + mBinding?.deletePhotoImageView?.isVisible = true + mBinding?.photoImageView?.setImageBitmap(bitmap) } } catch (e: IOException) { diff --git a/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectSelectCategoryFragment.kt b/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectSelectCategoryFragment.kt index 736f5de..afe8e53 100644 --- a/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectSelectCategoryFragment.kt +++ b/app/src/main/java/com/example/infraandroid/home/view/fragment/CreateProjectSelectCategoryFragment.kt @@ -10,6 +10,7 @@ import androidx.fragment.app.Fragment import androidx.navigation.findNavController import com.example.infraandroid.R import com.example.infraandroid.databinding.FragmentCreateProjectSelectCategoryBinding +import com.example.infraandroid.myinfo.myideamanage.view.fragment.MyIdeaManageFragmentDirections // 프로젝트의 종류를 선택하는 spinner와 관련된 .kt파일 // 작성자 : 신승민 @@ -32,19 +33,22 @@ class CreateProjectSelectCategoryFragment : Fragment(){ super.onViewCreated(view, savedInstanceState) val categoryItems = resources.getStringArray(R.array.category_array) - val categoryDetailItems = resources.getStringArray(R.array.category_detail_array) + val categoryDetailDevelopItems = resources.getStringArray(R.array.category_detail_develop_array) +// val categoryDetailStudyItems = resources.getStringArray(R.array.category_detail_study_array) +// val categoryDetailActivityItems = resources.getStringArray(R.array.category_detail_activity_array) val categoryAdapter = ArrayAdapter(requireActivity(), android.R.layout.simple_spinner_dropdown_item, categoryItems) - val categoryDetailAdapter = ArrayAdapter(requireActivity(), android.R.layout.simple_spinner_dropdown_item, categoryDetailItems) + var categoryDetailAdapter = ArrayAdapter(requireActivity(), android.R.layout.simple_spinner_dropdown_item, categoryDetailDevelopItems) val categorySpinner = mBinding?.categorySpinner - val categoryDetailSpinner = mBinding?.categoryDetailSpinner + var categoryDetailSpinner = mBinding?.categoryDetailSpinner - mBinding?.goBackImageButton?.setOnClickListener { - it.findNavController().navigate(R.id.action_createProjectSelectCategory_to_createProjectFragment) - } categorySpinner?.adapter = categoryAdapter categoryDetailSpinner?.adapter = categoryDetailAdapter + mBinding?.goBackImageButton?.setOnClickListener { + val action = CreateProjectSelectCategoryFragmentDirections.actionCreateProjectSelectCategoryToCreateProjectFragment(categorySpinner?.selectedItem.toString(), categoryDetailSpinner?.selectedItem.toString()) + it.findNavController().navigate(action) + } } override fun onDestroyView() { diff --git a/app/src/main/java/com/example/infraandroid/home/view/fragment/HomeFragment.kt b/app/src/main/java/com/example/infraandroid/home/view/fragment/HomeFragment.kt index af6e044..be719df 100644 --- a/app/src/main/java/com/example/infraandroid/home/view/fragment/HomeFragment.kt +++ b/app/src/main/java/com/example/infraandroid/home/view/fragment/HomeFragment.kt @@ -115,5 +115,4 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } } - } \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/MyProjectService.kt b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/MyProjectService.kt index 70a5c73..cde30e6 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/MyProjectService.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/MyProjectService.kt @@ -39,4 +39,12 @@ interface MyProjectService { @Header("X-REFRESH-TOKEN") refreshToken: Int, @Body body: RequestDeleteProjectData ): Call + + @POST("/project/team?") + fun viewProjectMember( + @Header("X-ACCESS-TOKEN") jwt: String, + @Header("X-REFRESH-TOKEN") refreshToken: Int, + @Query("user_id") userId:String, + @Body body: RequestTeamMemberData + ): Call } \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/RequestTeamMemberData.kt b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/RequestTeamMemberData.kt new file mode 100644 index 0000000..555cb98 --- /dev/null +++ b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/RequestTeamMemberData.kt @@ -0,0 +1,5 @@ +package com.example.infraandroid.myinfo.myideamanage.model + +data class RequestTeamMemberData( + val pj_num: Int? +) \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/ResponseTeamMemberData.kt b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/ResponseTeamMemberData.kt new file mode 100644 index 0000000..7d78339 --- /dev/null +++ b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/model/ResponseTeamMemberData.kt @@ -0,0 +1,14 @@ +package com.example.infraandroid.myinfo.myideamanage.model + +data class ResponseTeamMemberData( + val code: Int, + val isSuccess: Boolean, + val message: String, + val result: ArrayList +){ + data class Result( + val user_id: String, + val user_nickname: String, + val user_prPhoto: String + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/view/fragment/MyIdeaMemberFragment.kt b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/view/fragment/MyIdeaMemberFragment.kt index 1008578..9867782 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/view/fragment/MyIdeaMemberFragment.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/myideamanage/view/fragment/MyIdeaMemberFragment.kt @@ -1,5 +1,6 @@ package com.example.infraandroid.myinfo.myideamanage.view.fragment +import android.app.Service import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -8,10 +9,7 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import com.example.infraandroid.R import com.example.infraandroid.databinding.FragmentTeamMemberBinding -import com.example.infraandroid.myinfo.myideamanage.model.MyIdeaMemberManageInfo -import com.example.infraandroid.myinfo.myideamanage.model.MyIdeaMemberApplyManageInfo -import com.example.infraandroid.myinfo.myideamanage.model.MyProjectViewModel -import com.example.infraandroid.myinfo.myideamanage.model.ResponseViewProjectApplyData +import com.example.infraandroid.myinfo.myideamanage.model.* import com.example.infraandroid.myinfo.myideamanage.view.adapter.MyIdeaMemberApplyAdapter import com.example.infraandroid.myinfo.teammembereval.view.adapter.TeamMemberAdapter import com.example.infraandroid.util.BaseFragment @@ -54,6 +52,7 @@ class MyIdeaMemberFragment : BaseFragment(R.layout.fr //신청 관리 어뎁터 연결 binding.applicationManagementRecyclerview.adapter = teamMemberApplyAdapter + binding.teamMemberManagementRecyclerview.adapter = teamMemberAdapter val call : Call = ServiceCreator.myProjectService .viewProjectApply(InfraApplication.prefs.getString("jwt", "null"), InfraApplication.prefs.getString("refreshToken", "null").toInt(), InfraApplication.prefs.getString("userId", "null"), viewModel.currentObservingProjectNum.value) @@ -78,11 +77,42 @@ class MyIdeaMemberFragment : BaseFragment(R.layout.fr } } } - override fun onFailure(call: Call, t: Throwable) { TODO("Not yet implemented") } }) + + val requestTeamMemberData = RequestTeamMemberData(pj_num = viewModel.currentObservingProjectNum.value) + val projectMemberCall : Call = ServiceCreator.myProjectService + .viewProjectMember(InfraApplication.prefs.getString("jwt", "null"), InfraApplication.prefs.getString("refreshToken", "null").toInt(), + InfraApplication.prefs.getString("userId", "null"), requestTeamMemberData) + + projectMemberCall.enqueue(object: Callback{ + override fun onResponse( + call: Call, + response: Response + ) { + if(response.isSuccessful){ + val body = response.body() + if(body!=null){ + when(body.code){ + 1000->{ + val data = body.result + if(data!=null){ + teamMemberAdapter.teamMemberList = data + } + teamMemberAdapter.notifyDataSetChanged() + } + } + } + } + } + + override fun onFailure(call: Call, t: Throwable) { + TODO("Not yet implemented") + } + + }) } } \ No newline at end of file diff --git a/app/src/main/java/com/example/infraandroid/myinfo/teammembereval/view/adapter/TeamMemberAdapter.kt b/app/src/main/java/com/example/infraandroid/myinfo/teammembereval/view/adapter/TeamMemberAdapter.kt index 7e7facf..04bb191 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/teammembereval/view/adapter/TeamMemberAdapter.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/teammembereval/view/adapter/TeamMemberAdapter.kt @@ -7,9 +7,10 @@ import androidx.recyclerview.widget.RecyclerView import com.example.infraandroid.databinding.ItemTeamMemberRecyclerviewBinding import com.example.infraandroid.myinfo.myideamanage.view.WarningKickOutDialog import com.example.infraandroid.myinfo.myideamanage.model.MyIdeaMemberManageInfo +import com.example.infraandroid.myinfo.myideamanage.model.ResponseTeamMemberData class TeamMemberAdapter(): RecyclerView.Adapter() { - val teamMemderlist = mutableListOf() + var teamMemberList = mutableListOf() private lateinit var context: Context override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { @@ -23,24 +24,24 @@ class TeamMemberAdapter(): RecyclerView.Adapter() { } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { - (holder as TeamMemberViewHolder).onBind(teamMemderlist[position]) + (holder as TeamMemberViewHolder).onBind(teamMemberList[position]) } - override fun getItemCount(): Int = teamMemderlist.size + override fun getItemCount(): Int = teamMemberList.size inner class TeamMemberViewHolder( private val binding: ItemTeamMemberRecyclerviewBinding ) : RecyclerView.ViewHolder(binding.root) { - fun onBind(myIdeaMemberManageInfo: MyIdeaMemberManageInfo) { - binding.teamMemberNameTv.text = myIdeaMemberManageInfo.name + fun onBind(myIdeaMemberManageInfo: ResponseTeamMemberData.Result) { + binding.projectMember = myIdeaMemberManageInfo //binding.teamMemberProfileIv.setImageResource(teamMemberInfo.profileImg) //강퇴하기 버튼 클릭시 - binding.teamMemberKickOutButton.setOnClickListener { -// val warningKickOutDialog = WarningKickOutDialog(context) -// warningKickOutDialog.show() - } +// binding.teamMemberKickOutButton.setOnClickListener { +//// val warningKickOutDialog = WarningKickOutDialog(context) +//// warningKickOutDialog.show() +// } } diff --git a/app/src/main/res/drawable/close_photo.png b/app/src/main/res/drawable/close_photo.png new file mode 100644 index 0000000..ed774d5 Binary files /dev/null and b/app/src/main/res/drawable/close_photo.png differ diff --git a/app/src/main/res/layout/fragment_chat.xml b/app/src/main/res/layout/fragment_chat.xml index 0e5d455..131e5fa 100644 --- a/app/src/main/res/layout/fragment_chat.xml +++ b/app/src/main/res/layout/fragment_chat.xml @@ -43,18 +43,18 @@ app:layout_constraintBottom_toBottomOf="@id/back_to_chat_list_button" app:layout_constraintLeft_toRightOf="@id/back_to_chat_list_button"/> - + + + + + + + + + + + + + android:layout_marginTop="10dp" + android:layout_marginBottom="12dp"/> + android:layout_marginRight="6dp"/> @@ -449,7 +451,45 @@ android:textSize="14sp" android:layout_marginTop="8dp" android:layout_marginBottom="12dp" - android:layout_marginLeft="15dp"/> + android:layout_marginLeft="15dp" + android:visibility="visible"/> + + + + + diff --git a/app/src/main/res/layout/fragment_my_info.xml b/app/src/main/res/layout/fragment_my_info.xml index f5dc53a..9d35585 100644 --- a/app/src/main/res/layout/fragment_my_info.xml +++ b/app/src/main/res/layout/fragment_my_info.xml @@ -19,16 +19,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" - android:layout_marginTop="64dp" /> + android:layout_marginTop="42dp" /> + + app:layout_constraintTop_toTopOf="parent" /> - - + - + xmlns:app="http://schemas.android.com/apk/res-auto"> - + + + + + android:background="@color/infra_skyblue_b" + tools:context="com.example.infraandroid.myinfo.myideamanage.view.fragment.MyIdeaModifyPageFragment"> - - - - - - - + android:layout_height="match_parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:background="@color/infra_skyblue_b"> - - - - + android:layout_height="match_parent"> - - - - - - - - - - + android:layout_marginTop="15dp" + android:layout_marginLeft="20dp" /> + android:textSize="15sp" + android:textColor="@color/black" /> + android:textColor="@color/infra_skyblue_a" /> - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_marginHorizontal="20dp" + android:layout_marginTop="20dp"> + + + + + + + + + + + + + + + + + - - - - + android:layout_marginHorizontal="20dp" + android:paddingHorizontal="14dp" + android:lineSpacingExtra="4sp" + android:includeFontPadding="false" /> - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + android:layout_marginHorizontal="20dp" + android:layout_marginTop="36dp" + android:layout_marginBottom="30dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_team_member.xml b/app/src/main/res/layout/fragment_team_member.xml index d88825f..c626108 100644 --- a/app/src/main/res/layout/fragment_team_member.xml +++ b/app/src/main/res/layout/fragment_team_member.xml @@ -12,29 +12,30 @@ android:layout_height="match_parent" tools:context="com.example.infraandroid.myinfo.myideamanage.view.fragment.MyIdeaMemberFragment"> - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/app/src/main/res/layout/item_team_member_recyclerview.xml b/app/src/main/res/layout/item_team_member_recyclerview.xml index dc4653b..ca4d7f3 100644 --- a/app/src/main/res/layout/item_team_member_recyclerview.xml +++ b/app/src/main/res/layout/item_team_member_recyclerview.xml @@ -1,52 +1,64 @@ - + + + + + + - - + + + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent"> + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index ec43d70..a9515dd 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -221,6 +221,15 @@ + + + + + + app:destination="@id/login_fragment" + app:popUpTo="@+id/splashFragment" + app:popUpToInclusive="true"/> + app:destination="@id/home_fragment" + app:popUpTo="@+id/splashFragment" + app:popUpToInclusive="true"/> - 분야 개발 - 스터디 - 대외활동 - 기타 - - 세부 분야 - 토익 - 토스 - 국어 + + APP + WEB + API + ANDROID + DB + DESIGN + + \ No newline at end of file