-
Notifications
You must be signed in to change notification settings - Fork 5
[Week8] Jamie #41
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
base: jamie
Are you sure you want to change the base?
[Week8] Jamie #41
Conversation
SuHyeon00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ ์ฝ๋ฉํธ์ ๋จ๊ฒจ์ง ๋ถ๋ถ๋๋ก ์์ ํ ํ ์คํํด๋ณด์์ ๋ ๊ธฐ๋ฅ๋ค์ ์ ๋๋ก ๋์ํ๋ ๊ฒ ๊ฐ์์! ํ์ฌ flo ํ๋ก์ ํธ์ ๊ฐ ํด๋์ค๋ค์ด ์ด๋ค ๊ธฐ๋ฅ์ ํ๋ ๊ฒ์ธ์ง ํ์ ํ ํ์๊ฐ ์์ด ๋ณด์ ๋๋ค! ๊ฐ ๊ธฐ๋ฅ์ ๋ง์ถ์ด ํด๋๋ ์ ๋ฆฌํด๋ณด์๋ ๊ฑธ ์ถ์ฒ๋๋ ค์~ ์ค์ต ํ์๋๋ผ ์๊ณ ํ์ จ์ต๋๋ค!
| android:id="@+id/main_player_cl" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:background="@color/player_bg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น ๋ฆฌ์์ค๋ฅผ ์ฐพ์ ์ ์๋ค๊ณ ๋น๋๋ค! colors.xml ํ์ผ์ ์ ์๋ ์ปฌ๋ฌ๋ฅผ ์ฐ๊ฒฐํด์ฃผ์๊ฑฐ๋ ์๋ก ์์ ์ ์ํด์ฃผ์ธ์~
| @@ -0,0 +1,60 @@ | |||
| package com.example.flo | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ SavedAlbumFragment ํ์ผ์ ํจํค์ง ์ค์ ์ด com.example.flo๋ก ๋์ด์์ด์ LockerRVAdapter ํด๋์ค์์ SavedAlbumFragment๋ฅผ ์ํฌํธํ๋ ๋ถ๋ถ๊ณผ ์ถฉ๋์ด ๋๊ณ ์์ต๋๋ค. ํด๋น ํจํค์ง๋ฅผ com.example.flo_clone์ผ๋ก ์์ ํด์ฃผ์๊ฑฐ๋ LockerRVAdapter์ ์ํฌํธ๋ฌธ์ ์์ ํด์ฃผ์ธ์!
|
|
||
| import androidx.fragment.app.Fragment | ||
| import androidx.viewpager2.adapter.FragmentStateAdapter | ||
| import com.example.flo_clone.SavedAlbumFragment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ถ๋ถ์ ๋๋ค~
| <activity | ||
| android:name=".MainActivity" | ||
| android:exported="true" | ||
| android:label="@string/app_name"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
|
|
||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
|
|
||
| <activity | ||
| android:name=".SongActivity" | ||
| android:exported="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MainActivity์ SongActivity๋ฅผ mainfest ํ์ผ์ ์ถ๊ฐํด์ฃผ์ ๊ฒ์ฒ๋ผ ์๋ก์ด ์กํฐ๋นํฐ๋ฅผ ์ฌ์ฉํ์ ๋ค๋ฉด (LoginActivity, SingUpActivity) ์ด ํ์ผ์ ํญ์ ์ถ๊ฐํด์ฃผ์ ์ผ์ง ํ๋ฉด์ ๋ถ๋ฌ์ฌ ์ ์์ต๋๋ค!
| signUp() | ||
| finish() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finish() ํจ์๋ฅผ ์ด๊ณณ์ ๋๊ฒ ๋๋ค๋ฉด signUp์ด ์ ๋๋ก ๋์ง ์์์ ๋์๋ ํ์๊ฐ์ ํ๋ฉด์ด ์ข ๋ฃ๋๊ธฐ ๋๋ฌธ์ finish๋ ํ์๊ฐ์ ์ด ์ฑ๊ณตํ์ ๊ฒฝ์ฐ์๋ง ํ์ฌ ์กํฐ๋นํฐ๊ฐ ์ข ๋ฃ๋๋๋ก ์ค์ ํด์ฃผ์ธ์!
| import androidx.media3.common.util.Log | ||
| import androidx.media3.common.util.UnstableApi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ก๊ทธ ํด๋์ค๋ android.util์์ ์ํฌํธํด์ฃผ์ธ์!
| override fun onRemoveSong(songId: Int) { | ||
| albumDB.albumDao().getLikedAlbums(getJwt()) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋ฆญ ๋ฆฌ์ค๋ ๋ค์ด๋ฐ๊ณผ ์ค์ ๋ก ๋์ํ๋ ๊ธฐ๋ฅ์ด ๋งค์น๋์ง ์๋ ๊ฒ ๊ฐ์์. AlbumLockerRVAdapter์ onRemove ํจ์ ๋์์ ์ดํด๋ณด๋ฉด ๋๋ณด๊ธฐ ์์ด์ฝ์ ๋๋ ์ ๋ ์ข์์ํ๋ ์จ๋ฒ์ด ์ข์์๊ฐ ํด์ ๋์ด์ผ ํ๋ ๊ฒ ๊ฐ์๋ฐ ํ์ฌ๋ ๋ก๊ทธ์ธ ํ ์ ์ ์ ์ข์์ํ ์จ๋ฒ ๋ชฉ๋ก์ ๋ถ๋ฌ์ค๋ ๊ธฐ๋ฅ์ผ๋ก ๊ตฌํ๋์ด์๋ ๊ฒ ๊ฐ๋ค์. ํด๋น ๋ถ๋ถ ์์ ๋ถํ๋๋ ค์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ถ๊ฐ๋ก ํ๋ผ๋ฏธํฐ ๋ค์ด๋ฐ๋ song์ด ์๋ album๊ณผ ๊ด๋ จ๋ ๊ธฐ๋ฅ์ด๊ธฐ ๋๋ฌธ์ ์์ ํ ํ์๊ฐ ์์ด ๋ณด์ ๋๋ค..!
| // binding.homeAlbumImgIv1.setOnClickListener { | ||
| // var albumFragment = AlbumFragment() | ||
| // albumFragment.arguments = Bundle().apply { | ||
| // putString("title", binding.homeAlbumTitleTv1.text.toString()) | ||
| // putString("singer", binding.homeAlbumSingerTv1.text.toString()) | ||
| // } | ||
| // (context as MainActivity) | ||
| // .supportFragmentManager | ||
| // .beginTransaction() | ||
| // .replace(R.id.nav_host_fragment_activity_main, albumFragment) | ||
| // .commitAllowingStateLoss() | ||
| // } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ์ฉํ์ง ์๋ ์ฝ๋๋ ์ง์์ฃผ์ธ์!
| companion object { | ||
| fun onItemClick(album: Album) { | ||
|
|
||
| } | ||
|
|
||
| fun onRemoveAlbum(position: Int) { | ||
|
|
||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ถ๋ถ์ ๋ญ๊น์..?!
| } | ||
|
|
||
| override fun onRemoveAlbum(position: Int) { | ||
| albumRVAdapter.removeItem(position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์จ๋ฒ ์ญ์ ์ ๊ด๋ จ๋ ๋ก์ง์ด homeFragment์์ ๋์ํ ๊ธฐ๋ฅ์ด ์๊ณ AlbumRVAdapter ๋ด๋ถ์์๋ง ๋์ํ๋ฉด ๋๋ ๊ธฐ๋ฅ์ด๋ผ๋ฉด ๊ตณ์ด ํด๋ฆญ ๋ฆฌ์ค๋๋ก ์ธ๋ถ์์ ์ค์ ํ ํ์ ์์ด AlbumRVAdpater์ onRemove ํจ์๋ฅผ ์ ์ํ์ ์ ํด๋น ํจ์๋ก ์ฐ๊ฒฐํด์ฃผ์๋ฉด ๋ ๊ฒ ๊ฐ์์~
๐ ์ด์ ๋ฒํธ
๐ป ์์ ๋ด์ฉ
๐ข ๊ธฐํ ์ฌํญ