diff --git a/common/src/main/java/com/nocapstone/common/util/PermissionObject.kt b/common/src/main/java/com/nocapstone/common/util/PermissionObject.kt index 1ae7eca..4501704 100644 --- a/common/src/main/java/com/nocapstone/common/util/PermissionObject.kt +++ b/common/src/main/java/com/nocapstone/common/util/PermissionObject.kt @@ -33,5 +33,4 @@ enum class PermissionType(val permissionArray: Array) { ) ), CAMERA(arrayOf(Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE)), - NOTIFICATION(arrayOf(Manifest.permission.POST_NOTIFICATIONS)) } \ No newline at end of file diff --git a/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoarding3Fragment.kt b/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoarding3Fragment.kt deleted file mode 100644 index 51a158c..0000000 --- a/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoarding3Fragment.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.nocapstone.onboarding.ui - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.fragment.app.Fragment -import com.nocapstone.onboarding.R - -class OnBoarding3Fragment : Fragment() { - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_on_boarding3, container, false) - } - - companion object { - fun newInstance() = OnBoarding3Fragment() - } - -} \ No newline at end of file diff --git a/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoardingViewPagerFragment.kt b/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoardingViewPagerFragment.kt index f9541bf..ad5f72b 100644 --- a/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoardingViewPagerFragment.kt +++ b/onboarding/src/main/java/com/nocapstone/onboarding/ui/OnBoardingViewPagerFragment.kt @@ -20,27 +20,22 @@ import dagger.hilt.android.AndroidEntryPoint //todo companion? private val messageArray = arrayOf( "주위 동물병원 찾기 및 산책 지수 제공을 위한 GPS접근 동의가 필요해요.", - "진달을 위해서 갤러리 및 카메라 접근 동의가 필요해요." , - "버디들의 진단 정보 나 상태 정보 제공을 위한 알림 권한 동의가 필요해요" + "진단을 위해서 갤러리 및 카메라 접근 동의가 필요해요." ) private val imageArray = arrayOf(R.drawable.img_gps, R.drawable.img_gps, R.drawable.img_gps) - @AndroidEntryPoint class OnBoardingViewPagerFragment : Fragment(), PermissionCallback { - companion object{ - var viewpagerNum = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 3 else 2 - } - - + var viewpagerNum = 2 private var _binding: FragmentOnBoardingViewPagerBinding? = null private val binding - get() = _binding!! - private val requestPermissionLauncher = PermissionObject.checkPermission(this, { onSuccess() }, { onFail() }) + get() = _binding!! + private val requestPermissionLauncher = + PermissionObject.checkPermission(this, { onSuccess() }, { onFail() }) override fun onCreateView( @@ -80,26 +75,28 @@ class OnBoardingViewPagerFragment : Fragment(), PermissionCallback { } - private inner class OnBoardingViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { override fun getItemCount(): Int = viewpagerNum override fun createFragment(position: Int): Fragment { return when (position) { - 0 -> OnBoarding1Fragment.newInstance() - 1 -> OnBoarding2Fragment.newInstance() - else -> OnBoarding3Fragment.newInstance() + 0 -> { + binding.onboardingBack.setBackgroundResource(R.drawable.img_onboarding1) + OnBoarding1Fragment.newInstance() + } + else -> { + binding.onboardingBack.setBackgroundResource(R.drawable.img_onboarding2) + OnBoarding2Fragment.newInstance() + } } } - - } override fun onSuccess() { if (binding.viewpager2.currentItem == viewpagerNum - 1) { findNavController().navigate(R.id.next) - }else{ + } else { binding.viewpager2.currentItem++ } } diff --git a/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashActivity.kt b/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashActivity.kt index 768c940..3aa0c1f 100644 --- a/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashActivity.kt +++ b/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashActivity.kt @@ -41,7 +41,9 @@ class SplashActivity : AppCompatActivity() { splashViewModel.withJsonWebToken { JWT -> if (JWT != null) { Log.d("buddyTest","$JWT") - LoginUtil.startMainActivity(this, mainActivityClass) + initNav() + + //LoginUtil.startMainActivity(this, mainActivityClass) } else { Log.d("buddyTest","JWT널") initNav() diff --git a/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashViewModel.kt b/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashViewModel.kt index a7e1e51..c46462f 100644 --- a/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashViewModel.kt +++ b/onboarding/src/main/java/com/nocapstone/onboarding/ui/SplashViewModel.kt @@ -11,6 +11,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.* import kotlinx.coroutines.launch import javax.inject.Inject +import kotlin.math.log @HiltViewModel class SplashViewModel @Inject constructor( @@ -29,15 +30,18 @@ class SplashViewModel @Inject constructor( try { val response = authUseCase.login(token) dataStoreUseCase.editJsonWebToken(response.body()?.data?.jwt!!) - if (response.code() == 200) { - loginCallback.invoke() - } else { - createCallback.invoke() - } + Log.d("responsecode",response.code().toString()) +// if (response.code() == 200) { +// loginCallback.invoke() +// } else if (response.code() == 201) { +// } +// else{ +// Log.d("responsecode",response.code().toString()) +// } + createCallback.invoke() } catch (e: Exception) { Log.d("buddyTest", e.message.toString()) } - } } diff --git a/onboarding/src/main/res/drawable/img_onboarding1.png b/onboarding/src/main/res/drawable/img_onboarding1.png new file mode 100644 index 0000000..4845583 Binary files /dev/null and b/onboarding/src/main/res/drawable/img_onboarding1.png differ diff --git a/onboarding/src/main/res/drawable/img_onboarding2.png b/onboarding/src/main/res/drawable/img_onboarding2.png new file mode 100644 index 0000000..3be7559 Binary files /dev/null and b/onboarding/src/main/res/drawable/img_onboarding2.png differ diff --git a/onboarding/src/main/res/drawable/img_onboarding2.xml b/onboarding/src/main/res/drawable/img_onboarding2.xml deleted file mode 100644 index cfc8e92..0000000 --- a/onboarding/src/main/res/drawable/img_onboarding2.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/onboarding/src/main/res/layout/fragment_login.xml b/onboarding/src/main/res/layout/fragment_login.xml index 7d4e067..c17184a 100644 --- a/onboarding/src/main/res/layout/fragment_login.xml +++ b/onboarding/src/main/res/layout/fragment_login.xml @@ -18,18 +18,19 @@ android:text="BuddyVet" android:textColor="@color/black" android:textSize="24sp" + android:fontFamily="@font/cafe24_ssurround" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + android:text="현재 시간의 산책 지수를\n 실시간으로 받아봐요" + android:textColor="@color/black" + android:textStyle="bold" + android:textSize="22sp" /> + diff --git a/onboarding/src/main/res/layout/fragment_on_boarding2.xml b/onboarding/src/main/res/layout/fragment_on_boarding2.xml index ff44c03..f1e81c4 100644 --- a/onboarding/src/main/res/layout/fragment_on_boarding2.xml +++ b/onboarding/src/main/res/layout/fragment_on_boarding2.xml @@ -2,20 +2,20 @@ - - - - + android:text="휴대폰 카메라로 간단하게\n 우리 아이의 안구 질환을 검사해요" + android:textColor="@color/black" + android:textStyle="bold" + android:textSize="22sp" /> \ No newline at end of file diff --git a/onboarding/src/main/res/layout/fragment_on_boarding3.xml b/onboarding/src/main/res/layout/fragment_on_boarding3.xml deleted file mode 100644 index 4f96240..0000000 --- a/onboarding/src/main/res/layout/fragment_on_boarding3.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/onboarding/src/main/res/layout/fragment_on_boarding_view_pager.xml b/onboarding/src/main/res/layout/fragment_on_boarding_view_pager.xml index a501166..6923272 100644 --- a/onboarding/src/main/res/layout/fragment_on_boarding_view_pager.xml +++ b/onboarding/src/main/res/layout/fragment_on_boarding_view_pager.xml @@ -4,6 +4,8 @@ xmlns:tools="http://schemas.android.com/tools">