-
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
26 changed files
with
1,173 additions
and
641 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() | ||
} | ||
} | ||
} |
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) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
UMC_6th/app/src/main/java/com/example/umc_6th/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,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.FragmentLockerSavedalbumBinding | ||
|
||
class SavedAlbumFragment : Fragment() { | ||
|
||
lateinit var binding: FragmentLockerSavedalbumBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentLockerSavedalbumBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
UMC_6th/app/src/main/java/com/example/umc_6th/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,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.FragmentLockerSavedsongBinding | ||
|
||
class SavedSongFragment : Fragment() { | ||
lateinit var binding : FragmentLockerSavedsongBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentLockerSavedsongBinding.inflate(inflater,container,false) | ||
|
||
return binding.root | ||
} | ||
} |
Oops, something went wrong.