-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: 하우스 관리 페이지 #72
Merged
Merged
feat: 하우스 관리 페이지 #72
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d391486
셋팅 아이콘 추가
sujin-kk 4517e70
create manage house fragment and set navigation
sujin-kk 33d27ef
modify invite fragment
sujin-kk 0143e3e
초대 코드 화면 분기
sujin-kk 2d6a2f0
remove toast setgravity
sujin-kk 8875db0
Merge branch 'develop' into feature/house-setting-page
wjdwns 4983b5f
resolve conflict
sujin-kk 4521ca7
resolve conflict
sujin-kk 1f39884
Merge branch 'develop' of https://github.com/depromeet/HouseKeeper in…
sujin-kk 31765b1
conflict 해결
sujin-kk a1f9c7c
add google-service.json
sujin-kk f8d6f85
fix ci error
sujin-kk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "940546044137", | ||
"project_id": "fairer-def59", | ||
"storage_bucket": "fairer-def59.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:940546044137:android:ac124511669d0ae5ed0078", | ||
"android_client_info": { | ||
"package_name": "com.depromeet.housekeeper" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "940546044137-u481k2bgop3vkm173ufufdscgntvgd1f.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCaAHNuOuFFhzOSDbalhZLTiOaG6O2epEE" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "940546044137-u481k2bgop3vkm173ufufdscgntvgd1f.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/depromeet/housekeeper/model/enums/InviteViewType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.depromeet.housekeeper.model.enums | ||
|
||
enum class InviteViewType { | ||
SIGN, SETTING | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ import android.content.* | |
import android.content.Context.CLIPBOARD_SERVICE | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import android.view.Gravity | ||
import android.text.SpannableString | ||
import android.text.style.ForegroundColorSpan | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
@@ -14,10 +15,10 @@ import androidx.fragment.app.Fragment | |
import androidx.fragment.app.viewModels | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.fragment.findNavController | ||
import com.depromeet.housekeeper.MainActivity | ||
import androidx.navigation.fragment.navArgs | ||
import com.depromeet.housekeeper.model.enums.InviteViewType | ||
import com.depromeet.housekeeper.R | ||
import com.depromeet.housekeeper.databinding.FragmentInviteBinding | ||
import com.google.firebase.dynamiclinks.DynamicLink | ||
import com.google.firebase.dynamiclinks.ktx.* | ||
import com.google.firebase.ktx.Firebase | ||
import com.kakao.sdk.common.util.KakaoCustomTabsClient | ||
|
@@ -31,6 +32,7 @@ class InviteFragment : Fragment() { | |
lateinit var binding: FragmentInviteBinding | ||
lateinit var clipboard: ClipboardManager | ||
private val viewModel: InviteViewModel by viewModels() | ||
private val navArgs by navArgs<InviteFragmentArgs>() | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
|
@@ -47,6 +49,38 @@ class InviteFragment : Fragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
initListener() | ||
bindingVm() | ||
} | ||
|
||
private fun bindingVm() { | ||
// invite fragment 분기 - 건너뛰기 유무 | ||
viewModel.setViewType(navArgs.viewType) | ||
when(viewModel.viewType.value) { | ||
InviteViewType.SIGN -> { | ||
binding.inviteSkipBtn.visibility = View.VISIBLE | ||
} | ||
InviteViewType.SETTING -> { | ||
binding.inviteSkipBtn.visibility = View.GONE | ||
} | ||
} | ||
|
||
viewModel.groupName.value.apply { | ||
val format = String.format(getString(R.string.invite_group_name_text), this) | ||
val spannerString = SpannableString(format).apply { | ||
setSpan( | ||
ForegroundColorSpan(requireActivity().getColor(R.color.highlight)), | ||
0, | ||
this.indexOf("의"), | ||
SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE | ||
) | ||
} | ||
binding.inviteGroupNameTv.text = spannerString | ||
} | ||
|
||
// 유효기간 | ||
// TODO: API 호출 필요 | ||
val validText = getString(R.string.invite_code_valid_period_text, viewModel.inviteCodeValidPeriod.value) | ||
binding.inviteValidPeriodTv.text = validText | ||
} | ||
|
||
private fun initListener() { | ||
|
@@ -65,7 +99,7 @@ class InviteFragment : Fragment() { | |
} | ||
|
||
binding.inviteKakaoShareBtn.setOnClickListener { | ||
onKakaoShare(requireContext(),initDynamicLink()) | ||
onKakaoShare(requireContext(), initDynamicLink()) | ||
} | ||
|
||
binding.inviteSkipBtn.setOnClickListener { | ||
|
@@ -78,9 +112,7 @@ class InviteFragment : Fragment() { | |
val clip = ClipData.newPlainText("INVITE_CODE", code.toString()) | ||
clipboard.setPrimaryClip(clip) | ||
|
||
val toast = Toast.makeText(requireContext(), "코드를 클립보드에 복사했습니다.", Toast.LENGTH_SHORT) | ||
toast.setGravity(Gravity.CENTER, Gravity.CENTER_HORIZONTAL, Gravity.CENTER_VERTICAL) | ||
toast.show() | ||
Toast.makeText(requireContext(), getString(R.string.invite_code_copy_toast_text), Toast.LENGTH_SHORT).show() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제 코드에서는 초대코드 실험하기 위해서 수정해놓은 것이니 주석처리해놓고 작업해놓겠습니당 |
||
} | ||
|
||
private fun onKakaoShare(context: Context, uri: Uri) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/src/main/java/com/depromeet/housekeeper/ui/ManageHouseFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.depromeet.housekeeper.ui | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.databinding.DataBindingUtil | ||
import androidx.navigation.findNavController | ||
import com.depromeet.housekeeper.R | ||
import com.depromeet.housekeeper.databinding.FragmentManageHouseBinding | ||
import com.depromeet.housekeeper.model.enums.InviteViewType | ||
import com.depromeet.housekeeper.model.enums.SignViewType | ||
|
||
class ManageHouseFragment : Fragment() { | ||
lateinit var binding: FragmentManageHouseBinding | ||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
// Inflate the layout for this fragment | ||
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_manage_house, container, false) | ||
binding.lifecycleOwner = this.viewLifecycleOwner | ||
|
||
initListener() | ||
|
||
return binding.root | ||
} | ||
|
||
private fun initListener() { | ||
binding.manageHouseHeader.apply { | ||
defaultHeaderTitleTv.text = resources.getString(R.string.manage_house_header_title) | ||
|
||
defaultHeaderBackBtn.setOnClickListener { | ||
it.findNavController().navigateUp() | ||
} | ||
} | ||
|
||
binding.renameHouseRow.setOnClickListener { | ||
it.findNavController().navigate(ManageHouseFragmentDirections.actionManageHouseFragmentToSignNameFragment(viewType = SignViewType.ModifyGroupName, code = null)) | ||
} | ||
|
||
binding.inviteRow.setOnClickListener { | ||
it.findNavController().navigate(ManageHouseFragmentDirections.actionManageHouseFragmentToInviteFragment(InviteViewType.SETTING)) | ||
} | ||
|
||
binding.exitHouseRow.setOnClickListener { | ||
// ToDo: 하우스 나가기 API 연동 (hasTeam 정보 필요) | ||
} | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="18dp" | ||
android:height="18dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="18"> | ||
<path | ||
android:pathData="M8.9974,0.6665C4.3974,0.6665 0.6641,4.3998 0.6641,8.9998C0.6641,13.5998 4.3974,17.3332 8.9974,17.3332C13.5974,17.3332 17.3307,13.5998 17.3307,8.9998C17.3307,4.3998 13.5974,0.6665 8.9974,0.6665ZM8.9974,3.1665C10.3807,3.1665 11.4974,4.2832 11.4974,5.6665C11.4974,7.0498 10.3807,8.1665 8.9974,8.1665C7.6141,8.1665 6.4974,7.0498 6.4974,5.6665C6.4974,4.2832 7.6141,3.1665 8.9974,3.1665ZM8.9974,14.9998C6.9141,14.9998 5.0724,13.9332 3.9974,12.3165C4.0224,10.6582 7.3307,9.7498 8.9974,9.7498C10.6557,9.7498 13.9724,10.6582 13.9974,12.3165C12.9224,13.9332 11.0807,14.9998 8.9974,14.9998Z" | ||
android:fillColor="#323232"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="16dp" | ||
android:height="16dp" | ||
android:viewportWidth="16" | ||
android:viewportHeight="16"> | ||
android:width="18dp" | ||
android:height="18dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="18"> | ||
<path | ||
android:pathData="M7.999,1.333C4.319,1.333 1.332,4.32 1.332,8C1.332,11.68 4.319,14.667 7.999,14.667C11.679,14.667 14.665,11.68 14.665,8C14.665,4.32 11.679,1.333 7.999,1.333ZM8.665,11.333H7.332V7.333H8.665V11.333ZM8.665,6H7.332V4.667H8.665V6Z" | ||
android:fillColor="#D9D9D9"/> | ||
android:pathData="M8.1641,11.4998H9.8307V13.1665H8.1641V11.4998ZM8.1641,4.8332H9.8307V9.8332H8.1641V4.8332ZM8.9891,0.6665C4.3891,0.6665 0.6641,4.3998 0.6641,8.9998C0.6641,13.5998 4.3891,17.3332 8.9891,17.3332C13.5974,17.3332 17.3307,13.5998 17.3307,8.9998C17.3307,4.3998 13.5974,0.6665 8.9891,0.6665ZM8.9974,15.6665C5.3141,15.6665 2.3307,12.6832 2.3307,8.9998C2.3307,5.3165 5.3141,2.3332 8.9974,2.3332C12.6807,2.3332 15.6641,5.3165 15.6641,8.9998C15.6641,12.6832 12.6807,15.6665 8.9974,15.6665Z" | ||
android:fillColor="#323232"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="14dp" | ||
android:height="14dp" | ||
android:viewportWidth="14" | ||
android:viewportHeight="14"> | ||
<path | ||
android:pathData="M7.0026,0.3333C3.3226,0.3333 0.3359,3.3199 0.3359,6.9999C0.3359,10.6799 3.3226,13.6666 7.0026,13.6666C10.6826,13.6666 13.6693,10.6799 13.6693,6.9999C13.6693,3.3199 10.6826,0.3333 7.0026,0.3333ZM7.6693,10.3333H6.3359V6.3333H7.6693V10.3333ZM7.6693,4.9999H6.3359V3.6666H7.6693V4.9999Z" | ||
android:fillColor="#D9D9D9"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M13.8906,10.9419C15.0323,11.7169 15.8323,12.7669 15.8323,14.1669V16.6669H19.1656V14.1669C19.1656,12.3502 16.1906,11.2752 13.8906,10.9419Z" | ||
android:fillColor="#323232" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M7.5052,10.0002C9.3462,10.0002 10.8385,8.5078 10.8385,6.6668C10.8385,4.8259 9.3462,3.3335 7.5052,3.3335C5.6643,3.3335 4.1719,4.8259 4.1719,6.6668C4.1719,8.5078 5.6643,10.0002 7.5052,10.0002Z" | ||
android:fillColor="#323232"/> | ||
<path | ||
android:pathData="M12.499,10.0002C14.3406,10.0002 15.8323,8.5085 15.8323,6.6668C15.8323,4.8252 14.3406,3.3335 12.499,3.3335C12.1073,3.3335 11.7406,3.4168 11.3906,3.5335C12.0823,4.3918 12.499,5.4835 12.499,6.6668C12.499,7.8502 12.0823,8.9418 11.3906,9.8002C11.7406,9.9168 12.1073,10.0002 12.499,10.0002Z" | ||
android:fillColor="#323232" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M7.5026,10.8335C5.2776,10.8335 0.8359,11.9502 0.8359,14.1668V16.6668H14.1693V14.1668C14.1693,11.9502 9.7276,10.8335 7.5026,10.8335Z" | ||
android:fillColor="#323232" | ||
android:fillType="evenOdd"/> | ||
</vector> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
분기처리 직접해주셔서 감사합니다 ㅎㅎ