-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 배너 4개 중 4번째 이미지 상세 구현 (클릭 후 들어가는 화면)
- Loading branch information
Showing
23 changed files
with
866 additions
and
29 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
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/charo/android/domain/model/home/BannerAboutCharo.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,7 @@ | ||
package com.charo.android.domain.model.home | ||
|
||
data class BannerAboutCharo( | ||
val image: Int, | ||
val title: String, | ||
val context: String, | ||
) |
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/charo/android/domain/model/home/BannerLocal.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
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/charo/android/presentation/ui/home/BannerAboutCharoActivity.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,38 @@ | ||
package com.charo.android.presentation.ui.home | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentActivity | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
import androidx.viewpager2.widget.ViewPager2 | ||
import com.charo.android.R | ||
import com.charo.android.databinding.ActivityBannerAboutCharoBinding | ||
import com.charo.android.domain.model.home.BannerAboutCharo | ||
|
||
class BannerAboutCharoActivity : AppCompatActivity() { | ||
private lateinit var binding: ActivityBannerAboutCharoBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivityBannerAboutCharoBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
binding.vpBannerAboutCharo.adapter = BannerViewPagerAdapter(this) | ||
binding.vpBannerAboutCharo.orientation = ViewPager2.ORIENTATION_HORIZONTAL | ||
binding.dotsIndicator.setViewPager2(binding.vpBannerAboutCharo) | ||
|
||
} | ||
|
||
private inner class BannerViewPagerAdapter(fa : FragmentActivity) : FragmentStateAdapter(fa){ | ||
override fun getItemCount(): Int = 3 | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return when(position){ | ||
0 -> BannerAboutCharoFragment(BannerAboutCharo(R.drawable.onboarding_background_1_android, "구경하고","사람들의 드라이브 경험을\n자유롭게 구경해보세요.")) | ||
1 -> BannerAboutCharoFragment(BannerAboutCharo(R.drawable.onboarding_background_2_android, "검색하고","원하는 지역과 테마로\n맞춤 드라이브 코스를 찾아보세요.")) | ||
else -> BannerAboutCharoFragment(BannerAboutCharo(R.drawable.onboarding_background_3_android, "작성하고","나만의 드라이브 코스를\n기록하고 공유해보세요.")) | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/charo/android/presentation/ui/home/BannerAboutCharoFragment.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,36 @@ | ||
package com.charo.android.presentation.ui.home | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.charo.android.databinding.FragmentBannerAboutCharoBinding | ||
import com.charo.android.domain.model.home.BannerAboutCharo | ||
|
||
class BannerAboutCharoFragment(val item : BannerAboutCharo) : Fragment() { | ||
private var _binding: FragmentBannerAboutCharoBinding? = null | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
_binding = FragmentBannerAboutCharoBinding.inflate(inflater, container, false) | ||
val root: View = binding.root | ||
|
||
|
||
return root | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
binding.imgViewpager.setImageResource(item.image) | ||
binding.banner = item | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.