-
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.
- Loading branch information
Showing
29 changed files
with
1,257 additions
and
645 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
16 changes: 16 additions & 0 deletions
16
UMC_6th/app/src/main/java/com/example/umc_6th/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,16 @@ | ||
package com.example.umc_6th | ||
|
||
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() | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
UMC_6th/app/src/main/java/com/example/umc_6th/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,25 @@ | ||
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 | ||
import com.example.umc_6th.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.bannerImageIv.setImageResource(imgRes) | ||
return binding.root | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
UMC_6th/app/src/main/java/com/example/umc_6th/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,17 @@ | ||
package com.example.umc_6th | ||
|
||
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 = fragmentlist.size | ||
|
||
override fun createFragment(position: Int): Fragment = fragmentlist[position] | ||
|
||
fun addFragment(fragment: Fragment){ | ||
fragmentlist.add(fragment) | ||
notifyItemInserted(fragmentlist.size-1) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
UMC_6th/app/src/main/java/com/example/umc_6th/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,23 @@ | ||
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 | ||
import com.example.umc_6th.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
16 changes: 16 additions & 0 deletions
16
UMC_6th/app/src/main/java/com/example/umc_6th/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,16 @@ | ||
package com.example.umc_6th | ||
|
||
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() | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
UMC_6th/app/src/main/java/com/example/umc_6th/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,22 @@ | ||
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 | ||
import com.example.umc_6th.databinding.FragmentLockerMusicfileBinding | ||
|
||
class MusicFileFragment : Fragment() { | ||
lateinit var binding:FragmentLockerMusicfileBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentLockerMusicfileBinding.inflate(inflater,container,false) | ||
|
||
return binding.root | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
UMC_6th/app/src/main/java/com/example/umc_6th/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,28 @@ | ||
package com.example.umc_6th | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.example.umc_6th.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/umc_6th/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.umc_6th | ||
|
||
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) | ||
} | ||
} |
Oops, something went wrong.