Skip to content

Commit

Permalink
#248 [FEAT] : Banner - About Charo
Browse files Browse the repository at this point in the history
- 배너 4개 중 4번째 이미지 상세 구현 (클릭 후 들어가는 화면)
  • Loading branch information
HJinhee committed Apr 5, 2022
1 parent a0e3cfc commit f979d20
Show file tree
Hide file tree
Showing 23 changed files with 866 additions and 29 deletions.
52 changes: 27 additions & 25 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.charo.android">
package="com.charo.android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -13,7 +13,7 @@
<uses-permission android:name="android.permission.CAMERA" />

<application
android:name="com.charo.android.presentation.di.CharoApplication"
android:name=".presentation.di.CharoApplication"
android:allowBackup="true"
android:appComponentFactory="@string/app_name"
android:icon="@mipmap/ic_launcher_charo"
Expand All @@ -27,11 +27,14 @@
android:usesCleartextTraffic="true"
tools:replace="android:appComponentFactory">
<activity
android:name="com.charo.android.presentation.ui.mypage.other.OtherMyPageActivity"
android:name=".presentation.ui.home.BannerAboutCharoActivity"
android:exported="true" />
<activity
android:name=".presentation.ui.mypage.other.OtherMyPageActivity"
android:exported="false" />

<service
android:name="com.charo.android.presentation.ui.alarm.MyFirebaseMessagingService"
android:name=".presentation.ui.alarm.MyFirebaseMessagingService"
android:enabled="true"
android:exported="true">
<intent-filter>
Expand All @@ -40,35 +43,34 @@
</service>

<activity
android:name="com.charo.android.presentation.ui.detailpost.DetailPostActivity"
android:exported="true"/>
android:name=".presentation.ui.detailpost.DetailPostActivity"
android:exported="true" />
<activity
android:name="com.charo.android.presentation.ui.follow.FollowActivity"
android:name=".presentation.ui.follow.FollowActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.charo.follow.CharoListActivity"
android:name=".presentation.ui.charo.follow.CharoListActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.detail.DetailImageActivity"
android:name=".presentation.ui.detail.DetailImageActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.setting.SettingServiceTermActivity"
android:name=".presentation.ui.setting.SettingServiceTermActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.setting.SettingPrivacyActivity"
android:name=".presentation.ui.setting.SettingPrivacyActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.setting.SettingCsActivity"
android:name=".presentation.ui.setting.SettingCsActivity"
android:exported="false" />
<activity
android:name="com.charo.android.presentation.ui.signin.SocialSignInActivity"
android:name=".presentation.ui.signin.SocialSignInActivity"
android:exported="true" />
<activity android:name="com.charo.android.presentation.ui.write.WriteShareActivity" />
<activity android:name="com.charo.android.presentation.ui.alarm.AlarmActivity" />
<activity android:name=".presentation.ui.write.WriteShareActivity" />
<activity android:name=".presentation.ui.alarm.AlarmActivity" />
<activity
android:name="com.charo.android.presentation.ui.main.SplashActivity"
android:exported="true"/>

android:name=".presentation.ui.main.SplashActivity"
android:exported="true" />
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
Expand All @@ -84,22 +86,22 @@
</intent-filter>
</activity>
<activity
android:name="com.charo.android.presentation.ui.signup.SignUpActivity"
android:name=".presentation.ui.signup.SignUpActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />
<activity android:name="com.charo.android.presentation.ui.setting.SettingActivity" />
<activity android:name=".presentation.ui.setting.SettingActivity" />
<activity
android:name="com.charo.android.presentation.ui.onboarding.OnBoardingActivity"
android:name=".presentation.ui.onboarding.OnBoardingActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.charo.android.presentation.ui.search.SearchActivity" />
<activity android:name=".presentation.ui.search.SearchActivity" />
<activity
android:name="com.charo.android.presentation.ui.detail.DetailActivity"
android:name=".presentation.ui.detail.DetailActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand All @@ -114,9 +116,9 @@
<!-- //www.example.com/detail/{postId} //www.example.com/detail?postId=postId -->
</intent-filter>
</activity>
<activity android:name="com.charo.android.presentation.ui.signin.SignInActivity" />
<activity android:name=".presentation.ui.signin.SignInActivity" />
<activity
android:name="com.charo.android.presentation.ui.main.MainActivity"
android:name=".presentation.ui.main.MainActivity"
android:label="@string/app_name" />
</application>

Expand Down
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,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.charo.android.domain.model.home

import android.graphics.fonts.Font

data class BannerLocal(
val homeViewPagerRoadImage: Int,
val homeViewPagerTitle: String,
Expand Down
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기록하고 공유해보세요."))
}
}
}
}
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
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package com.charo.android.presentation.ui.home.adapter

import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.charo.android.databinding.ItemHomeViewpagerLocalBinding
import com.charo.android.domain.model.home.BannerLocal
import com.charo.android.domain.model.home.BannerRoad
import com.charo.android.presentation.ui.home.BannerAboutCharoActivity

class HomeViewPagerLocalAdapter() :
RecyclerView.Adapter<HomeViewPagerLocalAdapter.HomeViewPagerViewHolder>() {
class HomeViewPagerLocalAdapter() : RecyclerView.Adapter<HomeViewPagerLocalAdapter.HomeViewPagerViewHolder>() {
private val _banner = mutableListOf<BannerLocal>()
var banner: List<BannerLocal> = _banner

Expand All @@ -35,6 +37,24 @@ class HomeViewPagerLocalAdapter() :
) {
holder.onBind(banner[position], bannerRoad[position])

holder.itemView.setOnClickListener {
val activity = it.context as AppCompatActivity

when(position){
0->{

}
1->{

}
2->{

}
3->{
activity.startActivity(Intent(activity, BannerAboutCharoActivity::class.java))
}
}
}
}

override fun getItemCount(): Int {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/img_insta.png
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.
Binary file added app/src/main/res/drawable-mdpi/img_insta.png
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.
Binary file added app/src/main/res/drawable-xhdpi/img_insta.png
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.
Binary file added app/src/main/res/drawable-xxhdpi/img_insta.png
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.
Binary file added app/src/main/res/drawable-xxxhdpi/img_insta.png
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

0 comments on commit f979d20

Please sign in to comment.