Skip to content

Commit

Permalink
[maro/#47] feat :: 패키지 구조화
Browse files Browse the repository at this point in the history
  • Loading branch information
leesumin0526 committed Jun 24, 2024
1 parent 255a4d8 commit b6b4337
Show file tree
Hide file tree
Showing 55 changed files with 231 additions and 124 deletions.
108 changes: 83 additions & 25 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions UMC_6th/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<activity android:name=".LoginActivity"/>

<activity
android:name=".MainActivity"
android:name=".ui.MainActivity"
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
Expand All @@ -32,7 +32,7 @@
</intent-filter>
</activity>
<activity
android:name=".SongActivity"
android:name=".music.SongActivity"
android:exported="true" />
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.umc_6th.databinding.ItemAlbumBinding
import com.example.umc_6th.music.Album

class AlbumRVAdapter(private val albumList:ArrayList<Album>) : RecyclerView.Adapter<AlbumRVAdapter.ViewHolder>() {

Expand Down Expand Up @@ -32,13 +33,13 @@ class AlbumRVAdapter(private val albumList:ArrayList<Album>) : RecyclerView.Adap
notifyDataSetChanged()
}

override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): AlbumRVAdapter.ViewHolder {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ViewHolder {
val binding: ItemAlbumBinding = ItemAlbumBinding.inflate(LayoutInflater.from(viewGroup.context),viewGroup,false)

return ViewHolder(binding)
}

override fun onBindViewHolder(holder: AlbumRVAdapter.ViewHolder, position: Int) {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.bind(albumList[position])
holder.itemView.setOnClickListener{
mItemClickListener.onItemClick(albumList[position]) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.umc_6th.music.SongFragment
import com.example.umc_6th.ui.DetailFragment
import com.example.umc_6th.ui.VideoFragment

class AlbumVPAdapter(fragment:Fragment) : FragmentStateAdapter(fragment){
override fun getItemCount(): Int = 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import android.annotation.SuppressLint
import android.util.SparseBooleanArray
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Recycler
import com.example.umc_6th.databinding.ItemLockerAlbumBinding
import com.example.umc_6th.music.Song

class LockerAlbumRVAdapter () : RecyclerView.Adapter<LockerAlbumRVAdapter.ViewHolder>(){

Expand All @@ -16,14 +16,14 @@ class LockerAlbumRVAdapter () : RecyclerView.Adapter<LockerAlbumRVAdapter.ViewHo
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): LockerAlbumRVAdapter.ViewHolder {
): ViewHolder {
val binding: ItemLockerAlbumBinding = ItemLockerAlbumBinding
.inflate(LayoutInflater.from(parent.context),parent,false)

return ViewHolder(binding)
}

override fun onBindViewHolder(holder: LockerAlbumRVAdapter.ViewHolder, position: Int) {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.bind(songs[position])

holder.binding.itemLockerAlbumMoreIv.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.myfirstapp.SavedAlbumFragment
import com.example.umc_6th.ui.SavedAlbumFragment
import com.example.umc_6th.ui.SavedSongFragment
import com.example.umc_6th.music.MusicFileFragment

class LockerVPAdapter(fragment: Fragment) :FragmentStateAdapter(fragment) {
override fun getItemCount(): Int = 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.umc_6th.databinding.ItemLockerAlbumBinding
import com.example.umc_6th.music.Album

class SavedAlbumRVAdapter (): RecyclerView.Adapter<SavedAlbumRVAdapter.ViewHolder>() {
private val albums = ArrayList<Album>()
Expand All @@ -19,13 +20,13 @@ class SavedAlbumRVAdapter (): RecyclerView.Adapter<SavedAlbumRVAdapter.ViewHolde
mItemClickListener = itemClickListener
}

override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): SavedAlbumRVAdapter.ViewHolder {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ViewHolder {
val binding: ItemLockerAlbumBinding = ItemLockerAlbumBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)

return ViewHolder(binding)
}

override fun onBindViewHolder(holder: SavedAlbumRVAdapter.ViewHolder, position: Int) {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.bind(albums[position])
holder.binding.itemLockerAlbumMoreIv.setOnClickListener {
mItemClickListener.onRemoveSong(albums[position].id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
package com.example.umc_6th
package com.example.umc_6th.adapters

import android.annotation.SuppressLint
import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.umc_6th.models.FloChartResult
import com.example.umc_6th.databinding.ItemSongBinding

class SongRVAdapter(val context: Context, val result : FloChartResult) : RecyclerView.Adapter<SongRVAdapter.ViewHolder>() {


override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): SongRVAdapter.ViewHolder {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ViewHolder {
val binding: ItemSongBinding = ItemSongBinding.inflate(LayoutInflater.from(viewGroup.context), viewGroup, false)

return ViewHolder(binding)
}

override fun onBindViewHolder(holder: SongRVAdapter.ViewHolder, position: Int) {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
//holder.bind(result.songs[position])

if(result.songs[position].coverImgUrl == "" || result.songs[position].coverImgUrl == null){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example.umc_6th
package com.example.umc_6th.auth

import com.example.umc_6th.models.BaseResponse
import com.example.umc_6th.models.User
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.chrome.umcflo
package com.example.umc_6th.auth

import android.util.Log
import com.example.umc_6th.BaseResponse
import com.example.umc_6th.LoginView
import com.example.umc_6th.RetrofitInstance
import com.example.umc_6th.SignUpView
import com.example.umc_6th.User
import com.example.umc_6th.models.BaseResponse
import com.example.umc_6th.util.RetrofitInstance
import com.example.umc_6th.models.User
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.chrome.umcflo
import com.example.umc_6th.Result
package com.example.umc_6th.auth
import com.example.umc_6th.models.Result

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import com.example.umc_6th.LoginView
import com.example.umc_6th.MainActivity
import com.example.umc_6th.User
import com.example.umc_6th.ui.MainActivity
import com.example.umc_6th.models.User
import com.example.umc_6th.databinding.ActivityLoginBinding


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.example.umc_6th
package com.example.umc_6th.auth

import com.example.umc_6th.models.Result

interface LoginView {
fun onLoginSuccess(code : Int, result : Result)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.example.umc_6th
package com.example.umc_6th.auth

import com.example.umc_6th.models.FloChartResult

interface LookView {
fun onGetSongLoading()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.chrome.umcflo
package com.example.umc_6th.auth

import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.example.umc_6th.SignUpView
import com.example.umc_6th.User
import com.example.umc_6th.models.User
import com.example.umc_6th.databinding.ActivitySignUpBinding


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.auth

interface SignUpView {
fun onSignUpSuccess()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package com.example.umc_6th
package com.example.umc_6th.database

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.example.umc_6th.models.Like
import com.example.umc_6th.music.Album

@Dao
interface AlbumDao {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.database

class ApiRepository {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.umc_6th
package com.example.umc_6th.database

import com.example.umc_6th.models.SongResponse
import retrofit2.http.GET
import retrofit2.Call

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.example.umc_6th
package com.example.umc_6th.database

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.example.umc_6th.music.Song

@Dao
interface SongDao {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.example.umc_6th
package com.example.umc_6th.database

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.example.umc_6th.models.Like
import com.example.umc_6th.models.User
import com.example.umc_6th.music.Album
import com.example.umc_6th.music.Song

@Database(entities = [Song::class, Album::class, User::class, Like::class], version = 1)
abstract class SongDatabase: RoomDatabase() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.example.umc_6th
package com.example.umc_6th.database

import android.util.Log
import com.example.umc_6th.auth.LookView
import com.example.umc_6th.util.RetrofitInstance
import com.example.umc_6th.models.SongResponse
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.example.umc_6th
package com.example.umc_6th.database

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.umc_6th.models.User

@Dao
interface UserDao {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.models

import androidx.room.Entity
import androidx.room.PrimaryKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.models

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.models

import androidx.room.Entity
import androidx.room.PrimaryKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.music

import androidx.room.Entity
import androidx.room.PrimaryKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_6th
package com.example.umc_6th.music

import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -7,8 +7,14 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.setFragmentResultListener
import com.example.umc_6th.adapters.AlbumVPAdapter
import com.example.umc_6th.models.Like
import com.example.umc_6th.R
import com.example.umc_6th.database.SongDatabase
import com.example.umc_6th.databinding.FragmentAlbumBinding
import com.example.umc_6th.databinding.FragmentAlbumBinding.inflate
import com.example.umc_6th.ui.HomeFragment
import com.example.umc_6th.ui.MainActivity
import com.google.android.material.tabs.TabLayoutMediator
import com.google.gson.Gson

Expand All @@ -34,7 +40,7 @@ class AlbumFragment : Fragment() {

binding.albumBackIv.setOnClickListener{
(context as MainActivity).supportFragmentManager.beginTransaction().
replace(R.id.main_frm,HomeFragment()).
replace(R.id.main_frm, HomeFragment()).
commitAllowingStateLoss()
}

Expand Down
Loading

0 comments on commit b6b4337

Please sign in to comment.