-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
602 additions
and
251 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
31 changes: 31 additions & 0 deletions
31
MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/petsitter_main/PetsitterMainActivity.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,31 @@ | ||
package kr.co.lion.mungnolza.ui.petsitter_main | ||
|
||
import android.os.Build | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.navigation.fragment.NavHostFragment | ||
import androidx.navigation.ui.NavigationUI | ||
import kr.co.lion.mungnolza.R | ||
import kr.co.lion.mungnolza.databinding.ActivityPetsitterMainBinding | ||
import kr.co.lion.mungnolza.model.PetImgModel | ||
|
||
class PetsitterMainActivity : AppCompatActivity() { | ||
|
||
private lateinit var activityPetsitterMainBinding: ActivityPetsitterMainBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
activityPetsitterMainBinding = ActivityPetsitterMainBinding.inflate(layoutInflater) | ||
setContentView(activityPetsitterMainBinding.root) | ||
|
||
initView() | ||
} | ||
|
||
private fun initView(){ | ||
val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragment_container_petsitter) as NavHostFragment | ||
val navController = navHostFragment.navController | ||
NavigationUI.setupWithNavController(activityPetsitterMainBinding.navigationView, navController) | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/main/java/kr/co/lion/mungnolza/ui/petsitter_main/fragment/PetsitterFreeBoardFragment.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,21 @@ | ||
package kr.co.lion.mungnolza.ui.petsitter_main.fragment | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import kr.co.lion.mungnolza.R | ||
import kr.co.lion.mungnolza.databinding.FragmentPetsitterFreeBoardBinding | ||
|
||
class PetsitterFreeBoardFragment : Fragment() { | ||
|
||
lateinit var fragmentPetsitterFreeBoardBinding: FragmentPetsitterFreeBoardBinding | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
// Inflate the layout for this fragment | ||
fragmentPetsitterFreeBoardBinding = FragmentPetsitterFreeBoardBinding.inflate(inflater, container, false) | ||
|
||
return fragmentPetsitterFreeBoardBinding.root | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...pp/src/main/java/kr/co/lion/mungnolza/ui/petsitter_main/fragment/PetsitterHomeFragment.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,76 @@ | ||
package kr.co.lion.mungnolza.ui.petsitter_main.fragment | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.google.android.material.divider.MaterialDividerItemDecoration | ||
import kr.co.lion.mungnolza.R | ||
import kr.co.lion.mungnolza.databinding.FragmentPetsitterHomeBinding | ||
import kr.co.lion.mungnolza.databinding.RowPetsitterHomeChatPersonListBinding | ||
|
||
class PetsitterHomeFragment : Fragment() { | ||
|
||
lateinit var fragmentPetsitterHomeBinding : FragmentPetsitterHomeBinding | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
// Inflate the layout for this fragment | ||
fragmentPetsitterHomeBinding = FragmentPetsitterHomeBinding.inflate(inflater, container, false) | ||
|
||
return fragmentPetsitterHomeBinding.root | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
setRecyclerView() | ||
} | ||
|
||
// RecyclerView 설정 | ||
fun setRecyclerView(){ | ||
fragmentPetsitterHomeBinding.apply { | ||
recyclerViewPetsitterHomeChatList.apply { | ||
// 어뎁터 설정 | ||
adapter = RecyclerMainAdapter() | ||
// 레이아웃 | ||
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) | ||
// 데코 | ||
//val deco = MaterialDividerItemDecoration(requireContext(), MaterialDividerItemDecoration.HORIZONTAL) | ||
//addItemDecoration(deco) | ||
} | ||
} | ||
} | ||
|
||
// RecyclerView의 어뎁터 | ||
inner class RecyclerMainAdapter : RecyclerView.Adapter<RecyclerMainAdapter.RecyclerMainViewHolder>(){ | ||
inner class RecyclerMainViewHolder(rowPetsitterHomeChatPersonListBinding: RowPetsitterHomeChatPersonListBinding) : RecyclerView.ViewHolder(rowPetsitterHomeChatPersonListBinding.root){ | ||
val rowPetsitterHomeChatPersonListBinding : RowPetsitterHomeChatPersonListBinding | ||
|
||
init { | ||
this.rowPetsitterHomeChatPersonListBinding = rowPetsitterHomeChatPersonListBinding | ||
this.rowPetsitterHomeChatPersonListBinding.root.layoutParams = ViewGroup.LayoutParams( | ||
ViewGroup.LayoutParams.WRAP_CONTENT, | ||
ViewGroup.LayoutParams.MATCH_PARENT | ||
) | ||
} | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerMainViewHolder { | ||
val rowPetsitterHomeChatPersonListBinding = RowPetsitterHomeChatPersonListBinding.inflate(layoutInflater, parent, false) | ||
val recyclerMainViewHolder = RecyclerMainViewHolder(rowPetsitterHomeChatPersonListBinding) | ||
|
||
return recyclerMainViewHolder | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return 10 | ||
} | ||
|
||
override fun onBindViewHolder(holder: RecyclerMainViewHolder, position: Int) { | ||
holder.rowPetsitterHomeChatPersonListBinding.imageViewRowPetsitterHomeChatListPerson.setImageResource(R.drawable.eunwoo) | ||
holder.rowPetsitterHomeChatPersonListBinding.textViewRowPetsitterHomeChatListPersonName.text = "영준" | ||
} | ||
} | ||
} |
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
Oops, something went wrong.