-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- [HomeFragment]화면Panel 부분 Viewpager로 구현해보고 Indicator 추가해보기 - 오픈소스 라이브러리인 CircleIndicator 활용해서 슬라이드 만들어보기 - 일정 시간 후 다음 화면으로 넘어가는 자동 슬라이드 구현해보기
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.umc_6th | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
|
||
class FragmentHomeMainBanner : Fragment() { | ||
// 여기에 Fragment의 구현 내용을 작성합니다. | ||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// 여기에서 Fragment의 레이아웃을 인플레이트합니다. | ||
return inflater.inflate(R.layout.fragment_home_main_banner, container, false) | ||
} | ||
|
||
// 필요한 경우 다른 Fragment 생명주기 메소드를 오버라이드합니다. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.umc_6th | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
|
||
class FragmentHomeMainBanner2 : Fragment() { | ||
// 여기에 Fragment의 구현 내용을 작성합니다. | ||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// 여기에서 Fragment의 레이아웃을 인플레이트합니다. | ||
return inflater.inflate(R.layout.fragment_home_main_banner2, container, false) | ||
} | ||
|
||
// 필요한 경우 다른 Fragment 생명주기 메소드를 오버라이드합니다. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example.umc_6th.adapter | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
import com.example.umc_6th.FragmentHomeMainBanner | ||
import com.example.umc_6th.FragmentHomeMainBanner2 | ||
|
||
class HomePagerAdapter { | ||
class HomeMainViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { | ||
private val fragments = listOf( | ||
FragmentHomeMainBanner(), | ||
FragmentHomeMainBanner2() | ||
) | ||
|
||
override fun getItemCount(): Int = fragments.size | ||
|
||
override fun createFragment(position: Int): Fragment = fragments[position] | ||
} | ||
} |