-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 게시글 수정 요청 데이터 클래스 수정 2. 게시글 수정 기능 수정 3. 게시글 작성 뷰: 내전공 카테고리 선택 리스트 서버연결변경(내 전공만 뜨도록) closr #96
- Loading branch information
1 parent
a97c9a4
commit a34c20d
Showing
15 changed files
with
180 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...in/java/kr/nutee/nutee_android/ui/member/register/bottomsheet/ModalMyMajorsListAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package kr.nutee.nutee_android.ui.member.register.bottomsheet | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import kr.nutee.nutee_android.databinding.ItemModelListBinding | ||
|
||
class ModalMyMajorsListAdapter( | ||
private val itemClickListener: ((String) -> Unit)? = null, | ||
private val itemClickEndEvent: () -> Unit | ||
) : RecyclerView.Adapter<ModalMyMajorsListAdapter.ViewHolder>() { | ||
private val listData = mutableListOf<String>() | ||
|
||
fun addAllData(datas: List<String>) { | ||
listData.clear() | ||
listData.addAll(datas) | ||
notifyDataSetChanged() | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val binding = ItemModelListBinding.inflate( | ||
LayoutInflater.from(parent.context), | ||
parent, | ||
false | ||
) | ||
return ViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
holder.onBind(listData[position]) | ||
} | ||
|
||
override fun getItemCount(): Int = listData.size | ||
|
||
inner class ViewHolder( | ||
private val binding: ItemModelListBinding | ||
) : RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(item: String) { | ||
binding.itemModelListText.text = item | ||
itemView.setOnClickListener { | ||
itemClickListener?.invoke(item) | ||
itemClickEndEvent.invoke() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...ain/java/kr/nutee/nutee_android/ui/member/register/bottomsheet/ModalSelectMyMajorsList.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package kr.nutee.nutee_android.ui.member.register.bottomsheet | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | ||
import kr.nutee.nutee_android.data.App | ||
import kr.nutee.nutee_android.databinding.ModelBottomListBinding | ||
import kr.nutee.nutee_android.network.RequestToServer | ||
import kr.nutee.nutee_android.ui.extend.customEnqueue | ||
|
||
class ModalSelectMyMajorsList : BottomSheetDialogFragment() { | ||
private var binding: ModelBottomListBinding? = null | ||
private lateinit var adapter: ModalMyMajorsListAdapter | ||
private var itemClickListener: ((String) -> Unit)? = null | ||
|
||
fun setItemClickListener(listener: (String) -> Unit) { | ||
this.itemClickListener = listener | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
binding = ModelBottomListBinding.inflate(inflater, container, false) | ||
return requireBinding().root | ||
} | ||
|
||
private fun requireBinding(): ModelBottomListBinding = binding | ||
?: error("binding is not init") | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
initView() | ||
} | ||
|
||
private fun initView() { | ||
requireBinding().modelBottomTitle.text = "전공을 선택해주세요." | ||
requireBinding().modelBottomTextButton.visibility=View.GONE | ||
setCategoryAdapter() | ||
} | ||
|
||
private fun setCategoryAdapter() { | ||
adapter = ModalMyMajorsListAdapter( | ||
itemClickListener, | ||
{ dismiss() } | ||
) | ||
requireBinding().modelList.adapter = adapter | ||
loadDepartmentList() | ||
} | ||
|
||
private fun loadDepartmentList() { | ||
RequestToServer.backService | ||
.requestUserData( | ||
"Bearer "+ App.prefs.local_login_token | ||
) | ||
.customEnqueue( | ||
onSuccess = { adapter.addAllData(it.body()?.body?.majors!!) } | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<corners android:topLeftRadius="50dp" /> | ||
<corners android:topRightRadius="50dp" /> | ||
<solid android:color="#FFFFFF" /> | ||
</shape> |
Oops, something went wrong.