Skip to content

Commit

Permalink
[MIN-49] feat: 온보딩 뷰 수정(#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
KDW03 committed Feb 15, 2023
1 parent 95526a0 commit 0fb655f
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 16 deletions.
10 changes: 8 additions & 2 deletions common-ui/src/main/res/layout/dialog_for_permission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,26 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:textSize="16sp"
android:textColor="@color/black"
android:fontFamily="@font/cafe24_ssurround_air"
android:id="@+id/dialog_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:gravity="center"
android:lineSpacingExtra="@dimen/basic_spacingExtra"
android:text="위치 권한 요청합니다"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_iv" />

<com.google.android.material.button.MaterialButton
android:id="@+id/dialog_button"
style="@style/basic_btn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="17dp"
app:backgroundTint="@color/butter"
android:text="@string/confirm"
android:textSize="@dimen/basic_btn_textSize"
app:layout_constraintTop_toBottomOf="@id/dialog_tv" />
Expand All @@ -52,10 +56,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:lineSpacingExtra="2sp"
android:text="확인을 누르시면 동의 및 다음 단계로 넘어갑니다."
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_button" />

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class OnBoardingViewPagerFragment : Fragment() {

companion object{
companion object {
var viewpagerNum = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 3 else 2
}

Expand All @@ -36,7 +36,14 @@ class OnBoardingViewPagerFragment : Fragment() {


//todo companion?
private val messageArray = arrayOf("gps 권한", "알림 권한", "카메라 권한")
private val messageArray = arrayOf(
"기록을 위해서 갤러리 및\n" +
" 위치 접근 동의가 필요해요. ",
"사진을 찍기 위해서\n" +
"카메라 접근 동의가 필요해요",
"알림을 하기 위해서\n" +
"푸시 동의가 필요해요."
)
private val imageArray = arrayOf(R.drawable.img_gps, R.drawable.img_gps, R.drawable.img_gps)
private val permissionArray = arrayOf(
arrayOf(
Expand Down
9 changes: 6 additions & 3 deletions onboarding/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Mineme"
android:textColor="@color/black"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
<TextView
android:id="@+id/app_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_onboarding2"
android:gravity="center"
android:textSize="40sp"
android:text="아이콘"
app:layout_constraintBottom_toTopOf="@id/kakao_login_btn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -39,8 +42,8 @@
android:layout_marginHorizontal="21dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="43dp"
app:backgroundTint="@color/kakao"
android:text="카카오 계정으로 시작"
app:backgroundTint="@color/kakao"
app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<!-- todo delete black_radius -->
<me.relex.circleindicator.CircleIndicator3
android:layout_marginTop="16dp"
android:id="@+id/indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
package com.najudoryeong.mineme.story.ui

import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.najudoryeong.mineme.common_ui.BaseFragment
import com.najudoryeong.mineme.story.databinding.FragmentStoryBinding
import com.najudoryeong.mineme.story.StoryOutAdapter
import com.najudoryeong.mineme.story.util.Story_Foundation_Info
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

@AndroidEntryPoint
class StoryFragment : BaseFragment<FragmentStoryBinding>(Story_Foundation_Info) {

private val viewModel: StoryViewModel by viewModels()
private val storyOutAdapter : StoryOutAdapter by lazy {
private val storyOutAdapter: StoryOutAdapter by lazy {
StoryOutAdapter()
}


override fun initView() {
/// 이거는 바깥 그거에 넣어줄 데이터

viewModel.raedStory()

/// 이거는 바깥 그거에 넣어줄 데이터
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
launch {
viewModel.storyList.collect()
}
}
}


binding.apply {
//todo callback
this.adapter = storyOutAdapter
this.list = dummy
this.lifecycleOwner = viewLifecycleOwner
this.adapter = storyOutAdapter
this.viewModel = viewModel
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ package com.najudoryeong.mineme.story.ui

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.najudoryeong.mineme.common.domain.entity.Story
import com.najudoryeong.mineme.story.domain.entity.StoryListWithDate
import com.najudoryeong.mineme.common.domain.usecase.DataStoreUseCase
import com.najudoryeong.mineme.story.domain.usecase.StoryUseCase

import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import javax.inject.Inject

var dummy = mutableListOf(
Expand Down
2 changes: 1 addition & 1 deletion story/src/main/res/layout/fragment_story.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
adapter="@{adapter}"
submitList="@{list}"
submitList="@{viewModel.storyList}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
Expand Down

0 comments on commit 0fb655f

Please sign in to comment.