-
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.
Browse files
Browse the repository at this point in the history
[Kara/#13] feat: 3주차 구현 완료
- Loading branch information
Showing
31 changed files
with
1,172 additions
and
597 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
17 changes: 17 additions & 0 deletions
17
UMC_6th/app/src/main/java/com/example/myfirstapp/AlbumVpAdapter.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,17 @@ | ||
package com.example.myfirstapp | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
|
||
class AlbumVpAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { | ||
override fun getItemCount(): Int = 3 | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return when(position){ | ||
0 -> SongFragment() | ||
1 -> DetailFragment() | ||
else -> VideoFragment() | ||
} | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
UMC_6th/app/src/main/java/com/example/myfirstapp/BannerFragment.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,24 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.content.res.Configuration | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentBannerBinding | ||
|
||
class BannerFragment(val imgRes : Int) : Fragment() { | ||
lateinit var binding : FragmentBannerBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentBannerBinding.inflate(inflater, container, false) | ||
|
||
binding.bannerImgIv.setImageResource(imgRes) | ||
return binding.root | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
UMC_6th/app/src/main/java/com/example/myfirstapp/BannerVPAdapter.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,19 @@ | ||
package com.example.myfirstapp | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
|
||
class BannerVPAdapter(fragment: Fragment) : FragmentStateAdapter(fragment){ | ||
|
||
private val fragmentList : ArrayList<Fragment> = ArrayList() | ||
override fun getItemCount(): Int { | ||
return fragmentList.size | ||
} | ||
|
||
override fun createFragment(position: Int): Fragment = fragmentList[position] | ||
|
||
fun addFragment(fragment: Fragment){ | ||
fragmentList.add(fragment) | ||
notifyItemInserted(fragmentList.size-1) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
UMC_6th/app/src/main/java/com/example/myfirstapp/DetailFragment.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,22 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentDetailBinding | ||
|
||
class DetailFragment : Fragment(){ | ||
|
||
lateinit var binding: FragmentDetailBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentDetailBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
UMC_6th/app/src/main/java/com/example/myfirstapp/LockerVPAdapter.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,18 @@ | ||
package com.example.myfirstapp | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
|
||
class LockerVPAdapter (fragment: Fragment) : FragmentStateAdapter(fragment){ | ||
override fun getItemCount(): Int = 3 | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return when(position){ | ||
0 -> SavedSongFragment() | ||
1 -> MusicFileFragment() | ||
else -> SavedAlbumFragment() | ||
} | ||
} | ||
|
||
|
||
} |
23 changes: 23 additions & 0 deletions
23
UMC_6th/app/src/main/java/com/example/myfirstapp/MusicFileFragment.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,23 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentDetailBinding | ||
import com.example.myfirstapp.databinding.FragmentMusicfileBinding | ||
|
||
class MusicFileFragment : Fragment(){ | ||
|
||
lateinit var binding: FragmentMusicfileBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentMusicfileBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
UMC_6th/app/src/main/java/com/example/myfirstapp/PannelFragment.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,27 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentPannelBinding | ||
|
||
class PannelFragment (val imgRes : Int) : Fragment(){ | ||
|
||
lateinit var binding : FragmentPannelBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentPannelBinding.inflate(inflater, container, false) | ||
binding.pannelImageIv.setImageResource(imgRes) | ||
return binding.root | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
UMC_6th/app/src/main/java/com/example/myfirstapp/PannelVPAdapter.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,22 @@ | ||
package com.example.myfirstapp | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
|
||
class PannelVPAdapter (fragment : Fragment) : FragmentStateAdapter(fragment) { | ||
|
||
private val fragmentList : ArrayList<Fragment> = ArrayList() | ||
|
||
override fun getItemCount(): Int { | ||
return fragmentList.size | ||
} | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return fragmentList[position] | ||
} | ||
|
||
fun addFragment(fragment: Fragment) { | ||
fragmentList.add(fragment) | ||
notifyItemInserted(fragmentList.size-1) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
UMC_6th/app/src/main/java/com/example/myfirstapp/SavedAlbumFragment.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,24 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentDetailBinding | ||
import com.example.myfirstapp.databinding.FragmentMusicfileBinding | ||
import com.example.myfirstapp.databinding.FragmentSavedalbumBinding | ||
|
||
class SavedAlbumFragment : Fragment(){ | ||
|
||
lateinit var binding: FragmentSavedalbumBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentSavedalbumBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
UMC_6th/app/src/main/java/com/example/myfirstapp/SavedSongFragment.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,24 @@ | ||
package com.example.myfirstapp | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.example.myfirstapp.databinding.FragmentDetailBinding | ||
import com.example.myfirstapp.databinding.FragmentMusicfileBinding | ||
import com.example.myfirstapp.databinding.FragmentSavedsongBinding | ||
|
||
class SavedSongFragment : Fragment(){ | ||
|
||
lateinit var binding: FragmentSavedsongBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentSavedsongBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
} |
Oops, something went wrong.