Skip to content

Feat1/week3#7

Open
crownjoe wants to merge 20 commits intodevelopfrom
feat1/week3
Open

Feat1/week3#7
crownjoe wants to merge 20 commits intodevelopfrom
feat1/week3

Conversation

@crownjoe
Copy link
Contributor

@crownjoe crownjoe commented Nov 9, 2023

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 클릭한 바텀네비게이션 아이콘 색 바꾸기
  • FAB
  • 캡쳐버튼 클릭하면 캡쳐 가능하게 만들기

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

KakaoTalk_20231110_155335782.mp4

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

카메라 버튼 누르면 전체화면 캡쳐되게 구현하고 싶었는데 자꾸만 저장된 사진이 0 B라고 뜨네욥.. 어떻게 고쳐야 할 지 더 생각해보겠슴다
코리 달아주시면 수정할게요!

@crownjoe crownjoe added the 📕 필수 필수 과제 label Nov 9, 2023
Copy link
Member

@chattymin chattymin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!! 역시 코드 잘짜시네요

class HomeActivity : AppCompatActivity() {
private lateinit var binding: ActivityHomeBinding
private var openFAB = false
private val WRITE_EXTERNAL_STORAGE_REQUEST_CODE = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도 companion object에 넣으면 더 좋을 것 같습니다!

Comment on lines +16 to +17
private val View_Myprofile = 0
private val View_Friend = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요것도 companoin object로!

Copy link

@stellar-halo stellar-halo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAB에 이은 스크린 캡쳐까지,, 멋있는 코드들 잘 보고 갑니다! 너무 잘해요 ^0^

Comment on lines +5 to +6
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

권한 허가까지,,! 멋있다

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멋있다... 0-0

class DoAndroidFragment : Fragment() {
private var _binding : FragmentDoAndroidBinding ? = null
private val binding: FragmentDoAndroidBinding
get() = requireNotNull(_binding){"바인딩 에러"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요기는 string으로 뺴주시면 좋을 것 같아요~ getString(R.string.xxx)으로 사용하실 수 있습니다!

return if (user_id != null && user_major != null) {
MyPageFragment.newInstance(user_id, user_major)
} else {
throw IllegalArgumentException("데이터가 없어요!")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마찬가지입니다!


companion object {
fun createMyPageFragment(user_id: String?, user_major: String?): MyPageFragment {
return if (user_id != null && user_major != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isUserExist 요런식으로 따로 조건변수를 빼보는 건 어떤가요?

Comment on lines +56 to +79
when (it.itemId) {
R.id.menu_home -> {
replaceFragment(HomeFragment())
true
}

R.id.menu_do_android -> {
replaceFragment(DoAndroidFragment())
true
}

R.id.menu_mypage -> {
try {
val user_id = intent?.getStringExtra("user_id")
val user_major = intent?.getStringExtra("user_major")
val myPageFragment = createMyPageFragment(user_id, user_major)
replaceFragment(myPageFragment)
} catch (e: IllegalArgumentException) {
Toast.makeText(this, e.message, Toast.LENGTH_SHORT).show()
}
true
}

else -> false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sealed class 공부해보시는 걸 추천드립니다! else가 없어도 된다는 점,,ㅎㅎ

}

binding.fabShare.setOnClickListener {
Toast.makeText(this, "공유하는 중", Toast.LENGTH_SHORT).show()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string,,귀신,,등장

Comment on lines +30 to +32
val MainAdapter = MainAdapter(requireContext())
binding.rvFriends.adapter = MainAdapter
MainAdapter.profileList = viewModel.mockUserProfileLists

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수로 따로 빼주셔도 좋을 듯 합니다!

UserProfile.User(
profileImage = R.drawable.myimage,
name = "박강희",
message = "오늘 생일티비!"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고맙티비!

Comment on lines +22 to +24
idTextView.text = "$inputTextId"
majorTextView.text = "$inputTextMajor"
nameTextView.text = "$inputTextName"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputTextId 자체가 string이 아닌가요?

val binding = ItemFriendBinding.inflate(LayoutInflater.from(parent.context), parent, false)
FriendViewHolder(binding)
}
else -> throw IllegalArgumentException("유효하지 않소")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

알겠소

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피식했소,,,

Copy link

@lsakee lsakee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했숨니다

Comment on lines +12 to +14
Glide.with(ivProfile)
.load(userUserProfileData.profileImage)
.into(ivProfile)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 coil이란 이미지로더도 공부해보면 좋을덧! 솝트 꿀팁에 글있음!

return if (user_id != null && user_major != null) {
MyPageFragment.newInstance(user_id, user_major)
} else {
throw IllegalArgumentException("데이터가 없어요!")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오.. 에러를 던지군요

Comment on lines +33 to +36
loginIntent.putExtra("entered_id", enteredId)
loginIntent.putExtra("entered_password", enteredPassword)
loginIntent.putExtra("entered_Major", enteredMajor)
loginIntent.putExtra("entered_Name", enteredName)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하나로 만들고 싶지않나요?

with(binding) {
Glide.with(ivProfile)
.load(userUserProfileData.profileImage)
.into(ivProfile)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glide가 무슨 기능을 하는 클래스 인가요??

return if (user_id != null && user_major != null) {
MyPageFragment.newInstance(user_id, user_major)
} else {
throw IllegalArgumentException("데이터가 없어요!")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling까지 추가한 거 좋네요!! 배워갑니다...끙차끙차

}
binding.fabCapture.setOnClickListener {
takeScreenshot()
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수 쪼갠 거 보기 편하고 좋네요!

Comment on lines +13 to +15
Glide.with(ivProfile)
.load(userUserProfileData.profileImage)
.into(ivProfile)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

글라이드..요친구 공부해야겠어요... 배워갑니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📕 필수 필수 과제

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3차 세미나]

5 participants