From 998834376513ef7b347b14a8583990a5dc66e891 Mon Sep 17 00:00:00 2001 From: hangunhee39 Date: Thu, 11 Jan 2024 19:51:54 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat=20:=20home=20ui=20=EA=B5=AC=ED=98=84?= =?UTF-8?q?=20/=20ARCH-124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/home/HomeFragment.kt | 60 +--- .../presentation/ui/home/HomeViewModel.kt | 5 + .../presentation/ui/home/HomeViewModelImpl.kt | 13 + .../main/res/drawable/corner_radius_18.xml | 5 + .../main/res/drawable/corner_radius_22.xml | 5 + .../main/res/drawable/ic_alarm_main_24.xml | 30 ++ .../main/res/drawable/ic_alarm_on_main_24.xml | 33 +++ .../app/src/main/res/layout/fragment_home.xml | 268 +++++++++++++++++- .../app/src/main/res/values/colors.xml | 3 + 9 files changed, 360 insertions(+), 62 deletions(-) create mode 100644 frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt create mode 100644 frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt create mode 100644 frontend/ARchive/app/src/main/res/drawable/corner_radius_18.xml create mode 100644 frontend/ARchive/app/src/main/res/drawable/corner_radius_22.xml create mode 100644 frontend/ARchive/app/src/main/res/drawable/ic_alarm_main_24.xml create mode 100644 frontend/ARchive/app/src/main/res/drawable/ic_alarm_on_main_24.xml diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt index cb892552f..a4f868cf0 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt @@ -1,60 +1,16 @@ package com.droidblossom.archive.presentation.ui.home -import android.os.Bundle -import androidx.fragment.app.Fragment -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup +import androidx.fragment.app.viewModels import com.droidblossom.archive.R +import com.droidblossom.archive.databinding.FragmentHomeBinding +import com.droidblossom.archive.presentation.base.BaseFragment +import dagger.hilt.android.AndroidEntryPoint -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" +@AndroidEntryPoint +class HomeFragment : BaseFragment(R.layout.fragment_home) { -/** - * A simple [Fragment] subclass. - * Use the [HomeFragment.newInstance] factory method to - * create an instance of this fragment. - */ -class HomeFragment : Fragment() { - // TODO: Rename and change types of parameters - private var param1: String? = null - private var param2: String? = null + override val viewModel: HomeViewModelImpl by viewModels() - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - arguments?.let { - param1 = it.getString(ARG_PARAM1) - param2 = it.getString(ARG_PARAM2) - } - } - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_home, container, false) - } - - companion object { - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment HomeFragment. - */ - // TODO: Rename and change types and number of parameters - @JvmStatic - fun newInstance(param1: String, param2: String) = - HomeFragment().apply { - arguments = Bundle().apply { - putString(ARG_PARAM1, param1) - putString(ARG_PARAM2, param2) - } - } + override fun observeData() { } } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt new file mode 100644 index 000000000..054baea6e --- /dev/null +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt @@ -0,0 +1,5 @@ +package com.droidblossom.archive.presentation.ui.home + +interface HomeViewModel { + +} \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt new file mode 100644 index 000000000..f9d0c80d8 --- /dev/null +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt @@ -0,0 +1,13 @@ +package com.droidblossom.archive.presentation.ui.home + +import com.droidblossom.archive.presentation.base.BaseViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +@HiltViewModel +class HomeViewModelImpl @Inject constructor( + +) : BaseViewModel(), HomeViewModel { + + +} \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/drawable/corner_radius_18.xml b/frontend/ARchive/app/src/main/res/drawable/corner_radius_18.xml new file mode 100644 index 000000000..cead1e45b --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/corner_radius_18.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/drawable/corner_radius_22.xml b/frontend/ARchive/app/src/main/res/drawable/corner_radius_22.xml new file mode 100644 index 000000000..25e3ecfd7 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/corner_radius_22.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/drawable/ic_alarm_main_24.xml b/frontend/ARchive/app/src/main/res/drawable/ic_alarm_main_24.xml new file mode 100644 index 000000000..242d5c476 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/ic_alarm_main_24.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/frontend/ARchive/app/src/main/res/drawable/ic_alarm_on_main_24.xml b/frontend/ARchive/app/src/main/res/drawable/ic_alarm_on_main_24.xml new file mode 100644 index 000000000..967a7a1b4 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/ic_alarm_on_main_24.xml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index 8dd85a6cb..a576a3e3c 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -1,15 +1,263 @@ - + - + + + + + + + android:background="@android:color/holo_green_dark" + tools:context=".presentation.ui.home.HomeFragment"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/values/colors.xml b/frontend/ARchive/app/src/main/res/values/colors.xml index 4be005fbe..a093faa8b 100644 --- a/frontend/ARchive/app/src/main/res/values/colors.xml +++ b/frontend/ARchive/app/src/main/res/values/colors.xml @@ -21,4 +21,7 @@ #FF2E2E2E #FF1C1C1C + + #B3FFFFFF + #99FFFFFF \ No newline at end of file From 91e8a07ad383d3bb798ab2bf1cb69403c85fde4a Mon Sep 17 00:00:00 2001 From: hangunhee39 Date: Fri, 12 Jan 2024 01:09:14 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat=20:=20home=20VM=20=EC=9E=91=EC=97=85?= =?UTF-8?q?=20/=20ARCH-124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FAB animation 추가 - 캡슐 필터 데이터바인딩 작업 - 데이터바인딩, VM 작업 --- .../ARchive/app/src/main/AndroidManifest.xml | 16 +++-- .../presentation/ui/home/HomeFragment.kt | 25 ++++++- .../presentation/ui/home/HomeViewModel.kt | 25 ++++++- .../presentation/ui/home/HomeViewModelImpl.kt | 68 +++++++++++++++++++ .../archive/util/BindingAdapter.kt | 7 ++ .../main/res/drawable/ic_close_main_40.xml | 18 +++++ .../app/src/main/res/layout/fragment_home.xml | 62 +++++++++++------ .../app/src/main/res/values/colors.xml | 2 + 8 files changed, 192 insertions(+), 31 deletions(-) create mode 100644 frontend/ARchive/app/src/main/res/drawable/ic_close_main_40.xml diff --git a/frontend/ARchive/app/src/main/AndroidManifest.xml b/frontend/ARchive/app/src/main/AndroidManifest.xml index 9b592e6ee..4e78609d4 100644 --- a/frontend/ARchive/app/src/main/AndroidManifest.xml +++ b/frontend/ARchive/app/src/main/AndroidManifest.xml @@ -40,7 +40,15 @@ android:name=".presentation.ui.MainActivity" android:exported="true" android:screenOrientation="portrait" - tools:ignore="LockedOrientationActivity"/> + tools:ignore="LockedOrientationActivity"> + + + + + + + + - - - - - diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt index a4f868cf0..15d56a854 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt @@ -1,16 +1,39 @@ package com.droidblossom.archive.presentation.ui.home +import android.animation.ObjectAnimator +import android.os.Bundle +import android.view.View +import android.widget.Toast import androidx.fragment.app.viewModels +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle import com.droidblossom.archive.R import com.droidblossom.archive.databinding.FragmentHomeBinding import com.droidblossom.archive.presentation.base.BaseFragment import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.NonCancellable.start +import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.launch @AndroidEntryPoint class HomeFragment : BaseFragment(R.layout.fragment_home) { - override val viewModel: HomeViewModelImpl by viewModels() + override val viewModel: HomeViewModelImpl by viewModels() + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.vm = viewModel + + } override fun observeData() { + //FAB 상태 + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.STARTED){ + viewModel.filterCapsuleSelect.collect( + + ) + } + } } } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt index 054baea6e..87f38a4c2 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt @@ -1,5 +1,28 @@ package com.droidblossom.archive.presentation.ui.home +import kotlinx.coroutines.flow.StateFlow + interface HomeViewModel { - + + val filterCapsuleSelect : StateFlow + val isClickedFAB : StateFlow + val existsNotification : StateFlow + val followLocation : StateFlow + + + fun selectPublic() + fun selectGroup() + fun selectSecret() + fun selectHotPlace() + fun clickFollowBtn() + fun clickNotificationBtn() + fun clickFAB() + + enum class CapsuleFilter{ + ALL, + SECRET, + PUBLIC, + GROUP, + HOT + } } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt index f9d0c80d8..3375e0756 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt @@ -1,7 +1,11 @@ package com.droidblossom.archive.presentation.ui.home +import androidx.lifecycle.viewModelScope import com.droidblossom.archive.presentation.base.BaseViewModel import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel @@ -9,5 +13,69 @@ class HomeViewModelImpl @Inject constructor( ) : BaseViewModel(), HomeViewModel { + private val _filterCapsuleSelect: MutableStateFlow = + MutableStateFlow(HomeViewModel.CapsuleFilter.ALL) + override val filterCapsuleSelect: StateFlow + get() = _filterCapsuleSelect + + private val _isClickedFAB: MutableStateFlow = MutableStateFlow(false) + override val isClickedFAB: StateFlow + get() = _isClickedFAB + private val _existsNotification: MutableStateFlow = MutableStateFlow(false) + override val existsNotification: StateFlow + get() = _existsNotification + private val _followLocation: MutableStateFlow = MutableStateFlow(false) + override val followLocation: StateFlow + get() = _followLocation + + + override fun selectPublic() { + viewModelScope.launch { + if (filterCapsuleSelect.value == HomeViewModel.CapsuleFilter.PUBLIC) + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.ALL) + else + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.PUBLIC) + } + } + + override fun selectGroup() { + viewModelScope.launch { + if (filterCapsuleSelect.value == HomeViewModel.CapsuleFilter.GROUP) + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.ALL) + else + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.GROUP) } + } + + override fun selectSecret() { + viewModelScope.launch { + if (filterCapsuleSelect.value == HomeViewModel.CapsuleFilter.SECRET) + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.ALL) + else + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.SECRET) } + } + + override fun selectHotPlace() { + viewModelScope.launch { + if (filterCapsuleSelect.value == HomeViewModel.CapsuleFilter.HOT) + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.ALL) + else + _filterCapsuleSelect.emit(HomeViewModel.CapsuleFilter.HOT) } + } + + override fun clickFollowBtn() { + viewModelScope.launch { + _followLocation.emit(!followLocation.value) + } + } + + override fun clickNotificationBtn() { + viewModelScope.launch { + _existsNotification.emit(!existsNotification.value) + } + } + + override fun clickFAB() { + viewModelScope.launch { _isClickedFAB.emit(!isClickedFAB.value) } + } } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/BindingAdapter.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/BindingAdapter.kt index 83b4931b0..fbc83befe 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/BindingAdapter.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/BindingAdapter.kt @@ -1,11 +1,13 @@ package com.droidblossom.archive.util +import android.animation.ObjectAnimator import android.graphics.drawable.Drawable import android.net.Uri import android.telephony.PhoneNumberFormattingTextWatcher import android.widget.EditText import android.widget.ImageView import android.widget.TextView +import androidx.cardview.widget.CardView import androidx.databinding.BindingAdapter import com.bumptech.glide.Glide import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions @@ -36,4 +38,9 @@ fun TextView.displayRemainingTime(totalSeconds: Int) { val minutes = totalSeconds / 60 val seconds = totalSeconds % 60 this.text = String.format("%02d분 %02d초", minutes, seconds) +} + +@BindingAdapter("bind:animateFAB") +fun CardView.animateFAB(y : Float){ + ObjectAnimator.ofFloat(this, "translationY", y).apply { start() } } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/drawable/ic_close_main_40.xml b/frontend/ARchive/app/src/main/res/drawable/ic_close_main_40.xml new file mode 100644 index 000000000..d7ff0d569 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/ic_close_main_40.xml @@ -0,0 +1,18 @@ + + + + diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index a576a3e3c..de5e48c83 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -1,13 +1,21 @@ + + + + + @@ -23,12 +31,13 @@ android:layout_height="36dp" android:layout_marginStart="16dp" android:background="@drawable/corner_radius_18" - android:backgroundTint="@color/white_alpha60" + android:backgroundTint="@{vm.filterCapsuleSelect==filter.SECRET ? @color/main_alpha85 : @color/white_alpha60}" android:gravity="center" + android:onClick="@{()->vm.selectSecret()}" android:paddingHorizontal="14dp" android:text="비밀" - android:textAppearance="@style/TextAppearance.App.caption2" - android:textColor="@color/gray_700" + android:textAppearance="@style/TextAppearance.App.caption1" + android:textColor="@{vm.filterCapsuleSelect==filter.SECRET ? @color/white : @color/gray_700 }" app:layout_constraintBottom_toBottomOf="@id/notificationBtn" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@id/notificationBtn" /> @@ -39,28 +48,30 @@ android:layout_height="36dp" android:layout_marginStart="4dp" android:background="@drawable/corner_radius_18" - android:backgroundTint="@color/white_alpha60" + android:backgroundTint="@{vm.filterCapsuleSelect==filter.GROUP ? @color/main_alpha85 : @color/white_alpha60}" android:gravity="center" + android:onClick="@{()->vm.selectGroup()}" android:paddingHorizontal="14dp" android:text="그룹" - android:textAppearance="@style/TextAppearance.App.caption2" - android:textColor="@color/gray_700" + android:textAppearance="@style/TextAppearance.App.caption1" + android:textColor="@{vm.filterCapsuleSelect==filter.GROUP ? @color/white : @color/gray_700 }" app:layout_constraintBottom_toBottomOf="@id/notificationBtn" app:layout_constraintStart_toEndOf="@id/secretBtn" app:layout_constraintTop_toTopOf="@id/notificationBtn" /> @@ -71,14 +82,15 @@ android:layout_height="36dp" android:layout_marginStart="4dp" android:background="@drawable/corner_radius_18" - android:backgroundTint="@color/white_alpha60" + android:backgroundTint="@{vm.filterCapsuleSelect==filter.HOT ? @color/main_alpha85 : @color/white_alpha60}" android:gravity="center" + android:onClick="@{()->vm.selectHotPlace()}" android:paddingHorizontal="14dp" android:text="핫플레이스" - android:textAppearance="@style/TextAppearance.App.caption2" - android:textColor="@color/gray_700" + android:textAppearance="@style/TextAppearance.App.caption1" + android:textColor="@{vm.filterCapsuleSelect==filter.HOT ? @color/white : @color/gray_700 }" app:layout_constraintBottom_toBottomOf="@id/notificationBtn" - app:layout_constraintStart_toEndOf="@id/openBtn" + app:layout_constraintStart_toEndOf="@id/publicBtn" app:layout_constraintTop_toTopOf="@id/notificationBtn" /> @@ -93,7 +105,8 @@ android:background="@drawable/corner_radius_22" android:backgroundTint="@color/white_alpha60" android:scaleType="center" - android:src="@drawable/ic_alarm_main_24" + android:onClick="@{()->vm.clickNotificationBtn()}" + android:src="@{vm.existsNotification ? @drawable/ic_alarm_on_main_24 : @drawable/ic_alarm_main_24}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -102,13 +115,14 @@ android:layout_width="66dp" android:layout_height="66dp" android:backgroundTint="@color/white_alpha70" + android:visibility="@{vm.isClickedFAB ? View.VISIBLE : View.GONE}" app:cardCornerRadius="33dp" app:cardElevation="0dp" app:layout_constraintBottom_toBottomOf="@id/fab" app:layout_constraintEnd_toEndOf="@id/fab" app:layout_constraintStart_toStartOf="@id/fab" app:layout_constraintTop_toTopOf="@id/fab" - tools:visibility="invisible"> + bind:animateFAB="@{vm.isClickedFAB ? -630 : 0}"> + bind:animateFAB="@{vm.isClickedFAB ? -420 : 0}"> + bind:animateFAB="@{vm.isClickedFAB ? -210 : 0}"> @@ -247,7 +264,8 @@ android:background="@drawable/corner_radius_22" android:backgroundTint="@color/white_alpha70" android:scaleType="center" - android:src="@drawable/ic_location_off_24" + android:onClick="@{()->vm.clickFollowBtn()}" + android:src="@{vm.followLocation ? @drawable/ic_location_on_24 : @drawable/ic_location_off_24}" app:layout_constraintBottom_toTopOf="@id/place" app:layout_constraintStart_toStartOf="parent" /> diff --git a/frontend/ARchive/app/src/main/res/values/colors.xml b/frontend/ARchive/app/src/main/res/values/colors.xml index a093faa8b..5a79b8baa 100644 --- a/frontend/ARchive/app/src/main/res/values/colors.xml +++ b/frontend/ARchive/app/src/main/res/values/colors.xml @@ -24,4 +24,6 @@ #B3FFFFFF #99FFFFFF + #D94263F7 + #B3ECEFFE \ No newline at end of file From 14fb42c73ffa5b466813ffd8e2526c499b554ca3 Mon Sep 17 00:00:00 2001 From: hangunhee39 Date: Sat, 13 Jan 2024 00:32:39 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat=20:=20HomeSnackBar(small)=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=20/=20ARCH-124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/snack/HomeSnackBarBig.kt | 48 ++++++++++++++ .../presentation/snack/HomeSnackBarSmall.kt | 50 ++++++++++++++ .../archive/presentation/ui/MainActivity.kt | 4 ++ .../presentation/ui/home/HomeFragment.kt | 15 ++++- .../presentation/ui/home/HomeViewModel.kt | 3 + .../presentation/ui/home/HomeViewModelImpl.kt | 18 +++++ .../main/res/drawable/corner_radius_16.xml | 4 ++ .../app/src/main/res/layout/fragment_home.xml | 34 +++++----- .../main/res/layout/snackbar_home_alert.xml | 46 +++++++++++++ .../layout/snackbar_home_alert_with_image.xml | 65 +++++++++++++++++++ .../app/src/main/res/values/colors.xml | 1 + 11 files changed, 270 insertions(+), 18 deletions(-) create mode 100644 frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarBig.kt create mode 100644 frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarSmall.kt create mode 100644 frontend/ARchive/app/src/main/res/drawable/corner_radius_16.xml create mode 100644 frontend/ARchive/app/src/main/res/layout/snackbar_home_alert.xml create mode 100644 frontend/ARchive/app/src/main/res/layout/snackbar_home_alert_with_image.xml diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarBig.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarBig.kt new file mode 100644 index 000000000..8160f3c98 --- /dev/null +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarBig.kt @@ -0,0 +1,48 @@ +package com.droidblossom.archive.presentation.snack + +import android.view.LayoutInflater +import android.view.View +import android.widget.Toast +import androidx.core.content.ContextCompat +import androidx.databinding.DataBindingUtil +import com.droidblossom.archive.R +import com.droidblossom.archive.databinding.SnackbarHomeAlertWithImageBinding +import com.google.android.material.snackbar.Snackbar + +class HomeSnackBarBig(private val view : View, private val message: String, private val imgUrl : String) { + + private val context = view.context + private val snackBar = Snackbar.make(view, "", 5000) + private val snackBarLayout = snackBar.view as Snackbar.SnackbarLayout + private val inflater = LayoutInflater.from(context) + private val snackBarBinding: SnackbarHomeAlertWithImageBinding = DataBindingUtil.inflate(inflater, R.layout.snackbar_home_alert_with_image, null, false) + + + init { + initView() + initData() + } + + private fun initView() { + val location = view.findViewById(R.id.place) + + with(snackBarLayout) { + removeAllViews() + setPadding(0, 0, 0, 70) + setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent)) + addView(snackBarBinding.root, 0) + } + snackBar.anchorView = location + } + + private fun initData() { + snackBarBinding.openBtn.setOnClickListener { + Toast.makeText(context,"테스트2", Toast.LENGTH_SHORT).show() + } + } + + fun show() { + snackBar.show() + } + +} \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarSmall.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarSmall.kt new file mode 100644 index 000000000..e3d76c0f9 --- /dev/null +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/snack/HomeSnackBarSmall.kt @@ -0,0 +1,50 @@ +package com.droidblossom.archive.presentation.snack + + +import android.view.LayoutInflater +import android.view.View +import android.widget.Toast +import androidx.core.content.ContextCompat +import androidx.databinding.DataBindingUtil +import com.droidblossom.archive.R +import com.droidblossom.archive.databinding.SnackbarHomeAlertBinding +import com.google.android.material.snackbar.Snackbar + + +class HomeSnackBarSmall(private val view :View) { + + private val context = view.context + private val snackBar = Snackbar.make(view, "", 5000) + private val snackBarLayout = snackBar.view as Snackbar.SnackbarLayout + private val inflater = LayoutInflater.from(context) + private val snackBarBinding: SnackbarHomeAlertBinding = DataBindingUtil.inflate(inflater, com.droidblossom.archive.R.layout.snackbar_home_alert, null, false) + + + init { + initView() + initData() + } + + private fun initView() { + val location = view.findViewById(R.id.place) + + with(snackBarLayout) { + removeAllViews() + setPadding(0, 0, 0, 70) + setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent)) + addView(snackBarBinding.root, 0) + } + snackBar.anchorView = location + } + + private fun initData() { + snackBarBinding.openBtn.setOnClickListener { + Toast.makeText(context,"테스트1",Toast.LENGTH_SHORT).show() + } + } + + fun show() { + snackBar.show() + } + +} \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/MainActivity.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/MainActivity.kt index 686efb3cd..51bad5e0c 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/MainActivity.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/MainActivity.kt @@ -15,6 +15,8 @@ import dagger.hilt.android.AndroidEntryPoint class MainActivity : BaseActivity(R.layout.activity_main) { override val viewModel: Nothing? = null + lateinit var viewBinding: ActivityMainBinding + override fun observeData() {} @@ -25,6 +27,8 @@ class MainActivity : BaseActivity(R.layout.activi val navController = findNavController(R.id.mainNavHost) NavigationUI.setupWithNavController(binding.bottomNavigation, findNavController(R.id.mainNavHost)) + viewBinding = binding + binding.fab.setOnClickListener { navController.navigate( R.id.cameraFragment, null, NavOptions.Builder() diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt index 15d56a854..1f5a1c89b 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt @@ -1,9 +1,7 @@ package com.droidblossom.archive.presentation.ui.home -import android.animation.ObjectAnimator import android.os.Bundle import android.view.View -import android.widget.Toast import androidx.fragment.app.viewModels import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope @@ -11,8 +9,9 @@ import androidx.lifecycle.repeatOnLifecycle import com.droidblossom.archive.R import com.droidblossom.archive.databinding.FragmentHomeBinding import com.droidblossom.archive.presentation.base.BaseFragment +import com.droidblossom.archive.presentation.snack.HomeSnackBarBig +import com.droidblossom.archive.presentation.snack.HomeSnackBarSmall import dagger.hilt.android.AndroidEntryPoint -import kotlinx.coroutines.NonCancellable.start import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch @@ -25,6 +24,16 @@ class HomeFragment : BaseFragment(R.layo super.onViewCreated(view, savedInstanceState) binding.vm = viewModel + binding.makeOpenCapsuleBtn.setOnClickListener { + //스낵바 스몰 테스트용 + HomeSnackBarSmall(requireView()).show() + } + + binding.makeGroupCapsuleBtn.setOnClickListener { + //스낵바 빅 테스트용 + HomeSnackBarBig(requireView(),"","").show() + } + } override fun observeData() { //FAB 상태 diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt index 87f38a4c2..c7ba492c6 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt @@ -17,6 +17,9 @@ interface HomeViewModel { fun clickFollowBtn() fun clickNotificationBtn() fun clickFAB() + fun clickCreateGroupCapsule() + fun clickCreateSecretCapsule() + fun clickCreatePublicCapsule() enum class CapsuleFilter{ ALL, diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt index 3375e0756..f7241b4b0 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt @@ -78,4 +78,22 @@ class HomeViewModelImpl @Inject constructor( viewModelScope.launch { _isClickedFAB.emit(!isClickedFAB.value) } } + override fun clickCreateGroupCapsule() { + viewModelScope.launch { + + } + } + + override fun clickCreateSecretCapsule() { + viewModelScope.launch { + + } + } + + override fun clickCreatePublicCapsule() { + viewModelScope.launch { + + } + } + } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/drawable/corner_radius_16.xml b/frontend/ARchive/app/src/main/res/drawable/corner_radius_16.xml new file mode 100644 index 000000000..3b22b11b0 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/drawable/corner_radius_16.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index de5e48c83..80b98dbc9 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -104,8 +104,8 @@ android:layout_marginBottom="22dp" android:background="@drawable/corner_radius_22" android:backgroundTint="@color/white_alpha60" - android:scaleType="center" android:onClick="@{()->vm.clickNotificationBtn()}" + android:scaleType="center" android:src="@{vm.existsNotification ? @drawable/ic_alarm_on_main_24 : @drawable/ic_alarm_main_24}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -115,13 +115,14 @@ android:layout_width="66dp" android:layout_height="66dp" android:backgroundTint="@color/white_alpha70" + android:onClick="@{()->vm.clickCreateSecretCapsule()}" android:visibility="@{vm.isClickedFAB ? View.VISIBLE : View.GONE}" app:cardCornerRadius="33dp" app:cardElevation="0dp" - app:layout_constraintBottom_toBottomOf="@id/fab" - app:layout_constraintEnd_toEndOf="@id/fab" - app:layout_constraintStart_toStartOf="@id/fab" - app:layout_constraintTop_toTopOf="@id/fab" + app:layout_constraintBottom_toBottomOf="@id/homeFab" + app:layout_constraintEnd_toEndOf="@id/homeFab" + app:layout_constraintStart_toStartOf="@id/homeFab" + app:layout_constraintTop_toTopOf="@id/homeFab" bind:animateFAB="@{vm.isClickedFAB ? -630 : 0}"> diff --git a/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert.xml b/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert.xml new file mode 100644 index 000000000..f2f6ef7dd --- /dev/null +++ b/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert_with_image.xml b/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert_with_image.xml new file mode 100644 index 000000000..66ee6c2e8 --- /dev/null +++ b/frontend/ARchive/app/src/main/res/layout/snackbar_home_alert_with_image.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/values/colors.xml b/frontend/ARchive/app/src/main/res/values/colors.xml index 5a79b8baa..2650ec22e 100644 --- a/frontend/ARchive/app/src/main/res/values/colors.xml +++ b/frontend/ARchive/app/src/main/res/values/colors.xml @@ -26,4 +26,5 @@ #99FFFFFF #D94263F7 #B3ECEFFE + #B31B3AC4 \ No newline at end of file From 528cbe33e6f6f866894af780fdb91098b54ffd43 Mon Sep 17 00:00:00 2001 From: hangunhee39 Date: Sat, 13 Jan 2024 00:37:51 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat=20:=20HomeSnackBar(big)=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=20/=20ARCH-124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/home/HomeFragment.kt | 4 +-- .../app/src/main/res/layout/fragment_home.xml | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt index 1f5a1c89b..dcbb18733 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt @@ -24,12 +24,12 @@ class HomeFragment : BaseFragment(R.layo super.onViewCreated(view, savedInstanceState) binding.vm = viewModel - binding.makeOpenCapsuleBtn.setOnClickListener { + binding.snackbarTestBtn.setOnClickListener { //스낵바 스몰 테스트용 HomeSnackBarSmall(requireView()).show() } - binding.makeGroupCapsuleBtn.setOnClickListener { + binding.snackbarBigText.setOnClickListener { //스낵바 빅 테스트용 HomeSnackBarBig(requireView(),"","").show() } diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index 80b98dbc9..9df5219f8 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -25,6 +25,31 @@ android:background="@android:color/holo_green_dark" tools:context=".presentation.ui.home.HomeFragment"> + + + + + Date: Sat, 13 Jan 2024 03:12:55 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat=20:=20home(main)=20->=20createCapsule?= =?UTF-8?q?=20=EB=84=A4=EB=B9=84=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/home/HomeFragment.kt | 19 ++++++++++-- .../presentation/ui/home/HomeViewModel.kt | 4 --- .../presentation/ui/home/HomeViewModelImpl.kt | 18 ----------- .../createcapsule/CreateCapsule1Fragment.kt | 14 +++++++++ .../createcapsule/CreateCapsule2Fragment.kt | 6 ++++ .../createcapsule/CreateCapsule3Fragment.kt | 6 ++++ .../createcapsule/CreateCapsuleActivity.kt | 15 +++++++-- .../createcapsule/CreateCapsuleViewModel.kt | 1 + .../CreateCapsuleViewModelImpl.kt | 6 +++- .../res/layout/activity_create_capsule.xml | 8 ++--- .../app/src/main/res/layout/fragment_home.xml | 31 +++++++++---------- 11 files changed, 80 insertions(+), 48 deletions(-) diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt index dcbb18733..b90a72e5a 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeFragment.kt @@ -11,6 +11,7 @@ import com.droidblossom.archive.databinding.FragmentHomeBinding import com.droidblossom.archive.presentation.base.BaseFragment import com.droidblossom.archive.presentation.snack.HomeSnackBarBig import com.droidblossom.archive.presentation.snack.HomeSnackBarSmall +import com.droidblossom.archive.presentation.ui.home.createcapsule.CreateCapsuleActivity import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch @@ -24,6 +25,19 @@ class HomeFragment : BaseFragment(R.layo super.onViewCreated(view, savedInstanceState) binding.vm = viewModel + binding.makeGroupCapsuleBtn.setOnClickListener { + //그룹 캡슐 생성 페이지로 이동 + startActivity(CreateCapsuleActivity.newIntent(requireContext(),true)) + } + binding.makeOpenCapsuleBtn.setOnClickListener { + //공개 캡슐 생성 페이지로 이동 + startActivity(CreateCapsuleActivity.newIntent(requireContext(),false)) + } + binding.makeSecretCapsuleBtn.setOnClickListener { + //그룹 캡슐 생성 페이지로 이동 + startActivity(CreateCapsuleActivity.newIntent(requireContext(),false)) + } + binding.snackbarTestBtn.setOnClickListener { //스낵바 스몰 테스트용 HomeSnackBarSmall(requireView()).show() @@ -31,14 +45,15 @@ class HomeFragment : BaseFragment(R.layo binding.snackbarBigText.setOnClickListener { //스낵바 빅 테스트용 - HomeSnackBarBig(requireView(),"","").show() + HomeSnackBarBig(requireView(), "", "").show() } } + override fun observeData() { //FAB 상태 lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.STARTED){ + repeatOnLifecycle(Lifecycle.State.STARTED) { viewModel.filterCapsuleSelect.collect( ) diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt index c7ba492c6..7b4423a3a 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModel.kt @@ -17,10 +17,6 @@ interface HomeViewModel { fun clickFollowBtn() fun clickNotificationBtn() fun clickFAB() - fun clickCreateGroupCapsule() - fun clickCreateSecretCapsule() - fun clickCreatePublicCapsule() - enum class CapsuleFilter{ ALL, SECRET, diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt index f7241b4b0..3375e0756 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/HomeViewModelImpl.kt @@ -78,22 +78,4 @@ class HomeViewModelImpl @Inject constructor( viewModelScope.launch { _isClickedFAB.emit(!isClickedFAB.value) } } - override fun clickCreateGroupCapsule() { - viewModelScope.launch { - - } - } - - override fun clickCreateSecretCapsule() { - viewModelScope.launch { - - } - } - - override fun clickCreatePublicCapsule() { - viewModelScope.launch { - - } - } - } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule1Fragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule1Fragment.kt index b91a249f7..1a7a372b7 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule1Fragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule1Fragment.kt @@ -1,7 +1,11 @@ package com.droidblossom.archive.presentation.ui.home.createcapsule +import android.os.Bundle +import android.view.View import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels +import androidx.navigation.NavController +import androidx.navigation.Navigation import com.droidblossom.archive.R import com.droidblossom.archive.databinding.FragmentCreateCapsule1Binding import com.droidblossom.archive.presentation.base.BaseFragment @@ -12,6 +16,16 @@ class CreateCapsule1Fragment : BaseFragment(R.layout.fragment_create_capsule1) { override val viewModel: CreateCapsuleViewModelImpl by activityViewModels() + lateinit var navController: NavController + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.vm = viewModel + navController = Navigation.findNavController(view) + + if (!viewModel.isGroupCapsuleCreate){ + navController.navigate(R.id.action_createCapsule1Fragment_to_createCapsule2Fragment) + } + } override fun observeData() {} } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule2Fragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule2Fragment.kt index a4c767895..782c8f6a5 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule2Fragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule2Fragment.kt @@ -1,5 +1,7 @@ package com.droidblossom.archive.presentation.ui.home.createcapsule +import android.os.Bundle +import android.view.View import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import com.droidblossom.archive.R @@ -13,6 +15,10 @@ class CreateCapsule2Fragment : override val viewModel: CreateCapsuleViewModelImpl by activityViewModels() + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.vm = viewModel + } override fun observeData() { } diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule3Fragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule3Fragment.kt index f94f077b2..1f1c59fc9 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule3Fragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsule3Fragment.kt @@ -1,5 +1,7 @@ package com.droidblossom.archive.presentation.ui.home.createcapsule +import android.os.Bundle +import android.view.View import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import com.droidblossom.archive.R @@ -13,6 +15,10 @@ class CreateCapsule3Fragment : override val viewModel: CreateCapsuleViewModelImpl by activityViewModels() + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.vm = viewModel + } override fun observeData() { } diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleActivity.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleActivity.kt index 3686c9698..53a885700 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleActivity.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleActivity.kt @@ -5,10 +5,13 @@ import android.content.Intent import android.os.Bundle import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity +import androidx.navigation.findNavController import com.droidblossom.archive.R import com.droidblossom.archive.databinding.ActivityCreateCapsuleBinding import com.droidblossom.archive.presentation.base.BaseActivity +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class CreateCapsuleActivity : BaseActivity(R.layout.activity_create_capsule) { override val viewModel: CreateCapsuleViewModelImpl? by viewModels() @@ -18,12 +21,20 @@ class CreateCapsuleActivity : BaseActivity + app:layout_constraintTop_toBottomOf="@id/closeBtn" + app:navGraph="@navigation/nav_create_capsule_graph" /> \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index 9df5219f8..a6db732e5 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -27,27 +27,27 @@ + app:layout_constraintBottom_toTopOf="@id/snackbarBigText" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/snackbarTestBtn" + app:layout_constraintVertical_chainStyle="packed" /> Date: Mon, 15 Jan 2024 15:13:36 +0900 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20=EB=84=A4=EC=9D=B4=EB=B2=84?= =?UTF-8?q?=EC=A7=80=EB=8F=84=20sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/ARchive/app/build.gradle | 9 +++++++++ frontend/ARchive/app/src/main/AndroidManifest.xml | 8 +++++++- .../archive/presentation/ui/MainActivity.kt | 2 +- .../ARchive/app/src/main/res/layout/fragment_home.xml | 10 ++++++++++ frontend/ARchive/settings.gradle | 3 +++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/frontend/ARchive/app/build.gradle b/frontend/ARchive/app/build.gradle index 524795a3c..fd53ad5e9 100644 --- a/frontend/ARchive/app/build.gradle +++ b/frontend/ARchive/app/build.gradle @@ -6,6 +6,9 @@ plugins { id 'dagger.hilt.android.plugin' } +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + android { namespace 'com.droidblossom.archive' compileSdk 33 @@ -18,6 +21,8 @@ android { versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + manifestPlaceholders = [NAVER_CLIENT_ID: properties['naver_client_id']] } buildTypes { @@ -36,6 +41,7 @@ android { buildFeatures{ dataBinding = true viewBinding = true + buildConfig = true } } @@ -102,6 +108,9 @@ dependencies { //circleIndicator : https://github.com/ongakuer/CircleIndicator implementation 'me.relex:circleindicator:2.1.6' + + //네이버 지도 : https://navermaps.github.io/android-map-sdk/guide-ko/1.html + implementation 'com.naver.maps:map-sdk:3.17.0' } kapt { correctErrorTypes true diff --git a/frontend/ARchive/app/src/main/AndroidManifest.xml b/frontend/ARchive/app/src/main/AndroidManifest.xml index 4e78609d4..00b4f58d5 100644 --- a/frontend/ARchive/app/src/main/AndroidManifest.xml +++ b/frontend/ARchive/app/src/main/AndroidManifest.xml @@ -3,6 +3,8 @@ xmlns:tools="http://schemas.android.com/tools"> + + - + + + (R.layout.activi override val viewModel: Nothing? = null lateinit var viewBinding: ActivityMainBinding - override fun observeData() {} override fun onCreate(savedInstanceState: Bundle?) { diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml index a6db732e5..e8549120f 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_home.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_home.xml @@ -25,6 +25,16 @@ android:background="@android:color/holo_green_dark" tools:context=".presentation.ui.home.HomeFragment"> + + Date: Mon, 15 Jan 2024 15:45:11 +0900 Subject: [PATCH 7/7] =?UTF-8?q?style:=20fab=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../createcapsule/CreateCapsuleViewModel.kt | 1 + .../app/src/main/res/layout/fragment_skin.xml | 32 ++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleViewModel.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleViewModel.kt index 0b1829447..456bdf9e4 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleViewModel.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/home/createcapsule/CreateCapsuleViewModel.kt @@ -2,4 +2,5 @@ package com.droidblossom.archive.presentation.ui.home.createcapsule interface CreateCapsuleViewModel { var isGroupCapsuleCreate : Boolean + } \ No newline at end of file diff --git a/frontend/ARchive/app/src/main/res/layout/fragment_skin.xml b/frontend/ARchive/app/src/main/res/layout/fragment_skin.xml index 97008b88a..d4bc1e8fb 100644 --- a/frontend/ARchive/app/src/main/res/layout/fragment_skin.xml +++ b/frontend/ARchive/app/src/main/res/layout/fragment_skin.xml @@ -40,40 +40,50 @@ android:text="@string/search" android:textAppearance="@style/TextAppearance.App.caption3" android:textColor="@color/main_1" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/viewHeaderTitle" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintVertical_bias="0.0647" /> + + app:rippleColor="@color/white" /> + android:visibility="visible" + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/searchBtn" /> + + +