Skip to content

Commit

Permalink
[Nunu/#47] feat: 10주차 구현 (#49)
Browse files Browse the repository at this point in the history
* [nunu/#47] update : 파일구조화

data(Model) / ui(View, Controller) / utils 구분

* [nunu/#47] feat: 카카오 로그인 구현

- gradle 설정
- 카카오 해시값 설정
- 카카오 로그인 구현
- 카카오 로그인 성공시 이동
  • Loading branch information
Ssamssamukja authored Jun 25, 2024
1 parent 75287d1 commit 816d40a
Show file tree
Hide file tree
Showing 58 changed files with 347 additions and 234 deletions.
3 changes: 3 additions & 0 deletions UMC_6th/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@ dependencies {
//Glide
implementation("com.github.bumptech.glide:glide:4.11.0")
annotationProcessor("com.github.bumptech.glide:compiler:4.11.0")

//카카오
implementation ("com.kakao.sdk:v2-user:2.20.1")
}
26 changes: 20 additions & 6 deletions UMC_6th/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".GlobalApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -19,13 +20,13 @@
android:theme="@style/Theme.UMC_6th"
tools:targetApi="31">
<service
android:name=".ForegroundService"
android:name=".utils.ForegroundService"
android:enabled="true"
android:exported="false"
android:foregroundServiceType="mediaPlayback"></service>

<activity
android:name=".SplashActivity"
android:name=".ui.splash.SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -34,16 +35,29 @@
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:name=".ui.main.MainActivity"
android:exported="true"></activity>
<activity
android:name=".SongActivity"
android:name=".ui.song.SongActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:label="@string/title_activity_song"
android:theme="@style/Theme.UMC_6th"></activity>
<activity android:name=".LoginActivity"/>
<activity android:name=".SignUpActivity"/>
<activity android:name=".ui.login.LoginActivity"/>
<activity android:name=".ui.signup.SignUpActivity"/>
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- Redirect URI: "kakao${NATIVE_APP_KEY}://oauth" -->
<data android:host="oauth"
android:scheme="kakao9d12108978063874c1db2eef7e2b81de" />
</intent-filter>
</activity>
</application>

</manifest>
13 changes: 13 additions & 0 deletions UMC_6th/app/src/main/java/com/example/umc_6th/GlobalApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.umc_6th;

import android.app.Application
import com.kakao.sdk.common.KakaoSdk

class GlobalApplication : Application() {
override fun onCreate() {
super.onCreate()

// Kakao Sdk 초기화
KakaoSdk.init(this, "9d12108978063874c1db2eef7e2b81de")
}
}
92 changes: 0 additions & 92 deletions UMC_6th/app/src/main/java/com/example/umc_6th/LoginActivity.kt

This file was deleted.

This file was deleted.

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


import androidx.room.Entity
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.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.umc_6th
package com.example.umc_6th.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.umc_6th
package com.example.umc_6th.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.umc_6th
package com.example.umc_6th.data.local

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

@Dao
interface AlbumDao {
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.data.local

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.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.umc_6th
package com.example.umc_6th.data.local

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.example.umc_6th.data.entities.Album
import com.example.umc_6th.data.entities.Like
import com.example.umc_6th.data.entities.Song
import com.example.umc_6th.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,8 +1,9 @@
package com.example.umc_6th
package com.example.umc_6th.data.local

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.umc_6th.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.umc_6th
package com.example.umc_6th.data.remote

class ApiRepository {
companion object {
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.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.umc_6th
package com.example.umc_6th.data.remote.album

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

import com.google.gson.annotations.SerializedName

data class AlbumResponse( @SerializedName("isSuccess") val isSuccess: Boolean,
@SerializedName("code") val code: Int,
@SerializedName("message") val message: String,
@SerializedName("result") val result: TodayAlbumResult)
@SerializedName("result") val result: TodayAlbumResult
)


data class TodayAlbumResult(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.umc_6th
package com.example.umc_6th.data.remote.album

import android.util.Log
import com.example.umc_6th.ui.main.home.HomeAlbumView
import com.example.umc_6th.data.remote.auth.RetrofitInstance
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
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.data.remote.auth

import com.example.umc_6th.data.entities.User
import com.example.umc_6th.data.remote.BaseResponse
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.example.umc_6th
package com.example.umc_6th.data.remote.auth

import android.util.Log
import com.example.umc_6th.ui.login.LoginView
import com.example.umc_6th.ui.signup.SignUpView
import com.example.umc_6th.data.entities.User
import com.example.umc_6th.data.remote.BaseResponse
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.example.umc_6th
package com.example.umc_6th.data.remote.auth

import com.example.umc_6th.data.remote.album.AlbumApi
import com.example.umc_6th.data.remote.ApiRepository
import com.example.umc_6th.data.remote.song.SongApi
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.umc_6th
package com.example.umc_6th.data.remote.song

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

import com.google.gson.annotations.SerializedName

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

import android.util.Log
import com.example.umc_6th.ui.main.look.LookView
import com.example.umc_6th.data.remote.auth.RetrofitInstance
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.example.umc_6th.adapter
package com.example.umc_6th.ui.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.umc_6th.AlbumDetailFragment
import com.example.umc_6th.AlbumSongsFragment
import com.example.umc_6th.AlbumVideoFragment
import com.example.umc_6th.HomeFragment
import com.example.umc_6th.ui.main.album.AlbumDetailFragment
import com.example.umc_6th.ui.main.album.AlbumSongsFragment
import com.example.umc_6th.ui.main.album.AlbumVideoFragment
import com.example.umc_6th.ui.main.home.HomeFragment


class AlbumPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
Expand Down
Loading

0 comments on commit 816d40a

Please sign in to comment.