Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kara/#47] feat : 10주차 구현 #51

Open
wants to merge 1 commit into
base: kara/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions UMC_6th/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity android:name=".LoginActivity"></activity>
<activity android:name=".SignUpActivity"></activity>
<activity android:name=".ui.signin.LoginActivity"></activity>
<activity android:name=".ui.singup.SignUpActivity"></activity>
<activity
android:name=".MainActivity"
android:name=".ui.main.MainActivity"
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
Expand All @@ -26,7 +26,7 @@
</intent-filter>
</activity>
<activity
android:name=".SongActivity"
android:name=".ui.song.SongActivity"
android:exported="true"></activity>
</application>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.entities

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.myfirstapp
package com.example.myfirstapp.data.entities

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.myfirstapp
package com.example.myfirstapp.data.entities

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.myfirstapp
package com.example.myfirstapp.data.entities

import androidx.room.Entity
import androidx.room.PrimaryKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.local

import androidx.room.*
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.data.entities.Like

@Dao
interface AlbumDao {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.local

import androidx.room.*
import com.example.myfirstapp.data.entities.Song

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

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.data.entities.Like
import com.example.myfirstapp.data.entities.Song
import com.example.myfirstapp.data.entities.User

@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,7 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.local

import androidx.room.*
import com.example.myfirstapp.data.entities.User

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

class ApiRepository {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote


import com.example.myfirstapp.data.entities.User
import retrofit2.Call
import retrofit2.http.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

data class AuthResponse(val isSucess:Boolean, val code:Int, val message:String)
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

import android.util.Log
import com.example.myfirstapp.ui.signin.LoginView
import com.example.myfirstapp.ui.singup.SignUpView
import com.example.myfirstapp.data.entities.User
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.myfirstapp.data.remote

import com.example.myfirstapp.data.entities.Album

interface CommunicationInterface {
fun sendData(album: Album)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

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.myfirstapp
package com.example.myfirstapp.data.remote

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

import retrofit2.Call
import retrofit2.http.GET
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.myfirstapp
package com.example.myfirstapp.data.remote

import android.util.Log
import com.example.myfirstapp.ui.main.look.LookView
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.myfirstapp
package com.example.myfirstapp.ui.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.databinding.ItemAlbumBinding

class AlbumRVAdapter(private val albumlist: ArrayList<Album>): RecyclerView.Adapter<AlbumRVAdapter.ViewHolder>() {
Expand All @@ -27,12 +28,12 @@ class AlbumRVAdapter(private val albumlist: ArrayList<Album>): RecyclerView.Adap
albumlist.removeAt(position)
notifyDataSetChanged()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AlbumRVAdapter.ViewHolder {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val binding : ItemAlbumBinding = ItemAlbumBinding.inflate(LayoutInflater.from(parent.context), parent, 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{
myItemClickListener.onItemClick(albumlist[position])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.myfirstapp.ui.main.album.DetailFragment
import com.example.myfirstapp.ui.main.album.SongFragment
import com.example.myfirstapp.ui.main.album.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.myfirstapp
package com.example.myfirstapp.ui.adapter

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

import android.util.SparseBooleanArray
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.myfirstapp.data.entities.Song
import com.example.myfirstapp.databinding.ItemLockerAlbumBinding

class LockerAlbumRVAdapter () : RecyclerView.Adapter<LockerAlbumRVAdapter.ViewHolder>() {
Expand All @@ -13,14 +14,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.itemAlbumMoreIv.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.adapter

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

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.myfirstapp
package com.example.myfirstapp.ui.adapter

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

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.databinding.ItemLockerAlbumBinding

class SavedAlbumRVAdapter (): RecyclerView.Adapter<SavedAlbumRVAdapter.ViewHolder>() {
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.itemAlbumMoreIv.setOnClickListener {
mItemClickListener.onRemoveSong(albums[position].id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.adapter

import android.content.Context
import android.util.Log
Expand All @@ -8,18 +8,19 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.myfirstapp.data.remote.FloChartResult
import com.example.myfirstapp.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,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.main

import android.content.Intent
import android.os.Bundle
Expand All @@ -7,8 +7,16 @@ import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import com.example.myfirstapp.R
import com.example.myfirstapp.ui.main.search.SearchFragment
import com.example.myfirstapp.ui.song.SongActivity
import com.example.myfirstapp.data.local.SongDatabase
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.data.entities.Song
import com.example.myfirstapp.databinding.ActivityMainBinding
import com.google.gson.Gson
import com.example.myfirstapp.ui.main.home.HomeFragment
import com.example.myfirstapp.ui.main.locker.LockerFragment
import com.example.myfirstapp.ui.main.look.LookFragment

class MainActivity : AppCompatActivity() {

Expand Down Expand Up @@ -48,7 +56,7 @@ class MainActivity : AppCompatActivity() {
editor.putInt("songId", songs[nowPos].id)
editor.apply()

val intent = Intent(this,SongActivity::class.java)
val intent = Intent(this, SongActivity::class.java)
activityResultLauncher.launch(intent)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.main.album

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import com.example.myfirstapp.ui.adapter.AlbumVpAdapter
import com.example.myfirstapp.ui.main.home.HomeFragment
import com.example.myfirstapp.ui.main.MainActivity
import com.example.myfirstapp.R
import com.example.myfirstapp.data.local.SongDatabase
import com.example.myfirstapp.data.entities.Album
import com.example.myfirstapp.data.entities.Like
import com.example.myfirstapp.databinding.FragmentAlbumBinding
import com.google.android.material.tabs.TabLayoutMediator
import com.google.gson.Gson
Expand Down Expand Up @@ -34,7 +40,10 @@ class AlbumFragment : Fragment() {
setOnClickListener(album)

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

val albumVpAdapter = AlbumVpAdapter(this)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.myfirstapp
package com.example.myfirstapp.ui.main.album

import android.os.Bundle
import android.view.LayoutInflater
Expand Down
Loading